var util = require("../../utils/util.js") const app = getApp() Page({ data: { cityObj: [] }, onLoad: function(options) { let _this = this; _this.setData({ navH: app.globalData.navHeight }); this.getCityList(); }, // 获取当前已开通城市 getCityList: function() { util.getData('/getBranches') .then(res => { this.setData({ cityObj: res }) }) .catch(err => { console.log(err); }) }, // 点击城市跳转 clickCity: function(e) { let code = e.currentTarget.dataset.code; let name = e.currentTarget.dataset.name; wx.setStorageSync( 'branche_code', code ) wx.setStorageSync( 'branche_name', name ) util.goHome(); } })