|
|
|
// pages/home/home.js
|
|
|
|
Page({
|
|
|
|
jumpToSubSystem (options) {
|
|
|
|
console.log('1sadsdasd',options)
|
|
|
|
const key = options.currentTarget.dataset.key;
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/package/subSystem/subSystem?key=${key}`,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
itemList:[{
|
|
|
|
picPath:'/images/conduct.png',
|
|
|
|
itemName:'指挥中心'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/waterSupply.png',
|
|
|
|
itemName:'给水仓'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/pipeGallery.png',
|
|
|
|
itemName:'管廊本体'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/elevator.png',
|
|
|
|
itemName:'电梯系统'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/power.png',
|
|
|
|
itemName:'供配电系统'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/gas.png',
|
|
|
|
itemName:'燃气仓'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/security.png',
|
|
|
|
itemName:'安防系统'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/highTension.png',
|
|
|
|
itemName:'高压电力仓'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/electricalStorageRoom.png',
|
|
|
|
itemName:'电气仓'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
picPath:'/images/lightningProtection.png',
|
|
|
|
itemName:'防雷与接地'
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad (options) {
|
|
|
|
const {windowHeight}=wx.getSystemInfoSync()
|
|
|
|
const pageHeight=windowHeight - 48
|
|
|
|
this.setData({
|
|
|
|
pageHeight:pageHeight+'px'
|
|
|
|
})
|
|
|
|
console.log('xxxx',pageHeight)
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow () {
|
|
|
|
const userInfo = wx.getStorageSync('userInfo');
|
|
|
|
if (!userInfo || !userInfo.id) {
|
|
|
|
wx.reLaunch({
|
|
|
|
url: '/pages/login/login'
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
|
|
|
this.getTabBar().setData({
|
|
|
|
selected: 0
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage () {
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|