From 75f7bffb88f97d54bd640f033fe50937f665c254 Mon Sep 17 00:00:00 2001 From: lfs3 Date: Fri, 20 Jul 2018 10:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 63a56da..7adb1d7 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,6 +1,6 @@ //获取应用实例 const app = getApp() - +var merchantNo = ''; Page({ /** * 页面的初始数据 @@ -11,7 +11,6 @@ Page({ interval: 5000, duration: 1000, imgUrls: [], - merchantNo: '', // bannerImage: '/images/activity_banner.png', menu_list: [ { name: '拼团', disabled: false, className: 'green_button' }, @@ -46,7 +45,7 @@ Page({ * 生命周期函数--监听页面加载 */ onShow: function (options) { - var that = this; + let that = this; //获取本地数据 // 获取地址 wx.getStorage({ @@ -56,18 +55,18 @@ Page({ districtName: res.data }) } + }); + // 商家编号 wx.getStorage({ key: 'merchantNo', success: function (res) { - console.log(1) - console.log(res.data) - console.log(1) - that.setData({ - merchantNo: res.data - }), - that.getActivityList(res.data); + // that.setData({ + merchantNo = res.data + // }) + console.log("merchantNo:" +merchantNo); + that.getActivityList(); wx.request({ url: app.gw.hostUrl + '/mall/wxa/activity/banner', method: 'get', @@ -109,9 +108,10 @@ Page({ }, - getActivityList: function ( merchantNo) { + getActivityList: function () { let that = this; wx.showNavigationBarLoading() //在标题栏中显示加载 + console.log("districtName:" + that.districtName); wx.request({ url: app.gw.hostUrl + '/mall/wxa/activity/list', method: 'get',