|
@@ -333,6 +333,7 @@
|
|
|
...baseFormData,
|
|
|
...currentCurrencyInfo,
|
|
|
usdEstimateOrderAmount: treasureFormData.usdEstimateOrderAmount,
|
|
|
+ upGainAmountUsdValue: treasureFormData.upGainAmountUsdValue,
|
|
|
currencyIconUrl: currentCurrencyInfo.iconPath,
|
|
|
customPosterUrl: customPosterInfo && customPosterInfo.after && customPosterInfo.after.imagePath || '',
|
|
|
userInfo: {
|
|
@@ -362,7 +363,12 @@
|
|
|
|
|
|
<!-- 预览 -->
|
|
|
<template v-else-if="showComType == 'preview'">
|
|
|
- <preview-sheet :baseFormData="baseFormData"
|
|
|
+ <preview-sheet
|
|
|
+ :baseFormData="{
|
|
|
+ ...baseFormData,
|
|
|
+ addFans: treasureFormData.addFans,
|
|
|
+ }"
|
|
|
+ :upGainAmountUsdValue="treasureFormData.upGainAmountUsdValue"
|
|
|
:currentCurrencyInfo="currentCurrencyInfo"
|
|
|
:tempCurrentCurrencyInfo="tempCurrentCurrencyInfo"
|
|
|
:publishRes="publishRes"
|
|
@@ -475,6 +481,7 @@ import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, pr
|
|
|
import { postPublish, syncChainTokenRechargeRecord, getCurrencyInfoByCode, getUser } from "@/http/publishApi";
|
|
|
import { getInviteGuildInfo, getInviteGuildInfoByOpenApi, saveInviteGuildInfo } from "@/http/discordApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
|
+import { upGainCalculate } from "@/http/treasureApi";
|
|
|
import { getFrontConfig, calcRechargePayAmount } from "@/http/account";
|
|
|
import { uploadSignature, uploadFile } from '@/http/media';
|
|
|
import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
@@ -773,7 +780,8 @@ let toolBoxPageData = reactive({
|
|
|
let treasureFormData = reactive({
|
|
|
usdEstimateOrderAmount: '',
|
|
|
usdEstimateFansUnitAmount: '',
|
|
|
- addFans: ''
|
|
|
+ addFans: '',
|
|
|
+ upGainAmountUsdValue: 0,
|
|
|
})
|
|
|
|
|
|
|
|
@@ -1487,11 +1495,30 @@ const calcUsd2TokenEstimate = (params) => {
|
|
|
const calcAddFans = (params = {}) => {
|
|
|
let {totalAmount, unitPrice} = params;
|
|
|
if (totalAmount > 0 && unitPrice > 0) {
|
|
|
+ setUpGainAmountUsdValue(params);
|
|
|
+
|
|
|
let count = Math.floor(totalAmount / unitPrice);
|
|
|
return count;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const setUpGainAmountUsdValue = (params) => {
|
|
|
+ const { usdPrice, currencyCode } = currentCurrencyInfo.value;
|
|
|
+ let {totalAmount, unitPrice} = params;
|
|
|
+ if(!currencyCode) return;
|
|
|
+ upGainCalculate({
|
|
|
+ params: {
|
|
|
+ amountValue: totalAmount,
|
|
|
+ currencyUsdPrice: usdPrice,
|
|
|
+ fansUnitAmountValue: unitPrice
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 0 && res.data) {
|
|
|
+ treasureFormData.upGainAmountUsdValue = res.data.upGainAmountUsdValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 奖励总金额 美元估值
|
|
|
*/
|