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.
44 lines
1.1 KiB
44 lines
1.1 KiB
// pages/message/detail/index.js
|
|
import Scene from '../../index/scene'
|
|
const app = getApp()
|
|
|
|
Scene({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
height: app.globalData.fragmentHeight,
|
|
CustomBar: app.globalData.CustomBar,
|
|
TabList: [
|
|
{ index: 0, value: 'focus', name: '关注' },
|
|
{ index: 1, value: 'factory', name: '全部' }
|
|
],
|
|
pageIndex: 0,
|
|
},
|
|
onLoad: function (options) {
|
|
this.setData({
|
|
height: app.globalData.fragmentHeight,
|
|
StatusBar: app.globalData.StatusBar || 40,
|
|
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
|
|
})
|
|
},
|
|
backspace() {
|
|
wx.navigateBack()
|
|
},
|
|
onShow: function () {
|
|
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value)
|
|
if (pageView) {
|
|
pageView.onRestart()
|
|
}
|
|
},
|
|
stopTouchMove: function (e) {
|
|
return false
|
|
},
|
|
onTabChangeTop: function (e) {
|
|
if (this.data.pageIndex == Number(e.currentTarget.dataset.index)) {
|
|
return
|
|
}
|
|
this.setData({ pageIndex: Number(e.currentTarget.dataset.index) })
|
|
this.onShow()
|
|
}
|
|
})
|