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