|
|
@@ -5,6 +5,8 @@ const util = require("../../../utils/util"); |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: {}, |
|
|
|
couponChannelId: null, |
|
|
|
couponId: null, |
|
|
|
orderId: "", |
|
|
|
day: "", |
|
|
|
hour: "", |
|
|
@@ -13,6 +15,10 @@ Page({ |
|
|
|
onLoad(options) { |
|
|
|
let that = this; |
|
|
|
console.log(options.id); |
|
|
|
that.setData({ |
|
|
|
couponChannelId: options.id, |
|
|
|
couponId: options.couponId |
|
|
|
}) |
|
|
|
wx.showLoading({ |
|
|
|
title: "加载中..." |
|
|
|
}); |
|
|
@@ -160,8 +166,8 @@ Page({ |
|
|
|
return Http.post({ |
|
|
|
url: config.api.orderSave, |
|
|
|
data: { |
|
|
|
couponChannelId: '' + that.data.data.id, |
|
|
|
couponId: '' + that.data.data.couponId |
|
|
|
couponChannelId: '' + that.data.couponChannelId, |
|
|
|
couponId: '' + that.data.couponId |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
@@ -170,13 +176,13 @@ Page({ |
|
|
|
if (err.code == 11005) { |
|
|
|
// 用户手机未授权 |
|
|
|
wx.redirectTo({ |
|
|
|
url: "../../getphoneInfo/index?couponChannelId=" + that.data.id |
|
|
|
url: "../../getphoneInfo/index?couponChannelId=" + that.data.couponChannelId + "&couponId=" + that.data.couponId |
|
|
|
}); |
|
|
|
} |
|
|
|
if (err.code == 11006) { |
|
|
|
// 用户手机已加密 |
|
|
|
wx.redirectTo({ |
|
|
|
url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.id |
|
|
|
url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.couponChannelId + "& couponId=" + that.data.couponId |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
@@ -197,8 +203,8 @@ Page({ |
|
|
|
console.log(res); |
|
|
|
var payOrderId = "" + res.data.out_trade_no; |
|
|
|
wx.hideLoading(); |
|
|
|
//payment(res); |
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 |
|
|
|
payment(res); |
|
|
|
//that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 |
|
|
|
}); |
|
|
|
} else { |
|
|
|
// 免费券 |
|
|
|