diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index 5777a09..9cced9c 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -1,4 +1,4 @@ - + diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 880f325..ff5ac5f 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -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 { // 免费券 diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index 4fd5df3..a410a3f 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -5,12 +5,14 @@ Page({ data: { canIUse: wx.canIUse('button.open-type.getPhoneNumber'), couponChannelId: null, + couponId: null }, onLoad: function(options) { var that = this; console.log(options); that.setData({ - couponChannelId: options.couponChannelId + couponChannelId: options.couponChannelId, + couponId: options.couponId }) }, getPhoneNumber: function(e) { @@ -32,7 +34,8 @@ Page({ icon: "success", success: function(res) { wx.redirectTo({ - url: '/pages/coupon/detail/index?id=' + that.data.couponChannelId + "&flag=pay", + url: '/pages/coupon/detail/index?id=' + + that.data.couponChannelId + '&couponId='+ that.data.couponId +'&flag=pay", }) } }) diff --git a/pages/index/rushToBuy/index.js b/pages/index/rushToBuy/index.js index 0548ae7..4ca9508 100644 --- a/pages/index/rushToBuy/index.js +++ b/pages/index/rushToBuy/index.js @@ -36,12 +36,12 @@ Component({ gotodetail: function(e) { console.log(e); console.log("出错啦 大哥"); - console.log(e.currentTarget.dataset.couponid); + console.log(e.currentTarget.dataset.id); console.log(e.currentTarget.dataset.targetad); wx.navigateTo({ url: `/pages/coupon/detail/index?id=${ - e.currentTarget.dataset.couponid - }&targetAd=${e.currentTarget.dataset.targetad}` + e.currentTarget.dataset.id + }&couponId=${e.currentTarget.dataset.couponId}` }); } }, diff --git a/pages/phoneinput/phoneinput.js b/pages/phoneinput/phoneinput.js index 4a19807..4b27171 100644 --- a/pages/phoneinput/phoneinput.js +++ b/pages/phoneinput/phoneinput.js @@ -10,12 +10,14 @@ Page({ retry: false, time: 60, couponChannelId: null, + couponId:null }, onLoad: function (options) { var that = this; console.log(options); that.setData({ - couponChannelId: options.couponChannelId + couponChannelId: options.couponChannelId, + couponId: options.couponId, }) }, getYZM(e) {