diff --git a/miniProject/pages/home/index.wxml b/miniProject/pages/home/index.wxml index 29d1ebe..ebe905e 100644 --- a/miniProject/pages/home/index.wxml +++ b/miniProject/pages/home/index.wxml @@ -1,6 +1,6 @@ - + - + - + { + this.getGateList(value) + }) }, checkboxChange: function(e) { const { value } = e.detail this.setData({ selectData: value }) }, - + // 获取出入口列表 + getGateList: function(e) { + const atoken = wx.getStorageSync('atoken'); + const id = wx.getStorageSync('accountId'); + const data = { + accountId: id, + mallId: e, + status: 1, + type_arr: '1,3' + } + getIndexInfo('/report/gates', data, { 'Authorization': atoken }).then(res => { + console.log(res.data) + if (res.data.length > 0) { + this.setData({ + gateList: res.data, + gateId: [res.data[0].id], + selectGate: res.data[0].name + }) + } + }) + }, // 返回上一页 queding: function(e) { - const { selectData, accountList, reportType } = this.data + const { selectData, accountList, reportType,gateList,gateId,selectGate } = this.data let pages = getCurrentPages(); let prevPage = pages[ pages.length - 2 ]; let selectMall = '' @@ -80,8 +105,11 @@ Page({ } prevPage.setData({ - accountId: selectData, - selectMall: selectMall + accountId: selectData, + selectMall: selectMall, + gateList: gateList, + gateId: gateId, + selectGate: selectGate }) wx.navigateBack({ delta: 1 }) }