소스 검색

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

zhangwei 2 년 전
부모
커밋
8edebe79f9

+ 1 - 0
.gitignore

@@ -21,3 +21,4 @@ pnpm-debug.log*
 *.njsproj
 *.sln
 *.sw?
+*.zip

+ 1 - 1
buildTestApp.sh

@@ -23,7 +23,7 @@ yarn build-$env
 
 echo '----------------打包结束--------------------'
 
-zip $libname.zip dist/*
+zip -r $libname.zip dist/*
 
 open ./
 open $libname.zip -R

+ 3 - 1
src/log-center/autoLog/click.js

@@ -2,13 +2,15 @@
 
 import { reportLog } from '../logger';
 import { getTargetElementWhenClick } from '@/uilts/help';
+import Report from "@/log-center/log";
 
 let clickDataMap = new Map();
 
 const clickHandle = (e) => { 
     const target = getTargetElementWhenClick(e);
     const logData = clickDataMap.get(target?.denetClickLogkey);
-    return  logData && reportLog({
+    return logData && reportLog({
+        businessType: Report.businessType.buttonClick,
         ...logData
     })
 }

+ 3 - 1
src/log-center/autoLog/show.js

@@ -1,5 +1,6 @@
 import { reportLog } from '../logger';
 import { getActiveKeyAfterClick } from '@/uilts/help';
+import Report from "@/log-center/log"
 
 // 每个窗口共享一个Observer实例
 class ShowLogObserver { 
@@ -39,7 +40,8 @@ class ShowLogObserver {
 
     report(el) { 
         const logData = this.showLogMap.get(el?.target?.denetShowLogkey);
-        return  logData && reportLog({
+        return logData && reportLog({
+            businessType: Report.businessType.pageView,
             ...logData
         })
     }

+ 4 - 3
src/logic/background/denet.js

@@ -6,10 +6,11 @@ export const closeAchPayNoticeHandler = async () => {
     if(res.url.startsWith(payAchNoticeUrl)) {
         chrome.tabs.remove(
             res.id, () => {
-                getChromeStorage('achPayInfo', (res) => {
+                getChromeStorage('achPayInfo', (result) => {
+                    let {tab} = result || {};
                     chrome.storage.local.remove("achPayInfo");
-                    if(res && res.tab) {
-                        chrome.tabs.highlight({ windowId: res.tab.windowId, tabs: res.tab.index })
+                    if(tab) {
+                        chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab.index })
                     }
                 })
             }

+ 2 - 2
src/logic/content/twitter.js

@@ -981,9 +981,9 @@ function onPageVisbile() {
 }
 
 const depositUSShowPopupPage = async () => {
-    let {form = ''} = await getChromeStorage('achPayData') || {};
+    let {form = '', path} = await getChromeStorage('achPayData') || {};
     if(form == 'popupPage') {
-        showPopupPage();
+        showPopupPage({path});
         chrome.storage.local.remove("achPayData");
     }
 }

+ 1 - 0
src/view/iframe/buy-nft/buy/home.vue

@@ -296,6 +296,7 @@ onMounted(() => {
                 padding: 0 15px 0 20px;
                 margin-right: 25px;
                 box-sizing: border-box;
+                min-height: 50px;
 
                 .left {
                     margin-right: 20px;

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

@@ -160,7 +160,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    ;
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();

+ 26 - 4
src/view/popup/currency-detail.vue

@@ -71,7 +71,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, inject, reactive } from "vue";
+import { ref, onMounted, inject, reactive, onBeforeUnmount } from "vue";
 import router from "@/router/popup.js";
 import Report from "@/log-center/log";
 import { getStorage } from "@/uilts/help";
@@ -261,7 +261,6 @@ const showSendGiveawayDialog = (params = {}) => {
       showCurrencySelect.value = true;
       currencyOpertionType = "SEND";
   } else {
-    console.log(params,'params')
       setLocalSelectCurrencyInfo(params)
       setTimeout(() => {
         chrome.runtime.sendMessage({ 
@@ -294,8 +293,11 @@ const confirmDeposit = (params) => {
   };
   let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
   setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+  let str = window.location.hash + '&refresh=true';
+  let path = str.substring(1, str.length);
   setChromeStorage({ achPayData : JSON.stringify({
-    form: 'popupPage'
+    form: 'popupPage',
+    path
   })});
 
   chrome.tabs.create({
@@ -328,13 +330,28 @@ const onDepositAmountInput = async (params = {}) => {
   }
 }
 
+
+const onMessage = () => {
+    chrome.runtime.onMessage.addListener(msgListener)
+}
+
+const msgListener = (req, sender, sendResponse) => {
+    switch (req.actionType) {
+        case 'CONTENT_POPUP_PAGE_SHOW':
+            let {refresh = false} = router.currentRoute.value.query;
+            if(refresh && currencyInfo.value.tokenSymbol) {
+              onRefresh();
+            }
+            break;
+    }
+}
+
 onMounted(() => {
     let {params = '{}'} = router.currentRoute.value.query;
 
     let {currencies = [], totalBalance = 0, totalUsdEstimateBalance = 0} =  JSON.parse(params);
 
     currenciesData.value = currencies;
-
     if(currencies.length) {
       currencyInfo.value = {
         ...currencies[0],
@@ -351,6 +368,11 @@ onMounted(() => {
     } else {
       showSendBtn.value = true;
     }
+    onMessage();
+})
+
+onBeforeUnmount(() => {
+    chrome.runtime.onMessage.removeListener(msgListener);
 })
 
 </script>

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

@@ -481,7 +481,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  ;
   switch (req.actionType) {
     case 'CONTENT_POPUP_PAGE_SHOW':
       init();

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

@@ -84,7 +84,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  ;
   switch (req.actionType) {
     case 'CONTENT_POPUP_PAGE_SHOW':
       getNFTListMine();

+ 0 - 1
src/view/popup/tabbar-page/wallter/popup.vue

@@ -204,7 +204,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    ;
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();