|
@@ -23,7 +23,6 @@
|
|
|
<!-- 充值组件 -->
|
|
|
<top-up
|
|
|
v-if="showComType == 'topUp'"
|
|
|
- :asyncIng="asyncIng"
|
|
|
:currentCurrencyInfo="tempCurrentCurrencyInfo"
|
|
|
@topUpDone="topUpDone">
|
|
|
</top-up>
|
|
@@ -154,7 +153,7 @@
|
|
|
:src="require('@/assets/svg/icon-winner-v2.svg')"/>
|
|
|
Winner Count
|
|
|
</div>
|
|
|
- <div class="msg" v-show="selectModeInfo.type == 1">Recommend Winners 100~10000</div>
|
|
|
+ <div class="msg" v-show="selectModeInfo.type == PlayType.common">Recommend Winners 100~10000</div>
|
|
|
</div>
|
|
|
<input v-model="baseFormData.totalCount"
|
|
|
placeholder="0"
|
|
@@ -162,7 +161,7 @@
|
|
|
@input="onCountInput"
|
|
|
@blur="onCountBlur"/>
|
|
|
</div>
|
|
|
- <div class="item automatically-input" v-if="selectModeInfo.type == 2">
|
|
|
+ <div class="item automatically-input" v-if="selectModeInfo.type == PlayType.lottery">
|
|
|
<div class="label">
|
|
|
<img class="icon"
|
|
|
:src="require('@/assets/svg/icon-automatically.svg')"/>
|
|
@@ -170,10 +169,10 @@
|
|
|
</div>
|
|
|
<div class="input-wrapper">
|
|
|
<input v-model="baseFormData.validityDuration"
|
|
|
- placeholder="0"
|
|
|
- @input="onValidityDurationInput"
|
|
|
- @blur="onValidityDurationBlur"/>
|
|
|
- <span class="unit">h</span>
|
|
|
+ placeholder="0"
|
|
|
+ @input="onValidityDurationInput"
|
|
|
+ @blur="onValidityDurationBlur"/>
|
|
|
+ <span class="unit">h</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -217,7 +216,7 @@
|
|
|
<li class="row">
|
|
|
Each user can only receive a reward once per task.
|
|
|
</li>
|
|
|
- <li class="row" v-show="selectModeInfo.type == 1">
|
|
|
+ <li class="row" v-show="selectModeInfo.type == PlayType.common">
|
|
|
The reward will expire in 7 days once issued. Please promote it as much as possible within this period. After the experiment, the remaining rewards will be returned to your DeNet Wallet.
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -282,8 +281,7 @@
|
|
|
@click="confirm">
|
|
|
<img class="icon-loading"
|
|
|
v-if="submitIng"
|
|
|
- :src="require('@/assets/svg/icon-btn-loading.svg')"
|
|
|
- />
|
|
|
+ :src="require('@/assets/svg/icon-btn-loading.svg')"/>
|
|
|
{{iptErrMsgTxt ? iptErrMsgTxt : 'NEXT'}}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -291,86 +289,18 @@
|
|
|
|
|
|
<!-- 预览 -->
|
|
|
<template v-else-if="showComType == 'preview'">
|
|
|
- <div class="preview">
|
|
|
- <div class="card"
|
|
|
- :class="{ center: !isMoneyRewardCpd || Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
|
|
|
- <div class="card-title">
|
|
|
- <img class="img"
|
|
|
- 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
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="flash">
|
|
|
- <preview-card
|
|
|
- :currentCurrencyInfo="currentCurrencyInfo"
|
|
|
- :postData="publishRes"
|
|
|
- :baseFormData="baseFormData"
|
|
|
- :amountFontSize="previewFontSize"
|
|
|
- :customPosterInfo="customPosterData"
|
|
|
- ></preview-card>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 需充值 -->
|
|
|
- <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') " />
|
|
|
- <div class="font">Deposit to Send Giveaway</div>
|
|
|
- </div>
|
|
|
- <div class="card-list">
|
|
|
- <div class="item">
|
|
|
- <div class="l">Giveaway Amount</div>
|
|
|
- <div class="r order-amount">${{finalAmountData.orderAmountValue}}</div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Balance</div>
|
|
|
- <div class="r txt">${{finalAmountData.balance}}</div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Paypal charges fee ({{finalAmountData.feeDesc}})</div>
|
|
|
- <div class="r txt">${{finalAmountData.feeAmountValue}}</div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Deposit Amount</div>
|
|
|
- <div class="r deposit-amount">${{finalAmountData.rechargeAmountValue}}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <div class="card-title">
|
|
|
- <img class="img" :src=" require('@/assets/subject/top-02.svg') " />
|
|
|
- <div class="font">Deposit to Send Giveaway</div>
|
|
|
- </div>
|
|
|
- <top-up2
|
|
|
- :asyncIng="asyncIng"
|
|
|
- :currentCurrencyInfo="tempCurrentCurrencyInfo"
|
|
|
- @topUpDone="topUpDone">
|
|
|
- </top-up2>
|
|
|
- <div class="card-title">
|
|
|
- <img class="img" :src=" require('@/assets/subject/top-03.svg') " />
|
|
|
- <div class="font">Wait for the amount to arrive</div>
|
|
|
- </div>
|
|
|
- <div class="card-amount">
|
|
|
- <img class="icon" src="@/assets/subject/icon-balance.png" />
|
|
|
- <div class="con">
|
|
|
- <div class="desc">Balance</div>
|
|
|
- <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.tokenSymbol}}</div>
|
|
|
- </div>
|
|
|
- <img
|
|
|
- class="refresh"
|
|
|
- :class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
|
- @click="updateCurrencyBanlce"
|
|
|
- :src=" require('@/assets/svg/icon-form-refresh-blue.svg') "
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <preview-sheet :baseFormData="baseFormData"
|
|
|
+ :currentCurrencyInfo="currentCurrencyInfo"
|
|
|
+ :tempCurrentCurrencyInfo="tempCurrentCurrencyInfo"
|
|
|
+ :publishRes="publishRes"
|
|
|
+ :previewFontSize="previewFontSize"
|
|
|
+ :customPosterData="customPosterData"
|
|
|
+ :finalAmountData="finalAmountData"
|
|
|
+ @onTopUpDone="topUpDone"
|
|
|
+ @onUpdateCurrencyBanlce="updateCurrencyBanlce"></preview-sheet>
|
|
|
</template>
|
|
|
|
|
|
- <!-- paypal支付按钮 -->
|
|
|
+ <!-- 支付按钮 -->
|
|
|
<div class="payment" v-show="showComType == 'preview'">
|
|
|
<pay-button
|
|
|
ref="payButtonDom"
|
|
@@ -467,7 +397,7 @@ import { getFrontConfig, calcRechargePayAmount } 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 { PlayType, RewardType, TaskType } from '@/types';
|
|
|
import Report from "@/log-center/log"
|
|
|
import { ElMessage, ElLoading } from "element-plus";
|
|
|
import "element-plus/es/components/message/style/css";
|
|
@@ -480,14 +410,13 @@ import { message } from 'ant-design-vue';
|
|
|
import messageBox from "@/view/components/message-box.vue";
|
|
|
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 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'
|
|
|
import giveawayPoster from '@/view/iframe/publish/components/giveaway-poster.vue';
|
|
|
import giveDialogHead from "@/view/iframe/publish/components/give-dialog-head";
|
|
|
+import previewSheet from "@/view/iframe/publish/components/preview-sheet.vue";
|
|
|
import GlobalTip from '@/view/components/global-tip.vue'
|
|
|
import customCardCover from '@/view/components/custom-card-cover.vue'
|
|
|
|
|
@@ -599,7 +528,7 @@ let postId = ref('');
|
|
|
|
|
|
let selectModeInfo = reactive({
|
|
|
index: 0,
|
|
|
- type: 2 // 1: 红包 2: 抽奖
|
|
|
+ type: PlayType.lottery // 1: 红包 2: 抽奖
|
|
|
})
|
|
|
|
|
|
// 余额是否同步中
|
|
@@ -654,7 +583,7 @@ let formList = reactive([
|
|
|
label: "Follow",
|
|
|
icon: require("@/assets/svg/icon-task-twitter.svg"),
|
|
|
nodeType: "textarea",
|
|
|
- type: 1,
|
|
|
+ type: TaskType.twitterFollow,
|
|
|
text: [],
|
|
|
checked: true,
|
|
|
show: true
|
|
@@ -663,7 +592,7 @@ let formList = reactive([
|
|
|
label: "Retweet & Like",
|
|
|
icon: require("@/assets/svg/icon-task-twitter.svg"),
|
|
|
nodeType: "div",
|
|
|
- type: 3,
|
|
|
+ type: TaskType.twitterRetweet,
|
|
|
checked: true,
|
|
|
show: true
|
|
|
},
|
|
@@ -671,7 +600,7 @@ let formList = reactive([
|
|
|
label: "Like Tweet",
|
|
|
icon: require("@/assets/svg/icon-task-twitter.svg"),
|
|
|
nodeType: "div",
|
|
|
- type: 2,
|
|
|
+ type: TaskType.twitterLikeTweet,
|
|
|
checked: true,
|
|
|
show: false
|
|
|
},
|
|
@@ -679,7 +608,7 @@ let formList = reactive([
|
|
|
label: "Comment and Tag 3 friends",
|
|
|
icon: require("@/assets/svg/icon-task-twitter.svg"),
|
|
|
nodeType: "div",
|
|
|
- type: 9,
|
|
|
+ type: TaskType.twitterCommentAndTag,
|
|
|
checked: true,
|
|
|
show: true
|
|
|
},
|
|
@@ -688,7 +617,7 @@ let formList = reactive([
|
|
|
icon: require("@/assets/svg/icon-task-facebook.svg"),
|
|
|
nodeType: "div",
|
|
|
text: '',
|
|
|
- type: 8,
|
|
|
+ type: TaskType.repostToFacebook,
|
|
|
checked: false,
|
|
|
show: true
|
|
|
},
|
|
@@ -697,7 +626,7 @@ let formList = reactive([
|
|
|
icon: require("@/assets/svg/icon-discord-mini.svg"),
|
|
|
nodeType: "input",
|
|
|
text: '',
|
|
|
- type: 7,
|
|
|
+ type: TaskType.joinDiscord,
|
|
|
checked: false,
|
|
|
show: true
|
|
|
},
|
|
@@ -707,12 +636,12 @@ let publishModeList = reactive([
|
|
|
{
|
|
|
imgActive: require("@/assets/svg/img-A1.svg"),
|
|
|
imgInActive: require("@/assets/svg/img-A0.svg"),
|
|
|
- type: 2
|
|
|
+ type: PlayType.lottery
|
|
|
},
|
|
|
{
|
|
|
imgActive: require("@/assets/svg/img-B1.svg"),
|
|
|
imgInActive: require("@/assets/svg/img-B0.svg"),
|
|
|
- type: 1
|
|
|
+ type: PlayType.common
|
|
|
}
|
|
|
])
|
|
|
|
|
@@ -1067,13 +996,10 @@ const customCoverImg = () => {
|
|
|
*/
|
|
|
const topUpDone = () => {
|
|
|
currentCurrencyInfo.value = tempCurrentCurrencyInfo.value;
|
|
|
- asyncIng.value = true;
|
|
|
- asyncIng.value = false;
|
|
|
showCurrencyPop.value = false;
|
|
|
showCurrencySelect.value = false;
|
|
|
showComType.value = 'default';
|
|
|
- onIptSetErrorTxt()
|
|
|
-
|
|
|
+ onIptSetErrorTxt();
|
|
|
asyncTokenRechRecord((res) => {
|
|
|
if(res.code == 0 && res.data && res.data.length) {
|
|
|
let currencyInfo = res.data[0];
|
|
@@ -1109,12 +1035,19 @@ const updateCurrencyBanlce = () => {
|
|
|
* 同步链上交易
|
|
|
*/
|
|
|
const asyncTokenRechRecord = (cb) => {
|
|
|
+ if(asyncIng.value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ asyncIng.value = true;
|
|
|
syncChainTokenRechargeRecord({
|
|
|
params: {
|
|
|
currencyCode: currentCurrencyInfo.value.currencyCode
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ asyncIng.value = false;
|
|
|
cb && cb(res)
|
|
|
+ }).catch((err) => {
|
|
|
+ asyncIng.value = false;
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -1135,12 +1068,12 @@ const submitRequest = async () => {
|
|
|
for (let i = 0; i < formList.length; i++) {
|
|
|
let item = {};
|
|
|
item.type = formList[i]["type"];
|
|
|
- if (item.type == 1 && atUserList.value.length) {
|
|
|
+ if (item.type == TaskType.twitterFollow && atUserList.value.length) {
|
|
|
// follow 参数
|
|
|
let relatedUsers = atUserList.value.filter(item => item.name);
|
|
|
item.relatedUsers = relatedUsers;
|
|
|
finishConditions.push(item);
|
|
|
- } else if (formList[i]["type"] == 7) {
|
|
|
+ } else if (formList[i]["type"] == TaskType.joinDiscord) {
|
|
|
// join discord
|
|
|
if(formList[i]["checked"] && formList[i]["text"]) {
|
|
|
item.bizData = JSON.stringify({inviteUrl: formList[i]["text"]});
|
|
@@ -1269,7 +1202,7 @@ const initParams = () => {
|
|
|
};
|
|
|
|
|
|
const setDiscordIptTxt = ({text}) => {
|
|
|
- const index = formList.findIndex(item => item.type == 7);
|
|
|
+ const index = formList.findIndex(item => item.type == TaskType.joinDiscord);
|
|
|
formList[index]['text'] = text;
|
|
|
}
|
|
|
|
|
@@ -1379,21 +1312,19 @@ const onCountInput = () => {
|
|
|
};
|
|
|
|
|
|
const onValidityDurationInput = () => {
|
|
|
- let val = baseFormData.validityDuration;
|
|
|
-
|
|
|
- if (val == 0) {
|
|
|
- val = "";
|
|
|
- } else if(val > lotteryMaxHourDuration) {
|
|
|
- val = lotteryMaxHourDuration+'';
|
|
|
- }
|
|
|
- val = val.replace(/[^\d]/g, "");
|
|
|
- baseFormData.validityDuration = val;
|
|
|
-
|
|
|
- setInputErrorMsg();
|
|
|
+ validityDurationHandler()
|
|
|
+ let val = setInputErrorMsg();
|
|
|
return val;
|
|
|
}
|
|
|
|
|
|
const onValidityDurationBlur = () => {
|
|
|
+ validityDurationHandler();
|
|
|
+ let val = setInputErrorMsg();
|
|
|
+ return val;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const validityDurationHandler = () => {
|
|
|
let val = baseFormData.validityDuration;
|
|
|
if (val == 0) {
|
|
|
val = "";
|
|
@@ -1403,7 +1334,6 @@ const onValidityDurationBlur = () => {
|
|
|
val = val.replace(/[^\d]/g, "");
|
|
|
baseFormData.validityDuration = val;
|
|
|
|
|
|
- setInputErrorMsg();
|
|
|
return val;
|
|
|
}
|
|
|
|
|
@@ -1468,7 +1398,7 @@ const onIptSetErrorTxt = (params = {}) => {
|
|
|
if (!res.flag) {
|
|
|
iptErrMsgTxt.value = `${baseFormData.amountValue} ${currentCurrencyInfo.value.tokenSymbol} Can send up to ${res.count} winners`;
|
|
|
} else {
|
|
|
- if(baseFormData.type == 2 && !baseFormData.validityDuration) {
|
|
|
+ if(baseFormData.type == PlayType.lottery && !baseFormData.validityDuration) {
|
|
|
iptErrMsgTxt.value = "Enter Automatically Draw";
|
|
|
} else {
|
|
|
//清空错误提示
|
|
@@ -1478,7 +1408,7 @@ const onIptSetErrorTxt = (params = {}) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } else if(baseFormData.type == 2 && !baseFormData.validityDuration) {
|
|
|
+ } else if(baseFormData.type == PlayType.lottery && !baseFormData.validityDuration) {
|
|
|
// 抽奖模式 没有输入时长
|
|
|
iptErrMsgTxt.value = "Enter Automatically Draw";
|
|
|
} else {
|
|
@@ -1496,7 +1426,7 @@ const formSwitchChange = (val, params, index) => {
|
|
|
}
|
|
|
|
|
|
const closeDiscordTask = (val, params, index) => {
|
|
|
- if(params.type == 7) {
|
|
|
+ if(params.type == TaskType.joinDiscord) {
|
|
|
if(!val) {
|
|
|
//错误类型 discord 清空discord错误校验
|
|
|
if(iptErrType == 'discord') {
|
|
@@ -1531,7 +1461,7 @@ const onBlurDiscordAddress = (e, index) => {
|
|
|
|
|
|
|
|
|
const getDiscordIptData = () => {
|
|
|
- let discordItem = formList.find(item => item.type == 7);
|
|
|
+ let discordItem = formList.find(item => item.type == TaskType.joinDiscord);
|
|
|
return discordItem;
|
|
|
}
|
|
|
|
|
@@ -2510,117 +2440,6 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.preview {
|
|
|
- padding: 30px 40px;
|
|
|
- height: calc(100% - 80px);
|
|
|
- overflow-y: auto;
|
|
|
- .card {
|
|
|
- float: left;
|
|
|
- width: 480px;
|
|
|
- position: relative;
|
|
|
- .flash {
|
|
|
- overflow: hidden;
|
|
|
- height: 600px;
|
|
|
- border-radius: 26px;
|
|
|
- border: solid 1px #ECECEC;
|
|
|
- }
|
|
|
- &.center {
|
|
|
- margin-left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- }
|
|
|
- }
|
|
|
- .card-title {
|
|
|
- height: 32px;
|
|
|
- .img {
|
|
|
- float: left;
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- margin-right: 8px;
|
|
|
- }
|
|
|
- .font {
|
|
|
- float: left;
|
|
|
- font-size: 17px;
|
|
|
- font-weight: 500;
|
|
|
- span {
|
|
|
- color: #0091e9;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .card-content {
|
|
|
- float: right;
|
|
|
- width: 500px;
|
|
|
- }
|
|
|
- .card-amount {
|
|
|
- overflow: hidden;
|
|
|
- display: flex;
|
|
|
- height: 80px;
|
|
|
- align-items: center;
|
|
|
- padding: 20px;
|
|
|
- border-radius: 20px;
|
|
|
- border: 1px solid #E6E6E6;
|
|
|
- .icon {
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- }
|
|
|
- .con {
|
|
|
- flex: 1;
|
|
|
- padding: 0 10px;
|
|
|
- .desc {
|
|
|
- color: rgba($color: #000000, $alpha: 0.5);
|
|
|
- font-size: 12px;
|
|
|
- margin-bottom: 4px;
|
|
|
- }
|
|
|
- .price {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- word-break: break-all;
|
|
|
- }
|
|
|
- }
|
|
|
- .refresh {
|
|
|
- cursor: pointer;
|
|
|
- width: 30px;
|
|
|
- height: 30px;
|
|
|
- margin-top: -5px;
|
|
|
- }
|
|
|
- }
|
|
|
- .card-list {
|
|
|
- padding: 10px 20px;
|
|
|
- border-radius: 20px;
|
|
|
- border: 1px solid #E6E6E6;
|
|
|
- .item {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- height: 47px;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 500;
|
|
|
- box-shadow: inset 0px -1px 0px #EAEAEA;
|
|
|
-
|
|
|
- .order-amount {
|
|
|
- font-weight: 600;
|
|
|
- font-size: 20px;
|
|
|
- }
|
|
|
-
|
|
|
- .txt {
|
|
|
- font-weight: 500;
|
|
|
- font-size: 16px;
|
|
|
- color: #9A9A9A;
|
|
|
- }
|
|
|
-
|
|
|
- .deposit-amount {
|
|
|
- font-weight: 600;
|
|
|
- font-size: 20px;
|
|
|
- color: #1D9BF0;
|
|
|
- }
|
|
|
- }
|
|
|
- .item:last-child {
|
|
|
- box-shadow: none;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
.icon-refresh-rotate {
|
|
|
transform: rotate(360deg);
|
|
|
transition-duration: 1s;
|