|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
// pages/user/cashOut/index.js
|
|
|
|
|
const app = getApp() |
|
|
|
|
const user = '../../../api/user.js' |
|
|
|
|
const user = require('../../../api/user.js') |
|
|
|
|
Page({ |
|
|
|
|
/** |
|
|
|
|
* 页面的初始数据 |
|
|
|
|
*/ |
|
|
|
|
data: { |
|
|
|
|
brokeragePrice: 0, |
|
|
|
|
userInfo: {}, |
|
|
|
|
cashNum: '' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -14,9 +14,7 @@ Page({
|
|
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
|
*/ |
|
|
|
|
onLoad: function (options) { |
|
|
|
|
this.setData({ |
|
|
|
|
brokeragePrice: options.brokeragePrice |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
allCash(){ |
|
|
|
|
this.setData({ |
|
|
|
@ -29,6 +27,7 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
cashClick(){ |
|
|
|
|
if(this.data.userInfo.userBank){ |
|
|
|
|
if(this.data.cashNum == '' || this.data.cashNum <= 100){ |
|
|
|
|
return app.alertMessage('请输入正确的积分') |
|
|
|
|
} |
|
|
|
@ -45,6 +44,12 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
},1500) |
|
|
|
|
}) |
|
|
|
|
} else{ |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/pages/user/bindCard/index', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
@ -57,9 +62,15 @@ Page({
|
|
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
|
*/ |
|
|
|
|
onShow: function () { |
|
|
|
|
|
|
|
|
|
this.getUserInfo() |
|
|
|
|
}, |
|
|
|
|
getUserInfo(){ |
|
|
|
|
user.getUserInfo().then((res)=> { |
|
|
|
|
this.setData({ |
|
|
|
|
userInfo: res.data.data |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
|
*/ |
|
|
|
|