|
@@ -510,33 +510,42 @@
|
|
|
orderPay() {
|
|
|
uni.showLoading({});
|
|
|
var that = this;
|
|
|
- this.$http('miniApp/maintainOrder/orderPay', {
|
|
|
+ this.$http('worldKeepCar/maintainOrder/orderPay', {
|
|
|
sheetID: this.orderData.ID
|
|
|
}, 'POST').then(res => {
|
|
|
uni.hideLoading();
|
|
|
- var payInfo = JSON.parse(res.data.payInfo)
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'wxpay',
|
|
|
- // timeStamp: String(Date.now()),
|
|
|
- timeStamp: payInfo.timeStamp,
|
|
|
- nonceStr: payInfo.nonceStr,
|
|
|
- package: payInfo.package,
|
|
|
- signType: payInfo.signType,
|
|
|
- paySign: payInfo.paySign,
|
|
|
- success: function(res) {
|
|
|
- console.log('success:' + JSON.stringify(res));
|
|
|
- uni.showToast({
|
|
|
- title: '支付成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- that.getData()
|
|
|
- },
|
|
|
- fail: function(err) {
|
|
|
- console.log('fail:' + JSON.stringify(err));
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ if(res.isPay==0){
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ that.getData()
|
|
|
+ }else{
|
|
|
+ var payInfo = JSON.parse(res.data.payInfo)
|
|
|
+ uni.requestPayment({
|
|
|
+ provider: 'wxpay',
|
|
|
+ // timeStamp: String(Date.now()),
|
|
|
+ timeStamp: payInfo.timeStamp,
|
|
|
+ nonceStr: payInfo.nonceStr,
|
|
|
+ package: payInfo.package,
|
|
|
+ signType: payInfo.signType,
|
|
|
+ paySign: payInfo.paySign,
|
|
|
+ success: function(res) {
|
|
|
+ console.log('success:' + JSON.stringify(res));
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ that.getData()
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log('fail:' + JSON.stringify(err));
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
timeSfCk(item, index) {
|