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',