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.2 KiB
42 lines
1.2 KiB
// pages/withdrawal/balance/index.js
|
|
import { getBalanceInfo } from "../../api/payment"
|
|
const math = require('../../../utils/math')
|
|
const util = require('../../../utils/util')
|
|
const app = getApp()
|
|
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
accountMoney: '',
|
|
frozenMoney: ''
|
|
},
|
|
onShow: function () {
|
|
wx.showLoading({ title: '加载中', mask: true })
|
|
getBalanceInfo().then(result => {
|
|
wx.hideLoading()
|
|
this.setData({
|
|
accountMoney: math.minus(result.data.accountMoney, result.data.frozenMoney),
|
|
frozenMoney: result.data.frozenMoney,
|
|
StatusBar: app.globalData.StatusBar || 40,
|
|
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
|
|
Custom: app.globalData.Custom
|
|
})
|
|
}).catch(err => {
|
|
wx.hideLoading()
|
|
this.setData({
|
|
StatusBar: app.globalData.StatusBar || 40,
|
|
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
|
|
Custom: app.globalData.Custom
|
|
})
|
|
})
|
|
},
|
|
toPage:function(e){
|
|
if (e.currentTarget.id == 'toTx') {
|
|
util.navigateTo('/pages/withdrawal/vcheckout/index')
|
|
} else if (e.currentTarget.id == 'toRt') {
|
|
wx.navigateBack()
|
|
}
|
|
}
|
|
})
|