diff --git a/pages/order/confirm_order.vue b/pages/order/confirm_order.vue index 02b0c39..607c866 100644 --- a/pages/order/confirm_order.vue +++ b/pages/order/confirm_order.vue @@ -153,23 +153,31 @@ this.ifPay = false; this.$http(this.API.API_CREATEORDER,{id: this.goods_id,num: 1,pay_type: this.pay_type,name:this.contact,mobile:this.phone}).then(res => { this.order_id = res.data.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/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) - }, - fail: (err) => { - this.ifPay = true - this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) - }, - }) - + console.log(res) + + + if(this.pay_type == 3) { + this.ifPay = true + this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) + }else { + 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/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) + }, + fail: (err) => { + this.ifPay = true + this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) + }, + }) + } + }).catch(err => { this.ifPay = true })