纸通宝小程序
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.
 

65 lines
1.9 KiB

const app = getApp()
const event = require('../../utils/event.js')
Page({
data: {
TabList: [
// { index: 0, value: 'main', icon: 'form', badge: 0, name: '首页' },
{ index: 0, value: 'order', icon: 'form', badge: 0, name: '订单' },
{ index: 1, value: 'home', icon: 'my', badge: 0, name: '我的' }
],
pageIndex: 0,
safeBottom: app.globalData.safeBottom
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// const updateManager = wx.getUpdateManager()
// updateManager.onCheckForUpdate(function (res) {
// // 请求完新版本信息的回调
// console.log('updateManager>>>' + res.hasUpdate)
// // if(!res.hasUpdate){
// // that.checkLogin(options)
// // }
// })
// updateManager.onUpdateReady(function () {
// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
// updateManager.applyUpdate()
// })
this.setData({safeBottom: app.globalData.safeBottom })
event.on('EventMessage', this, this.onEvent)
// 检查用户是否设置过密码;
if(options.pwd == 0){
wx.navigateTo({
url: '/pages/home/password/index?from=home'
})
}
},
//事件处理函数
onNavChange(e) {
// 处理用户的登录校验
this.setData({ pageIndex: Number(e.currentTarget.dataset.tab) })
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value);
pageView.onRestart()
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value);
if (pageView) {
pageView.onRestart()
}
},
onEvent: function (message) {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
event.remove('EventMessage', this)
}
})