修改提现为上传收款码

This commit is contained in:
TOP糯米 2023-04-06 14:32:49 +08:00
parent e9e703e73c
commit 0d7a250e1e
2 changed files with 53 additions and 35 deletions

View File

@ -239,12 +239,12 @@ export default {
/** /**
* 提现 * 提现
*/ */
withdraw(money) { withdraw(qrcode) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
prototype.$request({ prototype.$request({
api: "user.withdraw.withdraw", api: "user.withdraw.withdraw",
data: { data: {
money: money imgs: qrcode,
} }
}).then(response => { }).then(response => {
if (response.code == 1) { if (response.code == 1) {

View File

@ -1,16 +1,15 @@
<template> <template>
<app-layout title="我要提现"> <app-layout title="我要提现">
<view class="withdraw-section"> <view class="withdraw-section">
<view class="title">提现金额</view> <view class="title">上传收款码</view>
<view class="input-box"> <view class="section-content-box">
<text class="icon">¥</text> <view class="upload-image" @click="uploadQrCode">
<input <image v-if="qrcode" class="icon" :src="qrcode" mode="aspectFill" />
class="input" <view v-if="!qrcode" class="icon">
type="number" <text class="iconfont icon-shangchuantupian"></text>
v-model="money" <view class="text">收款码</view>
:placeholder="'请输入提现金额,不可低于' + min + '元'" </view>
placeholder-class="placeholder-style-4" </view>
/>
</view> </view>
<view class="total-box"> <view class="total-box">
<text class="text">可提现金额</text> <text class="text">可提现金额</text>
@ -36,9 +35,8 @@ export default {
name: "member-cash-withdraw", name: "member-cash-withdraw",
data() { data() {
return { return {
min: 0,
money: null,
balance: 0, balance: 0,
qrcode: "",
explain: "", explain: "",
}; };
}, },
@ -55,7 +53,6 @@ export default {
await this.$store.dispatch("user/info", true); await this.$store.dispatch("user/info", true);
this.$models.user.withdrawExplain().then((data) => { this.$models.user.withdrawExplain().then((data) => {
this.explain = data.tixian_content; this.explain = data.tixian_content;
this.min = data.min;
}); });
}, },
onReady() {}, onReady() {},
@ -64,12 +61,21 @@ export default {
onShareTimeline() {}, onShareTimeline() {},
onShareAppMessage() {}, onShareAppMessage() {},
methods: { methods: {
uploadQrCode() {
this.$utils.chooseImage(1).then((tempFiles) => {
tempFiles.forEach((item) => {
this.$models.system.upload(item.path).then((response) => {
this.qrcode = response.img;
});
});
});
},
submit() { submit() {
if (this.money <= 0) { if (!this.qrcode) {
return this.$utils.toast("请输入提现金额"); return this.$utils.toast("请上传收款码");
} }
this.$models.user this.$models.user
.withdraw(this.money) .withdraw(this.qrcode)
.then((response) => { .then((response) => {
this.$utils.toast(response.msg); this.$utils.toast(response.msg);
}) })
@ -93,23 +99,6 @@ export default {
color: #2d2d2d; color: #2d2d2d;
line-height: 30rpx; line-height: 30rpx;
} }
.input-box {
display: flex;
align-items: center;
margin: 50rpx 0;
.icon {
font-size: 48rpx;
line-height: 48rpx;
font-weight: bold;
color: #f83232;
}
.input {
width: 500rpx;
font-size: 32rpx;
color: #666666;
margin-left: 36rpx;
}
}
.total-box { .total-box {
line-height: 30rpx; line-height: 30rpx;
.text { .text {
@ -131,4 +120,33 @@ export default {
padding: 50rpx 0 80rpx 0; padding: 50rpx 0 80rpx 0;
} }
} }
.section-content-box {
margin: 40rpx 0;
.upload-image {
display: inline-block;
border: 1rpx solid #999999;
}
.image,
.icon {
width: 136rpx;
height: 136rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.iconfont {
font-size: 60rpx;
color: #999999;
line-height: 60rpx;
}
.text {
font-size: 24rpx;
color: #999999;
line-height: 24rpx;
margin-top: 16rpx;
}
}
}
</style> </style>