feat(withdrawal): 提现页面弹窗提示

This commit is contained in:
woody 2025-07-08 14:27:34 +08:00
parent 620d63ce00
commit 7f08fc4883
3 changed files with 485 additions and 240 deletions

View File

@ -0,0 +1,156 @@
<template>
<u-modal
:show="show"
:showConfirmButton="true"
:showCancelButton="false"
confirmText="我知道了"
@confirm="handleConfirm"
:closeOnClickOverlay="false"
width="640rpx"
:customStyle="{ 'border-radius': '16rpx' }"
>
<view class="withdrawal-guide-content">
<view class="guide-title">提现绑定操作指南</view>
<view class="guide-text">
<text>尊敬的经销商伙伴们</text>
<text
>为了让大家顺利快捷地提现符合法律法规的要求现需完成提现绑定操作步骤如下按序操作即可</text
>
</view>
<view class="guide-steps">
<view class="step-item">
<text class="step-number">1.</text>
<text class="step-text"
>微信扫码后用实际收款人本人手机号登录</text
>
</view>
<view class="step-item">
<text class="step-number">2.</text>
<text class="step-text"
>点击 "继续签约"上传本人身份证照片完成实名认证</text
>
</view>
<view class="step-item">
<text class="step-number">3.</text>
<text class="step-text"
>进入合同页面选择 "默认印章"输入收到的验证码完成签约</text
>
</view>
<view class="step-item">
<text class="step-number">4.</text>
<text class="step-text"
>返回首页点击 "提现"若显示 "开户"下拉刷新页面即可</text
>
</view>
<view class="step-item">
<text class="step-number">5.</text>
<text class="step-text"
>进入绑卡页面完成银行卡绑定后即可操作提现</text
>
</view>
</view>
<view class="guide-footer">
<text>请大家尽快办理有疑问可随时联系我们感谢配合</text>
</view>
<view class="qr-code-section">
<image
class="qr-code-image"
src="/static/images/with-drawal-mini-code.png"
mode="aspectFit"
/>
</view>
</view>
</u-modal>
</template>
<script>
export default {
name: 'WithdrawalGuide',
props: {
show: {
type: Boolean,
default: false,
},
},
methods: {
handleConfirm() {
this.$emit('confirm')
},
},
}
</script>
<style lang="scss" scoped>
.withdrawal-guide-content {
padding: 0rpx 32rpx 32rpx;
.guide-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.guide-text {
font-size: 26rpx;
color: #666666;
line-height: 40rpx;
margin-bottom: 24rpx;
text {
display: block;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
}
}
.guide-steps {
margin-bottom: 24rpx;
.step-item {
display: flex;
align-items: flex-start;
margin-bottom: 16rpx;
.step-number {
color: #005bac;
font-size: 26rpx;
font-weight: bold;
width: 32rpx;
flex-shrink: 0;
}
.step-text {
font-size: 26rpx;
color: #666666;
line-height: 40rpx;
flex: 1;
}
}
}
.guide-footer {
font-size: 26rpx;
color: #666666;
line-height: 40rpx;
margin-bottom: 32rpx;
text-align: center;
}
.qr-code-section {
display: flex;
justify-content: center;
align-items: center;
.qr-code-image {
width: 200rpx;
height: 200rpx;
border-radius: 8rpx;
}
}
}
</style>

View File

