Browse Source

Merge branch 'dev_1.1.0' into bug_fix_220611_popup

# Conflicts:
#	src/logic/content/twitter.js
A\An 2 years ago
parent
commit
19986a94cc

+ 3 - 0
src/assets/svg/icon-form-refresh-blue.svg

@@ -0,0 +1,3 @@
+<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.21664 9.31085C4.21664 9.31085 6.4009 5.93844 9.85712 4.12882C13.3133 2.31927 17.5714 2.84021 20.364 4.59492C23.1566 6.34973 24.0968 7.83024 24.0968 7.83024L26.5022 6.45938C26.5022 6.45938 27 6.21266 27 6.78841V15.3978C27 15.3978 27 16.1655 26.4193 15.8912C25.9308 15.6607 20.648 12.655 18.9833 11.7067C18.0691 11.2988 18.8723 10.9673 18.8723 10.9673L21.1935 9.63986C21.1935 9.63986 19.8695 7.98074 17.9315 7.10206C15.8571 6.02069 13.9151 5.89246 11.5362 6.79105C9.985 7.37687 8.15868 8.87707 6.84323 11.093L4.21664 9.31085ZM25.7834 20.6891C25.7834 20.6891 23.5991 24.0616 20.1429 25.8711C16.6866 27.6807 12.4286 27.1599 9.63599 25.4051C6.84326 23.6503 5.90327 22.1697 5.90327 22.1697L3.4977 23.5405C3.4977 23.5405 3 23.7874 3 23.2115V14.6022C3 14.6022 3 13.8346 3.58058 14.1087C4.06912 14.3394 9.35204 17.345 11.0167 18.2933C11.9309 18.7013 11.1278 19.0326 11.1278 19.0326L8.80649 20.3601C8.80649 20.3601 10.1306 22.0192 12.0685 22.8979C14.1428 23.9792 16.0848 24.1075 18.4638 23.2089C20.0149 22.623 21.8412 21.123 23.1566 18.9069L25.7834 20.6891Z" fill="#1D9BF0"/>
+</svg>

+ 18 - 3
src/logic/background/twitter.js

@@ -256,9 +256,24 @@ export function onInstalledCreateTab() {
             });
             removeChromeCookie(cookiesParams)
         } else {
-            chrome.tabs.create({
-                url: "https://twitter.com",
-            });
+            let nftParams = {
+                name: 'nft_info',
+                url: pageUrl
+            }
+            getChromeCookie(nftParams, (res) => {
+                let { twitterAccount, nftProjectId } = res;
+                if (res && twitterAccount && nftProjectId) {
+                    let url = `https://twitter.com/${twitterAccount}`
+                    chrome.tabs.create({
+                        url
+                    });
+                    removeChromeCookie(nftParams)
+                } else {
+                    chrome.tabs.create({
+                        url: "https://twitter.com",
+                    });
+                }
+            })
         }
     })
 }

+ 1 - 1
src/logic/content/ParseCard.js

