|
@@ -68,6 +68,9 @@ Page({
|
|
|
try {
|
|
|
let order = await activity.createOrder(_self.data.activityId,_self.data.memberMobile);
|
|
|
let orderSn = order.orderSn;
|
|
|
+ _self.setData({
|
|
|
+ orderSn:orderSn
|
|
|
+ })
|
|
|
let codeId = _self.data.codeId;
|
|
|
try {
|
|
|
//插入 订单 和 codeId bind-share-code
|
|
@@ -75,12 +78,24 @@ Page({
|
|
|
}catch(e) {
|
|
|
console.log(e)
|
|
|
}
|
|
|
- //领取成功
|
|
|
- app.showToast('领取成功','success',1000,function(){
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/myCoupons/myCoupons?mobile='+_self.data.memberMobile,
|
|
|
- })
|
|
|
- })
|
|
|
+ if (_self.data.activityInfo.isPay == 1 && orderSn) {
|
|
|
+ console.log(22222)
|
|
|
+ //TODO::暂时屏蔽
|
|
|
+ // _self.goPay();
|
|
|
+ app.showToast('领取成功','success',1000,function(){
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/myCoupons/myCoupons?mobile='+_self.data.memberMobile,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //领取成功
|
|
|
+ app.showToast('领取成功','success',1000,function(){
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/myCoupons/myCoupons?mobile='+_self.data.memberMobile,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}catch(e) {
|
|
|
|
|
@@ -88,6 +103,38 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取订单参数
|
|
|
+ */
|
|
|
+ async goPay() {
|
|
|
+ var _self = this;
|
|
|
+ try {
|
|
|
+ let res = await activity.getOrderParams(_self.data.orderSn,_self.activityInfo.name);
|
|
|
+ console.log(res);
|
|
|
+ res = res.wxPrePayVo
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: res.timeStamp,
|
|
|
+ package: res.pack,
|
|
|
+ nonceStr: res.nonceStr,
|
|
|
+ signType: res.signType,
|
|
|
+ paySign: res.paySign,
|
|
|
+ success: function (res) {
|
|
|
+ //领取成功
|
|
|
+ app.showToast('领取成功','success',1000,function(){
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/myCoupons/myCoupons?mobile='+_self.data.memberMobile,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//获取手机号
|
|
|
getPhoneNumber(e) {
|
|
|
let _self = this;
|