|
|
@@ -132,7 +132,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 支付订单更新 |
|
|
|
*/ |
|
|
|
payOrderUpdate: (orderId, payOrderId, status, reason,type) => { |
|
|
|
payOrderUpdate: (orderId, payOrderId, status, reason,type,_this) => { |
|
|
|
let that=this; |
|
|
|
// 支付成功 |
|
|
|
Http.post({ |
|
|
@@ -145,7 +145,6 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(that.payOrderUpdate()); |
|
|
|
console.log("成功"); |
|
|
|
if(!type){ |
|
|
|
setTimeout(() => { |
|
|
@@ -158,7 +157,10 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
console.log(_this); |
|
|
|
setTimeout(function(){ |
|
|
|
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this); |
|
|
|
},2000) |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** |
|
|
@@ -305,16 +307,7 @@ Page({ |
|
|
|
signType: (res.data.signType) ? res.data.signType : "MD5", |
|
|
|
paySign: res.data.paySign, |
|
|
|
success: res => { |
|
|
|
|
|
|
|
var timesRun = 0; |
|
|
|
var interval = setInterval(function () { |
|
|
|
timesRun += 1; |
|
|
|
if (timesRun === 3) { |
|
|
|
clearInterval(interval); |
|
|
|
} |
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1, ); |
|
|
|
}, 2000); |
|
|
|
|
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); |
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
|
setTimeout(function () { |
|
|
|
wx.hideLoading(); |
|
|
@@ -331,14 +324,10 @@ Page({ |
|
|
|
wx.switchTab({ |
|
|
|
url: '/pages/passCar/passCar' |
|
|
|
}); |
|
|
|
}, 1600); |
|
|
|
// this.initUsrCarList() |
|
|
|
// 领取 5.停车券 |
|
|
|
// TODO 选取用户下的车牌 |
|
|
|
}, 1600); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
fail: res => { |
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 2,'','fail'); // 支付失败 |
|
|
|
return; |
|
|
@@ -346,16 +335,10 @@ Page({ |
|
|
|
complete: res => { |
|
|
|
} |
|
|
|
}); |
|
|
|
/// End payment -------- |
|
|
|
|
|
|
|
///// virtual pay |
|
|
|
//var payOrderId = "" + res.data.out_trade_no; |
|
|
|
//that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 |
|
|
|
///// end virtual pay |
|
|
|
}); |
|
|
|
} else { |
|
|
|
// 免费券 |
|
|
|
that.payOrderUpdate(orderId, "0", 1); |
|
|
|
that.payOrderUpdate(orderId, "0", 1, '', 'fail'); |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum', |
|
|
|
data: "couponNum" |
|
|
|