修改提现为上传收款码

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) => {
prototype.$request({
api: "user.withdraw.withdraw",
data: {
money: money
imgs: qrcode,
}
}).then(response => {
if (response.code == 1) {

View File

@ -1,16 +1,15 @@
<template>
<app-layout title="我要提现">
<view class="withdraw-section">
<view class="title">提现金额</view>
<view class="input-box">
<text class="icon">¥</text>
<input
class="input"
type="number"
v-model="money"
:placeholder="'请输入提现金额,不可低于' + min + '元'"
placeholder-class="placeholder-style-4"
/>
<view class="title">上传收款码</view>
<view class="section-content-box">
<view class="upload-image" @click="uploadQrCode">
<image v-if="qrcode" class="icon" :src="qrcode" mode="aspectFill" />
<view v-if="!qrcode" class="icon">
<text class="iconfont icon-shangchuantupian"></text>
<view class="text">收款码</view>
</view>
</view>
</view>
<view class="total-box">
<text class="text">可提现金额</text>
@ -36,9 +35,8 @@ export default {
name: "member-cash-withdraw",
data() {
return {
min: 0,
money: null,
balance: 0,
qrcode: "",
explain: "",
};
},
@ -55,7 +53,6 @@ export default {
await this.$store.dispatch("user/info", true);
this.$models.user.withdrawExplain().then((data) => {
this.explain = data.tixian_content;
this.min = data.min;
});
},
onReady() {},
@ -64,12 +61,21 @@ export default {
onShareTimeline() {},
onShareAppMessage() {},
methods: {
uploadQrCode() {
this.$utils.chooseImage(1).then((tempFiles) => {
tempFiles.forEach((item) => {
this.$models.system.upload(item.path).then((response) => {
this.qrcode = response.img;
});
});
});
},
submit() {
if (this.money <= 0) {
return this.$utils.toast("请输入提现金额");
if (!this.qrcode) {
return this.$utils.toast("请上传收款码");
}
this.$models.user
.withdraw(this.money)
.withdraw(this.qrcode)
.then((response) => {
this.$utils.toast(response.msg);
})
@ -93,23 +99,6 @@ export default {
color: #2d2d2d;
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 {
line-height: 30rpx;
.text {
@ -131,4 +120,33 @@ export default {
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>