<template>
|
<view class="cashOut-wrapper wrapperLayer">
|
<titleBar :titleText="'提现'" :pageForm='"cashOut"'></titleBar>
|
<view class="zfbInfo-container rowCen" @tap="setZFB()">
|
<view class="nozfbInfo" v-if="user.true_name && user.zfb_account">
|
<view class="leftcontent rowCen">
|
<image class="zfb" src="../../static/images/mine/zfb.png" mode=""></image>
|
<view class="txt-tips" style="margin-left: 30rpx;">
|
<view class="top-txt">
|
{{user.true_name}}
|
</view>
|
<view class="down-txt">
|
{{user.zfb_account.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="nozfbInfo rowCenBet" v-else>
|
<view class="leftcontent rowCen">
|
<image class="zfb" src="../../static/images/mine/zfb.png" mode=""></image>
|
<view class="txt-tips">
|
<view class="top-txt">
|
您还未绑定支付宝账号
|
</view>
|
<view class="down-txt">
|
{{appInfo.appName}}保证不会泄露您的支付宝信息
|
</view>
|
</view>
|
</view>
|
<view class="right-btn rowCenCen">
|
<view>立即绑定</view>
|
</view>
|
</view>
|
</view>
|
|
<view class="cashNum-container colCen">
|
<view class="box-title">
|
提现金额
|
</view>
|
<view class="cash-input-container rowCenBet">
|
<view class="left-input rowCen">
|
<view class="rmb">
|
¥
|
</view>
|
<input class="cashinput" type="number" v-model="cashPrice"
|
:placeholder="`(最低提现1元 可提现¥`+user.money+')'" placeholder-class="placStyle" />
|
</view>
|
|
<view class="right-btn" @tap="cashAll()">
|
全部
|
</view>
|
</view>
|
</view>
|
|
<view class="confirm-bar rowCen" @tap='casntap()'>
|
<view class="confirm-btn rowCenCen">
|
<view>确认提现</view>
|
</view>
|
</view>
|
|
<view class="bottom-list-container colCen">
|
<view class="title-nav-bar rowCenBet">
|
<block v-for="(items,index) in orderNav" :key="index">
|
<view class="nav-items rowCenCen"
|
:style="navCurrent==index?'border-bottom: 4rpx solid #FD002F;':'border-bottom: 4rpx solid transparent;'"
|
@tap="clkNav(index)">
|
<view>{{items.label}}</view>
|
</view>
|
</block>
|
</view>
|
<view class="recordList-container colCen">
|
<block v-for="(items,index) in recordList" :key="index">
|
<view class="items-container rowCenBet">
|
<view class="record-details">
|
<view class="record-title">
|
{{items.title}}{{navCurrent==1?items.status==1?'-成功':items.status==2?'-失败':'-审核中':''}}
|
</view>
|
<view class="record-time">
|
{{items.create_time_text}}
|
</view>
|
</view>
|
|
<view class="right-num-content colCen">
|
<view class="numbox" :style="'color:' + (items.change_money>0?'#FE3738;':'#999999;')">
|
{{items.change_money}}
|
</view>
|
</view>
|
</view>
|
</block>
|
</view>
|
</view>
|
<aLoadMore :status="loadstate" mode="loading3" :showTitle='true' color="#999999"></aLoadMore>
|
|
<u-modal v-model="showModel" show-cancel-button :content="content" @confirm="confirm" :async-close="true">
|
</u-modal>
|
</view>
|
</template>
|
|
<script>
|
import {
|
mapMutations
|
} from "vuex";
|
import util from '@/utils/utils.js'
|
import titleBar from '@/components/backTitlebar.vue'
|
export default {
|
components: {
|
titleBar
|
},
|
data() {
|
return {
|
user: '',
|
cashPrice: '',
|
navCurrent: 0,
|
orderNav: [{
|
label: '结算日志'
|
},
|
{
|
label: '提现记录'
|
},
|
{
|
label: '余额明细'
|
}
|
],
|
recordList: [],
|
|
showModel: false,
|
content: '确认提现?',
|
|
loadstate: 'loading',
|
pageCurrent: 0,
|
canload: false,
|
appInfo: ''
|
}
|
},
|
onLoad() {
|
this.checkToken();
|
this.getrecord()
|
},
|
onShow() {
|
this.appInfo = uni.getStorageSync('appInfo')
|
this.getuserInfo()
|
},
|
onReachBottom() {
|
if (this.canload) {
|
this.getrecord()
|
}
|
},
|
methods: {
|
...mapMutations(["checkToken"]),
|
cashAll() {
|
this.cashPrice = this.user.money
|
},
|
|
casntap() {
|
if (this.user.zfb_account && this.user.true_name) {
|
if (Number(this.cashPrice) < 1) {
|
uni.showToast({
|
title: '提现金额不能小于1元!',
|
icon: 'none'
|
});
|
} else {
|
if (Number(this.cashPrice) > Number(this.user.money)) {
|
uni.showToast({
|
title: '余额不足了!',
|
icon: 'none'
|
});
|
} else {
|
this.showModel = true
|
}
|
}
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: '您还没有绑定支付宝账号!'
|
})
|
}
|
},
|
|
confirm() {
|
var that = this;
|
this.$u.api.withdraw({
|
amount:this.cashPrice
|
}).then(e => {
|
if(e.code == 1)return that.$alert(e.msg);
|
that.$alert(e.msg);
|
that.cashPrice = ''
|
that.getuserInfo()
|
that.clkNav(1)
|
that.showModel = false
|
}).catch(function (err) {
|
that.cashPrice = ''
|
that.recordList = []
|
that.getuserInfo()
|
that.getrecord()
|
that.showModel = false
|
return that.$alert('提交失败');
|
})
|
},
|
|
getuserInfo() {
|
var that = this;
|
this.$u.api.getUserInfo({}).then(e => {
|
that.user = e.data.userinfo;
|
util.setCache('userInfo', e.data.userinfo)
|
}).catch(function (err) {
|
console.log(err)
|
})
|
},
|
|
getrecord() {
|
var that = this;
|
this.$u.api.getBalanceLog({
|
pageSize: 10,
|
page: this.pageCurrent,
|
type: this.navCurrent
|
}).then(e => {
|
var res = e.data;
|
uni.stopPullDownRefresh()
|
if (res.length < 10) {
|
that.loadstate = 'nomore'
|
that.canload = false
|
} else {
|
that.loadstate = 'loading'
|
that.canload = true
|
that.pageCurrent ++;
|
}
|
that.recordList = that.recordList.concat(res)
|
}).catch(function (err) {
|
console.log(err)
|
})
|
|
},
|
|
clkNav(idx) {
|
this.navCurrent = idx
|
this.recordList = []
|
this.canload = false
|
this.pageCurrent = 1
|
this.loadstate = 'loading'
|
this.getrecord()
|
},
|
|
setZFB() {
|
uni.navigateTo({
|
url: './setting/bindingZFB'
|
})
|
}
|
},
|
onPullDownRefresh() {
|
this.recordList = []
|
this.canload = false
|
this.pageCurrent = 1
|
this.loadstate = 'loading'
|
this.getrecord()
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.cashOut-wrapper {
|
width: 100%;
|
|
.zfbInfo-container {
|
width: 100%;
|
height: 138rpx;
|
margin-top: 20rpx;
|
background: #FFFFFF;
|
padding: 0 12rpx;
|
|
.nozfbInfo {
|
width: 100%;
|
|
.leftcontent {
|
.zfb {
|
width: 86rpx;
|
height: 86rpx;
|
}
|
|
.txt-tips {
|
margin-left: 12rpx;
|
|
.top-txt {
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #333333;
|
}
|
|
.down-txt {
|
font-size: 24rpx;
|
font-weight: 500;
|
color: #666666;
|
}
|
}
|
}
|
|
.right-btn {
|
width: 156rpx;
|
height: 62rpx;
|
background: #0D0D0D;
|
border-radius: 31rpx;
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #FFFFFF;
|
margin-right: 30rpx;
|
}
|
}
|
}
|
|
.cashNum-container {
|
width: 750rpx;
|
height: 280rpx;
|
background: #FFFFFF;
|
margin-top: 20rpx;
|
|
.box-title {
|
width: 100%;
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #333333;
|
padding: 0 28rpx;
|
margin-top: 40rpx;
|
}
|
|
.cash-input-container {
|
width: 100%;
|
padding: 0 30rpx;
|
margin-top: 60rpx;
|
|
.left-input {
|
.rmb {
|
font-size: 30rpx;
|
font-weight: bold;
|
color: #333333;
|
}
|
|
.cashinput {
|
width: 500rpx;
|
margin-left: 20rpx;
|
font-size: 50rpx;
|
font-weight: bold;
|
color: #333333;
|
}
|
|
.placStyle {
|
font-size: 30rpx;
|
font-weight: 500;
|
color: #999999;
|
}
|
}
|
|
.right-btn {
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #FE3738;
|
}
|
}
|
}
|
|
.confirm-bar {
|
width: 100%;
|
padding: 0 30rpx;
|
|
.confirm-btn {
|
width: 100%;
|
height: 86rpx;
|
background: #FD002F;
|
border-radius: 43rpx;
|
font-size: 30rpx;
|
font-weight: 500;
|
color: #FFFFFF;
|
margin: 50rpx 0;
|
}
|
}
|
|
.bottom-list-container {
|
width: 100%;
|
background-color: #FFFFFF;
|
|
.title-nav-bar {
|
width: 100%;
|
height: 86rpx;
|
padding: 0 104rpx;
|
|
.nav-items {
|
width: 112rpx;
|
height: 100%;
|
font-size: 28rpx;
|
font-weight: 500;
|
color: #333333;
|
}
|
}
|
|
.recordList-container {
|
width: 100%;
|
|
.items-container {
|
width: 100%;
|
height: 134rpx;
|
padding: 0 30rpx;
|
|
// border-bottom: 1rpx solid #F1F1F1;
|
.record-details {
|
.record-title {
|
font-size: 26rpx;
|
font-weight: 500;
|
color: #333333;
|
}
|
|
.record-time {
|
font-size: 22rpx;
|
font-weight: 500;
|
color: #666666;
|
margin-top: 25rpx;
|
}
|
}
|
|
.right-num-content {
|
.numbox {
|
font-size: 36rpx;
|
font-weight: bold;
|
color: #333333;
|
}
|
|
.state {
|
font-size: 24rpx;
|
font-weight: 500;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|