add withdrawal

master
misworga831 2023-03-08 22:01:02 +08:00
parent b2a448447c
commit d870ee409a
3 changed files with 74 additions and 15 deletions

View File

@ -419,3 +419,16 @@ export function getMemberPointSum() {
method: Method.GET,
});
}
/**
* 获取会员积分VO
* @param
*/
export function withdrawalSettingVO() {
return http.request({
url: `/wallet/wallet/withdrawalSettingVO`,
method: Method.GET,
needToken: true,
});
}

View File

@ -1,5 +1,13 @@
<template>
<view>
<view class="-list">
<view class="title">提现类型</view>
<view class="content">
<view class="price">
<u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
</view>
</view>
</view>
<view class="-list">
<view class="title">提现金额</view>
<view class="content">
@ -15,7 +23,23 @@
</view>
<view class="tips">
最低提现金额为1.00
最低提现金额为 {{ minPrice }}
</view>
</view>
<view class="-list" v-if="type === 'ALI'">
<view class="title">真实姓名</view>
<view class="content">
<view class="price">
<u-input v-model="realName" placeholder="" />
</view>
</view>
</view>
<view class="-list" v-if="type === 'ALI'">
<view class="title">第三方登录账号</view>
<view class="content">
<view class="price">
<u-input v-model="connectNumber" placeholder="" />
</view>
</view>
</view>
@ -23,17 +47,24 @@
</view>
</template>
<script>
import { getUserWallet, withdrawalApply } from "@/api/members";
import { getUserWallet, withdrawalApply, withdrawalSettingVO } from "@/api/members";
export default {
data() {
return {
price: 0,
walletNum: 0,
minPrice: 0,
type: '',
connectNumber: '',
realName: ''
};
},
async mounted() {
let result = await getUserWallet(); //
let res = await withdrawalSettingVO();
this.walletNum = result.data.result.memberWallet;
this.minPrice = res.data.result.minPrice;
this.type = res.data.result.type;
},
methods: {
@ -41,7 +72,20 @@ export default {
this.price = this.price + "";
if (this.$u.test.amount(parseInt(this.price))) {
withdrawalApply({ price: this.price }).then((res) => {
let params = { price: this.price };
if (this.type === 'ALI') {
if (!this.connectNumber || !this.realName) {
uni.showToast({
title: "请输入真实姓名和第三方登录账号",
duration: 2000,
icon: "none",
});
return;
}
params.connectNumber = this.connectNumber;
params.realName = this.realName;
}
withdrawalApply(params).then((res) => {
if (res.data.success) {
uni.showToast({
title: "提现成功!",

View File

@ -410,6 +410,7 @@
//storageopenid
// #ifndef MP-WEIXIN
uni.setStorageSync("openid", res.authResult.openid);
res.authResult.unionId && uni.setStorageSync("unionId", res.authResult.unionId);
// #endif
},
fail(e) {
@ -454,6 +455,7 @@
avatar: uni.getStorageSync("avatar"), //
uniAccessToken: uni.getStorageSync("uni_access_token"), //token
};
uni.getStorageSync("unionId") && (params.unionId = uni.getStorageSync("unionId"));
openIdLogin(params, clientType).then((res) => {
if (!res.data.success) {
let errormessage = "第三方登录暂不可用";