wenliming 2 лет назад
Родитель
Сommit
da495770a1

+ 13 - 1
src/entry/background.js

@@ -143,7 +143,13 @@ function onInstalledMethod() {
     })
 }
 
-function onMessageMethod(req, sender, sendResponse) {
+const getCurrentTab = async () => {
+    let queryOptions = { active: true, lastFocusedWindow: true };
+    let [tab] = await chrome.tabs.query(queryOptions);
+    return tab || {};
+}
+
+async function onMessageMethod(req, sender, sendResponse) {
     try {
 
         if (req) {
@@ -215,6 +221,12 @@ function onMessageMethod(req, sender, sendResponse) {
                 case 'CONTENT_CLOSE_ACH_PAY_NOTICE':
                     closeAchPayNoticeHandler();
                     break;
+                case 'POPUP_SHOW_CONTENT_POPUP_PAGE':
+                    console.log('sender', sender)
+                    let tab = await getCurrentTab();
+                    
+                    chrome.tabs.sendMessage(tab.id, { actionType: 'BG_SHOW_CONTENT_POPUP_PAGE', data: ''}, (res) => { console.log(res) });
+                    break
             }
         }
     } catch (error) {

+ 4 - 0
src/entry/content.js

@@ -210,5 +210,9 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
         case 'Set_ToolBox_Fixed':
             toolBox.switchStatus(req)
             break
+        case 'BG_SHOW_CONTENT_POPUP_PAGE':
+            console.log('BG_SHOW_CONTENT_POPUP_PAGE')
+            showPopupPage();
+            break
     }
 })

+ 4 - 4
src/view/components/popup-withdraw.vue

@@ -213,7 +213,7 @@ const withdraw = () => {
     }
     params.withdrawReceiveAccount = params.withdrawReceiveAccount.replace(/\s*/g, "");
     params.amountValue = params.amountValue;
-    if (parseInt(params.amountValue) > parseInt(canWithdrawBalance.value)) {
+    if (+params.amountValue > +canWithdrawBalance.value) {
         return;
     }
     withdrawIng.value = true;
@@ -259,7 +259,7 @@ const onAmountInput = () => {
     setWithdrawIptStatus(value);
 
     // 输入金额大于可提现金额
-    if (parseInt(value) > parseInt(canWithdrawBalance.value)) {
+    if (+value > +canWithdrawBalance.value) {
         if (!showWithdrawError.value) {
             showWithdrawIptError.value = true;
         }
@@ -275,8 +275,8 @@ const onAmountInput = () => {
 const setWithdrawIptStatus = (amount) => {
     //显示tips
     if (
-        amount > 0 &&
-        amount < walletWithdrawConfig.value.withdrawPerMinAmount
+        +amount > 0 &&
+        +amount < +walletWithdrawConfig.value.withdrawPerMinAmount
     ) {
         showWithdrawError.value = true;
     } else {

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

@@ -295,9 +295,16 @@ const confirmDeposit = (params) => {
   let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
   setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
 
-  chrome.tabs.create({
+  chrome.runtime.sendMessage({ 
+      actionType: "POPUP_SHOW_CONTENT_POPUP_PAGE", 
+      data: { } 
+  }, () => { });
+
+  setTimeout(() => {
+    chrome.tabs.create({
       url: guideUrl
-  });
+    });
+  }, 600)
 }
 
 const onDepositAmountInput = async (params = {}) => {