|
@@ -407,6 +407,7 @@
|
|
|
<!-- paypal支付按钮 -->
|
|
|
<div class="payment" v-show="showComType == 'preview'">
|
|
|
<pay-button
|
|
|
+ ref="payButtonDom"
|
|
|
v-if="isMoneyRewardCpd"
|
|
|
:finalAmountData="finalAmountData"
|
|
|
:payConfig="{
|
|
@@ -443,14 +444,16 @@
|
|
|
:dialogVisible="showMessageBox"
|
|
|
:title="messageBoxData.title"
|
|
|
:content="messageBoxData.content"
|
|
|
+ cancelTxt="Not yet"
|
|
|
+ confirmTxt="Deposit"
|
|
|
@cancel="messageBoxCancel"
|
|
|
@confirm="messageBoxConfirm"></message-box>
|
|
|
|
|
|
<message-box
|
|
|
:dialogVisible="showDepositMessageBox"
|
|
|
title="Is the Deposit Completed?"
|
|
|
- @cancel="depositCancel"
|
|
|
- @confirm="depositConfirm"></message-box>
|
|
|
+ @cancel="depositAchCancel"
|
|
|
+ @confirm="depositAchConfirm"></message-box>
|
|
|
|
|
|
<!-- 裁剪 -->
|
|
|
<div class="dialog" v-if="cropperDialog">
|
|
@@ -504,6 +507,7 @@ import "element-plus/es/components/loading/style/css";
|
|
|
import 'vue-cropper/dist/index.css'
|
|
|
import { VueCropper } from "vue-cropper";
|
|
|
import {create, all} from "mathjs";
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
|
|
|
import messageBox from "@/view/components/message-box.vue";
|
|
|
import currencyList from "@/view/components/currency-list.vue";
|
|
@@ -615,7 +619,9 @@ let showCurrencySelect = ref(false);
|
|
|
let showMoreOption = ref(false);
|
|
|
|
|
|
// 货币列表的dom
|
|
|
-let currencyListDom = ref('');
|
|
|
+let currencyListDom = ref(null);
|
|
|
+
|
|
|
+let payButtonDom = ref(null);
|
|
|
|
|
|
// 刷新按钮旋转
|
|
|
let refreshRotate = ref(false);
|
|
@@ -1820,23 +1826,18 @@ const getCurrencyInfo = async (_params) => {
|
|
|
let { loop = false} = _params || {};
|
|
|
let {accessToken = ''} = await getChromeStorage('userInfo') || {};
|
|
|
if (accessToken) {
|
|
|
- getChromeStorage('selectCurrencyInfo', (res) => {
|
|
|
- if(res && res.currencyCode) {
|
|
|
- getCurrencyInfoByCode({
|
|
|
- params: {
|
|
|
- currencyCode: res.currencyCode
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if(res.code == 0 && res.data) {
|
|
|
- currentCurrencyInfo.value = res.data;
|
|
|
- tempCurrentCurrencyInfo.value = res.data;
|
|
|
- if(!loop) {
|
|
|
- onIptSetErrorTxt();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ let {currencyCode = ''} = await getChromeStorage('selectCurrencyInfo') || {};
|
|
|
+
|
|
|
+ if(currencyCode) {
|
|
|
+ let currencyInfoRes = await getCurrencyByCode({currencyCode});
|
|
|
+ if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
|
|
|
+ currentCurrencyInfo.value = currencyInfoRes.data;
|
|
|
+ tempCurrentCurrencyInfo.value = currencyInfoRes.data;
|
|
|
+ if(!loop) {
|
|
|
+ onIptSetErrorTxt();
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
|
|
|
getChromeStorage('selectCurrencyList', (res) => {
|
|
|
if (showCurrencySelect.value === false) {
|
|
@@ -1846,6 +1847,15 @@ const getCurrencyInfo = async (_params) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const getCurrencyByCode = async (params) => {
|
|
|
+ let res = await getCurrencyInfoByCode({
|
|
|
+ params: {
|
|
|
+ currencyCode: params.currencyCode
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return res || {};
|
|
|
+}
|
|
|
+
|
|
|
const selectPublishMode = (params, index) => {
|
|
|
selectModeInfo.index = index;
|
|
|
selectModeInfo.type = params.type;
|
|
@@ -1973,6 +1983,24 @@ const submitReward = (reward) => {
|
|
|
onIptSetErrorTxt();
|
|
|
}
|
|
|
|
|
|
+const depositAchCancel = () => {
|
|
|
+ showDepositMessageBox.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+const depositAchConfirm = async () => {
|
|
|
+ showDepositMessageBox.value = false;
|
|
|
+ let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
+
|
|
|
+ if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
|
|
|
+ let {balance} = currencyInfoRes.data;
|
|
|
+ if(balance > finalAmountData.value.orderAmountValue) {
|
|
|
+ payButtonDom.value && payButtonDom.value.balancePay();
|
|
|
+ } else {
|
|
|
+ message.info('Deposit failed, please try again later');
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
setFrontConfig();
|
|
|
setPayConfig();
|