|
|
@ -94,7 +94,9 @@ |
|
|
goods_specs_id: 1, |
|
|
goods_specs_id: 1, |
|
|
orderDetails: {}, |
|
|
orderDetails: {}, |
|
|
ifchoose: true, |
|
|
ifchoose: true, |
|
|
ifCheck: true |
|
|
|
|
|
|
|
|
ifCheck: true, |
|
|
|
|
|
type: 0, |
|
|
|
|
|
order_id: 0 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -108,7 +110,9 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(e) { |
|
|
onLoad(e) { |
|
|
this.goods_id = e.goods_id |
|
|
|
|
|
|
|
|
this.type = e.type; |
|
|
|
|
|
this.goods_id = e.goods_id; |
|
|
|
|
|
this.order_id = e.order_id; |
|
|
this.goods_specs_id = e.goods_specs_id |
|
|
this.goods_specs_id = e.goods_specs_id |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
@ -117,16 +121,16 @@ |
|
|
if(res.code == 0) { |
|
|
if(res.code == 0) { |
|
|
this.orderDetails = res.data |
|
|
this.orderDetails = res.data |
|
|
this.skeletonLoading = false |
|
|
this.skeletonLoading = false |
|
|
if( Object.keys(res.metal_data).length != 0 ) { |
|
|
|
|
|
this.ifCheck = false |
|
|
|
|
|
}else { |
|
|
|
|
|
this.ifCheck = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.ifCheck = false |
|
|
}else { |
|
|
}else { |
|
|
this.$msg(res.msg) |
|
|
this.$msg(res.msg) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
// this.mescroll.endErr(); |
|
|
|
|
|
|
|
|
if(res.code == 9999) { |
|
|
|
|
|
this.ifCheck = true |
|
|
|
|
|
}else { |
|
|
|
|
|
this.ifCheck = false |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
reduce() { |
|
|
reduce() { |
|
|
@ -151,7 +155,7 @@ |
|
|
}, |
|
|
}, |
|
|
submit(){ |
|
|
submit(){ |
|
|
if(this.ifchoose == true) { |
|
|
if(this.ifchoose == true) { |
|
|
if(this.ifCheck == false) { |
|
|
|
|
|
|
|
|
if(this.ifCheck == true) { |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
|
content: '是否同意前往手机授权?', |
|
|
content: '是否同意前往手机授权?', |
|
|
@ -161,11 +165,14 @@ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}else { |
|
|
}else { |
|
|
|
|
|
if(this.type == 1){ |
|
|
|
|
|
this.pay(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.$http(this.API.API_PRPAID, { |
|
|
this.$http(this.API.API_PRPAID, { |
|
|
goods_id: this.goods_id, |
|
|
goods_id: this.goods_id, |
|
|
goods_specs_id: this.goods_specs_id, |
|
|
goods_specs_id: this.goods_specs_id, |
|
|
number: this.num, |
|
|
number: this.num, |
|
|
token: 'fdf12000e774e48bc60c6b6d42055602' |
|
|
|
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
uni.requestPayment({ |
|
|
uni.requestPayment({ |
|
|
@ -175,10 +182,10 @@ |
|
|
package: res.data.package, |
|
|
package: res.data.package, |
|
|
signType: res.data.signType, |
|
|
signType: res.data.signType, |
|
|
paySign: res.data.paySign, |
|
|
paySign: res.data.paySign, |
|
|
success: function (res) { |
|
|
|
|
|
|
|
|
success: (res) => { |
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+1) |
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+1) |
|
|
}, |
|
|
}, |
|
|
fail: function (err) { |
|
|
|
|
|
|
|
|
fail: (err) => { |
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+2) |
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+2) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -191,12 +198,32 @@ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
pay(){ |
|
|
|
|
|
console.log("this.order_id", this.order_id) |
|
|
|
|
|
this.$http(this.API.API_PAYMENT_DIRECT, {order_id: this.order_id}).then(res => { |
|
|
|
|
|
console.log("res") |
|
|
|
|
|
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.$routerGo('/pages/order/pay-success?ifSuccess='+1) |
|
|
|
|
|
}, |
|
|
|
|
|
fail: (err) => { |
|
|
|
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+2) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
//下拉刷新 |
|
|
//下拉刷新 |
|
|
downCallback() { |
|
|
downCallback() { |
|
|
this.getConfirmOrder() |
|
|
this.getConfirmOrder() |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
|
|
|
|
|
|
onShow() { |
|
|
this.getConfirmOrder() |
|
|
this.getConfirmOrder() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|