| | |
| | | { name: '待支付', id: 0 ,index:1}, |
| | | { name: '待发货/自提', id: 1,index:2 }, |
| | | { name: '待收货', id: 2 ,index:3}, |
| | | ] |
| | | ], |
| | | loading: false |
| | | }; |
| | | }, |
| | | onLoad(options) { |
| | |
| | | this.currentOrder = item |
| | | } |
| | | }, |
| | | |
| | | 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, |
| | | nonceStr: res.data.response.nonceStr, |
| | | package: res.data.response.packageValue, |
| | | signType: res.data.response.signType, |
| | | paySign: res.data.response.paySign, |
| | | success (pay) { |
| | | if (pay.errMsg === "requestPayment:ok") { |
| | | that.getFirstPageData() |
| | | } else { |
| | | uni.showToast({ title: '订单取消支付', icon: 'none' }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | doneOrder(item){ |
| | | this.currentOrder = null |
| | |
| | | var that =this |
| | | let res = await this.$u.api.affirmOrder({ orderId: this.currentOrder.id }); |
| | | if (res.code === 200 ) { |
| | | that.showDone = false |
| | | 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||'确定收货失败!', |
| | |
| | | var that =this |
| | | let res = await that.$u.api.cancelOrder({ orderId: this.currentOrder.id }); |
| | | if (res.code === 200 ) { |
| | | this.showCancel = false |
| | | //修改订单状态 |
| | | 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||'取消订单失败!', |
| | |
| | | var that =this |
| | | let res = await that.$u.api.delOrder({ orderId: this.currentOrder.id }); |
| | | if (res.code === 200 ) { |
| | | this.showDelete = false |
| | | //修改订单状态 |
| | | /* var tindex = -1; |
| | | this.dataList.forEach((item,index)=>{ |