| @@ -1,4 +1,4 @@ | |||||
| <navigator url="/pages/coupon/detail/index?id={{data.id}}&couponId={{data.couponId}}"> | |||||
| <navigator url="/pages/coupon/detail/index?couponChannelId={{data.id}}&couponId={{data.couponId}}"> | |||||
| <!-- 首页优惠券列表页面 --> | <!-- 首页优惠券列表页面 --> | ||||
| <view class="coupons"> | <view class="coupons"> | ||||
| <view class="coupons-img"> | <view class="coupons-img"> | ||||
| @@ -14,9 +14,9 @@ Page({ | |||||
| }, | }, | ||||
| onLoad(options) { | onLoad(options) { | ||||
| let that = this; | let that = this; | ||||
| console.log(options.id); | |||||
| console.log(options.couponChannelId); | |||||
| that.setData({ | that.setData({ | ||||
| couponChannelId: options.id, | |||||
| couponChannelId: options.couponChannelId, | |||||
| couponId: options.couponId | couponId: options.couponId | ||||
| }) | }) | ||||
| wx.showLoading({ | wx.showLoading({ | ||||
| @@ -29,7 +29,7 @@ Page({ | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponDetail, | url: config.api.couponDetail, | ||||
| data: { | data: { | ||||
| id: options.id, | |||||
| id: options.couponChannelId, | |||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res); | console.log(res); | ||||
| @@ -143,7 +143,7 @@ Page({ | |||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res); | console.log(res); | ||||
| /* | |||||
| /// Begin payment ---- | /// Begin payment ---- | ||||
| var payOrderId = "" + res.data.payOrderId; | var payOrderId = "" + res.data.payOrderId; | ||||
| wx.hideLoading(); | wx.hideLoading(); | ||||
| @@ -202,10 +202,10 @@ Page({ | |||||
| } | } | ||||
| }); | }); | ||||
| /// End payment -------- | /// End payment -------- | ||||
| */ | |||||
| ///// virtual pay | ///// virtual pay | ||||
| var payOrderId = "" + res.data.out_trade_no; | |||||
| that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | |||||
| //var payOrderId = "" + res.data.out_trade_no; | |||||
| //that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | |||||
| ///// end virtual pay | ///// end virtual pay | ||||
| }); | }); | ||||
| } else { | } else { | ||||
| @@ -34,7 +34,7 @@ Page({ | |||||
| icon: "success", | icon: "success", | ||||
| success: function(res) { | success: function(res) { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: '/pages/coupon/detail/index?id='+ that.data.couponChannelId + '&couponId='+ that.data.couponId +'&flag=pay' | |||||
| url: '/pages/coupon/detail/index?couponChannelId='+ that.data.couponChannelId + '&couponId='+ that.data.couponId +'&flag=pay' | |||||
| }) | }) | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -39,7 +39,7 @@ Component({ | |||||
| console.log(e.currentTarget.dataset.id); | console.log(e.currentTarget.dataset.id); | ||||
| console.log(e.currentTarget.dataset.targetad); | console.log(e.currentTarget.dataset.targetad); | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/coupon/detail/index?id=${ | |||||
| url: `/pages/coupon/detail/index?couponChannelId=${ | |||||
| e.currentTarget.dataset.id | e.currentTarget.dataset.id | ||||
| }&couponId=${e.currentTarget.dataset.couponId} | }&couponId=${e.currentTarget.dataset.couponId} | ||||
| }&targetAd=${e.currentTarget.dataset.targetad}` | }&targetAd=${e.currentTarget.dataset.targetad}` | ||||
| @@ -40,7 +40,7 @@ Page({ | |||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: '/pages/coupon/detail/index?id=' + that.data.couponChannelId + "&flag=pay", | |||||
| url: '/pages/coupon/detail/index?couponChannelId=' + that.data.couponChannelId + '&couponId=' + that.data.couponId + "&flag=pay", | |||||
| }) | }) | ||||
| }) | }) | ||||
| .catch(error => { | .catch(error => { | ||||
| @@ -116,9 +116,9 @@ Page({ | |||||
| console.log(e.currentTarget.dataset.couponid); | console.log(e.currentTarget.dataset.couponid); | ||||
| console.log(e.currentTarget.dataset.targetad); | console.log(e.currentTarget.dataset.targetad); | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/coupon/detail/index?id=${ | |||||
| url: `/pages/coupon/detail/index?couponChannelId=${ | |||||
| e.currentTarget.dataset.id | e.currentTarget.dataset.id | ||||
| }`, | |||||
| }&couponId=${e.currentTarget.dataset.couponId}`, | |||||
| success: function(res) { | success: function(res) { | ||||
| // success | // success | ||||
| }, | }, | ||||