|
@@ -37,8 +37,9 @@
|
|
|
<span style="margin-left: 7px; font-size: 15px;font-weight: 700; color: #fff; ">Join Now</span>
|
|
|
</div>
|
|
|
|
|
|
- <svg v-show="state.show == 'arrow'" id="denet_tip_group_arrow" style="position: absolute; right: 20px;"
|
|
|
- width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <svg @click="clickArrow" v-show="state.show == 'arrow'" id="denet_tip_group_arrow"
|
|
|
+ style="position: absolute; right: 20px;" width="40" height="40" viewBox="0 0 40 40" fill="none"
|
|
|
+ xmlns="http://www.w3.org/2000/svg">
|
|
|
<path d="M15 10L26 19.6875L15 29.375" stroke="white" stroke-width="2" />
|
|
|
</svg>
|
|
|
</div>
|
|
@@ -49,10 +50,11 @@
|
|
|
import { reactive, onMounted } from 'vue'
|
|
|
import { getTwitterNftGroupInfo, getTwitterNftPostPre } from "@/http/group";
|
|
|
import { getQueryString } from '@/uilts/help.js';
|
|
|
-import { sendChromeTabMessage ,checkIsLogin} from '@/uilts/chromeExtension.js';
|
|
|
+import { sendChromeTabMessage, checkIsLogin } from '@/uilts/chromeExtension.js';
|
|
|
|
|
|
let state = reactive({
|
|
|
show: 'post', //join
|
|
|
+ show2: '',
|
|
|
data: {},
|
|
|
twitterAccount: ''
|
|
|
})
|
|
@@ -68,6 +70,7 @@ const clickJoin = () => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
const init = (callback) => {
|
|
|
getTwitterNftGroupInfo({
|
|
|
params: {
|
|
@@ -79,39 +82,52 @@ const init = (callback) => {
|
|
|
if (state.data) {
|
|
|
// 未加入
|
|
|
if (res.data.joinStatus == 0) {
|
|
|
+ state.show2 = 'join'
|
|
|
state.show = 'join'
|
|
|
// 已加入
|
|
|
} else if (res.data.joinStatus == 1) {
|
|
|
+ state.show2 = 'post'
|
|
|
state.show = 'post'
|
|
|
}
|
|
|
callback()
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
sendMessageToContent({
|
|
|
actionType: 'IFRAME_GROUP_BANNER_GROUP_INFO',
|
|
|
data: res.data || {}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
sendResponse('')
|
|
|
switch (req.actionType) {
|
|
|
case 'FINISH_GROUP_BANNNER':
|
|
|
init()
|
|
|
break
|
|
|
+ case 'SWITCH_GROUP_BANNER_STATUS':
|
|
|
+ if (req.data.type == 'arrow') {
|
|
|
+ state.show = 'arrow'
|
|
|
+ } else {
|
|
|
+ state.show = state.show2
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
const sendMessageToContent = (params) => {
|
|
|
- let {actionType, data} = params || {};
|
|
|
+ let { actionType, data } = params || {};
|
|
|
chrome.tabs.getCurrent((tab) => {
|
|
|
chrome.tabs.sendMessage(tab.id, {
|
|
|
- actionType,
|
|
|
- data,
|
|
|
+ actionType,
|
|
|
+ data,
|
|
|
}, (res) => { console.log(res) });
|
|
|
})
|
|
|
}
|
|
|
+const clickArrow = () => {
|
|
|
+ chrome.runtime.sendMessage({ actionType: "SWITCH_GROUP_STATUS" }, () => { })
|
|
|
+}
|
|
|
|
|
|
async function clickPost() {
|
|
|
// getTwitterNftPostPre({
|
|
@@ -153,8 +169,6 @@ async function clickPost() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
state.twitterAccount = getQueryString('twitterAccount') || ''
|
|
|
init(() => {
|