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.
42 lines
1.1 KiB
42 lines
1.1 KiB
// pages/stock/index.js
|
|
const util = require('../../../../utils/util')
|
|
const app = getApp()
|
|
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
height: app.globalData.safeFragmentHeight - 90,
|
|
safeBottom: app.globalData.safeBottom,
|
|
firstShow: false,
|
|
tabList: [ '热门', '纸品价格', '车辆排队', '纸厂扣点' ],
|
|
tabIndex: 0
|
|
},
|
|
onLoad:function(){
|
|
this.onRestart()
|
|
},
|
|
onRestart: function () {
|
|
var fragment = this.selectComponent('#fragment' + this.data.tabIndex)
|
|
if (fragment) {
|
|
fragment.onRestart()
|
|
}
|
|
if (!this.data.firstShow) {
|
|
this.setData({ height: app.globalData.safeFragmentHeight - 90, tabList: this.data.tabList, safeBottom: app.globalData.safeBottom})
|
|
}
|
|
this.data.firstShow = true
|
|
},
|
|
onTabChange: function({detail}){
|
|
if(this.data.tabIndex == Number(detail.index)){
|
|
return
|
|
}
|
|
this.setData({ tabIndex: Number(detail.index) })
|
|
this.onRestart()
|
|
},
|
|
stopTouchMove: function(e){
|
|
return false
|
|
},
|
|
postMoment: function(){
|
|
util.navigateTo('/pakageInfo/pages/article/publish/index')
|
|
}
|
|
})
|