|
@@ -312,6 +312,8 @@
|
|
|
</div>
|
|
|
<!-- 需充值 -->
|
|
|
<div class="card-content" v-if="Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)">
|
|
|
+
|
|
|
+ <!-- 真实支付金额 大于余额-->
|
|
|
<template v-if="currentCurrencyInfo.currencyCode === 'USD'">
|
|
|
<div class="card-title">
|
|
|
<img class="img" :src=" require('@/assets/subject/top-02.svg') " />
|
|
@@ -370,17 +372,15 @@
|
|
|
|
|
|
<!-- paypal支付按钮 -->
|
|
|
<div class="payment" v-show="showComType == 'preview'">
|
|
|
- <paypal-button
|
|
|
+ <pay-button
|
|
|
:finalAmountData="finalAmountData"
|
|
|
:payConfig="{
|
|
|
- paypalClientId,
|
|
|
feeDesc: payConfig.feeDesc,
|
|
|
- paypalHtml,
|
|
|
amount: baseFormData.amountValue,
|
|
|
postId
|
|
|
}"
|
|
|
:currentCurrencyInfo="currentCurrencyInfo"
|
|
|
- @payPalFinsh="payPalFinsh">
|
|
|
+ @payFinsh="payFinish">
|
|
|
<template v-slot:balance>
|
|
|
<div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance)">
|
|
|
<img class="icon" src="@/assets/subject/icon-balance.png" />
|
|
@@ -394,7 +394,7 @@
|
|
|
@click="updateCurrencyBanlce"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </paypal-button>
|
|
|
+ </pay-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -466,7 +466,7 @@ import currencyList from "@/view/components/currency-list.vue";
|
|
|
import currencySelect from "@/view/components/currency-select.vue";
|
|
|
import previewCard from "@/view/iframe/publish/components/preview-card";
|
|
|
import followInput from "@/view/iframe/publish/components/follow-input";
|
|
|
-import paypalButton from "@/view/iframe/publish/components/paypal-button";
|
|
|
+import payButton from "@/view/iframe/publish/components/pay-button";
|
|
|
import topUp from "@/view/iframe/publish/components/top-up.vue";
|
|
|
import topUp2 from "@/view/iframe/publish/components/top-up2.vue";
|
|
|
import giveawayPoster from '@/view/iframe/publish/components/giveaway-poster.vue';
|
|
@@ -484,9 +484,7 @@ const math = create(all, config);
|
|
|
let tempCurrentCurrencyInfo = ref({});
|
|
|
let tempCurrentCurrencyList = ref([]);
|
|
|
|
|
|
-let paypalClientId = ref("");
|
|
|
let payConfig = ref({});
|
|
|
-let paypalHtml = ref("");
|
|
|
let installStatus = ref(false);
|
|
|
let timer = ref(null);
|
|
|
provide('installStatus', installStatus)
|
|
@@ -731,7 +729,7 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-const emits = defineEmits(["close", "confirm", "payPalFinsh"]);
|
|
|
+const emits = defineEmits(["close", "confirm", "payFinish"]);
|
|
|
|
|
|
const close = () => {
|
|
|
if (showComType.value != "default") {
|
|
@@ -792,7 +790,7 @@ const getPayAmount = async (amountValue) => {
|
|
|
params: {
|
|
|
amountValue,
|
|
|
currencyCode: currentCurrencyInfo.value.currencyCode,
|
|
|
- payChannel: 'paypal',
|
|
|
+ payChannel: 'ach',
|
|
|
},
|
|
|
});
|
|
|
if (res.code == 0) {
|
|
@@ -1079,9 +1077,12 @@ const submitRequest = async () => {
|
|
|
|
|
|
// 法币支付需要计算费率
|
|
|
if(formData.amountCurrencyCode == "USD") {
|
|
|
- let payAmountRes = await getPayAmount(amountValue);
|
|
|
- formData["payAmountValue"] = payAmountRes.finalAmountValue;
|
|
|
+ // 获取充值金额
|
|
|
+
|
|
|
+ // let payAmountRes = await getPayAmount(amountValue);
|
|
|
+ // formData["payAmountValue"] = payAmountRes.finalAmountValue;
|
|
|
}
|
|
|
+
|
|
|
let data = {
|
|
|
params: {
|
|
|
postBizData: JSON.stringify(formData),
|
|
@@ -1151,34 +1152,14 @@ const setDiscordIptTxt = ({text}) => {
|
|
|
/**
|
|
|
* 支付完成回调
|
|
|
*/
|
|
|
-const payPalFinsh = (params) => {
|
|
|
+const payFinish = (params) => {
|
|
|
let {payNetwork, payStatus} = params;
|
|
|
// token 支付
|
|
|
- if(payNetwork == 'bsc') {
|
|
|
+ if(payNetwork == 'token') {
|
|
|
payStatusHandle(payStatus);
|
|
|
} else {
|
|
|
// 法币支付
|
|
|
- let transaction = params.transaction;
|
|
|
- let loadingInstance = ElLoading.service({
|
|
|
- background: "rgba(0,0,0,.3)",
|
|
|
- });
|
|
|
- verifyPaypalResult({
|
|
|
- params: {
|
|
|
- paypalTransactionId: transaction.id,
|
|
|
- postId: publishRes.postId,
|
|
|
- paypalClientId: paypalClientId.value,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- loadingInstance.close();
|
|
|
- if (res.code == 0) {
|
|
|
- if (res.data) {
|
|
|
- payStatusHandle(res.data.payStatus)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- loadingInstance.close();
|
|
|
- });
|
|
|
+ payStatusHandle(1);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1186,27 +1167,15 @@ const payStatusHandle = (payStatus) => {
|
|
|
//支付状态 0:未支付,1:支付成功,2:支付失败,3:已关闭,4:已退款
|
|
|
switch (payStatus) {
|
|
|
case 1:
|
|
|
- emits("payPalFinsh", { publishRes });
|
|
|
+ emits("payFinish", { publishRes });
|
|
|
showComType.value = "default";
|
|
|
initParams();
|
|
|
break;
|
|
|
case 2:
|
|
|
- // ElMessage({
|
|
|
- // message: "Pay Fail",
|
|
|
- // type: "warning",
|
|
|
- // });
|
|
|
break;
|
|
|
case 3:
|
|
|
- // ElMessage({
|
|
|
- // message: "Pay Exceptions",
|
|
|
- // type: "warning",
|
|
|
- // });
|
|
|
break;
|
|
|
case 4:
|
|
|
- // ElMessage({
|
|
|
- // message: "Pay Exceptions",
|
|
|
- // type: "warning",
|
|
|
- // });
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -1643,7 +1612,7 @@ const inviteGuildResHandler = (res, params) => {
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * 获取支付配置(paypalClientId)
|
|
|
+ * 获取支付配置
|
|
|
*/
|
|
|
const setPayConfig = () => {
|
|
|
getPayConfig({
|
|
@@ -1651,7 +1620,6 @@ const setPayConfig = () => {
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
payConfig.value = res.data;
|
|
|
- paypalClientId.value = res.data.paypalClientId;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -1664,7 +1632,6 @@ const setFrontConfig = () => {
|
|
|
params: {},
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
- paypalHtml.value = res.data.paypalHtml;
|
|
|
lotteryMaxHourDuration = res.data.lotteryMaxHourDuration;
|
|
|
}
|
|
|
});
|