This commit is contained in:
2025-05-21 15:45:10 +08:00
parent f6ed5b04de
commit 5d96054c0c
44 changed files with 2460 additions and 2126 deletions

View File

@@ -2,17 +2,44 @@
import {ref} from "vue";
import XConfirmModal from "../../../components/XConfirmModal.vue";
import {showToast} from "../../../utils/uils.js";
import {useUserStore} from "../../../pinia/UserStore/index.js";
import dayjs from "dayjs";
import Api from "../../../api/index.js";
const UserStore = useUserStore();
const emits = defineEmits(['success']);
const show = ref(false);
const open = () => {
const defaultDrawal = ref();
const open = async () => {
if (UserStore.userInfo.money < 1) {
showToast({
icon: 'error',
title: '平台最低提现金额为1.00元',
});
return;
}
if (dayjs().hour() <= 11 || dayjs().hour() >= 18) {
showToast({
icon: 'error',
title: '请于11:00至18:00发起提现',
});
return;
}
const {data} = await Api.system.getDefaultWithdrawalInfo();
defaultDrawal.value = data;
show.value = true;
}
const success = () => {
const success = async () => {
const {msg} = await Api.system.postWithdrawal({
id: defaultDrawal.value.id,
money: UserStore.userInfo.money,
});
showToast({
icon: 'success',
title: '发起提现成功,正在打款',
title: msg,
});
emits('success');
}
</script>
@@ -29,19 +56,23 @@ const success = () => {
confirm-text="我已确认"
:cancel="false">
<template v-slot:context>
<view class="w-full">
<view class="w-full" v-if="defaultDrawal">
<view class="title">
请核对提现信息
</view>
<view class="info">
姓名李晓<br/>
支付宝号13566890241<br/>
提现金额36.78<br/>
提现手续费3.678<br/>
到账金额33.10
姓名{{ defaultDrawal.realname }}<br/>
{{ defaultDrawal.type_text }}{{ defaultDrawal.account }}<br/>
提现金额{{ UserStore.userInfo.money.toFixed(2) }}<br/>
提现手续费{{
(UserStore.userInfo.money * (Number(defaultDrawal.ratio) / 100)).toFixed(2)
}}<br/>
到账金额{{
(UserStore.userInfo.money - (UserStore.userInfo.money * (Number(defaultDrawal.ratio) / 100))).toFixed(2)
}}
</view>
<view class="exp">
手续费率为6%由三方代账公司收取
手续费率为{{ defaultDrawal.ratio }}%由三方代账公司收取
</view>
</view>
</template>

View File

@@ -6,10 +6,24 @@ import XLink from "../../components/XLink.vue";
import Right from "../../static/icons/right.png";
import {toPage} from "../../utils/uils.js";
import WithdrawalModal from "./components/WithdrawalModal.vue";
import {useUserStore} from "../../pinia/UserStore/index.js";
import {onShow} from "@dcloudio/uni-app";
import Api from "../../api/index.js";
import {ref} from "vue";
import ZFENUM from "../../enum/ZFENUM.js";
const withdrawal = async () => {
const UserStore = useUserStore();
const defaultDrawal = ref();
const getData = async () => {
await UserStore.getUserInfo();
const {data: _defaultDrawal} = await Api.system.getDefaultWithdrawalInfo();
defaultDrawal.value = _defaultDrawal;
}
onShow(() => {
getData();
})
</script>
<template>
@@ -18,6 +32,7 @@ const withdrawal = async () => {
<view class="!flex flex-col gap-[20rpx] p-[20rpx]">
<view class="py-[20rpx] pl-[30rpx] pr-[24rpx] rounded-[12rpx] bg-[#fff] w-full !flex gap-[22rpx] items-center"
v-if="!defaultDrawal?.id"
@click="toPage('/pages/paymentAccount/index')">
<image class="!size-[72rpx]" mode="aspectFill" :src="ICON1"></image>
<view class="text-[#86909C] test-28r">您还没有添加收款信息~</view>
@@ -25,15 +40,24 @@ const withdrawal = async () => {
<image class="!w-[12rpx]" mode="widthFix" :src="ICON2"></image>
</view>
<view class="py-[20rpx] pl-[30rpx] pr-[24rpx] rounded-[12rpx] bg-[#fff] w-full !flex gap-[22rpx] items-center"
v-else
@click="toPage('/pages/paymentAccount/index')">
<image class="!size-[72rpx] rounded-[20rpx]" mode="aspectFill" :src="ZFENUM[defaultDrawal.type]"></image>
<view class="text-[#1D2129] test-28r">{{ defaultDrawal.account }}</view>
<image class="!w-[12rpx] !ml-auto" mode="widthFix" :src="ICON2"></image>
</view>
<view class="py-[32rpx] px-[24rpx] rounded-[12rpx] bg-[#fff] w-full">
<view class="!flex items-center justify-between">
<view>
<view class="test-28r">可提现余额(</view>
<view class="HarmonyOS" style="font-size: 60rpx;font-weight: 500;">0.00</view>
<view class="HarmonyOS" style="font-size: 60rpx;font-weight: 500;">
{{ UserStore.userInfo.money.toFixed(2) }}
</view>
</view>
<withdrawal-modal>
<withdrawal-modal @success="getData">
<view
@click=""
class="py-[8rpx] bg-[var(--primary-color)] text-[#fff] rounded-full w-[200rpx] !flex justify-center items-center">
立即提现
</view>