// pages/index/gridChange.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { list: [], deptName:'' }, onLoad: function (options) { let that = this that.setData({ list: app.globalData.deptDataScopeList, deptName: wx.getStorageSync('currentGrid').deptName }) console.log('currentGrid', wx.getStorageSync('currentGrid')) }, change: function (e) { let index = e.currentTarget.dataset.index wx.setStorageSync('currentGrid', this.data.list[index]) app.globalData.currentDept = this.data.list[index] console.log(wx.getStorageSync('currentGrid')) wx.reLaunch({ url: '/pages/index/index' }) }, allchange: function (e) { wx.setStorageSync('currentGrid', '') console.log(wx.getStorageSync('currentGrid')) wx.reLaunch({ url: '/pages/index/index' }) }, })