From 5166ed39ceb59fd0606be803338fc876407362b7 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Wed, 29 Aug 2018 11:41:34 +0800 Subject: [PATCH] =?UTF-8?q?[banner=E5=9B=BE=E6=94=AF=E4=BB=98][=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D]:=E4=BF=AE=E5=A4=8Dbanner=E6=94=AF=E4=BB=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bannerdetail/index.wxml | 2 +- pages/coupon/detail/index.js | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) 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 => {