Browse Source

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

nieyuge 2 years ago
parent
commit
2812a856b2

+ 16 - 13
src/logic/content/twitter.js

@@ -773,9 +773,9 @@ const createNFTIframe = ({ url, id }, callback) => {
 
 function initParseCard() {
     let timer = setInterval(() => {
-        let inTwitter = window.location.href.includes('twitter.com');
+        let inTwitter = window.location.host.includes('twitter.com');
         let inTwitterNode = document.querySelector('main');
-        let inFacebook = window.location.href.includes('facebook.com');
+        let inFacebook = window.location.host.includes('facebook.com');
         let inFacebookNode = document.querySelector('#facebook');
         if (inTwitter && inTwitterNode) {
             clearInterval(timer)
@@ -832,23 +832,26 @@ export function init() {
         }
     }, () => { });
 
-    let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
+    let where = window.location.host.indexOf('twitter.com') < 0 && window.location.host.indexOf('facebook.com') < 0;
     if (where) {
         return
     }
     twitterPinLogin();
+    if(window.location.host.includes('twitter.com')){
+        showNFTCard()
+        showNFTGroupIcon()
+        addEventAction();
+        checkUserJoinGroup();
+        renderDom();
+        checkTwitterTaskState();
+        initBuyNFT();
+        addJoinedGroupList();
+        getSysTheme();
+        addGroupTab();
+    }
     // 渲染dom
     initParseCard()
-    showNFTCard()
-    showNFTGroupIcon()
-    addEventAction();
-    checkUserJoinGroup();
-    renderDom();
-    checkTwitterTaskState();
-    initBuyNFT();
-    addJoinedGroupList();
-    getSysTheme();
-    addGroupTab();
+
 
     getChromeStorage("popupShowPublishDialog", (res) => {
         console.log("popupShowPublishDialog", res);

+ 15 - 1
src/view/components/nft-group-list.vue

@@ -42,7 +42,7 @@ const clickHandler = (item) => {
     emits('clickCallBack', item);
 }
 
-onBeforeMount(() => {
+const getDetail = () => {
     listJoinNftGroup({
         params: {
             pageNum,
@@ -56,6 +56,20 @@ onBeforeMount(() => {
             emits('updateList', data);
         }
     })
+}
+
+const onPageVisbile = () => {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            getDetail();
+        }
+    });
+}
+
+onBeforeMount(() => {
+    getDetail();
+    onPageVisbile();
 })
 </script>
 

+ 2 - 1
src/view/iframe/buy-nft/group/tip.vue

@@ -74,7 +74,8 @@ const clickJoin = () => {
         } else {
             let msg = ''
             switch (String(res.code)) {
-                case '':
+                case '5201':
+                    msg = 'need to buy NFT to join the discussion group'
                     break
                 default:
                     msg = res.msg