|
@@ -28,8 +28,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-for="item in state.data.salePlans.slice(0, 2).reverse()">
|
|
<template v-for="item in state.data.salePlans.slice(0, 2).reverse()">
|
|
- <div class="buy1" @click="clickJump(item)" v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1
|
|
|
|
- && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="buy1"
|
|
|
|
+ :class="{ grey: payNext }"
|
|
|
|
+ @click="clickJump(item)"
|
|
|
|
+ v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1 && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
|
|
<template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
|
|
<template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
|
|
<div class="left">Buy 1</div>
|
|
<div class="left">Buy 1</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
@@ -112,6 +115,8 @@ import { getNftMysteryBoxSaleInfo, redeemNft } from "@/http/nft";
|
|
import BtnLoading from '../components/btn-loading.vue'
|
|
import BtnLoading from '../components/btn-loading.vue'
|
|
import Report from "@/log-center/log"
|
|
import Report from "@/log-center/log"
|
|
import { getQueryString } from "@/uilts/help";
|
|
import { getQueryString } from "@/uilts/help";
|
|
|
|
+import { calcRechargePayAmount } from "@/http/account";
|
|
|
|
+import { getCurrencyInfoByCode } from "@/http/publishApi";
|
|
import { sendChromeTabMessage } from '@/uilts/chromeExtension.js';
|
|
import { sendChromeTabMessage } from '@/uilts/chromeExtension.js';
|
|
let postId = inject('post_Id');
|
|
let postId = inject('post_Id');
|
|
let pay_info = inject('pay_info');
|
|
let pay_info = inject('pay_info');
|
|
@@ -119,6 +124,7 @@ let router = useRouter()
|
|
let showDesc = ref(true)
|
|
let showDesc = ref(true)
|
|
let showRedeem = ref(false)
|
|
let showRedeem = ref(false)
|
|
let redeemNext = ref(false)
|
|
let redeemNext = ref(false)
|
|
|
|
+let payNext = ref(false)
|
|
let redeemStr = ref('')
|
|
let redeemStr = ref('')
|
|
let refInput = ref('')
|
|
let refInput = ref('')
|
|
let groupId = ref('')
|
|
let groupId = ref('')
|
|
@@ -155,7 +161,41 @@ const clickClose = () => {
|
|
}
|
|
}
|
|
const clickJump = (item) => {
|
|
const clickJump = (item) => {
|
|
pay_info.home.sale_plan = item
|
|
pay_info.home.sale_plan = item
|
|
- router.push({ path: '/pay' });
|
|
|
|
|
|
+ payNext.value = true;
|
|
|
|
+ if (item.currencyCode === 'USD') {
|
|
|
|
+ const p1 = calcRechargePayAmount({
|
|
|
|
+ params: {
|
|
|
|
+ currencyCode: item.currencyCode,
|
|
|
|
+ orderAmountValue: item.price,
|
|
|
|
+ payChannel: 'ach'
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const p2 = getCurrencyInfoByCode({
|
|
|
|
+ params: {
|
|
|
|
+ currencyCode: item.currencyCode,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ Promise.all([p1, p2]).then(([res1, res2]) => {
|
|
|
|
+ if (res1.code == 0 && res2.code == 0) {
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/pay',
|
|
|
|
+ query: {
|
|
|
|
+ finalAmount: JSON.stringify(res1.data),
|
|
|
|
+ currentCurrencyInfo: JSON.stringify(res2.data),
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ router.push({ path: '/pay' });
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ payNext.value = false;
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ router.push({ path: '/pay' });
|
|
|
|
+ payNext.value = false;
|
|
|
|
+ }
|
|
// report
|
|
// report
|
|
Report.reportLog({
|
|
Report.reportLog({
|
|
pageSource: Report.pageSource.nftShopPage,
|
|
pageSource: Report.pageSource.nftShopPage,
|