|
@@ -162,64 +162,93 @@
|
|
|
Recommend winners 100~10000
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="form-label">Tasks</div>
|
|
|
+ <div class="form-label">
|
|
|
+ <div>
|
|
|
+ Tasks
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-dropdown trigger="click">
|
|
|
+ <img src="@/assets/svg/icon-add-task.svg" class="icon-add-task">
|
|
|
+ <template #dropdown v-if="formList.some(item => !item.show)">
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <div v-for="(item, key) in formList" :key="key"
|
|
|
+ @click="clickDropdown(item, key)">
|
|
|
+ <el-dropdown-item style="height: 50px;width: 240px" v-if="!item.show">
|
|
|
+ <img :src="item.icon" style="width: 20px; height: 20px;margin-right: 12px" />
|
|
|
+ {{item.label}}
|
|
|
+ </el-dropdown-item>
|
|
|
+ </div>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 转推、like、关注 -->
|
|
|
<div class="form-require">
|
|
|
<div
|
|
|
- class="form-item"
|
|
|
v-for="(item, index) in formList"
|
|
|
:key="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>
|
|
|
- <!-- join discord -->
|
|
|
- <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 v-if="item.show" class="form-item">
|
|
|
+ <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>
|
|
|
+ <!-- join discord -->
|
|
|
+ <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>
|
|
|
- <input v-model="item.text"
|
|
|
- placeholder="Enter discord invite link"
|
|
|
- class="discord-address"
|
|
|
- @input="onIptDiscordAddress($event, index)"
|
|
|
- @blur="onBlurDiscordAddress($event, index)" />
|
|
|
</div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <el-switch
|
|
|
+ v-model="item.checked"
|
|
|
+ @change="formSwitchChange($event, item, index)"
|
|
|
+ />
|
|
|
+ <img src="@/assets/svg/icon-task-close.svg"
|
|
|
+ class="icon-task-close"
|
|
|
+ @click="hideTask(item, index)">
|
|
|
+ </div>
|
|
|
+ <!--
|
|
|
+ v-if="item.type == 2 || item.type == 3 || item.type == 7 || item.type == 8 || item.type == 9"
|
|
|
+
|
|
|
+ <img
|
|
|
+ v-if="item.type == 3"
|
|
|
+ :src="
|
|
|
+ require('@/assets/svg/icon-option-checked.svg')
|
|
|
+ "
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
- <el-switch
|
|
|
- v-if="item.type == 2 || item.type == 7 || item.type == 8 || item.type == 9"
|
|
|
- v-model="item.checked"
|
|
|
- @change="formSwitchChange($event, item, index)"
|
|
|
- />
|
|
|
- <img
|
|
|
- v-if="item.type == 3"
|
|
|
- :src="
|
|
|
- require('@/assets/svg/icon-option-checked.svg')
|
|
|
- "
|
|
|
- />
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 机器人 -->
|
|
@@ -412,7 +441,7 @@ import { getFrontConfig } from "@/http/account";
|
|
|
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 { ElMessage, ElLoading, ElDropdown, ElDropdownMenu, ElDropdownItem } from "element-plus";
|
|
|
import "element-plus/es/components/message/style/css";
|
|
|
|
|
|
import {create, all} from "mathjs";
|
|
@@ -552,6 +581,7 @@ let formList = reactive([
|
|
|
type: 1,
|
|
|
text: [],
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
label: "Retweet",
|
|
@@ -559,6 +589,7 @@ let formList = reactive([
|
|
|
nodeType: "div",
|
|
|
type: 3,
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
label: "Like Tweet",
|
|
@@ -566,6 +597,7 @@ let formList = reactive([
|
|
|
nodeType: "div",
|
|
|
type: 2,
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
label: "Comment and tag 3 friends",
|
|
@@ -573,6 +605,7 @@ let formList = reactive([
|
|
|
nodeType: "div",
|
|
|
type: 9,
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
label: "Repost to Facebook",
|
|
@@ -581,6 +614,7 @@ let formList = reactive([
|
|
|
text: '',
|
|
|
type: 8,
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
label: "Join Discord",
|
|
@@ -589,6 +623,7 @@ let formList = reactive([
|
|
|
text: '',
|
|
|
type: 7,
|
|
|
checked: true,
|
|
|
+ show: true
|
|
|
},
|
|
|
]);
|
|
|
|
|
@@ -1168,7 +1203,21 @@ const onIptSetErrorTxt = (params = {}) => {
|
|
|
* 监听开关触发事件
|
|
|
*/
|
|
|
const formSwitchChange = (val, params, index) => {
|
|
|
- console.log('formSwitchChange')
|
|
|
+ closeDiscordTask(val, params, index);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const hideTask = (params, index) => {
|
|
|
+ formList[index]['checked'] = false;
|
|
|
+ formList[index]['show'] = false;
|
|
|
+ closeDiscordTask(false, {type: 7}, index)
|
|
|
+}
|
|
|
+
|
|
|
+const clickDropdown = (params, index) => {
|
|
|
+ formList[index]['show'] = true;
|
|
|
+}
|
|
|
+
|
|
|
+const closeDiscordTask = (val, params, index) => {
|
|
|
if(params.type == 7) {
|
|
|
if(!val) {
|
|
|
//错误类型 discord 清空discord错误校验
|
|
@@ -1183,6 +1232,7 @@ const formSwitchChange = (val, params, index) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/** 监听 discord 输入 */
|
|
|
const onIptDiscordAddress = (e, index) => {
|
|
|
let val = formList[index].text;
|
|
@@ -1785,6 +1835,13 @@ onMounted(() => {
|
|
|
margin-bottom: 10px;
|
|
|
font-weight: 500;
|
|
|
font-size: 14px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .icon-add-task {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.form-require {
|
|
@@ -1820,7 +1877,7 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
.control {
|
|
|
- min-width: 280px;
|
|
|
+ min-width: 258px;
|
|
|
margin-left: 18px;
|
|
|
box-sizing: border-box;
|
|
|
border-left: 1px solid #ECECEC;
|
|
@@ -1872,6 +1929,11 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .icon-task-close {
|
|
|
+ margin-left: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
.form-item:last-child {
|
|
|
border-bottom: none !important;
|