纸通宝SAAS仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

45 lines
1.7 KiB

// pages/administ/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
safeBottom: app.globalData.safeBottom,
fragment: app.globalData.safeFragmentHeight,
tabList: [
{ index: 0, value: 'mall', badge: 0, name: '商城', blue: '/assets/image/tabbar/mall-blue.png', gray: '/assets/image/tabbar/mall-gray.png' },
{ index: 1, value: 'work', badge: 0, name: '工作台', blue: '/assets/image/tabbar/process-blue.png', gray: '/assets/image/tabbar/process-gray.png' },
{ index: 2, value: 'home', badge: 0, name: '我的', blue: '/assets/image/tabbar/home-blue.png', gray: '/assets/image/tabbar/home-gray.png' }
],
tabIndex: 0
},
/************************************** 初始化流程 ********************************************/
onLoad: function (options) {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate()
updateManager.onUpdateReady(function () {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100, safeBottom: app.globalData.safeBottom })
},
/************************************** 生命周期函数--监听页面初次渲染完成 ********************************************/
onShow: function () {
this.onResume()
},
onResume: function(){
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value)
if (pageView && this.data.inited) {
pageView.onRestart()
}
},
onChange: function ({detail}) {
this.setData({ tabIndex: detail })
this.onResume()
},
stopTouchMove: function(e){
return false
}
})