|
@@ -23,18 +23,26 @@ Page({
|
|
|
switchTab(e){
|
|
switchTab(e){
|
|
|
let index = e.currentTarget.dataset.index;
|
|
let index = e.currentTarget.dataset.index;
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- selectTab:index
|
|
|
|
|
|
|
+ selectTab:index,
|
|
|
|
|
+ pageNum: 1
|
|
|
})
|
|
})
|
|
|
this.getOrderLists(this.data.tab[index].status);
|
|
this.getOrderLists(this.data.tab[index].status);
|
|
|
},
|
|
},
|
|
|
// 获取订单列表
|
|
// 获取订单列表
|
|
|
getOrderLists(status){
|
|
getOrderLists(status){
|
|
|
API.getOrderLists({pageNum:this.data.pageNum,pageSize:10,status}).then(res=>{
|
|
API.getOrderLists({pageNum:this.data.pageNum,pageSize:10,status}).then(res=>{
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
res.orderDTOS.forEach(item=>{
|
|
res.orderDTOS.forEach(item=>{
|
|
|
let stats = {PAYED:"已支付",CANCELLED:"已取消",DELIVERED:"已发货",RECEIVED:"已收货",FINISHED:"完成",ORDERED:"已下单"};
|
|
let stats = {PAYED:"已支付",CANCELLED:"已取消",DELIVERED:"已发货",RECEIVED:"已收货",FINISHED:"完成",ORDERED:"已下单"};
|
|
|
item.statusName = stats[item.orderStatus]
|
|
item.statusName = stats[item.orderStatus]
|
|
|
|
|
+ if (item.orderDetailDTOS && typeof item.orderDetailDTOS === 'object') {
|
|
|
|
|
+ item.orderDetailDTOS.forEach(odDTOs=>{
|
|
|
|
|
+ if (odDTOs.orderDetailExprs && typeof odDTOs.orderDetailExprs === 'object') {
|
|
|
|
|
+ if (odDTOs.orderDetailExprs.length > 0) {
|
|
|
|
|
+ item.showExpr = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
this.setData({
|
|
this.setData({
|
|
|
orderList:this.data.pageNum === 1?res.orderDTOS:[...this.data.orderList,...res.orderDTOS]
|
|
orderList:this.data.pageNum === 1?res.orderDTOS:[...this.data.orderList,...res.orderDTOS]
|