|
@@ -406,18 +406,16 @@
|
|
|
|
|
|
<!-- paypal支付按钮 -->
|
|
|
<div class="payment" v-show="showComType == 'preview'">
|
|
|
- <paypal-button
|
|
|
+ <pay-button
|
|
|
v-if="isMoneyRewardCpd"
|
|
|
:finalAmountData="finalAmountData"
|
|
|
:payConfig="{
|
|
|
- paypalClientId,
|
|
|
feeDesc: payConfig.feeDesc,
|
|
|
- paypalHtml,
|
|
|
amount: baseFormData.amountValue,
|
|
|
postId
|
|
|
}"
|
|
|
:currentCurrencyInfo="currentCurrencyInfo"
|
|
|
- @payPalFinsh="payPalFinsh">
|
|
|
+ @payFinish="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" />
|
|
@@ -431,7 +429,7 @@
|
|
|
@click="updateCurrencyBanlce"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </paypal-button>
|
|
|
+ </pay-button>
|
|
|
<div v-else class="btn-wrap" @click="payStatusHandle(1)"><div class="custom-submit">Confirm</div></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -485,11 +483,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide, getCurrentInstance, computed } from "vue";
|
|
|
-import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
+import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide, computed } from "vue";
|
|
|
+import { postPublish, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
import { getInviteGuildInfo, getInviteGuildInfoByOpenApi, saveInviteGuildInfo } from "@/http/discordApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
|
-import { getFrontConfig } from "@/http/account";
|
|
|
+import { getFrontConfig, calcRechargePayAmount } from "@/http/account";
|
|
|
import { uploadSignature, uploadFile } from '@/http/media';
|
|
|
import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
|
import { debounce, getBit } from "@/uilts/help"
|
|
@@ -507,7 +505,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 toolBox from '@/view/iframe/publish/tool-box/index.vue'
|
|
@@ -515,8 +513,6 @@ import giveawayPoster from '@/view/iframe/publish/components/giveaway-poster.vue
|
|
|
import GlobalTip from '@/view/components/global-tip.vue'
|
|
|
import customCardCover from '@/view/components/custom-card-cover.vue'
|
|
|
|
|
|
-const currentInstance = getCurrentInstance();
|
|
|
-
|
|
|
import CustomizedRewardEditPopup from '@/view/iframe/publish/components/customized-reward-edit';
|
|
|
|
|
|
const config = {
|
|
@@ -528,9 +524,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)
|
|
@@ -920,7 +914,7 @@ const getPayAmount = async (amountValue) => {
|
|
|
params: {
|
|
|
amountValue,
|
|
|
currencyCode: currentCurrencyInfo.value.currencyCode,
|
|
|
- payChannel: 'paypal',
|
|
|
+ payChannel: 'ach',
|
|
|
},
|
|
|
});
|
|
|
if (res.code == 0) {
|
|
@@ -1223,8 +1217,10 @@ 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: {
|
|
@@ -1294,37 +1290,34 @@ const setDiscordIptTxt = ({text}) => {
|
|
|
formList[index]['text'] = text;
|
|
|
}
|
|
|
|
|
|
+const calcRechPayAmount = async (params) => {
|
|
|
+ let res = await calcRechargePayAmount({
|
|
|
+ params : {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.code == 0) {
|
|
|
+ let { finalAmountValue, feeDesc } = res.data;
|
|
|
+ payConfig.value.feeDesc = feeDesc;
|
|
|
+ if (finalAmountValue > 0) {
|
|
|
+ finalAmountData.value = res.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res.data;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 支付完成回调
|
|
|
*/
|
|
|
-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);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1337,22 +1330,10 @@ const payStatusHandle = (payStatus) => {
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
@@ -1803,7 +1784,6 @@ const setPayConfig = () => {
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
payConfig.value = res.data;
|
|
|
- paypalClientId.value = res.data.paypalClientId;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -1816,7 +1796,6 @@ const setFrontConfig = () => {
|
|
|
params: {},
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
- paypalHtml.value = res.data.paypalHtml;
|
|
|
lotteryMaxHourDuration = res.data.lotteryMaxHourDuration;
|
|
|
toolBoxPageData.postEditorLinkInputDescImage = res.data.postEditorLinkInputDescImage;
|
|
|
}
|
|
@@ -2541,6 +2520,7 @@ onMounted(() => {
|
|
|
height: 60px;
|
|
|
margin-left: 14px;
|
|
|
margin-right: 14px;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
.show-font {
|
|
|
position: relative;
|