123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- var app = getApp()
- const util = require('../../../utils/utils.js')
- Page({
- data: {
- balance:'0.00',//显示余额
- state:'',//认证状态
- phone: '',//手机认证状态
- imgUrl:'http://resource.weilaibike.com/xiaobanma/walletBg.png',
- stateStatus: '',
- is_bindPhone: '',
- student:'',
- is_student:'',
- setting:wx.getStorageSync('setting')
- },
- getBalance: util.throttle(function (e) {
- app.request("/me", '', "GET").then(res => {
- 200 == res.statusCode && wx.setStorageSync("userInfo", res.data), this.setData({
- balance: res.data.wallet_money
- })
- })
- //获取实名认证状态
- },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&hidden=true',
- })
- },
- goStudent:function(){
- wx.navigateTo({
- url: '/pages/student_certification/student_certification',
- })
- },
- goBindphone: function () {
- wx.navigateTo({
- url: '/pages/real_name/real_name?state1=1&index=0&hidden=true',
- })
- },
- huanbang: function () {
- wx.navigateTo({
- url: '/pages/huan_bang/huan_bang',
- })
- },
- onLoad: function (options) {
- },
- onReady: function () {
- },
- onShow: function () {
- this.getBalance();
- app.request("/user/status", '', "GET").then(res => {
- console.log(res)
- if (res.statusCode == 200) {
- if (res.data.is_card_certified == 1){
- this.setData({
- state:'已认证'
- })
- }else{
- this.setData({
- state:'去认证'
- })
- }
- if (res.data.is_bind_mobile == 1) {
- this.setData({
- phone: '去换绑'
- })
- } else {
- this.setData({
- phone: '去认证'
- })
- }
- if (res.data.is_student == 1) {
- this.setData({
- student: '认证成功'
- })
- } else {
- this.setData({
- student: '去认证'
- })
- }
- this.setData({
- stateStatus: res.data.is_card_certified,
- is_bindPhone: res.data.is_bind_mobile,
- is_student:res.data.is_student,
- setting:wx.getStorageSync('setting')
- })
- wx.setStorageSync('userState', res.data)
- }
- })
-
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- onReachBottom: function () {
- },
- onShareAppMessage: function () {
-
- }
- })
|