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.
51 lines
1.4 KiB
51 lines
1.4 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) {
|
|
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)
|
|
}
|
|
})
|