diff --git a/pages/bannerdetail/index.wxml b/pages/bannerdetail/index.wxml index af66fb4..2e80f76 100644 --- a/pages/bannerdetail/index.wxml +++ b/pages/bannerdetail/index.wxml @@ -37,7 +37,7 @@ --> - + diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 94bebc6..6ca469b 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -17,18 +17,11 @@ Page({ console.log(options); console.log(options.couponChannelId); console.log(options.couponId); - console.log(options.Id); console.log("传的变量的名字叫Id"); /** * 首页banner detail couponlist传过来的值 * iambannercoupon */ - - that.setData({ - couponChannelId: options.couponChannelId, - couponId: options.couponId - }); - wx.showLoading({ title: "加载中..." }); @@ -37,16 +30,23 @@ Page({ this.orderFunc(); } else { if (options.couponChannelId == "iambannercoupon") { + that.setData({ + couponId: options.couponId + }); /** * 待解决 */ var parmer = { url: config.api.bannercoupondetai, data: { - couponId: options.Id + couponId: options.couponId } }; } else { + that.setData({ + couponChannelId: options.couponChannelId, + couponId: options.couponId + }); var parmer = { url: config.api.couponDetail, data: { @@ -134,15 +134,21 @@ Page({ }) .then(res => { console.log(res); + var data = { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId + } + if (that.data.couponChannelId == null) { + data = { + couponId: "" + that.data.couponId + } + } /** * orderSave 下单 */ return Http.post({ url: config.api.orderSave, - data: { - couponChannelId: "" + that.data.couponChannelId, - couponId: "" + that.data.couponId - } + data: data }); }) .catch(err => {