|
@@ -88,6 +88,7 @@
|
|
@delUser="delFollowUser"></follow-input>
|
|
@delUser="delFollowUser"></follow-input>
|
|
</div>
|
|
</div>
|
|
<el-switch v-if="item.type == 2" v-model="item.checked" />
|
|
<el-switch v-if="item.type == 2" v-model="item.checked" />
|
|
|
|
+ <img v-if="item.type == 3" :src="require('../../assets/svg/icon-option-checked.svg')" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="anti-bot-wrapper">
|
|
<div class="anti-bot-wrapper">
|
|
@@ -140,6 +141,11 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <message-box :dialogVisible="showMessageBox"
|
|
|
|
+ :title="messageBoxData.title"
|
|
|
|
+ :content="messageBoxData.content"
|
|
|
|
+ @cancel="messageBoxCancel"
|
|
|
|
+ @confirm="messageBoxConfirm"></message-box>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -154,6 +160,7 @@ import 'element-plus/es/components/message/style/css'
|
|
import previewCard from "./preview-card";
|
|
import previewCard from "./preview-card";
|
|
import paypalButton from "./paypal-button";
|
|
import paypalButton from "./paypal-button";
|
|
import followInput from "./follow-input";
|
|
import followInput from "./follow-input";
|
|
|
|
+import messageBox from "./message-box.vue";
|
|
|
|
|
|
let paypalClientId = ref('');
|
|
let paypalClientId = ref('');
|
|
let paypalHtml = ref('');
|
|
let paypalHtml = ref('');
|
|
@@ -168,6 +175,12 @@ let submitIng = ref(false);
|
|
let atUserList = ref([]);
|
|
let atUserList = ref([]);
|
|
let iptErrMsgTxt = ref('');
|
|
let iptErrMsgTxt = ref('');
|
|
let isBack = ref(false);
|
|
let isBack = ref(false);
|
|
|
|
+let showMessageBox = ref(false);
|
|
|
|
+
|
|
|
|
+let messageBoxData = ref({
|
|
|
|
+ title: '',
|
|
|
|
+ content: ''
|
|
|
|
+})
|
|
|
|
|
|
let finalAmountData = ref({
|
|
let finalAmountData = ref({
|
|
currencyCode: "USD",
|
|
currencyCode: "USD",
|
|
@@ -271,11 +284,30 @@ const confirm = () => {
|
|
if(submitIng.value) {
|
|
if(submitIng.value) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- let {amountValue = 0, totalCount = 0, amountCurrencyCode} = baseFormData;
|
|
|
|
|
|
+ let {totalCount = 0} = baseFormData;
|
|
if(!totalCount) {
|
|
if(!totalCount) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- amountValue = amountValue * 100; // 元转分
|
|
|
|
|
|
+ if(!calcIptValue()) {
|
|
|
|
+ showMessageBox.value = true;
|
|
|
|
+ messageBoxData.value.title = 'Quantity is too small';
|
|
|
|
+ messageBoxData.value.content = 'A Reward of $100 is recommended to be allocated to 100~10000 participants, would you prefer to modify it?';
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ submitRequest();
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const messageBoxCancel = () => {
|
|
|
|
+ showMessageBox.value = false;
|
|
|
|
+ submitRequest();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const messageBoxConfirm = () => {
|
|
|
|
+ showMessageBox.value = false;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const submitRequest = () => {
|
|
|
|
+ let {amountValue = 0, totalCount = 0, amountCurrencyCode} = baseFormData;
|
|
formList[0]['text'] = atUserList.value;
|
|
formList[0]['text'] = atUserList.value;
|
|
|
|
|
|
let finishConditions = [];
|
|
let finishConditions = [];
|
|
@@ -291,7 +323,6 @@ const confirm = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let receiveConditions = openAntiBot.value ? '' : [];
|
|
let receiveConditions = openAntiBot.value ? '' : [];
|
|
- console.log('finishConditions', finishConditions);
|
|
|
|
let formData = {
|
|
let formData = {
|
|
amountCurrencyCode,
|
|
amountCurrencyCode,
|
|
amountValue,
|
|
amountValue,
|
|
@@ -299,11 +330,6 @@ const confirm = () => {
|
|
finishConditions,
|
|
finishConditions,
|
|
receiveConditions
|
|
receiveConditions
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(!calcIptValue()) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
submitIng.value = true;
|
|
submitIng.value = true;
|
|
getPayAmount(amountValue, (res) => {
|
|
getPayAmount(amountValue, (res) => {
|
|
formData['payAmountValue'] = res.finalAmountValue;
|
|
formData['payAmountValue'] = res.finalAmountValue;
|
|
@@ -316,19 +342,19 @@ const confirm = () => {
|
|
}
|
|
}
|
|
postPublish(data).then((res) => {
|
|
postPublish(data).then((res) => {
|
|
submitIng.value = false;
|
|
submitIng.value = false;
|
|
- if(res.code == 0) {
|
|
|
|
- publishRes = res.data;
|
|
|
|
- // setPreviewDialogHeight();
|
|
|
|
- showPreview.value = true;
|
|
|
|
- isBack.value = false;
|
|
|
|
- } else {
|
|
|
|
- console.log(res);
|
|
|
|
- }
|
|
|
|
- }).catch(err => {
|
|
|
|
- console.log(err);
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
|
|
+ if(res.code == 0) {
|
|
|
|
+ publishRes = res.data;
|
|
|
|
+ // setPreviewDialogHeight();
|
|
|
|
+ showPreview.value = true;
|
|
|
|
+ isBack.value = false;
|
|
|
|
+ } else {
|
|
|
|
+ console.log(res);
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log(err);
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
|
|
const calcIptValue = (cb) => {
|
|
const calcIptValue = (cb) => {
|
|
let amountValue = baseFormData.amountValue;
|
|
let amountValue = baseFormData.amountValue;
|
|
@@ -340,7 +366,7 @@ const calcIptValue = (cb) => {
|
|
}
|
|
}
|
|
|
|
|
|
//每人平均要分到大于 0.01美元(1美分)
|
|
//每人平均要分到大于 0.01美元(1美分)
|
|
- if(amountValue / totalCount < 1) {
|
|
|
|
|
|
+ if((amountValue * 100) / totalCount < 1) {
|
|
flag = false;
|
|
flag = false;
|
|
}
|
|
}
|
|
cb && cb(flag);
|
|
cb && cb(flag);
|
|
@@ -467,7 +493,7 @@ const onCountBlur = () => {
|
|
const setIptAmountErrorMsg = (cb) => {
|
|
const setIptAmountErrorMsg = (cb) => {
|
|
let res = calcIptValue();
|
|
let res = calcIptValue();
|
|
if(!res) {
|
|
if(!res) {
|
|
- iptErrMsgTxt.value = 'If you wish to send {100} red packets, please send USD amount > {$1.00}';
|
|
|
|
|
|
+ iptErrMsgTxt.value = 'If you wish to send 100 red packets, please send USD amount > $1.00';
|
|
} else {
|
|
} else {
|
|
iptErrMsgTxt.value = '';
|
|
iptErrMsgTxt.value = '';
|
|
}
|
|
}
|