var app = getApp() const util = require('../../../utils/utils.js') Page({ data: { balance:'0.00',//显示余额 state:'',//认证状态 phone: '',//手机认证状态 imgUrl:'', stateStatus: wx.getStorageSync('userState').is_card_certified, is_bindPhone: wx.getStorageSync('userState').is_bind_mobile }, getBalance: util.throttle(function (e) { this.setData({ balance: wx.getStorageSync('userInfo').wallet_money}) //获取实名认证状态 console.log(wx.getStorageSync('userState').is_card_certified == 1) if (wx.getStorageSync('userState').is_card_certified == 1){ this.setData({ state:'已认证' }) }else{ this.setData({ state:'去认证' }) } if (wx.getStorageSync('userState').is_bind_mobile == 1) { this.setData({ phone: '去换绑' }) } else { this.setData({ phone: '去认证' }) } },1000), walletDetail: function () { wx.navigateTo({ url: '/pages/wallet_details/wallet_details', }) }, goCertified:function(){ wx.navigateTo({ url: '/pages/real_name/real_name?state2=2&index=1', }) }, goBindphone: function () { wx.navigateTo({ url: '/pages/real_name/real_name?state1=1&index=0', }) }, huanbang: function () { wx.navigateTo({ url: '/pages/huan_bang/huan_bang', }) }, onLoad: function (options) { var img = wx.getStorageSync('imgUrl'); this.setData({ imgUrl: 'http://resource.' + img[1]}) }, onReady: function () { }, onShow: function () { this.getBalance(); this.setData({ stateStatus: wx.getStorageSync('userState').is_card_certified, is_bindPhone: wx.getStorageSync('userState').is_bind_mobile }) }, onHide: function () { }, onUnload: function () { }, onPullDownRefresh: function () { }, onReachBottom: function () { }, onShareAppMessage: function () { } })