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.
65 lines
1.5 KiB
65 lines
1.5 KiB
const math = require('../../../utils/math')
|
|
const event = require('../../../utils/event')
|
|
const app = getApp()
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
multipleSlots: true
|
|
},
|
|
|
|
/** 页面的初始数据 */
|
|
data: {
|
|
firstShow: false,
|
|
height: app.globalData.safeFragmentHeight - 100,
|
|
|
|
banlanceInfo: {accountMoney: 0, frozenMoney: 0}
|
|
},
|
|
lifetimes: {
|
|
attached: function () {
|
|
event.on('EventMessage', this, this.onEvent)
|
|
},
|
|
detached: function () {
|
|
event.remove('EventMessage', this)
|
|
}
|
|
},
|
|
methods: {
|
|
onRestart: function () {
|
|
if(!this.data.firstShow) {
|
|
this.setData({
|
|
height: app.globalData.safeFragmentHeight - 100,
|
|
customHeight: app.globalData.customHeight,
|
|
customWidth: app.globalData.Custom.left,
|
|
StatusBar: app.globalData.StatusBar || 40,
|
|
})
|
|
}
|
|
// this.fetchStatisticsInfo()
|
|
this.data.firstShow = true
|
|
},
|
|
onEvent: function (message) {
|
|
if (message.what == 888) {
|
|
}
|
|
},
|
|
fetchStatisticsInfo: function(loading){
|
|
getBalanceInfo().then(result => {
|
|
if(result.data){
|
|
result.data.accountMoney = math.minus(result.data.accountMoney, result.data.frozenMoney)
|
|
this.setData({ banlanceInfo: result.data })
|
|
}
|
|
if(loading){
|
|
wx.hideLoading()
|
|
}
|
|
}).catch(err => {
|
|
if(loading){
|
|
wx.hideLoading()
|
|
}
|
|
})
|
|
},
|
|
menuClick: function(e){
|
|
|
|
},
|
|
agentList: function (e) {
|
|
|
|
}
|
|
}
|
|
})
|