@ -1,256 +1,345 @@
<template> <template>
<view class="content"> <view class="content">
<view class="theform"> <view class="theform">
<u--form labelPosition="left" :model="dataForm" :rules="rules" ref="uForm"> <u--form
<u-form-item label-width="200rpx" :label="'银行卡号'" prop="cardNumber" borderBottom ref="item1"> labelPosition="left"
<u--input v-if="bankData.cardNumber" v-model="bankData.cardNumber" disabled disabledColor="#F5F5F5;" :model="dataForm"
border="none"></u--input> :rules="rules"
<view v-else style="color:red" @click="goBindbank"> ref="uForm"
{{'请先绑定银行卡'}} >
</view> <u-form-item
</u-form-item> label-width="200rpx"
<u-form-item label-width="200rpx" :label="`${'提现金额'}(${isLocaled()})`" prop="cashAmount" :label="'银行卡号'"
borderBottom ref="item1"> prop="cardNumber"
<u--input type='number' v-model="dataForm.cashAmount" :placeholder="'请输入'" borderBottom
border="none"></u--input> ref="item1"
</u-form-item> >
<u-form-item label-width="200rpx" :label="'二级密码'" prop="payPwd" borderBottom ref="item1"> <u--input
<template v-if="!ifeye"> v-if="bankData.cardNumber"
<u--input type='password' v-model="dataForm.payPwd" :placeholder="'请输入'" v-model="bankData.cardNumber"
border="none"></u--input> disabled
<image @click="ifeye=!ifeye" slot="right" style="width: 38rpx; disabledColor="#F5F5F5;"
height: 25rpx;" src="../../../static/images/my_eye.png" mode=""></image> border="none"
</template> ></u--input>
<template v-if="ifeye"> <view v-else style="color: red" @click="goBindbank">
<u--input v-model="dataForm.payPwd" :placeholder="'请输入'" border="none"></u--input> {{ '请先绑定银行卡' }}
<image @click="ifeye=!ifeye" slot="right" style="width: 38rpx; </view>
height: 30rpx;" src="../../../static/images/my_eye2.png" mode=""></image> </u-form-item>
</template> <u-form-item
</u-form-item> label-width="200rpx"
<u-form-item label-width="200rpx" :label="'备注'" prop="remarks" borderBottom ref="item1"> :label="`${'提现金额'}(${isLocaled()})`"
<u--input v-model="dataForm.remarks" border="none"></u--input> prop="cashAmount"
</u-form-item> borderBottom
<u-form-item label-width="200rpx" :label="'提现账户'" prop="pkAccountName" ref="item1"
@click="showAmount = true; " ref="item1"> >
<u--input v-model="dataForm.pkAccountName" disabled disabledColor="#ffffff" <u--input
:placeholder="'请选择'" border="none"></u--input> type="number"
<u-icon slot="right" name="arrow-right"></u-icon> v-model="dataForm.cashAmount"
</u-form-item> :placeholder="'请输入'"
<u-picker @cancel='showAmount=false' :show="showAmount" ref="uPicker" :columns="pkBdAccountList" border="none"
@confirm="confirm" keyName='accountName'></u-picker> ></u--input>
</u--form> </u-form-item>
<u-form-item
label-width="200rpx"
:label="'二级密码'"
prop="payPwd"
borderBottom
ref="item1"
>
<template v-if="!ifeye">
<u--input
type="password"
v-model="dataForm.payPwd"
:placeholder="'请输入'"
border="none"
></u--input>
<image
@click="ifeye = !ifeye"
slot="right"
style="width: 38rpx; height: 25rpx"
src="../../../static/images/my_eye.png"
mode=""
></image>
</template>
<template v-if="ifeye">
<u--input
v-model="dataForm.payPwd"
:placeholder="'请输入'"
border="none"
></u--input>
<image
@click="ifeye = !ifeye"
slot="right"
style="width: 38rpx; height: 30rpx"
src="../../../static/images/my_eye2.png"
mode=""
></image>
</template>
</u-form-item>
<u-form-item
label-width="200rpx"
:label="'备注'"
prop="remarks"
borderBottom
ref="item1"
>
<u--input v-model="dataForm.remarks" border="none"></u--input>
</u-form-item>
<u-form-item
label-width="200rpx"
:label="'提现账户'"
prop="pkAccountName"
@click="showAmount = true"
ref="item1"
>
<u--input
v-model="dataForm.pkAccountName"
disabled
disabledColor="#ffffff"
:placeholder="'请选择'"
border="none"
></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-picker
@cancel="showAmount = false"
:show="showAmount"
ref="uPicker"
:columns="pkBdAccountList"
@confirm="confirm"
keyName="accountName"
></u-picker>
</u--form>
<view class="contentbox">
<view class="linebox">
<view>{{ '可提现金额' }}()</view>
<view>{{ widthDrwaData.amount || '0.00' }}</view>
</view>
<view class="linebox">
<view>{{ '账户余额' }}()</view>
<view>{{ widthDrwaData.balance || '0.00' }}</view>
</view>
<view class="linebox">
<view>{{ '提现手续费' }}</view>
<view>{{ widthDrwaData.srviceCharge || '0.00' }}</view>
</view>
<view class="linebox">
<view>{{ '最低提现额度' }}()</view>
<view>{{ widthDrwaData.minAmount || '0.00' }}</view>
</view>
</view>
</view>
<view class="btnbox">
<u-button :disabled="canbind" class="subbtn" @click="submit">{{
'提现'
}}</u-button>
</view>
<u-toast ref="uToast"></u-toast>
<view class="contentbox"> <!-- 提现引导弹窗 -->
<view class="linebox"> <WithdrawalGuide
<view>{{'可提现金额'}}()</view> :show="showWithdrawalGuide"
<view>{{widthDrwaData.amount||'0.00'}}</view> @confirm="onWithdrawalGuideConfirm"
</view> />
<view class="linebox"> </view>
<view>{{'账户余额'}}()</view>
<view>{{widthDrwaData.balance||'0.00'}}</view>
</view>
<view class="linebox">
<view>{{'提现手续费'}}</view>
<view>{{widthDrwaData.srviceCharge||'0.00'}}</view>
</view>
<view class="linebox">
<view>{{'最低提现额度'}}()</view>
<view>{{widthDrwaData.minAmount||'0.00'}}</view>
</view>
</view>
</view>
<view class="btnbox">
<u-button :disabled="canbind" class="subbtn" @click="submit">{{'提现'}}</u-button>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template> </template>
<script> <script>
import * as bal from "@/config/balance.js" import * as bal from '@/config/balance.js'
import { import { isLocaled } from '@/util/numberToCurrency'
isLocaled import WithdrawalGuide from '@/components/withdrawalGuide/index.vue'
} from '@/util/numberToCurrency'
export default {
data() {
return {
showAmount: false,
dataForm: {
cardNumber: "",
cashAmount: "",
payPwd: "",
remarks: "",
pkAccountName: "",
pkAccount: "",
pkBank: ""
},
pkBdAccountList: [],
rules: {
cashAmount: [{
type: 'string',
required: true,
message: '请输入',
trigger: ['blur', 'change']
}],
payPwd: [{
type: 'string',
required: true,
message: '请输入',
trigger: ['blur', 'change']
}],
pkAccountName: [{
required: true,
message: '请选择',
trigger: ['change']
}],
},
bankData: {},
widthDrwaData: {},
ifeye: false,
canbind:false
} export default {
}, components: {
watch: { WithdrawalGuide,
'dataForm.cashAmount': 'checkAccount' },
}, data() {
onNavigationBarButtonTap() { return {
uni.navigateTo({ showAmount: false,
url:'/pages/mine/balance/withdrawlDetail' dataForm: {
}) cardNumber: '',
}, cashAmount: '',
onLoad() { payPwd: '',
this.getList() remarks: '',
}, pkAccountName: '',
methods: { pkAccount: '',
isLocaled, pkBank: '',
// },
goBindbank(){ pkBdAccountList: [],
uni.navigateTo({ rules: {
url:'/pages/mine/bindBank/bindBank' cashAmount: [
}) {
}, type: 'string',
getList() { required: true,
bal.getPkBdAccountList({ message: '请输入',
accountProperty: 3 trigger: ['blur', 'change'],
}).then(res => { },
res.data.forEach(ele => { ],
ele.name = ele.accountName payPwd: [
}) {
this.pkBdAccountList = [res.data] type: 'string',
required: true,
if(this.pkBdAccountList.length>0){ message: '请输入',
this.dataForm.pkAccountName = res.data[0].accountName trigger: ['blur', 'change'],
this.dataForm.pkAccount = res.data[0].pkId },
} ],
pkAccountName: [
}) {
bal.getDefaultBank().then((res) => { required: true,
this.bankData = res.data; message: '请选择',
this.dataForm.pkBank = res.data.pkId; trigger: ['change'],
}); },
// ],
bal.checkIsbindBank().then(res => { },
if (res.flag == 'Y') { bankData: {},
this.canbind = false widthDrwaData: {},
} else if (res.flag == 'N') { ifeye: false,
this.canbind = true canbind: false,
} showWithdrawalGuide: false,
}) }
},
watch: {
'dataForm.cashAmount': 'checkAccount',
},
onNavigationBarButtonTap() {
uni.navigateTo({
url: '/pages/mine/balance/withdrawlDetail',
})
},
onLoad() {
this.getList()
},
methods: {
isLocaled,
//
goBindbank() {
uni.navigateTo({
url: '/pages/mine/bindBank/bindBank',
})
},
getList() {
bal
.getPkBdAccountList({
accountProperty: 3,
})
.then(res => {
res.data.forEach(ele => {
ele.name = ele.accountName
})
this.pkBdAccountList = [res.data]
}, if (this.pkBdAccountList.length > 0) {
submit() { this.dataForm.pkAccountName = res.data[0].accountName
this.$refs.uForm.validate().then(res => { this.dataForm.pkAccount = res.data[0].pkId
bal.addWithdraw(this.dataForm).then(res => { }
if (res.code == 200) { })
this.$refs.uToast.show({ bal.getDefaultBank().then(res => {
message: res.msg, this.bankData = res.data
type: 'success' this.dataForm.pkBank = res.data.pkId
}) })
setTimeout(() => { //
uni.navigateBack() bal.checkIsbindBank().then(res => {
}, 1000); if (res.flag == 'Y') {
} this.canbind = false
}) } else if (res.flag == 'N') {
this.canbind = true
}
}).catch(errors => { })
uni.$u.toast('校验失败') },
}) submit() {
}, this.$refs.uForm
confirm(e) { .validate()
.then(res => {
this.dataForm.pkAccountName = e.value[0].accountName bal.addWithdraw(this.dataForm).then(res => {
this.dataForm.pkAccount = e.value[0].pkId if (res.code == 200) {
this.showAmount = false this.$refs.uToast.show({
this.checkAccount() message: res.msg,
type: 'success',
}, })
checkAccount() { //
if (!this.dataForm.cashAmount) { setTimeout(() => {
uni.$u.toast('请先输入金额') this.showWithdrawalGuide = true
return }, 300)
} else if (!this.dataForm.pkAccount) { }
uni.$u.toast('请先选择账户') })
return })
} .catch(errors => {
bal.getWidthdrawShow({ uni.$u.toast('校验失败')
pkAccount: this.dataForm.pkAccount, })
cashAmount: this.dataForm.cashAmount, },
}).then(res => { confirm(e) {
this.widthDrwaData = res.data this.dataForm.pkAccountName = e.value[0].accountName
}) this.dataForm.pkAccount = e.value[0].pkId
} this.showAmount = false
} this.checkAccount()
} },
checkAccount() {
if (!this.dataForm.cashAmount) {
uni.$u.toast('请先输入金额')
return
} else if (!this.dataForm.pkAccount) {
uni.$u.toast('请先选择账户')
return
}
bal
.getWidthdrawShow({
pkAccount: this.dataForm.pkAccount,
cashAmount: this.dataForm.cashAmount,
})
.then(res => {
this.widthDrwaData = res.data
})
},
//
onWithdrawalGuideConfirm() {
this.showWithdrawalGuide = false
uni.navigateBack()
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
background: #F2F2F2; background: #f2f2f2;
.theform { .theform {
margin-top: 6rpx; margin-top: 6rpx;
background: #FFFFFF; background: #ffffff;
padding: 20rpx 23rpx 48rpx 23rpx; padding: 20rpx 23rpx 48rpx 23rpx;
.contentbox { .contentbox {
background: rgba(251, 48, 36, 0.15); background: rgba(251, 48, 36, 0.15);
border-radius: 20rpx; border-radius: 20rpx;
padding: 35rpx 20rpx; padding: 35rpx 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
.linebox { .linebox {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
margin-top: 8rpx; margin-top: 8rpx;
} }
} }
}
} .btnbox {
margin-top: 38rpx;
padding: 0 20rpx;
.btnbox { .subbtn {
margin-top: 38rpx; background: #005bac;
padding: 0 20rpx; border-radius: 46rpx;
font-size: 30rpx;
.subbtn { font-family: Source Han Sans CN;
background: #005BAC; font-weight: 400;
border-radius: 46rpx; color: #ffffff;
font-size: 30rpx; }
font-family: Source Han Sans CN; }
font-weight: 400; }
color: #FFFFFF; </style>
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB