|
@@ -153,7 +153,7 @@
|
|
|
:src="require('@/assets/svg/icon-winner-v2.svg')"/>
|
|
|
Winner Count
|
|
|
</div>
|
|
|
- <div class="msg" v-show="selectModeInfo.type == PlayType.common">Recommend Winners 100~10000</div>
|
|
|
+ <div class="msg" v-show="selectModeInfo.type == PlayType.common">Recommend Winners 50~500</div>
|
|
|
</div>
|
|
|
<input v-model="baseFormData.totalCount"
|
|
|
placeholder="0"
|
|
@@ -176,6 +176,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="usd-min-message" v-show="isShowUsdMinMessage" v-html="checkUsdMinNumber('inTemplate')"></div>
|
|
|
<div class="giveaway-poster" @click="customCoverImg">
|
|
|
<div class="show-img">
|
|
|
<div
|
|
@@ -510,6 +511,9 @@ let atUserList = ref([]);
|
|
|
// 表单错误提示
|
|
|
let iptErrMsgTxt = ref("Select a reward");
|
|
|
|
|
|
+// usd最小金额限制提示展示
|
|
|
+let isShowUsdMinMessage = ref(false);
|
|
|
+
|
|
|
// 是否返回
|
|
|
let isBack = ref(false);
|
|
|
|
|
@@ -795,7 +799,7 @@ const setDialogStyle = (resize = false) => {
|
|
|
dialogStyle.dialogHeight = clientHeight - gapSafe;
|
|
|
} else {
|
|
|
if(resize) {
|
|
|
- dialogStyle.dialogHeight = 680;
|
|
|
+ dialogStyle.dialogHeight = 720;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1014,6 +1018,12 @@ const updateCurrencyBanlce = async () => {
|
|
|
if(currentCurrencyInfo.value.currencyCode == 'USD') {
|
|
|
let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
|
|
|
|
|
|
+ calcRechPayAmount({
|
|
|
+ currencyCode: currentCurrencyInfo.value.currencyCode,
|
|
|
+ orderAmountValue: baseFormData.amountValue,
|
|
|
+ payChannel: 'ach'
|
|
|
+ });
|
|
|
+
|
|
|
if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
|
|
|
currentCurrencyInfo.value = currencyInfoRes.data;
|
|
|
}
|
|
@@ -1372,6 +1382,32 @@ const calcIptValue = (cb) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * usd最小金额判断
|
|
|
+ * luckdropPostConfig.usdLimitEnable 当前选中的token是否开启usd最小金额判断
|
|
|
+ */
|
|
|
+const checkUsdMinNumber = (isInTemplate) => {
|
|
|
+ let forbiddenText = '';
|
|
|
+ const { usdPrice, luckdropPostConfig } = currentCurrencyInfo.value;
|
|
|
+ if (baseFormData.rewardType === RewardType.money && luckdropPostConfig?.usdLimitEnable === 1) {
|
|
|
+ const { amountValue, totalCount } = baseFormData;
|
|
|
+ if (luckdropPostConfig?.minTotalUsdAmount === 0 || luckdropPostConfig?.minAvgUsdAmount === 0) {
|
|
|
+ // 当前token允许的usd最小金额为0 或单个红包最小金额为0,则无限制
|
|
|
+ return forbiddenText;
|
|
|
+ } else {
|
|
|
+ const isAmountForbidden = luckdropPostConfig?.minTotalUsdAmount ? math.format(math.evaluate(amountValue * usdPrice)) < luckdropPostConfig.minTotalUsdAmount : false;
|
|
|
+ const isAvgForbidden = luckdropPostConfig?.minAvgUsdAmount ? math.format(math.evaluate(amountValue / totalCount * usdPrice)) < luckdropPostConfig.minAvgUsdAmount : false;
|
|
|
+ forbiddenText = isAmountForbidden && isAvgForbidden ?
|
|
|
+ `The prize pool must be above
|
|
|
+ ${isInTemplate ? ('<span class="font-color-1D9BF0">$' + luckdropPostConfig.minTotalUsdAmount + '</span>') : ('$' + luckdropPostConfig.minTotalUsdAmount)}
|
|
|
+ or the average prize must be above
|
|
|
+ ${isInTemplate ? ('<span class="font-color-1D9BF0">$' + luckdropPostConfig.minAvgUsdAmount +' per person.</span>' ): ('$' + luckdropPostConfig.minAvgUsdAmount + ' per person.') }`
|
|
|
+ : '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return forbiddenText;
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* 设置输入提示语
|
|
|
*/
|
|
@@ -1390,6 +1426,9 @@ const onIptSetErrorTxt = (params = {}) => {
|
|
|
iptErrMsgTxt.value = "Enter an amount";
|
|
|
} else if (!baseFormData.totalCount || baseFormData.totalCount == '0') {
|
|
|
iptErrMsgTxt.value = "Enter the number of winners";
|
|
|
+ } else if (iptErrMsgTxt.value = checkUsdMinNumber()) {
|
|
|
+ // 最小法币金额限制
|
|
|
+ return isShowUsdMinMessage.value = true;
|
|
|
} else if(baseFormData.rewardType === RewardType.money && +baseFormData.amountValue <= +currentCurrencyInfo.value.balance) {
|
|
|
// 输入金额 小于 余额
|
|
|
let res = calcIptValue();
|
|
@@ -1941,6 +1980,12 @@ onMounted(() => {
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
+<style lang="scss">
|
|
|
+.font-color-1D9BF0 {
|
|
|
+ color: #1D9BF0;
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
:deep() .ant-switch {
|
|
@@ -2373,6 +2418,16 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .usd-min-message {
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 16px;
|
|
|
+ letter-spacing: 0.3px;
|
|
|
+ color: #C88726;
|
|
|
+ margin-top: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
.giveaway-poster {
|
|
|
display: flex;
|
|
|
align-items: center;
|