|
@@ -168,27 +168,39 @@
|
|
|
v-for="(item, index) in formList"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <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 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'"
|
|
|
+ >
|
|
|
+ <input v-model="item.text"
|
|
|
+ placeholder="Enter link address"
|
|
|
+ class="discord-address"
|
|
|
+ @input="onIptDiscordAddress($event, index)"
|
|
|
+ @blur="onBlurDiscordAddress($event, index)" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<el-switch
|
|
|
- v-if="item.type == 2"
|
|
|
+ v-if="item.type == 2 || item.type == 7"
|
|
|
v-model="item.checked"
|
|
|
/>
|
|
|
<img
|
|
@@ -298,6 +310,7 @@
|
|
|
<script setup>
|
|
|
import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick } from "vue";
|
|
|
import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
+import { getInviteGuildInfo } from "@/http/discordApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
|
import { getFrontConfig } from "@/http/account";
|
|
|
import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
@@ -332,7 +345,7 @@ let paypalHtml = ref("");
|
|
|
let publishRes = reactive({});
|
|
|
|
|
|
//弹窗是否展示
|
|
|
-let visible = ref(false);
|
|
|
+let visible = ref(true);
|
|
|
|
|
|
//弹窗高度
|
|
|
let dialogHeight = ref(680);
|
|
@@ -448,6 +461,14 @@ let formList = reactive([
|
|
|
type: 2,
|
|
|
checked: true,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "Join Discord",
|
|
|
+ icon: require("@/assets/svg/icon-like.svg"),
|
|
|
+ nodeType: "input",
|
|
|
+ text: '',
|
|
|
+ type: 7,
|
|
|
+ checked: true,
|
|
|
+ },
|
|
|
]);
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -720,7 +741,10 @@ const submitRequest = async () => {
|
|
|
let relatedUsers = formList[i]["text"];
|
|
|
item.relatedUsers = relatedUsers;
|
|
|
finishConditions.push(item);
|
|
|
- } else if (formList[i]["checked"]) {
|
|
|
+ } else if (formList[i]["checked"] && formList[i]["text"] && formList[i]["type"] == 7) {
|
|
|
+ item.bizData = JSON.stringify({inviteUrl: formList[i]["text"]});
|
|
|
+ finishConditions.push(item);
|
|
|
+ } else if (formList[i]["checked"]) {
|
|
|
finishConditions.push(item);
|
|
|
}
|
|
|
}
|
|
@@ -974,6 +998,45 @@ const onIptSetErrorTxt = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const onIptDiscordAddress = (e, index) => {
|
|
|
+ let val = formList[index].text;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const onBlurDiscordAddress = (e, index) => {
|
|
|
+ let val = formList[index].text;
|
|
|
+
|
|
|
+ getInviteGuildInfoa(val);
|
|
|
+}
|
|
|
+
|
|
|
+const checkInviteUrl = (inviteUrl) => {
|
|
|
+ let flag = true;
|
|
|
+ const INVITE_URL_PREFIX = 'https://discord.gg/';
|
|
|
+ const INVITE_URL_PREFIX_OLD = 'https://discord.com/invite/';
|
|
|
+
|
|
|
+ if(inviteUrl == INVITE_URL_PREFIX || inviteUrl == INVITE_URL_PREFIX_OLD ||
|
|
|
+ (!inviteUrl.startsWith(INVITE_URL_PREFIX) && !inviteUrl.startsWith(INVITE_URL_PREFIX_OLD))) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return flag;
|
|
|
+}
|
|
|
+
|
|
|
+const getInviteGuildInfoa = (inviteUrl) => {
|
|
|
+ let validata = checkInviteUrl(inviteUrl);
|
|
|
+ console.log(validata, 'validata')
|
|
|
+ if(!validata) return;
|
|
|
+ getInviteGuildInfo({
|
|
|
+ params: {
|
|
|
+ inviteUrl
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 获取支付配置(paypalClientId)
|
|
|
*/
|
|
@@ -1430,9 +1493,15 @@ onMounted(() => {
|
|
|
justify-content: space-between;
|
|
|
margin: 0 16px;
|
|
|
border-bottom: 1px solid #ececec;
|
|
|
+ padding: 8px 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .item-left {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
|
|
|
.label {
|
|
|
- min-width: 88px;
|
|
|
+ min-width: 76px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
font-size: 15px;
|
|
@@ -1444,10 +1513,24 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
.control {
|
|
|
- width: 100%;
|
|
|
- min-height: 50px;
|
|
|
+ min-width: 280px;
|
|
|
margin-left: 18px;
|
|
|
box-sizing: border-box;
|
|
|
+ border-left: 1px solid #ECECEC;
|
|
|
+
|
|
|
+ .discord-address {
|
|
|
+ border: none;
|
|
|
+ outline: none;
|
|
|
+ color: #1D9BF0;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ width: 100%;
|
|
|
+ height: 34px;
|
|
|
+ padding-left: 15px;
|
|
|
+ }
|
|
|
+ .discord-address::placeholder {
|
|
|
+ color: #c5c5c5;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.form-item:last-child {
|