|
|
|
@ -14,9 +14,9 @@ |
|
|
|
<view class="flex justify-between align-center text-center"> |
|
|
|
<text class="block margin-top-sm text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量</text> |
|
|
|
<view class="flex align-center margin-top-sm"> |
|
|
|
<text class="lf-iconfont lf-icon-jianshao" @tap="reduce"></text> |
|
|
|
<text class="lf-iconfont lf-icon-jianshao lf-font-40" @tap="reduce"></text> |
|
|
|
<input type="number" v-model="num" class="text-center margin-lr-sm radius text-black lf-font-32" style="width: 60rpx; height: 50rpx;" /> |
|
|
|
<text class="lf-iconfont lf-icon-jia1" @tap="add"></text> |
|
|
|
<text class="lf-iconfont lf-icon-jia1 lf-font-40" @tap="add"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -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('请认真阅读并同意协议!') |
|
|
|
|