add withdrawal
parent
b2a448447c
commit
d870ee409a
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,39 +1,70 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="-list">
|
||||
<view class="title">提现金额</view>
|
||||
<view class="title">提现类型</view>
|
||||
<view class="content">
|
||||
<view class="price">
|
||||
<span> ¥</span>
|
||||
<u-input v-model="price" placeholder="" type="number" />
|
||||
<u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
|
||||
</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>
|
||||
</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: "提现成功!",
|
||||
|
|
|
@ -410,6 +410,7 @@
|
|||
//微信小程序意外的其它方式直接在storage中写入openid
|
||||
// #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 = "第三方登录暂不可用";
|
||||
|
|
Loading…
Reference in New Issue