|
|
@ -1,9 +1,10 @@ |
|
|
// pages/stock/index.js
|
|
|
// pages/stock/index.js
|
|
|
import Dialog from '../../../components/dialog/dialog' |
|
|
import Dialog from '../../../components/dialog/dialog' |
|
|
import { finalizeToken } from "../../../api/user" |
|
|
import { finalizeToken } from "../../../api/user" |
|
|
import { getBaseInfo } from "../../../api/saas" |
|
|
|
|
|
|
|
|
import { getBalanceInfo } from '../../../api/payment' |
|
|
const util = require('../../../utils/util') |
|
|
const util = require('../../../utils/util') |
|
|
const event = require('../../../utils/event') |
|
|
const event = require('../../../utils/event') |
|
|
|
|
|
const math = require('../../../utils/math') |
|
|
const storage = require('../../../utils/storage') |
|
|
const storage = require('../../../utils/storage') |
|
|
const app = getApp() |
|
|
const app = getApp() |
|
|
|
|
|
|
|
|
@ -20,7 +21,7 @@ Component({ |
|
|
firstShow: false, |
|
|
firstShow: false, |
|
|
userInfo: null, |
|
|
userInfo: null, |
|
|
avatarUrl: '/assets/image/ygImg.png', |
|
|
avatarUrl: '/assets/image/ygImg.png', |
|
|
creditInfo: { availableCreditLine: 0, creditLine: 0, usedCreditLine: 0.00 } |
|
|
|
|
|
|
|
|
xsaccountMoney: 0, //显示余额
|
|
|
}, |
|
|
}, |
|
|
lifetimes: { |
|
|
lifetimes: { |
|
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
|
@ -35,6 +36,11 @@ Component({ |
|
|
// resume的处理;
|
|
|
// resume的处理;
|
|
|
onRestart: function () { |
|
|
onRestart: function () { |
|
|
this.setUserInfo() |
|
|
this.setUserInfo() |
|
|
|
|
|
getBalanceInfo().then(result => { |
|
|
|
|
|
this.setData({ xsaccountMoney: math.minus(result.data.accountMoney, result.data.frozenMoney) }) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
this.data.firstShow = true |
|
|
this.data.firstShow = true |
|
|
}, |
|
|
}, |
|
|
onEvent: function (message) { |
|
|
onEvent: function (message) { |
|
|
@ -46,7 +52,6 @@ Component({ |
|
|
if(!app.userInfo){ |
|
|
if(!app.userInfo){ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var nickname = '' |
|
|
var nickname = '' |
|
|
if(app.userInfo.isAuth) { |
|
|
if(app.userInfo.isAuth) { |
|
|
nickname = app.userInfo.realName.substring(0, 14) |
|
|
nickname = app.userInfo.realName.substring(0, 14) |
|
|
@ -71,7 +76,7 @@ Component({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
orderList: function(){ |
|
|
orderList: function(){ |
|
|
wx.navigateTo({ url: '/pages/mall/order-list/index' }) |
|
|
|
|
|
|
|
|
wx.navigateTo({ url: '/pages/client/order-list/index' }) |
|
|
}, |
|
|
}, |
|
|
tipApply: function(){ |
|
|
tipApply: function(){ |
|
|
wx.navigateTo({ url: '/pages/htmls/auths/index' }) |
|
|
wx.navigateTo({ url: '/pages/htmls/auths/index' }) |
|
|
|