|
@@ -127,23 +127,18 @@ Page({
|
|
|
* 下单
|
|
|
*/
|
|
|
async nowBuy() {
|
|
|
-
|
|
|
-
|
|
|
let _self = this;
|
|
|
try {
|
|
|
let res = await WelfareMall.createOrder(_self.data.userMobile, _self.data.detail.activityId,1);
|
|
|
_self.setData({
|
|
|
orderInfo: res.data,
|
|
|
})
|
|
|
- // console.log(this.data.activityInfo.isPay)
|
|
|
- // console.log(_self.data.orderInfo)
|
|
|
if (this.data.detail.isPay == 1 && _self.data.orderInfo.orderSn) {
|
|
|
- // console.log(22222)
|
|
|
_self.goPay();
|
|
|
} else {
|
|
|
- // wx.reLaunch({
|
|
|
- // url: '/pages/couponSuccess/couponSuccess'
|
|
|
- // })
|
|
|
+ _self.setData({
|
|
|
+ hideWindowValue:true
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
} catch (err) {
|
|
@@ -157,9 +152,9 @@ Page({
|
|
|
async goPay() {
|
|
|
console.log(wx.getStorageSync('loginInfo').openId)
|
|
|
var _self = this;
|
|
|
- let res = await WelfareMall.getOrderParams(_self.data.orderInfo.orderSn,wx.getStorageSync('loginInfo').openId);
|
|
|
- console.log(res);
|
|
|
- // res = res.wxPrePayVo
|
|
|
+ let result = await WelfareMall.getOrderParams(_self.data.orderInfo.orderSn,wx.getStorageSync('loginInfo').openId);
|
|
|
+ console.log(result);
|
|
|
+ let res = result.data
|
|
|
wx.requestPayment({
|
|
|
timeStamp: res.wxPrePayVo.timeStamp,
|
|
|
package: res.wxPrePayVo.pack,
|
|
@@ -168,13 +163,15 @@ Page({
|
|
|
paySign: res.wxPrePayVo.paySign,
|
|
|
success: function (res) {
|
|
|
//支付成功,跳转领取成功页面
|
|
|
+ _self.setData({
|
|
|
+ hideWindowValue:true
|
|
|
+ })
|
|
|
// wx.reLaunch({
|
|
|
// url: '/pages/couponSuccess/couponSuccess'
|
|
|
// })
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
- // console.log('payerror')
|
|
|
- // console.log(res);
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
},
|