|
@@ -1,74 +1,58 @@
|
|
|
<template>
|
|
|
<div class="withdraw-wrapper">
|
|
|
- <div class="nav-bar">
|
|
|
+ <!-- <div class="nav-bar">
|
|
|
<img
|
|
|
:src="require('@/assets/svg/icon-bar-arrow-left.svg')"
|
|
|
class="icon"
|
|
|
@click="back"
|
|
|
/>
|
|
|
Withdraw
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<template v-if="!isSubmit">
|
|
|
<div class="content">
|
|
|
<div class="logo-wrapper">
|
|
|
<div class="title">Withdraw to</div>
|
|
|
- <img
|
|
|
- class="icon"
|
|
|
- :src="
|
|
|
- require('@/assets/svg/icon-withdraw-paypal-logo.svg')
|
|
|
- "
|
|
|
- />
|
|
|
+ <img class="icon" :src="
|
|
|
+ require('@/assets/svg/icon-withdraw-paypal-logo.svg')
|
|
|
+ " />
|
|
|
</div>
|
|
|
|
|
|
<div class="form-wrapper">
|
|
|
<div class="form-item">
|
|
|
<div class="label">PayPal account</div>
|
|
|
<div class="input-wrapper">
|
|
|
- <el-input
|
|
|
- type="text"
|
|
|
- v-model="
|
|
|
- requestWithdrawParams.withdrawReceiveAccount
|
|
|
- "
|
|
|
- placeholder="Enter PayPal account"
|
|
|
- :input-style="{
|
|
|
- 'box-shadow': 'none',
|
|
|
- height: '48px',
|
|
|
- 'border-radius': '8px',
|
|
|
- }"
|
|
|
- />
|
|
|
+ <el-input type="text" v-model="
|
|
|
+ requestWithdrawParams.withdrawReceiveAccount
|
|
|
+ " placeholder="Enter PayPal account" :input-style="{
|
|
|
+ 'box-shadow': 'none',
|
|
|
+ height: '48px',
|
|
|
+ 'border-radius': '8px',
|
|
|
+}" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
- <div class="label">Withdrawal amount<span class="msg">(${{walletWithdrawConfig.withdrawUSDPreMinAmount/100}} minimum)</span></div>
|
|
|
+ <div class="label">Withdrawal amount<span
|
|
|
+ class="msg">(${{ walletWithdrawConfig.withdrawUSDPreMinAmount / 100 }} minimum)</span></div>
|
|
|
<div class="input-wrapper amount-wrapper">
|
|
|
- <el-input
|
|
|
- type="text"
|
|
|
- @input="onAmountInput"
|
|
|
- @blur="onAmountBlur"
|
|
|
- v-model="requestWithdrawParams.amountValue"
|
|
|
- placeholder="$0"
|
|
|
- :input-style="{
|
|
|
+ <el-input type="text" @input="onAmountInput" @blur="onAmountBlur"
|
|
|
+ v-model="requestWithdrawParams.amountValue" placeholder="$0" :input-style="{
|
|
|
'box-shadow': 'none',
|
|
|
width: '220px',
|
|
|
height: '46px',
|
|
|
'border-radius': '8px',
|
|
|
- }"
|
|
|
- />
|
|
|
- <div
|
|
|
- @click="withdrawalAll"
|
|
|
- class="withdrawal-all-btn"
|
|
|
- >
|
|
|
+ }" />
|
|
|
+ <div @click="withdrawalAll" class="withdrawal-all-btn">
|
|
|
Withdrawal All
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="error-msg">
|
|
|
- <template v-if="showWithdrawError">
|
|
|
- The minimum withdrawal amount is ${{walletWithdrawConfig.withdrawUSDPreMinAmount/100}} USD
|
|
|
+ <template v-if="showWithdrawError">
|
|
|
+ The minimum withdrawal amount is ${{ walletWithdrawConfig.withdrawUSDPreMinAmount / 100 }} USD
|
|
|
</template>
|
|
|
- <template v-if="showWithdrawIptError">
|
|
|
- The withdrawal amount exceeds the total account balance of ${{canWithdrawBalance/100}} USD
|
|
|
+ <template v-if="showWithdrawIptError">
|
|
|
+ The withdrawal amount exceeds the total account balance of ${{ canWithdrawBalance / 100 }} USD
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -76,32 +60,29 @@
|
|
|
<div class="bottom-msg">
|
|
|
<div class="top">
|
|
|
<template v-if="!calcReq">
|
|
|
- final amount
|
|
|
- <span>${{
|
|
|
- finalWithdrawalAmount > 0
|
|
|
- ? finalWithdrawalAmount
|
|
|
- : 0
|
|
|
- }}
|
|
|
- </span>
|
|
|
+ final amount
|
|
|
+ <span>${{
|
|
|
+ finalWithdrawalAmount > 0
|
|
|
+ ? finalWithdrawalAmount
|
|
|
+ : 0
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
计算中
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div>{{walletWithdrawConfig.withdrawUSDPaypalFeeDesc}}</div>
|
|
|
+ <div>{{ walletWithdrawConfig.withdrawUSDPaypalFeeDesc }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div @click="withdraw" class="confirm-btn">
|
|
|
- <img class="icon-loading" v-if="withdrawIng" :src="require('@/assets/svg/icon-btn-loading.svg')" />
|
|
|
+ <img class="icon-loading" v-if="withdrawIng" :src="require('@/assets/svg/icon-btn-loading.svg')" />
|
|
|
Confirm
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="withdraw-status">
|
|
|
- <img
|
|
|
- :src="require('@/assets/svg/icon-withdraw-status.svg')"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img :src="require('@/assets/svg/icon-withdraw-status.svg')" alt="" />
|
|
|
<div>
|
|
|
<div class="title">Submitted successfully</div>
|
|
|
<div class="desc">
|
|
@@ -119,12 +100,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
/* eslint-disable */
|
|
|
-import { defineProps, defineEmits, ref, onMounted, watch, computed } from "vue";
|
|
|
-import { ElMessage } from 'element-plus';
|
|
|
+import { defineProps, defineEmits, ref, onMounted, watch, computed, inject } from "vue";
|
|
|
import 'element-plus/es/components/message/style/css'
|
|
|
-import { withdrawRequest } from "@/http/account";
|
|
|
+import { withdrawRequest, getWithdrawConfig } from "@/http/account";
|
|
|
import { withdrawCalcFee } from "@/http/pay";
|
|
|
-import {debounce} from "@/uilts/help"
|
|
|
+import { debounce } from "@/uilts/help"
|
|
|
|
|
|
const props = defineProps({
|
|
|
amountValue: {
|
|
@@ -142,7 +122,9 @@ const props = defineProps({
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+let withdraw_info = inject('withdraw_info')
|
|
|
|
|
|
+console.log('withdraw_info', withdraw_info)
|
|
|
let requestWithdrawParams = ref({
|
|
|
amountValue: "",
|
|
|
currencyCode: "USD",
|
|
@@ -150,7 +132,7 @@ let requestWithdrawParams = ref({
|
|
|
withdrawReceiveAccount: "",
|
|
|
});
|
|
|
|
|
|
-let canWithdrawBalance = ref(props.amountValue);
|
|
|
+let canWithdrawBalance = ref(withdraw_info.paypal.amount_value);
|
|
|
|
|
|
let showWithdrawError = ref(false);
|
|
|
let showWithdrawIptError = ref(false);
|
|
@@ -161,7 +143,24 @@ let finalWithdrawalAmount = ref('');
|
|
|
let calcReq = ref(false);
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ queryWithdrawConfig()
|
|
|
});
|
|
|
+/**
|
|
|
+ * 获取提现配置
|
|
|
+ */
|
|
|
+const queryWithdrawConfig = () => {
|
|
|
+ getWithdrawConfig({
|
|
|
+ params: {
|
|
|
+ currencyCode: withdraw_info.currency_code || 'USD',
|
|
|
+ withdrawNetwork: 'paypal'
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 0) {
|
|
|
+ walletWithdrawConfig.value = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const emits = defineEmits("back");
|
|
|
const back = () => {
|
|
@@ -182,7 +181,7 @@ const withdrawalAll = () => {
|
|
|
console.log(canWithdrawBalance.value);
|
|
|
showWithdrawIptError.value = false;
|
|
|
requestWithdrawParams.value.amountValue =
|
|
|
- canWithdrawBalance.value / 100;
|
|
|
+ canWithdrawBalance.value / 100;
|
|
|
setWithdrawIptStatus(canWithdrawBalance.value);
|
|
|
withdrawCalcAmount();
|
|
|
};
|
|
@@ -197,15 +196,15 @@ const withdrawCalcAmount = () => {
|
|
|
}
|
|
|
}).then(res => {
|
|
|
calcReq.value = false;
|
|
|
- if(res.code == 0) {
|
|
|
+ if (res.code == 0) {
|
|
|
finalWithdrawalAmount.value = res.data.finalAmountValue / 100;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const withdrawCalcAmountDebounce = debounce(function() {
|
|
|
+const withdrawCalcAmountDebounce = debounce(function () {
|
|
|
withdrawCalcAmount();
|
|
|
-}, 1000)
|
|
|
+}, 1000)
|
|
|
|
|
|
/**
|
|
|
* 提现
|
|
@@ -215,16 +214,16 @@ const withdraw = () => {
|
|
|
if (withdrawIng.value) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let params = {
|
|
|
...requestWithdrawParams.value,
|
|
|
};
|
|
|
- if(!params.amountValue || !params.withdrawReceiveAccount) {
|
|
|
+ if (!params.amountValue || !params.withdrawReceiveAccount) {
|
|
|
return;
|
|
|
}
|
|
|
- params.withdrawReceiveAccount = params.withdrawReceiveAccount.replace(/\s*/g,"");
|
|
|
+ params.withdrawReceiveAccount = params.withdrawReceiveAccount.replace(/\s*/g, "");
|
|
|
params.amountValue = params.amountValue * 100;
|
|
|
- if(params.amountValue > canWithdrawBalance.value) {
|
|
|
+ if (params.amountValue > canWithdrawBalance.value) {
|
|
|
// ElMessage({
|
|
|
// message: '大于可提现金额',
|
|
|
// type: 'warning',
|
|
@@ -250,9 +249,9 @@ const withdraw = () => {
|
|
|
console.log(res);
|
|
|
}
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const onAmountBlur = () => {
|
|
@@ -275,12 +274,12 @@ const onAmountInput = (value) => {
|
|
|
|
|
|
setWithdrawIptStatus(amount);
|
|
|
|
|
|
- // 输入金额大于可提现金额
|
|
|
- if(amount > canWithdrawBalance.value) {
|
|
|
+ // 输入金额大于可提现金额
|
|
|
+ if (amount > canWithdrawBalance.value) {
|
|
|
// value = '';
|
|
|
// requestWithdrawParams.value.amountValue = '';
|
|
|
|
|
|
- if(!showWithdrawError.value) {
|
|
|
+ if (!showWithdrawError.value) {
|
|
|
showWithdrawIptError.value = true;
|
|
|
}
|
|
|
} else {
|
|
@@ -296,7 +295,7 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
//显示tips
|
|
|
if (
|
|
|
amount > 0 &&
|
|
|
- amount < props.walletWithdrawConfig.withdrawUSDPreMinAmount
|
|
|
+ amount < withdraw_info.paypal.wallet_withdraw_config.withdrawUSDPreMinAmount
|
|
|
) {
|
|
|
showWithdrawError.value = true;
|
|
|
} else {
|
|
@@ -319,6 +318,7 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
align-items: center;
|
|
|
font-weight: 500;
|
|
|
font-size: 13px;
|
|
|
+
|
|
|
.icon {
|
|
|
width: 16px;
|
|
|
margin-right: 6px;
|
|
@@ -329,12 +329,14 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
.content {
|
|
|
padding: 0 20px;
|
|
|
box-sizing: border-box;
|
|
|
+
|
|
|
.logo-wrapper {
|
|
|
.title {
|
|
|
margin-top: 13px;
|
|
|
font-size: 14px;
|
|
|
color: #5b5b5b;
|
|
|
}
|
|
|
+
|
|
|
.icon {
|
|
|
width: 111px;
|
|
|
height: 56px;
|
|
@@ -345,22 +347,26 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
.form-wrapper {
|
|
|
.form-item {
|
|
|
margin-bottom: 30px;
|
|
|
+
|
|
|
.label {
|
|
|
font-size: 14px;
|
|
|
color: #5b5b5b;
|
|
|
margin-bottom: 8px;
|
|
|
+
|
|
|
.msg {
|
|
|
font-weight: 400;
|
|
|
font-size: 14px;
|
|
|
color: #FFA621;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.input-wrapper {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
border: 1px solid #e8e8e8;
|
|
|
border-radius: 8px;
|
|
|
+
|
|
|
.withdrawal-all-btn {
|
|
|
font-weight: 500;
|
|
|
font-size: 13px;
|
|
@@ -370,11 +376,12 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.error-msg {
|
|
|
font-size: 13px;
|
|
|
color: #ff0000;
|
|
|
margin-top: -15px;
|
|
|
- height: 38px;
|
|
|
+ height: 38px;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -383,8 +390,10 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
color: #9d9d9d;
|
|
|
text-align: right;
|
|
|
margin-top: 52px;
|
|
|
+
|
|
|
.top {
|
|
|
height: 22px;
|
|
|
+
|
|
|
span {
|
|
|
font-weight: 500;
|
|
|
font-size: 15px;
|
|
@@ -396,15 +405,18 @@ const setWithdrawIptStatus = (amount) => {
|
|
|
|
|
|
.withdraw-status {
|
|
|
text-align: center;
|
|
|
+
|
|
|
img {
|
|
|
margin-top: 40px;
|
|
|
margin-bottom: 34px;
|
|
|
}
|
|
|
+
|
|
|
.title {
|
|
|
font-weight: 500;
|
|
|
font-size: 20px;
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
+
|
|
|
.desc {
|
|
|
font-size: 15px;
|
|
|
color: rgba($color: #000000, $alpha: 0.5);
|