Browse Source

上传代码

yh
杨豪 3 years ago
parent
commit
c7f889b84e
  1. 5
      pages/user/bindCard/index.js
  2. 55
      pages/user/cashOut/index.js
  3. 2
      pages/user/cashOut/index.wxml

5
pages/user/bindCard/index.js

@ -57,6 +57,11 @@ Page({
wx.showToast({
title: '绑定成功!',
})
setTimeout(()=>{
wx.navigateBack({
delta: 1,
})
})
})
},
/**

55
pages/user/cashOut/index.js

@ -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,22 +27,29 @@ Page({
})
},
cashClick(){
if(this.data.cashNum == '' || this.data.cashNum <= 100){
return app.alertMessage('请输入正确的积分')
}
user.cash({
extractType: 'bank',
money: this.data.cashNum
}).then((res)=>{
wx.showToast({
title: '申请提现成功',
})
setTimeout(()=>{
wx.navigateBack({
delta: 1,
if(this.data.userInfo.userBank){
if(this.data.cashNum == '' || this.data.cashNum <= 100){
return app.alertMessage('请输入正确的积分')
}
user.cash({
extractType: 'bank',
money: this.data.cashNum
}).then((res)=>{
wx.showToast({
title: '申请提现成功',
})
},1500)
})
setTimeout(()=>{
wx.navigateBack({
delta: 1,
})
},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
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/

2
pages/user/cashOut/index.wxml

@ -4,7 +4,7 @@
<image src="../../../images/profit.png" class="profit-bg"></image>
<view class="profit-info">
<view>当前可提现积分<text class="s-word">(积分比例为1:1)</text></view>
<view class="fz70">{{brokeragePrice || 0}}</view>
<view class="fz70">{{userInfo.brokeragePrice || 0}}</view>
</view>
</view>
<view class="tips">注:提现需在每月20-26日进行,其他时间不可提现</view>

Loading…
Cancel
Save