@@ -46,7 +46,7 @@ class ParseCard {
                 }
                 if (item) {
                     for (let j in item) {
-                        if (item[j].innerText && item[j].innerText.includes('#DeNet')) {
+                        if (item[j].innerText && (item[j].innerText.includes('#DeNet') || item[j].innerText.includes('#DNFT'))) {
                             has_denet = true
                             break
                         }

+ 6 - 3
src/logic/content/twitter.js

@@ -1352,7 +1352,10 @@ export const tiggerInjectPopupPage = () => {
 }
 
 const onBodyClick = () => {
-    document.querySelector('body').addEventListener('click', function () {
-        hidePopupPage();
-    })
+    if(window.location.href.indexOf('api.twitter.com') < 0) {
+        document.querySelector('body').addEventListener('click', function () {
+            console.log('click')
+            hidePopupPage();
+        })
+    } 
 }

+ 4 - 4
src/view/components/preview-balance.vue

@@ -6,7 +6,7 @@
             <div class="price">{{ currentCurrencyInfo.balance }} {{ props.tokenSymbol }}</div>
         </div>
         <img class="refresh" :class="{ 'icon-refresh-rotate': refreshRotate }" @click="updateCurrencyBanlce"
-            :src="require('@/assets/svg/icon-form-refresh.svg')" />
+            :src="require('@/assets/svg/icon-form-refresh-blue.svg')" />
     </div>
 </template>
 <script setup>
@@ -99,7 +99,7 @@ onMounted(() => {
 .card-amount {
     overflow: hidden;
     display: flex;
-    height: 80px;
+    align-items: center;
     padding: 20px;
     border-radius: 20px;
     border: 1px solid #E6E6E6;
@@ -129,8 +129,8 @@ onMounted(() => {
 
     .refresh {
         cursor: pointer;
-        width: 50px;
-        height: 50px;
+        width: 30px;
+        height: 30px;
         margin-top: -5px;
     }
 

+ 8 - 3
src/view/iframe/buy-nft/buy/home.vue

@@ -22,7 +22,8 @@
             <div class="btn-area">
                 <template v-for="item in state.data.salePlans.splice(0, 2).reverse()">
                     <div class="buy1" @click="clickJump(item)"
-                        v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1">
+                        v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1
+                        && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
                         <template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
                             <div class="left">Buy 1</div>
                             <div class="right">
@@ -39,7 +40,8 @@
                         </template>
                     </div>
                     <div class="buy1 grey"
-                        v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) <= 0">
+                        v-if="item.itemCount == 1 && ((state.data.perUserBuyLimit - state.data.userBuyCount) <= 0
+                        || (state.data.itemTotalCount - state.data.itemSoldCount) <= 0)">
                         <template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
                             <div class="left">Buy 1</div>
                             <div class="right">
@@ -57,7 +59,8 @@
                     </div>
                     
                     <div class="buy5" 
-                        v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5"
+                        v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5 && 
+                        (state.data.itemTotalCount - state.data.itemSoldCount) >= 5"
                         @click="clickJump(item)">
                         <div class="left">Buy {{ item.itemCount }}</div>
 
@@ -212,6 +215,7 @@ onMounted(() => {
             height: 100%;
             display: flex;
             padding: 15px 0;
+            min-height: 50px;
 
             .buy5 {
                 border: 1px solid #1D9BF0;
@@ -220,6 +224,7 @@ onMounted(() => {
                 color: #1D9BF0;
                 min-width: 217px;
                 display: flex;
+                
                 justify-content: space-between;
                 align-items: center;
                 padding: 10px 15px 10px 20px;

+ 1 - 1
src/view/iframe/buy-nft/buy/pay.vue

@@ -148,7 +148,7 @@ const clickPlay = () => {
                     msg = 'Purchase limit reached'
                     break
                 default:
-                    msg = res.msg
+                    console.log(res.msg)
             }
             ElMessage({
                 message: msg,

+ 10 - 2
src/view/iframe/popup/index.vue

@@ -9,14 +9,22 @@
 import { onMounted, ref } from "vue";
 import popup from '@/view/popup/index.vue'
 
-let show = ref(false);
+let show = ref(true);
 
 const onMessage = () => {
     chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
         sendResponse('');
         switch (req.actionType) {
             case 'CONTENT_POPUP_PAGE_SHOW':
-                show.value = true;
+                if(show.value) {
+                    show.value = false;
+                    setTimeout(() => {
+                        show.value = true;
+                    })
+                } else {
+                    show.value = true;
+                }
+                
                 break;
             case 'CONTENT_POPUP_PAGE_HIDE':
                 show.value = false;

+ 4 - 3
src/view/iframe/publish/give-dialog.vue

@@ -388,7 +388,7 @@
                                                 class="refresh"
                                                 :class="{ 'icon-refresh-rotate': refreshRotate }"
                                                 @click="updateCurrencyBanlce"
-                                                :src=" require('@/assets/svg/icon-form-refresh.svg') "
+                                                :src=" require('@/assets/svg/icon-form-refresh-blue.svg') "
                                             />
                                         </div>
                                     </template>
@@ -2225,6 +2225,7 @@ onMounted(() => {
         overflow: hidden;
         display: flex;
         height: 80px;
+        align-items: center;
         padding: 20px;
         border-radius: 20px;
         border: 1px solid #E6E6E6;
@@ -2247,8 +2248,8 @@ onMounted(() => {
         }
         .refresh {
             cursor: pointer;
-            width: 50px;
-            height: 50px;
+            width: 30px;
+            height: 30px;
             margin-top: -5px;
         }
     }

+ 1 - 0
src/view/popup/components/head.vue

@@ -228,6 +228,7 @@ function clickList() {
         color: #000000;
         font-size: 16px;
         font-weight: 500;
+        word-break: break-all;
     }
 }
 </style>

+ 2 - 2
src/view/popup/currency-detail.vue

@@ -2,7 +2,7 @@
   <div class="currency-detail-page">
     <v-head :title="currencyInfo.tokenSymbol" 
             :show_more="false"
-            :show_refresh="true"
+            :show_refresh="false"
             :show_list="true"
             :transactionsRouterParams="{
               backUrl: 'back'
@@ -168,7 +168,7 @@ const onRefresh = () => {
 
 const asyncTokenRechRecord = (_params, cb) => {
     let { currencyCode = '' } = _params;
-    if(!currencyCode || !currencyOpertionType) return;
+    if(!currencyCode || currenciesData.value.length > 1) return;
     syncChainTokenRechargeRecord({
         params: {
             currencyCode: currencyCode

+ 15 - 0
src/view/popup/tabbar-page/index.vue

@@ -92,11 +92,26 @@ const callEventPageMethod = (actionType, data, callback) => {
     );
 };
 
+function onPageVisbile() {
+  document.addEventListener('visibilitychange', function () {
+    let isHidden = document.hidden;
+    console.log('joinDiscordActionState',);
+    if (!isHidden) {
+      if(!userInfo.value.accessToken) {
+        setTimeout(() => {
+          getUserInfo();
+        }, 800)
+      }
+    }
+  });
+}
+
 onMounted(() => {
   nextTick(() => {
     onTabbarHandler(router.currentRoute.value);
   })
   getUserInfo();
+  onPageVisbile();
 });
 </script>