Ver código fonte

Merge branch 'dev_1.1.1' of https://git.yishihui.com/DeNet/de-net into dev_1.1.1

wenliming 2 anos atrás
pai
commit
b5c628d746

+ 2 - 3
src/logic/content/nft.js

@@ -207,9 +207,8 @@ function _postTweetContent() {
     if (tempNftGroupPost && tempNftGroupPost.groupId) {
         publishNFTTweetPost(tempNftGroupPost)
         // 非首页处理
-        let jumpUrl = new URL(tempNftGroupPost['entryUrl'] || '');
-        let pathname = jumpUrl.pathname || '';
-        if (pathname !== '/home') {
+        let homeTag = document.querySelectorAll('div[data-testid="toolBar"]');
+        if (homeTag.length === 1) {
             jumpTwitterDetailByAlert()
         }
     }

+ 10 - 12
src/logic/content/twitter.js

@@ -1354,19 +1354,14 @@ export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
     let inputEle = document.querySelector('div[contenteditable="true"]');
     let textContent = inputEle.innerText
     let arr = srcContent.split(' ') || []
-    let text_content_arr = textContent.split(' ') || []
     arr.forEach((item) => {
         if (textContent.includes(item)) {
             textContent = textContent.replaceAll(item, '')
         }
     })
-    text_content_arr.forEach((item) => {
-        if (item.includes('#DNFT') || item.includes('⬇️')) {
-            textContent = textContent.replaceAll(item, '')
-        }
-    })
     textContent = textContent.replaceAll('#DNFT', '')
     textContent = textContent.replaceAll('⬇️', '')
+    textContent = textContent.replaceAll('Join Now:', '')
 
     let formData = {
         groupId,
@@ -1421,7 +1416,8 @@ const initGroupTip = () => {
         let iframe_banner = document.querySelector('#denet_group_banner')
         if (iframe_banner) {
             if (twitterAccount != getQueryStringByUrl(iframe_banner.src, 'twitterAccount')) {
-                iframe_banner.style.display = 'none'
+                iframe_banner.style.visibility = 'hidden'
+                iframe_banner.style.height = '0px'
                 iframe_banner.src = chrome.runtime.getURL(`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
             }
             return
@@ -1430,12 +1426,14 @@ const initGroupTip = () => {
             let dom = document.querySelector('div[data-testid="ScrollSnap-SwipeableList"]').closest('nav')
             let iframe = document.createElement('iframe')
             iframe.id = 'denet_group_banner'
-            iframe.style.cssText = 'border: medium none; display:none; width:100%; height:100px;'
+            iframe.style.cssText = 'border: medium none; visibility:hidden; width:100%; height:0px;'
 
             iframe.src = chrome.runtime.getURL(`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
 
-            if (dom && !dom.parentNode.children[0].querySelector('iframe')) {
-                dom.parentNode.children[0].appendChild(iframe)
+
+            if (dom && !dom.parentNode.querySelector('iframe')) {
+                dom.parentNode.insertBefore(iframe,dom)
+                // .children[0].appendChild(iframe)
             }
 
         } catch (error) {
@@ -1446,8 +1444,8 @@ const initGroupTip = () => {
 
 export const showGroupTip = () => {
     let dom_denet_group_banner = document.querySelector('#denet_group_banner')
-    dom_denet_group_banner.style.display = 'block';
-
+    dom_denet_group_banner.style.visibility = 'visible';
+    dom_denet_group_banner.style.height = '100px';
     groupBtnStyleChange();
 }
 

+ 6 - 2
src/view/iframe/group-card/card.vue

@@ -54,7 +54,7 @@ import { sendChromeTabMessage, checkIsLogin } from '@/uilts/chromeExtension.js';
 
 let state = reactive({
     show: 'arrow', //join
-    show2: 'post',
+    show2: 'join',
     data: {},
     twitterAccount: ''
 })
@@ -91,6 +91,8 @@ async function clickJoin() {
                 nftGroupName: state.data.nftGroupName
             }
         })
+    } else if (state.data.buyNftStatus == null || state.data.joinStatus == null) {
+        init()
     }
 }
 
@@ -181,6 +183,8 @@ async function clickPost() {
                 groupId: state.data.nftGroupId
             }
         })
+    } else if (state.data.buyNftStatus == null || state.data.joinStatus == null) {
+        init()
     }
 }
 
@@ -200,7 +204,7 @@ body,
     margin: 0;
     padding: 0;
     width: 100%;
-    height: 100%;
+    height: 100px;
 }
 
 #denet_group_tip {

+ 0 - 1
src/view/iframe/nft/group.vue

@@ -15,7 +15,6 @@ const clickHandler = (item) => {
         let { code, data = {} } = res
         if (code === 0) {
             chrome.tabs.getCurrent((tab) => {
-                data['entryUrl'] = tab.url;
                 chrome.tabs.sendMessage(tab.id, { actionType: "IFRAME_NFT_GROUP_LIST_HIDE" });
                 chrome.tabs.sendMessage(tab.id, {
                     actionType: "IFRAME_NFT_GROUP_SET_CONTENT",