|
@@ -34,7 +34,7 @@
|
|
|
</div>
|
|
|
<!-- 标题 -->
|
|
|
<div class="title">
|
|
|
- {{publishType.value == 'REDPACKET' ? currentComData[showComType]["title"] : 'Tool Box' }}
|
|
|
+ {{publishType == 'REDPACKET' ? currentComData[showComType]["title"] : 'Tool Box' }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
@@ -58,13 +58,25 @@
|
|
|
<!-- 内容 -->
|
|
|
<div class="body">
|
|
|
<!-- 充值组件 -->
|
|
|
- <top-up v-if="showComType == 'topUp'"
|
|
|
+ <top-up
|
|
|
+ v-if="showComType == 'topUp'"
|
|
|
:asyncIng="asyncIng"
|
|
|
:currentCurrencyInfo="tempCurrentCurrencyInfo"
|
|
|
- @topUpDone="topUpDone"></top-up>
|
|
|
+ @topUpDone="topUpDone">
|
|
|
+ </top-up>
|
|
|
+
|
|
|
+ <!-- 自定义红包封面 -->
|
|
|
+ <giveaway-poster
|
|
|
+ v-else-if="showComType == 'poster'"
|
|
|
+ :baseFormData="baseFormData"
|
|
|
+ :currentCurrencyInfo="currentCurrencyInfo"
|
|
|
+ :customPosterInfo="customPosterInfo"
|
|
|
+ @selectImage="selectImage"
|
|
|
+ @confirmData="confirmData">
|
|
|
+ </giveaway-poster>
|
|
|
|
|
|
<!-- 表单填写容器 -->
|
|
|
- <div class="body-content" v-if="showComType != 'topUp'">
|
|
|
+ <div class="body-content" v-else>
|
|
|
|
|
|
<!-- 货币列表 -->
|
|
|
<div class="currency-pop" v-show="showCurrencyPop">
|
|
@@ -105,279 +117,310 @@
|
|
|
@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">
|
|
|
- <img class="icon" :src="require('@/assets/svg/icon-reward-v2.svg')"/>
|
|
|
- Reward
|
|
|
+ <div class="form-wrapper" v-if="showComType == 'default'">
|
|
|
+ <div class="form-cell-item base-form-wrapper">
|
|
|
+ <div class="title">
|
|
|
+ <img class="icon" :src="require('@/assets/svg/icon-reward-v2.svg')"/>
|
|
|
+ Reward
|
|
|
+ </div>
|
|
|
+ <div class="form-cell-content">
|
|
|
+ <div class="select-mode-ele">
|
|
|
+ <img v-for="(item, index) in publishModeList"
|
|
|
+ :key="index"
|
|
|
+ :src="selectModeInfo.index == index ? item.imgActive : item.imgInActive"
|
|
|
+ @click="selectPublishMode(item, index)">
|
|
|
</div>
|
|
|
- <div class="form-cell-content">
|
|
|
- <div class="select-mode-ele">
|
|
|
- <img v-for="(item, index) in publishModeList"
|
|
|
- :key="index"
|
|
|
- :src="selectModeInfo.index == index ? item.imgActive : item.imgInActive"
|
|
|
- @click="selectPublishMode(item, index)">
|
|
|
- </div>
|
|
|
- <!-- 金额、数量 -->
|
|
|
- <div class="form-base">
|
|
|
- <div class="item currency-select-wrapper">
|
|
|
- <div>
|
|
|
- <div class="label currency-select"
|
|
|
- :class="{'selected': currentCurrencyInfo.currencyCode}"
|
|
|
- @click="selectCurrencyPopHandle">
|
|
|
- <img class="icon"
|
|
|
- v-if="currentCurrencyInfo.iconPath"
|
|
|
- :src="currentCurrencyInfo.iconPath"/>
|
|
|
- <div class="text">
|
|
|
- {{currentCurrencyInfo.currencyCode == 'USD' ? 'USD' : currentCurrencyInfo.tokenSymbol || 'Select a reward'}}
|
|
|
- </div>
|
|
|
- <img class="arrow"
|
|
|
- :src="currentCurrencyInfo.currencyCode ?
|
|
|
- require('@/assets/svg/icon-form-arrow-down.svg') : require('@/assets/svg/icon-form-white-arrow-down.svg')"/>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 刷新按钮、充值 -->
|
|
|
- <div class="currency-operation"
|
|
|
- v-if="currentCurrencyInfo.currencyCode">
|
|
|
- <div class="amount">
|
|
|
- Balance:
|
|
|
- <a-tooltip :title="currentCurrencyInfo.balance">
|
|
|
- {{ getBit(currentCurrencyInfo.balance) }}
|
|
|
- </a-tooltip>
|
|
|
- <img :class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
|
- :src="require('@/assets/svg/icon-form-refresh.svg')"
|
|
|
- @click="updateCurrencyBanlce"/>
|
|
|
- </div>
|
|
|
- <div v-if="currentCurrencyInfo.currencyCode != 'USD'"
|
|
|
- class="top-up"
|
|
|
- @click="goTopUp">Deposit</div>
|
|
|
+ <!-- 金额、数量 -->
|
|
|
+ <div class="form-base">
|
|
|
+ <div class="item currency-select-wrapper">
|
|
|
+ <div>
|
|
|
+ <div class="label currency-select"
|
|
|
+ :class="{'selected': currentCurrencyInfo.currencyCode}"
|
|
|
+ @click="selectCurrencyPopHandle">
|
|
|
+ <img class="icon"
|
|
|
+ v-if="currentCurrencyInfo.iconPath"
|
|
|
+ :src="currentCurrencyInfo.iconPath"/>
|
|
|
+ <div class="text">
|
|
|
+ {{currentCurrencyInfo.currencyCode == 'USD' ? 'USD' : currentCurrencyInfo.tokenSymbol || 'Select a reward'}}
|
|
|
</div>
|
|
|
+ <img class="arrow"
|
|
|
+ :src="currentCurrencyInfo.currencyCode ?
|
|
|
+ require('@/assets/svg/icon-form-arrow-down.svg') : require('@/assets/svg/icon-form-white-arrow-down.svg')"/>
|
|
|
</div>
|
|
|
|
|
|
- <input v-model="baseFormData.amountValue"
|
|
|
- placeholder="0"
|
|
|
- autofocus
|
|
|
- @input="onAmountInput"
|
|
|
- @blur="onAmountBlur"/>
|
|
|
- </div>
|
|
|
- <div class="item winners-count-input">
|
|
|
- <div>
|
|
|
- <div class="label">
|
|
|
- <img class="icon"
|
|
|
- :src="require('@/assets/svg/icon-winner-v2.svg')"/>
|
|
|
- Winner Count
|
|
|
+ <!-- 刷新按钮、充值 -->
|
|
|
+ <div class="currency-operation"
|
|
|
+ v-if="currentCurrencyInfo.currencyCode">
|
|
|
+ <div class="amount">
|
|
|
+ Balance:
|
|
|
+ <a-tooltip :title="currentCurrencyInfo.balance">
|
|
|
+ {{ getBit(currentCurrencyInfo.balance) }}
|
|
|
+ </a-tooltip>
|
|
|
+ <img :class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
|
+ :src="require('@/assets/svg/icon-form-refresh.svg')"
|
|
|
+ @click="updateCurrencyBanlce"/>
|
|
|
</div>
|
|
|
- <div class="msg" v-show="selectModeInfo.type == 1">Recommend Winners 100~10000</div>
|
|
|
+ <div v-if="currentCurrencyInfo.currencyCode != 'USD'"
|
|
|
+ class="top-up"
|
|
|
+ @click="goTopUp">Deposit</div>
|
|
|
</div>
|
|
|
- <input v-model="baseFormData.totalCount"
|
|
|
- placeholder="0"
|
|
|
- @input="onCountInput"
|
|
|
- @blur="onCountBlur"/>
|
|
|
</div>
|
|
|
- <div class="item automatically-input" v-if="selectModeInfo.type == 2">
|
|
|
+
|
|
|
+ <input v-model="baseFormData.amountValue"
|
|
|
+ placeholder="0"
|
|
|
+ autofocus
|
|
|
+ @input="onAmountInput"
|
|
|
+ @blur="onAmountBlur"/>
|
|
|
+ </div>
|
|
|
+ <div class="item winners-count-input">
|
|
|
+ <div>
|
|
|
<div class="label">
|
|
|
<img class="icon"
|
|
|
- :src="require('@/assets/svg/icon-automatically.svg')"/>
|
|
|
- Automatically Draw in
|
|
|
- </div>
|
|
|
- <div class="input-wrapper">
|
|
|
- <input v-model="baseFormData.validityDuration"
|
|
|
- placeholder="0"
|
|
|
- @input="onValidityDurationInput"
|
|
|
- @blur="onValidityDurationBlur"/>
|
|
|
- <span class="unit">h</span>
|
|
|
+ :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>
|
|
|
+ <input v-model="baseFormData.totalCount"
|
|
|
+ placeholder="0"
|
|
|
+ @input="onCountInput"
|
|
|
+ @blur="onCountBlur"/>
|
|
|
+ </div>
|
|
|
+ <div class="item automatically-input" v-if="selectModeInfo.type == 2">
|
|
|
+ <div class="label">
|
|
|
+ <img class="icon"
|
|
|
+ :src="require('@/assets/svg/icon-automatically.svg')"/>
|
|
|
+ Automatically Draw in
|
|
|
+ </div>
|
|
|
+ <div class="input-wrapper">
|
|
|
+ <input v-model="baseFormData.validityDuration"
|
|
|
+ placeholder="0"
|
|
|
+ @input="onValidityDurationInput"
|
|
|
+ @blur="onValidityDurationBlur"/>
|
|
|
+ <span class="unit">h</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 提示 -->
|
|
|
- <ul class="tips-wrapper">
|
|
|
- <li class="row">
|
|
|
- Rewards can only be claimed after the target user completes all tasks you set.
|
|
|
- </li>
|
|
|
- <li class="row">
|
|
|
- Each user can only receive a reward once per task.
|
|
|
- </li>
|
|
|
- <li class="row" v-show="selectModeInfo.type == 1">
|
|
|
- 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>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="form-cell-item task-wrapper">
|
|
|
- <div class="title">
|
|
|
- <img class="icon" :src="require('@/assets/svg/icon-tasks-v2.svg')"/>
|
|
|
- Tasks
|
|
|
</div>
|
|
|
- <div class="form-cell-content form-require">
|
|
|
- <!-- 转推、like、关注 -->
|
|
|
- <div v-for="(item, index) in formList"
|
|
|
- :key="index">
|
|
|
- <div v-if="item.show" class="form-item"
|
|
|
- :class="{ 'border-hide': formList.length - 1 == index }">
|
|
|
- <div class="item-left">
|
|
|
- <div class="label">
|
|
|
- <img class="icon" :src="item.icon"/>
|
|
|
- {{ item.label }}
|
|
|
- </div>
|
|
|
- <div class="control"
|
|
|
- v-if="item.nodeType == 'textarea'">
|
|
|
- <follow-input
|
|
|
- :isAddSelf="!isBack"
|
|
|
- :atUserList="atUserList"
|
|
|
- @addUser="addFollowUser"
|
|
|
- @setUser="setFollowUser"
|
|
|
- @delUser="delFollowUser"></follow-input>
|
|
|
- </div>
|
|
|
- <div class="control"
|
|
|
- v-if="item.nodeType == 'input'">
|
|
|
- <div v-if="showDiscordInvitePop"
|
|
|
- class="discord-invite-info"
|
|
|
- @click="showDiscordInvitePop = false">
|
|
|
- <img class="icon" :src="discordInviteInfo.icon || require('@/assets/svg/icon-discord-mini.svg')" />
|
|
|
- <span class="name">{{discordInviteInfo.name}}</span>
|
|
|
- </div>
|
|
|
- <input v-model="item.text"
|
|
|
- placeholder="Enter discord invite link"
|
|
|
- class="discord-address"
|
|
|
- @input="onIptDiscordAddress($event, index)"
|
|
|
- @blur="onBlurDiscordAddress($event, index)" />
|
|
|
- </div>
|
|
|
+ <div class="giveaway-poster" @click="customCoverImg">
|
|
|
+ <div class="show-img">
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ 'zoom': 55 / 500,
|
|
|
+ 'position': 'absolute',
|
|
|
+ 'width': '345px',
|
|
|
+ }">
|
|
|
+ <custom-card-cover
|
|
|
+ :data="{
|
|
|
+ totalCount: baseFormData.totalCount,
|
|
|
+ amountValue: baseFormData.amountValue,
|
|
|
+ tokenSymbol: currentCurrencyInfo.tokenSymbol,
|
|
|
+ currencyIconUrl: currentCurrencyInfo.iconPath,
|
|
|
+ type: baseFormData.type,
|
|
|
+ validityDuration: baseFormData.validityDuration,
|
|
|
+ customPosterUrl: customPosterData && customPosterData.after && customPosterData.after.imagePath || '',
|
|
|
+ }">
|
|
|
+ </custom-card-cover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="show-font">
|
|
|
+ <span>Giveaway Poster</span>
|
|
|
+ <img class="new" v-if="customShowNewImage" :src=" require('@/assets/svg/img-new.svg') " />
|
|
|
+ </div>
|
|
|
+ <div class="show-placeholder">Replace</div>
|
|
|
+ <div class="arrow">
|
|
|
+ <img :src=" require('@/assets/svg/icon-cell-arrow-right.svg') " />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 提示 -->
|
|
|
+ <ul class="tips-wrapper">
|
|
|
+ <li class="row" style="white-space:nowrap;">
|
|
|
+ Rewards can only be claimed after the target user completes all tasks you set.
|
|
|
+ </li>
|
|
|
+ <li class="row">
|
|
|
+ Each user can only receive a reward once per task.
|
|
|
+ </li>
|
|
|
+ <li class="row" v-show="selectModeInfo.type == 1">
|
|
|
+ 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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-cell-item task-wrapper">
|
|
|
+ <div class="title">
|
|
|
+ <img class="icon" :src="require('@/assets/svg/icon-tasks-v2.svg')"/>
|
|
|
+ Tasks
|
|
|
+ </div>
|
|
|
+ <div class="form-cell-content form-require">
|
|
|
+ <!-- 转推、like、关注 -->
|
|
|
+ <div v-for="(item, index) in formList"
|
|
|
+ :key="index">
|
|
|
+ <div v-if="item.show" class="form-item"
|
|
|
+ :class="{ 'border-hide': formList.length - 1 == index }">
|
|
|
+ <div class="item-left">
|
|
|
+ <div class="label">
|
|
|
+ <img class="icon" :src="item.icon"/>
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
-
|
|
|
- <div>
|
|
|
- <a-switch
|
|
|
- v-if="item.type > 3"
|
|
|
- v-model:checked="item.checked"
|
|
|
- @change="formSwitchChange($event, item, index)"/>
|
|
|
+ <div class="control"
|
|
|
+ v-if="item.nodeType == 'textarea'">
|
|
|
+ <follow-input
|
|
|
+ :isAddSelf="!isBack"
|
|
|
+ :atUserList="atUserList"
|
|
|
+ @addUser="addFollowUser"
|
|
|
+ @setUser="setFollowUser"
|
|
|
+ @delUser="delFollowUser"></follow-input>
|
|
|
</div>
|
|
|
+ <div class="control"
|
|
|
+ v-if="item.nodeType == 'input'">
|
|
|
+ <div v-if="showDiscordInvitePop"
|
|
|
+ class="discord-invite-info"
|
|
|
+ @click="showDiscordInvitePop = false">
|
|
|
+ <img class="icon" :src="discordInviteInfo.icon || require('@/assets/svg/icon-discord-mini.svg')" />
|
|
|
+ <span class="name">{{discordInviteInfo.name}}</span>
|
|
|
+ </div>
|
|
|
+ <input v-model="item.text"
|
|
|
+ placeholder="Enter discord invite link"
|
|
|
+ class="discord-address"
|
|
|
+ @input="onIptDiscordAddress($event, index)"
|
|
|
+ @blur="onBlurDiscordAddress($event, index)" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a-switch
|
|
|
+ v-if="item.type > 3"
|
|
|
+ v-model:checked="item.checked"
|
|
|
+ @change="formSwitchChange($event, item, index)"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="submit-btn-wrapper">
|
|
|
- <div class="submit-btn"
|
|
|
- :class="{ 'disabled-submit': iptErrMsgTxt != ''}"
|
|
|
- @click="confirm">
|
|
|
- <img class="icon-loading"
|
|
|
- v-if="submitIng"
|
|
|
- :src="require('@/assets/svg/icon-btn-loading.svg')"
|
|
|
- />
|
|
|
- {{iptErrMsgTxt ? iptErrMsgTxt : 'NEXT'}}
|
|
|
- </div>
|
|
|
+ <div class="submit-btn-wrapper">
|
|
|
+ <div class="submit-btn"
|
|
|
+ :class="{ 'disabled-submit': iptErrMsgTxt != ''}"
|
|
|
+ @click="confirm">
|
|
|
+ <img class="icon-loading"
|
|
|
+ v-if="submitIng"
|
|
|
+ :src="require('@/assets/svg/icon-btn-loading.svg')"
|
|
|
+ />
|
|
|
+ {{iptErrMsgTxt ? iptErrMsgTxt : 'NEXT'}}
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- 预览 -->
|
|
|
- <template v-else-if="showComType == 'preview'">
|
|
|
- <div class="preview">
|
|
|
- <div class="card"
|
|
|
- :class="{ center: Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
|
|
|
- <div class="card-title">
|
|
|
- <img class="img"
|
|
|
- v-if="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"
|
|
|
- ></preview-card>
|
|
|
+ <!-- 预览 -->
|
|
|
+ <template v-else-if="showComType == 'preview'">
|
|
|
+ <div class="preview">
|
|
|
+ <div class="card"
|
|
|
+ :class="{ center: Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
|
|
|
+ <div class="card-title">
|
|
|
+ <img class="img"
|
|
|
+ v-if="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="card-content" v-if="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"></div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Balance</div>
|
|
|
- <div class="r"></div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Paypal charges fee ()</div>
|
|
|
- <div class="r"></div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <div class="l">Deposit Amount</div>
|
|
|
- <div class="r"></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="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"></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 class="item">
|
|
|
+ <div class="l">Balance</div>
|
|
|
+ <div class="r"></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 class="item">
|
|
|
+ <div class="l">Paypal charges fee ()</div>
|
|
|
+ <div class="r"></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 class="item">
|
|
|
+ <div class="l">Deposit Amount</div>
|
|
|
+ <div class="r"></div>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <!-- paypal支付按钮 -->
|
|
|
- <div class="payment" v-show="showComType == 'preview'">
|
|
|
- <paypal-button
|
|
|
- :finalAmountData="finalAmountData"
|
|
|
- :payConfig="{
|
|
|
- paypalClientId,
|
|
|
- feeDesc: payConfig.feeDesc,
|
|
|
- paypalHtml,
|
|
|
- amount: baseFormData.amountValue,
|
|
|
- postId
|
|
|
- }"
|
|
|
- :currentCurrencyInfo="currentCurrencyInfo"
|
|
|
- @payPalFinsh="payPalFinsh">
|
|
|
- <template v-slot:balance>
|
|
|
- <div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance)">
|
|
|
+ </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"
|
|
|
+ <img
|
|
|
+ class="refresh"
|
|
|
:class="{ 'icon-refresh-rotate': refreshRotate }"
|
|
|
- :src=" require('@/assets/svg/icon-form-refresh.svg')"
|
|
|
- @click="updateCurrencyBanlce"/>
|
|
|
+ @click="updateCurrencyBanlce"
|
|
|
+ :src=" require('@/assets/svg/icon-form-refresh-blue.svg') "
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
- </paypal-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <!-- paypal支付按钮 -->
|
|
|
+ <div class="payment" v-show="showComType == 'preview'">
|
|
|
+ <paypal-button
|
|
|
+ :finalAmountData="finalAmountData"
|
|
|
+ :payConfig="{
|
|
|
+ paypalClientId,
|
|
|
+ feeDesc: payConfig.feeDesc,
|
|
|
+ paypalHtml,
|
|
|
+ amount: baseFormData.amountValue,
|
|
|
+ postId
|
|
|
+ }"
|
|
|
+ :currentCurrencyInfo="currentCurrencyInfo"
|
|
|
+ @payPalFinsh="payPalFinsh">
|
|
|
+ <template v-slot:balance>
|
|
|
+ <div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance)">
|
|
|
+ <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 }"
|
|
|
+ :src=" require('@/assets/svg/icon-form-refresh.svg')"
|
|
|
+ @click="updateCurrencyBanlce"/>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </paypal-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -391,25 +434,59 @@
|
|
|
@cancel="messageBoxCancel"
|
|
|
@confirm="messageBoxConfirm"
|
|
|
></message-box>
|
|
|
+
|
|
|
+ <!-- 裁剪 -->
|
|
|
+ <div class="dialog" v-if="cropperDialog">
|
|
|
+ <div class="corp-title">
|
|
|
+ <img class="back" :src="require('@/assets/svg/icon-back.svg')" @click="hiddenDialog" />
|
|
|
+ <span>Crop</span>
|
|
|
+ </div>
|
|
|
+ <div class="corp-content">
|
|
|
+ <vue-cropper
|
|
|
+ ref="refCropper"
|
|
|
+ :img="cropperOption.img"
|
|
|
+ :output-type="cropperOption.outputType"
|
|
|
+ :infoTrue="cropperOption.infoTrue"
|
|
|
+ :full="cropperOption.full"
|
|
|
+ :fixed="cropperOption.fixed"
|
|
|
+ :fixed-number="cropperOption.fixedNumber"
|
|
|
+ :auto-crop="cropperOption.autoCrop"
|
|
|
+ :auto-crop-width="cropperOption.autoCropWidth"
|
|
|
+ :auto-crop-height="cropperOption.autoCropHeight"
|
|
|
+ :center-box="cropperOption.centerBox"
|
|
|
+ :high="cropperOption.high"
|
|
|
+ :max-img-size="cropperOption.max">
|
|
|
+ </vue-cropper>
|
|
|
+ </div>
|
|
|
+ <div class="corp-footer">
|
|
|
+ <button v-if="cropperLoading" class="confirm disable">
|
|
|
+ <img :src=" require('@/assets/svg/icon-btn-loading.svg') " />
|
|
|
+ <span>Confirm</span>
|
|
|
+ </button>
|
|
|
+ <button v-else class="confirm" @click="confirmImage">Confirm</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-mask" v-if="cropperDialog"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide } from "vue";
|
|
|
+import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide, getCurrentInstance } from "vue";
|
|
|
import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
import { getInviteGuildInfo, getInviteGuildInfoByOpenApi, saveInviteGuildInfo } from "@/http/discordApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
|
import { getFrontConfig } from "@/http/account";
|
|
|
+import { uploadSignature, uploadFile } from '@/http/media';
|
|
|
import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
|
import { debounce, getBit } from "@/uilts/help"
|
|
|
import Report from "@/log-center/log"
|
|
|
import { ElMessage, ElLoading } from "element-plus";
|
|
|
import "element-plus/es/components/message/style/css";
|
|
|
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 GlobalTip from '@/view/components/global-tip.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";
|
|
@@ -419,6 +496,11 @@ 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();
|
|
|
|
|
|
const config = {
|
|
|
number: 'BigNumber',
|
|
@@ -450,6 +532,28 @@ let dialogStyle = reactive({
|
|
|
dialogContentWidth: 1100
|
|
|
})
|
|
|
|
|
|
+let cropperOption = ref({
|
|
|
+ img: '',
|
|
|
+ full: true,
|
|
|
+ infoTrue: true,
|
|
|
+ fixed: true,
|
|
|
+ fixedNumber: [16, 8.396],
|
|
|
+ outputType: 'png',
|
|
|
+ autoCrop: true,
|
|
|
+ autoCropWidth: 99999,
|
|
|
+ autoCropHeight: 99999,
|
|
|
+ centerBox: true,
|
|
|
+ high: true,
|
|
|
+ max: 99999,
|
|
|
+})
|
|
|
+let cropperDialog = ref(false)
|
|
|
+let cropperLoading = ref(false)
|
|
|
+let cropperType = ref('before')
|
|
|
+let customPosterInfo = ref({})
|
|
|
+let customPosterData = ref({})
|
|
|
+let customShowNewImage = ref(false)
|
|
|
+let refCropper = ref('')
|
|
|
+
|
|
|
// 当前展示组件内容 default(表单) preview(预览) topUp(充值)
|
|
|
let showComType = ref("default");
|
|
|
let currentComData = {
|
|
@@ -462,6 +566,9 @@ let currentComData = {
|
|
|
topUp: {
|
|
|
title: "Deposit",
|
|
|
},
|
|
|
+ poster: {
|
|
|
+ title: "Giveaway Poster",
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 机器人开关
|
|
@@ -903,6 +1010,19 @@ const goTopUp = () => {
|
|
|
showComType.value = 'topUp';
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 自定义封面
|
|
|
+ */
|
|
|
+const customCoverImg = () => {
|
|
|
+ customPosterInfo.value = {}
|
|
|
+ if (Object.keys(customPosterData.value).length > 0) {
|
|
|
+ customPosterInfo.value = customPosterData.value;
|
|
|
+ }
|
|
|
+ showComType.value = 'poster';
|
|
|
+ customShowNewImage.value = false;
|
|
|
+ setChromeStorage({ custom_poster_guide: Date.now() });
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 充值done事件
|
|
|
*/
|
|
@@ -1008,10 +1128,22 @@ const submitRequest = async () => {
|
|
|
receiveConditions,
|
|
|
payAmountValue: amountValue,
|
|
|
type: baseFormData.type,
|
|
|
+ posterType: 1,
|
|
|
validityDuration
|
|
|
};
|
|
|
submitIng.value = true;
|
|
|
|
|
|
+ // 自定义封面
|
|
|
+ if (Object.keys(customPosterData.value).length > 0) {
|
|
|
+ formData['posterType'] = 2;
|
|
|
+ if (customPosterData.value && customPosterData.value.after) {
|
|
|
+ formData['customPosterInstalled'] = customPosterData.value.after.objectKey || ''
|
|
|
+ }
|
|
|
+ if (customPosterData.value && customPosterData.value.before) {
|
|
|
+ formData['customPosterUninstalled'] = customPosterData.value.before.objectKey || ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 法币支付需要计算费率
|
|
|
if(formData.amountCurrencyCode == "USD") {
|
|
|
let payAmountRes = await getPayAmount(amountValue);
|
|
@@ -1076,6 +1208,8 @@ const initParams = () => {
|
|
|
setDiscordIptTxt({text: ''});
|
|
|
|
|
|
discordInviteInfo.value = {};
|
|
|
+ customPosterInfo.value = {};
|
|
|
+ customPosterData.value = {};
|
|
|
};
|
|
|
|
|
|
const setDiscordIptTxt = ({text}) => {
|
|
@@ -1671,6 +1805,81 @@ const toolBoxPublishFinish = (params) => {
|
|
|
emits("postPublishFinish", { publishRes: params.publishRes });
|
|
|
}
|
|
|
|
|
|
+// 截图相关
|
|
|
+const showDialog = () => {
|
|
|
+ cropperDialog.value = true;
|
|
|
+}
|
|
|
+const hiddenDialog = () => {
|
|
|
+ cropperDialog.value = false;
|
|
|
+ cropperLoading.value = false;
|
|
|
+}
|
|
|
+const selectImage = (option) => {
|
|
|
+ // 设置图片
|
|
|
+ cropperOption.value.img = option.file
|
|
|
+ // 选取比例
|
|
|
+ if (option && option.type && option.type == 2) {
|
|
|
+ cropperType.value = 'after';
|
|
|
+ cropperOption.value.fixedNumber = [1, 1];
|
|
|
+ } else {
|
|
|
+ cropperType.value = 'before';
|
|
|
+ cropperOption.value.fixedNumber = [16, 8.396];
|
|
|
+ }
|
|
|
+ nextTick(() => {
|
|
|
+ showDialog()
|
|
|
+ })
|
|
|
+}
|
|
|
+const confirmImage = () => {
|
|
|
+ let contentType = 'image/png';
|
|
|
+ cropperLoading.value = true;
|
|
|
+
|
|
|
+ if (refCropper.value) {
|
|
|
+ refCropper.value.getCropBlob(imgData => {
|
|
|
+ uploadSignature({
|
|
|
+ params: {
|
|
|
+ bizType: 1,
|
|
|
+ fileType: 1,
|
|
|
+ contentType: contentType,
|
|
|
+ fileSuffix: 'png',
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ let { code, data } = res;
|
|
|
+ if (code === 0) {
|
|
|
+ let reader = new FileReader()
|
|
|
+ reader.readAsArrayBuffer(imgData)
|
|
|
+ reader.onload = function(e) {
|
|
|
+ let execFile = e.target.result;
|
|
|
+ uploadFile({
|
|
|
+ url: data.url,
|
|
|
+ data: new Blob([execFile]),
|
|
|
+ headers: {
|
|
|
+ 'Authorization': data.authorization,
|
|
|
+ 'x-amz-date': data.date,
|
|
|
+ 'Content-Type': contentType
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ let { status } = res
|
|
|
+ if (status == 200) {
|
|
|
+ successImage(data)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ cropperLoading.value = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+const successImage = (data) => {
|
|
|
+ hiddenDialog()
|
|
|
+ // setPosterInfo
|
|
|
+ customPosterInfo.value[cropperType.value] = data;
|
|
|
+}
|
|
|
+const confirmData = (data) => {
|
|
|
+ close()
|
|
|
+ customPosterData.value = customPosterInfo.value;
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
setFrontConfig();
|
|
|
setPayConfig();
|
|
@@ -1678,6 +1887,12 @@ onMounted(() => {
|
|
|
window.addEventListener('resize', function () {
|
|
|
setDialogStyle(true);
|
|
|
})
|
|
|
+ // showNewImage
|
|
|
+ getChromeStorage('custom_poster_guide', (info) => {
|
|
|
+ if (!info) {
|
|
|
+ customShowNewImage.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -1944,11 +2159,11 @@ onMounted(() => {
|
|
|
img {
|
|
|
-webkit-user-drag: none;
|
|
|
width: 220px;
|
|
|
- height: 160px;
|
|
|
+ height: 90px;
|
|
|
}
|
|
|
}
|
|
|
.form-base {
|
|
|
- margin-top: 14px;
|
|
|
+ margin-top: 20px;
|
|
|
border: 1px solid #D1D9DD;
|
|
|
border-radius: 14px;
|
|
|
box-sizing: border-box;
|
|
@@ -2189,7 +2404,48 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ .giveaway-poster {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: row;
|
|
|
+ cursor: pointer;
|
|
|
+ height: 84px;
|
|
|
+ margin-top: 20px;
|
|
|
+ border-radius: 14px;
|
|
|
+ border: 1px solid #D1D9DD;
|
|
|
+ .show-img {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 45px;
|
|
|
+ height: 60px;
|
|
|
+ margin-left: 14px;
|
|
|
+ margin-right: 14px;
|
|
|
+ }
|
|
|
+ .show-font {
|
|
|
+ position: relative;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 500;
|
|
|
+ .new {
|
|
|
+ width: 40px;
|
|
|
+ height: 18px;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .show-placeholder {
|
|
|
+ flex: 1;
|
|
|
+ color: #1D9BF0;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 500;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .arrow {
|
|
|
+ width: 18px;
|
|
|
+ height: 24px;
|
|
|
+ margin-left: 2px;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.tips-wrapper {
|
|
|
margin: 16px 0 0 12px !important;
|
|
|
padding: 0px !important;
|
|
@@ -2371,4 +2627,77 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.dialog {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 2002;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ width: 800px;
|
|
|
+ height: calc(100% - 100px);
|
|
|
+ border-radius: 20px;
|
|
|
+ background-color: #ffffff;
|
|
|
+ .corp-title {
|
|
|
+ display: flex;
|
|
|
+ height: 48px;
|
|
|
+ align-items: center;
|
|
|
+ .back {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ margin: 0 12px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .corp-content {
|
|
|
+ width: 472px;
|
|
|
+ margin: auto;
|
|
|
+ height: calc(100% - 130px);
|
|
|
+ }
|
|
|
+ .corp-footer {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: right;
|
|
|
+ height: 80px;
|
|
|
+ text-align: right;
|
|
|
+ padding-right: 30px;
|
|
|
+ .confirm {
|
|
|
+ cursor: pointer;
|
|
|
+ border: 0;
|
|
|
+ width: 200px;
|
|
|
+ height: 50px;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 700;
|
|
|
+ border-radius: 25px;
|
|
|
+ background: #1D9BF0;
|
|
|
+ &.disable {
|
|
|
+ background: #D9D9D9;
|
|
|
+ img {
|
|
|
+ width: 20px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.dialog-mask {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 2001;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
+}
|
|
|
+:deep() .vue-cropper {
|
|
|
+ background-image: none;
|
|
|
+}
|
|
|
+:deep() .cropper-modal {
|
|
|
+ background: rgba(0, 0, 0, .05);
|
|
|
+}
|
|
|
</style>
|