You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

540 lines
13 KiB

<template>
<view class="cash">
<far-bottom></far-bottom>
<!-- 提现输入框 -->
<view class="cashInput">
<view class="cashInputPackage">
<view><span>提现金额</span></view>
<view>
<span>¥</span>
<input placeholder="请输入金额" v-model="settlementmoney" />
</view>
<view>
<block class="dis-flex">
<span style="line-height: 20upx;">可提现(元):{{creditCashInfo.nowmoney}}</span>
</block>
<view @click="allWithdrawal"><span>全部提现</span></view>
</view>
<view style="color: #FF4444;font-size: 22upx;">提现金额{{creditCashInfo.lowsetmoney}}元起<text v-if="creditCashInfo.maxsetmoney !== 99999999">,单次最高可提现金额{{creditCashInfo.maxsetmoney}}元</text>,提现手续费{{creditCashInfo.syssalepercent}}%</view>
<view>
<view @click="allWithdrawal"><span>全部提现</span></view>
</view>
</view>
</view>
<!-- 提现输入框 -->
<!-- 选择支付方式 -->
<view class="checkPayType">
<view class="checkPayTypePackage">
<view><span>提现到</span></view>
<!-- 微信 -->
<view class="type" v-if="creditCashInfo.wechatstatus==1" @click="cashtype=2">
<view class="typePackage">
<view>
<image :src="imgfixUrls + 'merchant/wechatPay.svg'" />
<span>微信零钱</span>
</view>
<view class="checked" v-if="cashtype==2">
<image :src="imgfixUrls + 'merchant/payCheck.svg'" />
</view>
<view v-else></view>
</view>
</view>
<!-- 微信 -->
<!-- 渠道1 -->
<view class="type" v-if="creditCashInfo.alipaystatus==1" @click="cashtype=1">
<view class="typePackage">
<view>
<image :src="imgfixUrls + 'merchant/payPal.svg'" />
<span>{{examineing==0?'支付宝':'渠道1'}}</span>
</view>
<view class="checked" v-if="cashtype==1">
<image :src="imgfixUrls + 'merchant/payCheck.svg'" />
</view>
<view v-else></view>
</view>
<view class="yhkInput" v-if="cashtype==1">
<view>
<span>真实姓名</span>
<input placeholder="请填写真实姓名" v-model="creditCashInfo.realname" />
</view>
<view>
<span>{{examineing==0?'支付宝':'渠道1'}}</span>
<input :placeholder="examineing==0?'请输入支付宝账号':'请输入渠道1账号'" v-model="creditCashInfo.alipay" />
</view>
</view>
</view>
<!-- 渠道1 -->
<!-- 渠道2 -->
<view class="type" v-if="creditCashInfo.bankcardstatus==1" @click="cashtype=3">
<view class="typePackage">
<view>
<image :src="imgfixUrls + 'merchant/yhk.png'" />
<span>{{examineing==0?'银行':'渠道2'}}账户</span>
</view>
<view class="checked" v-if="cashtype==3">
<image :src="imgfixUrls + 'merchant/payCheck.svg'" />
</view>
<view v-else></view>
</view>
<view class="yhkInput" v-if="cashtype==3">
<view>
<span>真实姓名</span>
<input placeholder="请输入姓名" v-model="creditCashInfo.bank_username" />
</view>
<view>
<span>开户{{examineing==0?'银行':'渠道2'}}</span>
<input :placeholder="examineing==0?'请输入开户行名称/地址':'请输入渠道2备注'" v-model="creditCashInfo.bank_name" />
</view>
<view>
<span>{{examineing==0?'银行卡号':'渠道2'}}</span>
<input :placeholder="examineing==0?'请输入银行卡号':'请输入渠道2号'" type="number" v-model="creditCashInfo.card_number" />
</view>
</view>
</view>
<!-- 渠道2 -->
<view class="inputFoot">
<span></span>
<view>
<span>请务必填写真实信息</span>
<span>*</span>
</view>
</view>
</view>
</view>
<!-- 选择支付方式 -->
<!-- 提交按钮 -->
<view class="cashSubmit" @click="creditCashing">
<span>提交审核</span>
</view>
<!-- 提交按钮 -->
</view>
</template>
<script>
import App from '@/common/js/app.js';
// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif
export default {
data() {
return {
creditCashInfo: {},
settlementmoney: "",
cashtype: '',
examineing:1
};
},
onLoad: function() {
this.init();
let TextSubstitution = uni.getStorageSync('TextSubstitution');
this.examineing = TextSubstitution.examineing || 0;
},
methods: {
allWithdrawal(){
let _this = this;
if( Number(_this.creditCashInfo.maxsetmoney) < Number(_this.creditCashInfo.nowmoney)){
uni.showToast({
icon: 'none',
title: `单次最大提现金额为${_this.creditCashInfo.maxsetmoney}`,
duration: 2000
});
_this.settlementmoney = _this.creditCashInfo.maxsetmoney;
}else{
_this.settlementmoney = _this.creditCashInfo.nowmoney;
}
},
init() {
let _this = this
_this.creditCashPage();
},
// 余额提现页面
creditCashPage() {
let _this = this,
data = {};
App._post_form('&p=member&do=creditCashPage', data, res => {
_this.creditCashInfo = res.data;
// _this.creditCashInfo.maxsetmoney = 0;
if(Number(_this.creditCashInfo.maxsetmoney) == 0){
_this.creditCashInfo.maxsetmoney = 99999999;
}
if (res.data.wechatstatus == 1) {
_this.cashtype = 2
} else {
if (res.data.alipaystatus == 1) {
_this.cashtype = 1
} else {
_this.cashtype = 3
}
}
}, fail => {
console.info()
if (fail.data.message == '余额提现已关闭') {
App.navigationTo({
url: 'pages/subPages/balance/balance'
})
}
})
},
// 确认提现
withdraw(fromData) {
App._post_form('&p=member&do=creditCashing', fromData, res => {
if (res.errno === 0) {
App.showSuccess('提现申请成功', () => {
uni.navigateBack()
})
}
})
},
// 余额提现申请
creditCashing() {
let _this = this,
datas = {
settlementmoney: _this.settlementmoney,
cashtype: _this.cashtype,
alipay: _this.creditCashInfo.alipay,
realname: _this.creditCashInfo.realname || '',
bank_name: _this.creditCashInfo.bank_name,
card_number: _this.creditCashInfo.card_number,
bank_username: _this.creditCashInfo.bank_username,
};
if (_this.settlementmoney == '') {
uni.showToast({
icon: 'none',
title: '提现金额不能为空',
duration: 2000
});
return;
}
if(Number(_this.settlementmoney) >Number(_this.creditCashInfo.nowmoney) || Number(_this.settlementmoney) >Number(_this.creditCashInfo.maxsetmoney)){
if(_this.creditCashInfo.nowmoney > _this.creditCashInfo.maxsetmoney){
uni.showToast({
icon: 'none',
title: `单次最大提现金额为${_this.creditCashInfo.maxsetmoney}`,
duration: 2000
});
}else{
uni.showToast({
icon: 'none',
title: `本次最大提现金额为${_this.creditCashInfo.nowmoney}`,
duration: 2000
});
}
_this.allWithdrawal();
return;
};
if (_this.cashtype == 1) {
if (_this.creditCashInfo.alipay == '') {
uni.showToast({
icon: 'none',
title: _this.examineing==0?'支付宝账号不能为空':'渠道1账号不能为空',
duration: 2000
});
return;
}
if (!_this.creditCashInfo.realname) {
uni.showToast({
icon: 'none',
title: '真实姓名不能为空',
duration: 2000
});
return;
}
}
if (_this.cashtype == 3) {
if (_this.creditCashInfo.bank_username == '') {
uni.showToast({
icon: 'none',
title: '真实姓名不能为空',
duration: 2000
});
return;
}
if (_this.creditCashInfo.bank_name == '') {
uni.showToast({
icon: 'none',
title: '开户行不能为空',
duration: 2000
});
return;
}
if (_this.creditCashInfo.card_number.length < 13 || _this.creditCashInfo.card_number.length > 25) {
uni.showToast({
icon: 'none',
title: _this.examineing==0?'银行卡号不能为空':'渠道2号格式不正确',
duration: 2000
});
return;
}
}
let currentPrice = _this.settlementmoney; //实际金额
let serviceCharge = _this.creditCashInfo.syssalepercent; //手续费
let calculate = {
money: currentPrice,
percent: serviceCharge
}
App._post_form('&p=pay&do=calculationCash', calculate, res => {
if (res.errno === 0) {
let conpmoney = res.data.realmoney;
console.log(conpmoney);
if(Number(conpmoney) < 1){
uni.showToast({
title:'最小实得金额不能小于1元,当前实得金额为'+conpmoney+'元',
icon:'none'
})
return
}
App.showError(
`确认提现${currentPrice}元,实得${conpmoney}`, (data) => {
if (data.confirm) {
!!data && _this.withdraw(datas)
}
}, true)
}
})
// let realTimePrice = Math.round((currentPrice - (Number(serviceCharge) / 100 * currentPrice)) * 100) / 100;//四舍五入
//
}
}
};
</script>
<style lang="less" scoped>
.cash {
font-size: 0;
border: 1upx solid rgba(0, 0, 0, 0);
}
page {
background: #f6f6f6;
overflow-x: hidden;
}
.cashInput {
margin: 20upx auto 0 auto;
width: 688upx;
background: rgba(255, 255, 255, 1);
border-radius: 10upx;
}
.cashInputPackage {
padding: 30upx;
>view:nth-child(1) {
>span {
font-size: 28upx;
color: rgba(51, 51, 51, 1);
}
}
>view:nth-child(2) {
margin-top: 48upx;
padding-bottom: 20upx;
border-bottom: 1upx solid rgba(246, 246, 246, 1);
>span {
vertical-align: bottom;
font-size: 24upx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
}
>input {
display: inline-block;
width: 500upx;
font-size: 36upx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
}
}
>view:nth-child(3) {
margin: 20upx 0 0 0;
display: flex;
justify-content: space-between;
>span {
line-height: 70upx;
font-size: 24upx;
color: rgba(153, 153, 153, 1);
}
>view {
display: inline-block;
width: 184upx;
height: 70upx;
background: rgba(244, 79, 68, 1);
border-radius: 35upx;
text-align: center;
>span {
line-height: 70upx;
font-size: 24upx;
color: rgba(255, 255, 255, 1);
}
}
}
}
.checkPayType {
margin: 20upx auto 0 auto;
width: 688upx;
background: rgba(255, 255, 255, 1);
border-radius: 10upx;
}
.checkPayTypePackage {
padding: 30upx;
>view:nth-child(1) {
>span {
font-size: 30upx;
color: rgba(51, 51, 51, 1);
}
}
>view:nth-child(2) {
margin-top: 10upx;
}
}
.typePackage {
padding: 20upx 0;
display: flex;
justify-content: space-between;
border-bottom: 1upx solid rgba(246, 246, 246, 1);
>view:nth-child(1) {
vertical-align: middle;
>image {
vertical-align: middle;
width: 60upx;
height: 60upx;
}
>span {
margin-left: 15upx;
vertical-align: middle;
font-size: 28upx;
color: rgba(81, 81, 81, 1);
}
}
>view:nth-child(2) {
margin-top: 15upx;
vertical-align: middle;
width: 35upx;
height: 35upx;
border: 2upx solid rgba(238, 238, 238, 1);
border-radius: 50%;
>image {
width: 35upx;
height: 35upx;
}
}
}
.yhkInput {
padding: 20upx;
>view {
border-bottom: 1upx solid rgba(246, 246, 246, 1);
padding: 20upx 0;
>span {
vertical-align: middle;
display: inline-block;
width: 100upx;
font-size: 24upx;
color: rgba(81, 81, 81, 1);
}
>input {
padding-left: 30upx;
vertical-align: middle;
width: 400upx;
display: inline-block;
font-size: 24upx;
font-weight: 400;
color: rgba(81, 81, 81, 1);
}
}
}
.inputFoot {
margin-top: 20upx;
display: flex;
justify-content: space-between;
>view {
display: inline-block;
>span:nth-child(1) {
vertical-align: top;
font-size: 24upx;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
>span:nth-child(2) {
vertical-align: top;
font-size: 24upx;
font-weight: 400;
color: #EF4949;
}
}
}
.cashSubmit {
margin: 20upx auto 0 auto;
width: 688upx;
height: 84upx;
background: rgba(244, 79, 68, 1);
border-radius: 42upx;
text-align: center;
>span {
line-height: 84upx;
font-size: 28upx;
font-weight: 400;
color: rgba(255, 255, 255, 1);
}
}
.checked {
width: 35px;
height: 35px;
background: #F44F44;
border-radius: 50%;
} </style>