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.
26 lines
757 B
26 lines
757 B
const app = getApp()
|
|
|
|
Page({
|
|
data: {
|
|
TabList: [
|
|
{ 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 })
|
|
},
|
|
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()
|
|
}
|
|
}
|
|
})
|