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

38 lines
897 B

// pages/balance/index/index.js
const app = getApp()
Page({
data: {
height: app.globalData.fragmentHeight,
CustomBar: 0,
tabList:['收入', '支出'],
tabIndex: 0
},
onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight - 100, CustomBar: app.globalData.CustomBar })
},
onReady: function(){
this.pageResume()
},
onTabChange: function({detail}) {
if(this.data.tabIndex == Number(detail.index)){
return
}
this.setData({tabIndex: Number(detail.index)})
this.pageResume()
},
onSwiperChange: function(e){
const { current: index, source } = e.detail
if (!!source) {
this.setData({tabIndex: index})
}
this.pageResume()
},
pageResume: function (e) {
var pageView = this.selectComponent('#fragment' + this.data.tabIndex)
if (pageView) {
pageView.onRestart()
}
}
})