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, method: Method.GET,
}); });
} }
/**
* 获取会员积分VO
* @param
*/
export function withdrawalSettingVO() {
return http.request({
url: `/wallet/wallet/withdrawalSettingVO`,
method: Method.GET,
needToken: true,
});
}

View File

@ -1,39 +1,70 @@
<template> <template>
<view> <view>
<view class="-list"> <view class="-list">
<view class="title">提现金额</view> <view class="title">提现类型</view>
<view class="content"> <view class="content">
<view class="price"> <view class="price">
<span> </span> <u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
<u-input v-model="price" placeholder="" type="number" />
</view> </view>
</view>
<view class="all">
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span></view>
</view>
</view>
<view class="tips">
最低提现金额为1.00
</view>
</view> </view>
<view class="-list">
<view class="title">提现金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder="" type="number" />
</view>
<view class="all">
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span></view>
</view>
</view>
<view class="tips">
最低提现金额为 {{ 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>
<view class="submit" @click="cashd"></view> <view class="submit" @click="cashd"></view>
</view> </view>
</template> </template>
<script> <script>
import { getUserWallet, withdrawalApply } from "@/api/members"; import { getUserWallet, withdrawalApply, withdrawalSettingVO } from "@/api/members";
export default { export default {
data() { data() {
return { return {
price: 0, price: 0,
walletNum: 0, walletNum: 0,
minPrice: 0,
type: '',
connectNumber: '',
realName: ''
}; };
}, },
async mounted() { async mounted() {
let result = await getUserWallet(); // let result = await getUserWallet(); //
let res = await withdrawalSettingVO();
this.walletNum = result.data.result.memberWallet; this.walletNum = result.data.result.memberWallet;
this.minPrice = res.data.result.minPrice;
this.type = res.data.result.type;
}, },
methods: { methods: {
@ -41,7 +72,20 @@ export default {
this.price = this.price + ""; this.price = this.price + "";
if (this.$u.test.amount(parseInt(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) { if (res.data.success) {
uni.showToast({ uni.showToast({
title: "提现成功!", title: "提现成功!",

View File

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