MrShi
2026-05-12 47d56a8b0f22fb15a46b69dfd46fac23560ad2cd
mini-program/pagesA/pages/order/order.vue
@@ -178,7 +178,8 @@
               { name: '待支付', id: 0 ,index:1},
               { name: '待发货/自提', id: 1,index:2 },
               { name: '待收货', id: 2 ,index:3},
            ]
            ],
            loading: false
         };
      },
      onLoad(options) {
@@ -280,9 +281,12 @@
         },
         payOrder(item){
            var that = this;
            if (this.loading) return;
            this.loading = true
            this.$u.api.replayPay({
               orderId: item.id
            }).then(res => {
               this.loading = false
               if (res.code === 200) {
                  wx.requestPayment({
                     timeStamp: res.data.response.timeStamp,
@@ -296,6 +300,9 @@
                        } else {
                           uni.showToast({ title: '订单取消支付', icon: 'none' })
                        }
                     },
                     fail(err) {
                        console.log(err)
                     }
                  })
               }
@@ -312,16 +319,22 @@
            if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
               return
            }
            if (this.loading) return;
            this.loading = true
            var that =this
            let res = await this.$u.api.affirmOrder({ orderId: this.currentOrder.id  });
            if (res.code === 200 ) {
            this.loading = false
            that.showDone = false
            if (res.code === 200 ) {
               that.getFirstPageData()
               //修改订单状态
               this.dataList.forEach(item=>{
                  if(item.id==this.currentOrder.id){
                     item.status =3
                  }
               })
               this.doneOrder()
               // this.dataList.forEach(item=>{
               //    if(item.id==this.currentOrder.id){
               //       item.status =3
               //    }
               // })
               // this.doneOrder()
               this.showDone()
            }else{
               /* uni.showToast({
                  title:res.message||'确定收货失败!',
@@ -333,16 +346,21 @@
            if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
               return
            }
            if (this.loading) return;
            this.loading = true
               var that =this
            let res = await that.$u.api.cancelOrder({ orderId: this.currentOrder.id  });
            if (res.code === 200 ) {
            this.loading = false
            this.showCancel = false
            if (res.code === 200 ) {
               //修改订单状态
               this.dataList.forEach(item=>{
                  if(item.id==this.currentOrder.id){
                     item.status = 4
                  }
               }) 
               this.cancelOrder()
               // this.cancelOrder()
               that.getFirstPageData()
            }else{
               /* uni.showToast({
                  title:res.message||'取消订单失败!',
@@ -354,9 +372,13 @@
            if(this.userType == 1 || this.currentOrder==null || this.currentOrder.id == null) {
               return
            }
            if (this.loading) return;
            this.loading = true
            var that =this
            let res = await that.$u.api.delOrder({ orderId: this.currentOrder.id  });
            if (res.code === 200 ) {
            this.loading = false
            this.showDelete = false
            if (res.code === 200 ) {
               //修改订单状态
               /* var tindex = -1;
               this.dataList.forEach((item,index)=>{