|
|
@@ -17,7 +17,7 @@ Page({ |
|
|
|
console.log(that.data); |
|
|
|
if (that.data.data.merchantLinkPhone) { |
|
|
|
wx.makePhoneCall({ |
|
|
|
phoneNumber: that.data.data.merchantLinkPhone //仅为示例,并非真实的电话号码 |
|
|
|
phoneNumber: that.data.data.merchantLinkPhone |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@@ -55,11 +55,10 @@ Page({ |
|
|
|
console.log("details"); |
|
|
|
//当前时间与优惠券下架时间做计算 |
|
|
|
var endTime = util.fmtDate(res.data.endTime); |
|
|
|
util.timechuo(endTime) |
|
|
|
console.log(util.timechuo(endTime)); |
|
|
|
util.timechuo(endTime); |
|
|
|
that.setData({ |
|
|
|
endtime:util.timechuo(endTime) |
|
|
|
}) |
|
|
|
endtime: util.timechuo(endTime) |
|
|
|
}); |
|
|
|
wx.hideLoading(); |
|
|
|
that.setData({ |
|
|
|
data: res.data |
|
|
@@ -133,6 +132,23 @@ Page({ |
|
|
|
console.log(that.data.couponChannelId); |
|
|
|
console.log(that.data.couponId); |
|
|
|
console.log("我即将要跳转到用户手机号授权的页面"); |
|
|
|
if (err.code == "3002") { |
|
|
|
wx.showToast({ |
|
|
|
title: "领取达到上限", |
|
|
|
image: "./../../../assets/img/fail.png", |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} |
|
|
|
if (err.code == "4003") { |
|
|
|
wx.showToast({ |
|
|
|
title: "卡券已作废", |
|
|
|
image: "./../../../assets/img/fail.png", |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
if (err.code == 11005) { |
|
|
|
// 用户手机未授权 |
|
|
|
/** |
|
|
@@ -189,8 +205,6 @@ Page({ |
|
|
|
signType: "MD5", |
|
|
|
paySign: res.data.paySign, |
|
|
|
success: res => { |
|
|
|
console.log(res); |
|
|
|
console.log("姐在检查付款异常"); |
|
|
|
that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 |
|
|
|
console.log(res); |
|
|
|
if (res.errMsg == "requestPayment:ok") { |
|
|
@@ -198,9 +212,14 @@ Page({ |
|
|
|
title: "购买成功", |
|
|
|
image: "./../../../assets/img/success.png", |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
mask: false, |
|
|
|
success:function(){ |
|
|
|
wx.redirectTo({ |
|
|
|
url: `/pages/order/detail/index?orderId=${that.data.orderId}`, |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 用户支付成功以后跳转到券包列表 |
|
|
|
*/ |
|
|
@@ -240,7 +259,7 @@ Page({ |
|
|
|
wx.showToast({ |
|
|
|
title: "领取成功", |
|
|
|
duration: 3000, |
|
|
|
image: "./../../../assets/img/success.png", |
|
|
|
image: "./../../../assets/img/success.png" |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|