const app = getApp(); const util = require("../../../utils/util"); var utils = require("../../../utils/http"), casepage = 1; let time = 0,timer = null; Page({ /** * 页面的初始数据 */ data: { nowstyle: '', stylelist: [], square_start: '', //面积开始值 square_end: '', //面积结束值 nowcommunity: '', communitylist: [], nowhousetype: '', housetypelist: [], imgUrl: app.globalData.imgUrl, caselist: [], keyword: '', datashow: false, loginFlag:false, canIUseGetUserProfile: false, shareobj:{}, employeeflag:false,//false是用户,true是员工 top:app.globalData.statusBarHeight, hgt:app.globalData.titleBarHeight, companyobj:{}, nowcommunitname:'', typearr:[ {id:1,name:'效果案例',type:1}, {id:2,name:'实景案例',type:2} ], noweffect:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { const that=this; wx.hideHomeButton(); time=0; this.setData({ top:app.globalData.statusBarHeight, hgt:app.globalData.titleBarHeight, }) if(!!options.scene){ options=unescape(options.scene); let arr=options.split('&'); let obj={}; for(let i=0;i { let pinyin1 = c1.pinyin; let pinyin2 = c2.pinyin; return pinyin1.localeCompare(pinyin2) }) // 添加首字母 const map = new Map() for (const city of cities) { const alpha = city.pinyin.charAt(0).toUpperCase() if (!map.has(alpha)) map.set(alpha, []) map.get(alpha).push({ name: city.name,id: city.id}) } const keys = [] for (const key of map.keys()) { keys.push(key) } keys.sort() const list = [] for (const key of keys) { list.push({ alpha: key, subItems: map.get(key) }) } for(let i=0;i