Compare commits

...

1 Commits
master ... yh

Author SHA1 Message Date
杨豪 c7f889b84e 上传代码 3 years ago
  1. 5
      pages/user/bindCard/index.js
  2. 25
      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({ wx.showToast({
title: '绑定成功!', title: '绑定成功!',
}) })
setTimeout(()=>{
wx.navigateBack({
delta: 1,
})
})
}) })
}, },
/** /**

25
pages/user/cashOut/index.js

@ -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,6 +27,7 @@ Page({
}) })
}, },
cashClick(){ cashClick(){
if(this.data.userInfo.userBank){
if(this.data.cashNum == '' || this.data.cashNum <= 100){ if(this.data.cashNum == '' || this.data.cashNum <= 100){
return app.alertMessage('请输入正确的积分') return app.alertMessage('请输入正确的积分')
} }
@ -45,6 +44,12 @@ Page({
}) })
},1500) },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
})
})
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

2
pages/user/cashOut/index.wxml

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

Loading…
Cancel
Save