diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index 564f2e9..e209012 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -14,9 +14,9 @@ 数量 - + - + @@ -133,18 +133,8 @@ if(res.code == 0) { this.orderDetails = res.data this.skeletonLoading = false - this.ifCheck = false - }else { - this.$msg(res.msg) } - }).catch(err => { - console.log('code',res.code) - if(res.code == 9997) { - this.ifCheck = true - }else { - this.ifCheck = false - } - }); + }) }, reduce() { if (this.num === 1) return @@ -168,47 +158,47 @@ }, submit(){ if(this.ifchoose == true) { - if(this.ifCheck == true) { - uni.showModal({ - title: '提示', - content: '是否同意前往手机授权?', - success: e => { - if (!e.confirm) return; - this.$routerGo('/pages/login/index?type=phone') - } - }); - }else { - if(!this.ifPay) return; - this.ifPay = false; - if(this.type == 1){ - this.pay(); - return; - } - this.$http(this.API.API_PRPAID, { - goods_id: this.goods_id, - goods_specs_id: this.goods_specs_id, - number: this.num, - }).then(res => { - this.order_id = res.data.order_id - uni.requestPayment({ - orderInfo: res.data.order_num, - timeStamp: res.data.timeStamp, - nonceStr: res.data.nonceStr, - package: res.data.package, - signType: res.data.signType, - paySign: res.data.paySign, - success: (res) => { - this.ifPay = true - this.$url('/pages/order/pay-success?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) - }, - fail: (err) => { - this.ifPay = true - this.$url('/pages/order/pay-success?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) - }, - }) - - }) + if(!this.ifPay) return; + this.ifPay = false; + if(this.type == 1){ + this.pay(); + return; } + this.$http(this.API.API_PRPAID, { + goods_id: this.goods_id, + goods_specs_id: this.goods_specs_id, + number: this.num, + }).then(res => { + this.order_id = res.data.order_id + uni.requestPayment({ + orderInfo: res.data.order_num, + timeStamp: res.data.timeStamp, + nonceStr: res.data.nonceStr, + package: res.data.package, + signType: res.data.signType, + paySign: res.data.paySign, + success: (res) => { + this.ifPay = true + this.$url('/pages/order/pay-success?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) + }, + fail: (err) => { + this.ifPay = true + this.$url('/pages/order/pay-success?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) + }, + }) + + }).catch(err => { + if(err.code == 9997) { + uni.showModal({ + title: '提示', + content: '是否同意前往手机授权?', + success: e => { + if (!e.confirm) return; + this.$routerGo('/pages/login/index?type=phone') + } + }); + } + }); }else { this.$msg('请认真阅读并同意协议!') diff --git a/pages/order/order-details.vue b/pages/order/order-details.vue index 802e2b1..77da6bc 100644 --- a/pages/order/order-details.vue +++ b/pages/order/order-details.vue @@ -134,6 +134,7 @@ methods: { refreshCode() { this.getOrderDetails() + this.$msg('刷新成功') }, //二维码回调 qrR(data) {