diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index c0039ac..29fd101 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -15,10 +15,17 @@ Page({ onLoad(options) { let that = this; console.log(options.couponChannelId); + console.log(options.couponId); + /** + * 首页banner detail couponlist传过来的值 + * iambannercoupon + */ + that.setData({ couponChannelId: options.couponChannelId, couponId: options.couponId }); + wx.showLoading({ title: "加载中..." }); @@ -26,13 +33,26 @@ Page({ if (options.flag) { this.orderFunc(); } else { - Http.get({ - url: config.api.couponDetail, - data: { + + if(options.couponChannelId=='iambannercoupon'){ + /** + * 待解决 + */ + var details ={ + couponChannelId: options.couponId + } + }else{ + var details ={ couponChannelId: options.couponChannelId } + } + + Http.get({ + url: config.api.couponDetail, + data: details }).then(res => { console.log(res); + console.log("details") //当前时间与优惠券下架时间做计算 var startTime = util.fmtDate(res.data.endTime); console.log(startTime);