|
@@ -15,16 +15,26 @@
|
|
|
<div class="left">
|
|
|
<!-- 关闭按钮 -->
|
|
|
<div class="close-btn" @click="close">
|
|
|
- <img class="icon-close"
|
|
|
+ <template v-if="publishType == 'TOOL_BOX'">
|
|
|
+ <img class="icon-close"
|
|
|
+ :src="require('@/assets/svg/icon-close.svg')"
|
|
|
+ v-if="toolBoxPageData.activePage == 'EDITOR'"/>
|
|
|
+ <img class="icon-close"
|
|
|
+ :src="require('@/assets/svg/icon-back.svg')"
|
|
|
+ v-else/>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <img class="icon-close"
|
|
|
:src="require('@/assets/svg/icon-close.svg')"
|
|
|
v-if="showComType == 'default'"/>
|
|
|
- <img class="icon-close"
|
|
|
- :src="require('@/assets/svg/icon-back.svg')"
|
|
|
- v-else/>
|
|
|
+ <img class="icon-close"
|
|
|
+ :src="require('@/assets/svg/icon-back.svg')"
|
|
|
+ v-else/>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<!-- 标题 -->
|
|
|
<div class="title">
|
|
|
- {{ currentComData[showComType]["title"] }}
|
|
|
+ {{publishType == 'REDPACKET' ? currentComData[showComType]["title"] : 'Tool Box' }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
@@ -72,8 +82,20 @@
|
|
|
<div class="currency-pop" v-show="showCurrencyPop">
|
|
|
<currency-list
|
|
|
ref="currencyListDom"
|
|
|
+ :showGeneralLottery="true"
|
|
|
@selectCurrency="selectCurrency"
|
|
|
- @setCurrencyList="setCurrentCurrencyInfo"></currency-list>
|
|
|
+ @setCurrencyList="setCurrentCurrencyInfo"
|
|
|
+ @addGeneralLottery="addCustomizedRewardHandle"></currency-list>
|
|
|
+ </div>
|
|
|
+ <!-- 通用奖品编辑弹窗 -->
|
|
|
+ <div class="customized-reward-edit-popup" v-if="showCustomizedRewardEditPopup">
|
|
|
+ <customized-reward-edit-popup
|
|
|
+ ref="rewardEditDom"
|
|
|
+ :customizedReward="baseFormData.customizedReward"
|
|
|
+ :rewardType="baseFormData.rewardType"
|
|
|
+ @closeRewardPopup="closeRewardPopup"
|
|
|
+ @removeReward="removeReward"
|
|
|
+ @submitReward="submitReward"></customized-reward-edit-popup>
|
|
|
</div>
|
|
|
<div class="currency-pop-select" v-show="showCurrencySelect">
|
|
|
<currency-select
|
|
@@ -82,17 +104,31 @@
|
|
|
@selectCurrency="selectCurrencyAfter"></currency-select>
|
|
|
</div>
|
|
|
|
|
|
- <div class="left" v-if="showComType != 'preview'">
|
|
|
- <div class="gift-pack-wrapper">
|
|
|
- <img class="icon" :src="require('@/assets/svg/icon-gift-pack.svg')"/>
|
|
|
- </div>
|
|
|
- <div class="bottom">
|
|
|
+ <div class="left" v-if="showComType != 'preview' && toolBoxPageData.activePage != 'PREVIEW'">
|
|
|
+ <div class="tab-item"
|
|
|
+ :class="{'active-tab': item.type == publishType}"
|
|
|
+ v-for="(item, index) in leftTabList"
|
|
|
+ :key="index"
|
|
|
+ @click="clickLeftTab(item, index)"
|
|
|
+ >
|
|
|
+ <img class="icon" :src="item.icon"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="right"
|
|
|
- :class="{'fill-right': showComType == 'preview'}">
|
|
|
+ :class="{'fill-right': showComType == 'preview' || toolBoxPageData.activePage == 'PREVIEW'}">
|
|
|
<global-tip :type="'2'"></global-tip>
|
|
|
+
|
|
|
+
|
|
|
+ <template v-if="publishType == 'TOOL_BOX'">
|
|
|
+ <tool-box
|
|
|
+ :pageData="{
|
|
|
+ 'linkInputDescImage': toolBoxPageData.postEditorLinkInputDescImage
|
|
|
+ }"
|
|
|
+ :activePage="toolBoxPageData.activePage" @onPageChange="onToolBoxPageChange"
|
|
|
+ @toolBoxPublishFinish="toolBoxPublishFinish"></tool-box>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
<div class="form-wrapper" v-if="showComType == 'default'">
|
|
|
<div class="form-cell-item base-form-wrapper">
|
|
|
<div class="title">
|
|
@@ -111,17 +147,16 @@
|
|
|
<div class="item currency-select-wrapper">
|
|
|
<div>
|
|
|
<div class="label currency-select"
|
|
|
- :class="{'selected': currentCurrencyInfo.currencyCode}"
|
|
|
+ :class="{'selected': currencySelectCpd}"
|
|
|
@click="selectCurrencyPopHandle">
|
|
|
<img class="icon"
|
|
|
- v-if="currentCurrencyInfo.iconPath"
|
|
|
- :src="currentCurrencyInfo.iconPath"/>
|
|
|
+ v-if="currentIconCpd"
|
|
|
+ :src="currentIconCpd"/>
|
|
|
<div class="text">
|
|
|
- {{currentCurrencyInfo.currencyCode == 'USD' ? 'USD' : currentCurrencyInfo.tokenSymbol || 'Select a reward'}}
|
|
|
+ {{currentPrizeCpd}}
|
|
|
</div>
|
|
|
<img class="arrow"
|
|
|
- :src="currentCurrencyInfo.currencyCode ?
|
|
|
- require('@/assets/svg/icon-form-arrow-down.svg') : require('@/assets/svg/icon-form-white-arrow-down.svg')"/>
|
|
|
+ :src="currentArrowCpd"/>
|
|
|
</div>
|
|
|
|
|
|
<!-- 刷新按钮、充值 -->
|
|
@@ -159,6 +194,7 @@
|
|
|
</div>
|
|
|
<input v-model="baseFormData.totalCount"
|
|
|
placeholder="0"
|
|
|
+ :disabled="baseFormData.rewardType === RewardType.custom"
|
|
|
@input="onCountInput"
|
|
|
@blur="onCountBlur"/>
|
|
|
</div>
|
|
@@ -194,6 +230,8 @@
|
|
|
type: baseFormData.type,
|
|
|
validityDuration: baseFormData.validityDuration,
|
|
|
customPosterUrl: customPosterData && customPosterData.after && customPosterData.after.imagePath || '',
|
|
|
+ rewardType: baseFormData.rewardType,
|
|
|
+ customizedReward: baseFormData.customizedReward
|
|
|
}">
|
|
|
</custom-card-cover>
|
|
|
</div>
|
|
@@ -291,10 +329,10 @@
|
|
|
<template v-else-if="showComType == 'preview'">
|
|
|
<div class="preview">
|
|
|
<div class="card"
|
|
|
- :class="{ center: Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
|
|
|
+ :class="{ center: !isMoneyRewardCpd || Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
|
|
|
<div class="card-title">
|
|
|
<img class="img"
|
|
|
- v-if="Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)"
|
|
|
+ v-if="isMoneyRewardCpd && Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)"
|
|
|
:src=" require('@/assets/subject/top-01.svg') " />
|
|
|
<div class="font">
|
|
|
Preview: <span>{{installStatus ? 'After' : 'Before' }}</span> DeNet Installed
|
|
@@ -311,7 +349,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 需充值 -->
|
|
|
- <div class="card-content" v-if="Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)">
|
|
|
+ <div class="card-content" v-if="isMoneyRewardCpd && 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') " />
|
|
@@ -371,6 +409,7 @@
|
|
|
<!-- paypal支付按钮 -->
|
|
|
<div class="payment" v-show="showComType == 'preview'">
|
|
|
<paypal-button
|
|
|
+ v-if="isMoneyRewardCpd"
|
|
|
:finalAmountData="finalAmountData"
|
|
|
:payConfig="{
|
|
|
paypalClientId,
|
|
@@ -395,7 +434,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</paypal-button>
|
|
|
+ <div v-else class="btn-wrap" @click="payStatusHandle(1)"><div class="custom-submit">Confirm</div></div>
|
|
|
</div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -446,7 +487,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide, getCurrentInstance } from "vue";
|
|
|
+import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide, getCurrentInstance, computed } from "vue";
|
|
|
import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
import { getInviteGuildInfo, getInviteGuildInfoByOpenApi, saveInviteGuildInfo } from "@/http/discordApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
@@ -454,6 +495,7 @@ import { getFrontConfig } from "@/http/account";
|
|
|
import { uploadSignature, uploadFile } from '@/http/media';
|
|
|
import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
|
import { debounce, getBit } from "@/uilts/help"
|
|
|
+import { PlayType, RewardType } from '@/types';
|
|
|
import Report from "@/log-center/log"
|
|
|
import { ElMessage, ElLoading } from "element-plus";
|
|
|
import "element-plus/es/components/message/style/css";
|
|
@@ -461,6 +503,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 messageBox from "@/view/components/message-box.vue";
|
|
|
import currencyList from "@/view/components/currency-list.vue";
|
|
|
import currencySelect from "@/view/components/currency-select.vue";
|
|
@@ -469,12 +512,15 @@ import followInput from "@/view/iframe/publish/components/follow-input";
|
|
|
import paypalButton from "@/view/iframe/publish/components/paypal-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'
|
|
|
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 = {
|
|
|
number: 'BigNumber',
|
|
|
}
|
|
@@ -496,6 +542,8 @@ let publishRes = reactive({});
|
|
|
|
|
|
//弹窗是否展示
|
|
|
let visible = ref(false);
|
|
|
+let publishType = ref('REDPACKET');
|
|
|
+
|
|
|
|
|
|
//弹窗高度
|
|
|
let dialogStyle = reactive({
|
|
@@ -605,11 +653,12 @@ let baseFormData = reactive({
|
|
|
amountValue: "",
|
|
|
totalCount: "",
|
|
|
validityDuration: "",
|
|
|
- type: selectModeInfo.type
|
|
|
+ type: selectModeInfo.type,
|
|
|
+ rewardType: RewardType.money,
|
|
|
+ customizedReward: ""
|
|
|
});
|
|
|
|
|
|
-// 当前选择的货币信息
|
|
|
-let currentCurrencyInfo = ref({
|
|
|
+const defaultCurrentCurrencyInfo = {
|
|
|
currencyCode: "",
|
|
|
currencyName: "",
|
|
|
balance: "",
|
|
@@ -619,7 +668,10 @@ let currentCurrencyInfo = ref({
|
|
|
tokenChain: "",
|
|
|
tokenSymbol: "",
|
|
|
usdEstimateBalance: ""
|
|
|
-});
|
|
|
+}
|
|
|
+
|
|
|
+// 当前选择的货币信息
|
|
|
+let currentCurrencyInfo = ref(defaultCurrentCurrencyInfo);
|
|
|
|
|
|
const discordIptErrTxt = 'Discord invite link is wrong';
|
|
|
const discordIptEmptyErrTxt = 'Enter discord invite link';
|
|
@@ -695,22 +747,81 @@ let publishModeList = reactive([
|
|
|
|
|
|
let discordInviteInfo = ref({});
|
|
|
let showDiscordInvitePop = ref(false);
|
|
|
+let showCustomizedRewardEditPopup = ref(false);
|
|
|
|
|
|
let lotteryMaxHourDuration = 168;
|
|
|
|
|
|
+let leftTabList = reactive([
|
|
|
+ {
|
|
|
+ icon: require('@/assets/svg/icon-gift-pack.svg'),
|
|
|
+ type: 'REDPACKET'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: require('@/assets/svg/icon-tool-box-02.svg'),
|
|
|
+ type: 'TOOL_BOX'
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
+let toolBoxPageData = reactive({
|
|
|
+ activePage: 'EDITOR', //EDITOR PREVIEW
|
|
|
+ postEditorLinkInputDescImage: ''
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
- dialogVisible: {
|
|
|
- type: Boolean,
|
|
|
- default: false,
|
|
|
+ dialogData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ type: 'REDPACKET'
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|
|
|
+//selected prize icon cpd
|
|
|
+let currentIconCpd = computed(() => {
|
|
|
+ if(baseFormData.rewardType === RewardType.custom) {
|
|
|
+ return require("@/assets/svg/icon-gift.svg");
|
|
|
+ } else {
|
|
|
+ return currentCurrencyInfo.value.iconPath;
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// selected prize cpd
|
|
|
+let currentPrizeCpd = computed(() => {
|
|
|
+ const {currencyCode, tokenSymbol} = currentCurrencyInfo.value
|
|
|
+ if(baseFormData.rewardType === RewardType.custom) {
|
|
|
+ return baseFormData.customizedReward;
|
|
|
+ } else if(currencyCode == "USD") {
|
|
|
+ return "USD";
|
|
|
+ } else {
|
|
|
+ return tokenSymbol || "Select a reward";
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+let currencySelectCpd = computed(() => {
|
|
|
+ return baseFormData.customizedReward || currentCurrencyInfo.value.currencyCode;
|
|
|
+})
|
|
|
+
|
|
|
+let currentArrowCpd = computed(() => {
|
|
|
+ if(baseFormData.rewardType === RewardType.custom) {
|
|
|
+ return require("@/assets/svg/icon-cell-arrow-right.svg");
|
|
|
+ } else {
|
|
|
+ return currentCurrencyInfo.value.currencyCode ? require("@/assets/svg/icon-form-arrow-down.svg") : require("@/assets/svg/icon-form-white-arrow-down.svg");
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+let isMoneyRewardCpd =computed(() => baseFormData.rewardType === RewardType.money);
|
|
|
+
|
|
|
watch(
|
|
|
- () => props.dialogVisible,
|
|
|
+ () => props.dialogData,
|
|
|
(newVal) => {
|
|
|
- console.log("watch", newVal);
|
|
|
- visible.value = newVal;
|
|
|
- if (newVal) {
|
|
|
+ visible.value = newVal.visible;
|
|
|
+
|
|
|
+ if (newVal.visible) {
|
|
|
+ publishType.value = newVal.type;
|
|
|
Report.reportLog({
|
|
|
pageSource: Report.pageSource.publisherDialog,
|
|
|
businessType: Report.businessType.pageView,
|
|
@@ -728,18 +839,33 @@ watch(
|
|
|
} else {
|
|
|
clearInterval(timer.value);
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-const emits = defineEmits(["close", "confirm", "payPalFinsh"]);
|
|
|
+const emits = defineEmits(["close", "confirm", "postPublishFinish"]);
|
|
|
|
|
|
const close = () => {
|
|
|
- if (showComType.value != "default") {
|
|
|
- showComType.value = "default";
|
|
|
- isBack.value = true;
|
|
|
+ if(publishType.value == 'TOOL_BOX') {
|
|
|
+ closeToolBoxPage()
|
|
|
} else {
|
|
|
- initParams();
|
|
|
+ if (showComType.value != "default") {
|
|
|
+ showComType.value = "default";
|
|
|
+ isBack.value = true;
|
|
|
+ } else {
|
|
|
+ initParams();
|
|
|
+ emits("close", false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const closeToolBoxPage = () => {
|
|
|
+ if(toolBoxPageData.activePage == "EDITOR") {
|
|
|
emits("close", false);
|
|
|
+ } else if(toolBoxPageData.activePage == "PREVIEW") {
|
|
|
+ toolBoxPageData.activePage = "EDITOR";
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -776,12 +902,16 @@ const selectCurrencyPopHandle = () => {
|
|
|
pageSource: Report.pageSource.currencySelectorPage,
|
|
|
businessType: Report.businessType.pageView,
|
|
|
});
|
|
|
- showCurrencyPop.value = true;
|
|
|
- nextTick(() => {
|
|
|
- if(currencyListDom.value) {
|
|
|
- currencyListDom.value.getCurrencyInfoList && currencyListDom.value.getCurrencyInfoList();
|
|
|
- }
|
|
|
- })
|
|
|
+ if(baseFormData.rewardType === RewardType.custom) {
|
|
|
+ showCustomizedRewardEditPopup.value = true
|
|
|
+ } else {
|
|
|
+ showCurrencyPop.value = true;
|
|
|
+ nextTick(() => {
|
|
|
+ if(currencyListDom.value) {
|
|
|
+ currencyListDom.value.getCurrencyInfoList && currencyListDom.value.getCurrencyInfoList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -875,12 +1005,16 @@ const selectCurrencyAfter = (params, openWindow = true) => {
|
|
|
resetFormIpt(false);
|
|
|
onIptSetErrorTxt();
|
|
|
}
|
|
|
+ baseFormData.customizedReward = "";
|
|
|
+ baseFormData.rewardType = RewardType.money;
|
|
|
}
|
|
|
|
|
|
const resetFormIpt = (clearMode = true) => {
|
|
|
baseFormData.amountValue = "";
|
|
|
baseFormData.totalCount = "";
|
|
|
baseFormData.validityDuration = "";
|
|
|
+ baseFormData.rewardType = RewardType.money;
|
|
|
+ baseFormData.customizedReward = "";
|
|
|
|
|
|
if(clearMode) {
|
|
|
selectModeInfo.index = 0;
|
|
@@ -1016,7 +1150,12 @@ const asyncTokenRechRecord = (cb) => {
|
|
|
* 提交表单请求
|
|
|
*/
|
|
|
const submitRequest = async () => {
|
|
|
- let { amountValue = 0, totalCount = 0 } = baseFormData;
|
|
|
+ let {
|
|
|
+ amountValue = 0,
|
|
|
+ totalCount = 0,
|
|
|
+ rewardType = RewardType.money,
|
|
|
+ customizedReward = ""
|
|
|
+ } = baseFormData;
|
|
|
baseFormData.amountCurrencyCode = currentCurrencyInfo.value.currencyCode;
|
|
|
// 组装提交参数
|
|
|
|
|
@@ -1043,7 +1182,7 @@ const submitRequest = async () => {
|
|
|
let receiveConditions = openAntiBot.value ? "" : [];
|
|
|
|
|
|
let validityDuration = '';
|
|
|
- if(baseFormData.type == 2) {
|
|
|
+ if(baseFormData.type == PlayType.lottery) {
|
|
|
//小时转毫秒
|
|
|
let unit = process.env.NODE_ENV != 'production' ? 60 * 1000 : 60 * 60 * 1000;
|
|
|
// let unit = 60 * 60 * 1000
|
|
@@ -1054,16 +1193,24 @@ const submitRequest = async () => {
|
|
|
|
|
|
// 提交参数
|
|
|
let formData = {
|
|
|
- amountCurrencyCode: baseFormData.amountCurrencyCode,
|
|
|
amountValue,
|
|
|
totalCount,
|
|
|
finishConditions,
|
|
|
receiveConditions,
|
|
|
- payAmountValue: amountValue,
|
|
|
type: baseFormData.type,
|
|
|
posterType: 1,
|
|
|
- validityDuration
|
|
|
+ validityDuration,
|
|
|
+ rewardType
|
|
|
};
|
|
|
+ if(rewardType === RewardType.custom) {
|
|
|
+ // 通用奖品 类型的活动,添加奖品名称
|
|
|
+ formData.customizedReward = customizedReward;
|
|
|
+ delete formData.amountValue;
|
|
|
+ } else {
|
|
|
+ // 货币类型 添加货币code
|
|
|
+ formData.amountCurrencyCode = baseFormData.amountCurrencyCode;
|
|
|
+ formData.payAmountValue = baseFormData.payAmountValue;
|
|
|
+ }
|
|
|
submitIng.value = true;
|
|
|
|
|
|
// 自定义封面
|
|
@@ -1135,6 +1282,8 @@ const initParams = () => {
|
|
|
tempCurrentCurrencyInfo.value = {};
|
|
|
currentCurrencyInfo.value = {};
|
|
|
|
|
|
+ publishType.value = 'REDPACKET';
|
|
|
+
|
|
|
// clear discord value
|
|
|
setDiscordIptTxt({text: ''});
|
|
|
|
|
@@ -1186,7 +1335,7 @@ const payStatusHandle = (payStatus) => {
|
|
|
//支付状态 0:未支付,1:支付成功,2:支付失败,3:已关闭,4:已退款
|
|
|
switch (payStatus) {
|
|
|
case 1:
|
|
|
- emits("payPalFinsh", { publishRes });
|
|
|
+ emits("postPublishFinish", { publishRes });
|
|
|
showComType.value = "default";
|
|
|
initParams();
|
|
|
break;
|
|
@@ -1231,6 +1380,8 @@ const onAmountInput = () => {
|
|
|
// val = val.replace(/[^\d^\.]+/g, "");
|
|
|
val = val.replace(/^\D*(\d*(?:\.\d{0,18})?).*$/g, '$1');
|
|
|
|
|
|
+ const maxCount = baseFormData.rewardType === RewardType.money ? Number.MAX_SAFE_INTEGER : 100000000;
|
|
|
+
|
|
|
if(val == '00') {
|
|
|
val = '0'
|
|
|
}
|
|
@@ -1242,6 +1393,15 @@ const onAmountInput = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (baseFormData.rewardType === RewardType.custom) {
|
|
|
+ const maxCount = 100000000;
|
|
|
+ val = val.replace(/^(0)*/, '').replace(/\./, ''); // 通用奖品类型 过滤掉起始位的0和小数点符号
|
|
|
+ if (val > maxCount) {
|
|
|
+ val = maxCount
|
|
|
+ }
|
|
|
+ baseFormData.totalCount = val;
|
|
|
+ }
|
|
|
+
|
|
|
baseFormData.amountValue = val;
|
|
|
setInputErrorMsg({from: 'amount', type:'input'});
|
|
|
|
|
@@ -1343,13 +1503,14 @@ const setInputErrorMsg = () => {
|
|
|
* 输入时 检测设置错误信息
|
|
|
*/
|
|
|
const onIptSetErrorTxt = (params = {}) => {
|
|
|
- if(!currentCurrencyInfo.value.currencyCode) {
|
|
|
+ if((baseFormData.rewardType === RewardType.money && !currentCurrencyInfo.value.currencyCode)
|
|
|
+ || (baseFormData.rewardType === RewardType.custom && !baseFormData.customizedReward)) {
|
|
|
iptErrMsgTxt.value = "Select a reward"
|
|
|
} else if (!baseFormData.amountValue || baseFormData.amountValue == '0') {
|
|
|
iptErrMsgTxt.value = "Enter an amount";
|
|
|
} else if (!baseFormData.totalCount || baseFormData.totalCount == '0') {
|
|
|
iptErrMsgTxt.value = "Enter the number of winners";
|
|
|
- } else if(+baseFormData.amountValue <= +currentCurrencyInfo.value.balance) {
|
|
|
+ } else if(baseFormData.rewardType === RewardType.money && +baseFormData.amountValue <= +currentCurrencyInfo.value.balance) {
|
|
|
// 输入金额 小于 余额
|
|
|
let res = calcIptValue();
|
|
|
if (!res.flag) {
|
|
@@ -1666,6 +1827,7 @@ const setFrontConfig = () => {
|
|
|
if (res.code == 0) {
|
|
|
paypalHtml.value = res.data.paypalHtml;
|
|
|
lotteryMaxHourDuration = res.data.lotteryMaxHourDuration;
|
|
|
+ toolBoxPageData.postEditorLinkInputDescImage = res.data.postEditorLinkInputDescImage;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -1722,6 +1884,19 @@ const selectPublishMode = (params, index) => {
|
|
|
setInputErrorMsg();
|
|
|
}
|
|
|
|
|
|
+const clickLeftTab = (params, index) => {
|
|
|
+ publishType.value = params.type;
|
|
|
+}
|
|
|
+
|
|
|
+const onToolBoxPageChange = (params) => {
|
|
|
+ toolBoxPageData.activePage = params.page;
|
|
|
+};
|
|
|
+
|
|
|
+const toolBoxPublishFinish = (params) => {
|
|
|
+ toolBoxPageData.activePage = 'EDITOR';
|
|
|
+ emits("postPublishFinish", { publishRes: params.publishRes });
|
|
|
+}
|
|
|
+
|
|
|
// 截图相关
|
|
|
const showDialog = () => {
|
|
|
cropperDialog.value = true;
|
|
@@ -1796,6 +1971,37 @@ const confirmData = (data) => {
|
|
|
close()
|
|
|
customPosterData.value = customPosterInfo.value;
|
|
|
}
|
|
|
+/**
|
|
|
+ * 显示通用奖品名称编辑框
|
|
|
+ */
|
|
|
+const addCustomizedRewardHandle = () => {
|
|
|
+ showCurrencyPop.value = false;
|
|
|
+ showCustomizedRewardEditPopup.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+const closeRewardPopup = () => {
|
|
|
+ showCustomizedRewardEditPopup.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+const removeReward = () => {
|
|
|
+ showCustomizedRewardEditPopup.value = false;
|
|
|
+ resetFormIpt(false);
|
|
|
+ onIptSetErrorTxt();
|
|
|
+}
|
|
|
+
|
|
|
+// 提交通用奖品
|
|
|
+const submitReward = (reward) => {
|
|
|
+ if(baseFormData.customizedReward !== reward) {
|
|
|
+ // 有修改时,重置之前已提交的数据
|
|
|
+ resetFormIpt(false);
|
|
|
+ }
|
|
|
+ baseFormData.rewardType = RewardType.custom;
|
|
|
+ baseFormData.customizedReward = reward;
|
|
|
+ showCustomizedRewardEditPopup.value = false;
|
|
|
+ currentCurrencyInfo.value = defaultCurrentCurrencyInfo;
|
|
|
+ setLocalSelectCurrencyInfo(defaultCurrentCurrencyInfo);
|
|
|
+ onIptSetErrorTxt();
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
setFrontConfig();
|
|
@@ -1997,16 +2203,19 @@ onMounted(() => {
|
|
|
width: 50px;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
align-items: center;
|
|
|
|
|
|
- .gift-pack-wrapper {
|
|
|
+ .tab-item {
|
|
|
width: 100%;
|
|
|
height: 55px;
|
|
|
- background: #f5f5f5;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .active-tab {
|
|
|
+ background-color: #D2EAFC;
|
|
|
}
|
|
|
|
|
|
.bottom {
|
|
@@ -2103,6 +2312,12 @@ onMounted(() => {
|
|
|
input::placeholder {
|
|
|
color: #c5c5c5;
|
|
|
}
|
|
|
+
|
|
|
+ input:disabled {
|
|
|
+ color: #c5c5c5;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
input {
|
|
|
padding-right: 16px;
|
|
|
}
|
|
@@ -2335,6 +2550,7 @@ onMounted(() => {
|
|
|
height: 60px;
|
|
|
margin-left: 14px;
|
|
|
margin-right: 14px;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
.show-font {
|
|
|
position: relative;
|
|
@@ -2540,6 +2756,37 @@ onMounted(() => {
|
|
|
margin-left: -5px;
|
|
|
}
|
|
|
}
|
|
|
+ .btn-wrap {
|
|
|
+ width: 100%;
|
|
|
+ height: 80px;
|
|
|
+ background-color: #fff;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ box-shadow: 0px -1px 0px #ececec;
|
|
|
+ border-bottom-right-radius: 16px;
|
|
|
+ padding: 12px 30px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ border-bottom-left-radius: 16px;
|
|
|
+ z-index: 999;
|
|
|
+ .custom-submit {
|
|
|
+ width: 200px;
|
|
|
+ height: 50px;
|
|
|
+ background: #1D9BF0;
|
|
|
+ border-radius: 50px;
|
|
|
+ font-weight: 700;
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ letter-spacing: 0.3px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.dialog {
|