From cb2f880c5e676777fcc8612f6626a2f89db74bad Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Wed, 28 Nov 2018 13:15:04 +0800 Subject: [PATCH] =?UTF-8?q?[bannerDetail=E5=A2=9E=E5=8A=A0id=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bannerdetail/index.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pages/bannerdetail/index.js b/pages/bannerdetail/index.js index c980ac7..f539eac 100644 --- a/pages/bannerdetail/index.js +++ b/pages/bannerdetail/index.js @@ -13,15 +13,16 @@ Page({ }, onLoad(options) { let that = this; - Http.get({ - url: config.api.bannerDetail, - data: { - id: options.id - } - }).then(res => { - that.setData({ - data: res.data - }); + if (options.id){ + Http.get({ + url: config.api.bannerDetail, + data: { + id: options.id + } + }).then(res => { + that.setData({ + data: res.data + }); }).catch(err => { wx.showToast({ title: err.errMsg, @@ -30,6 +31,7 @@ Page({ mask: false }); }) + } }, gotoactdetail:function(){ let that = this;