Browse Source

[edit] paypal withdraw

wenliming 2 years ago
parent
commit
b6bf2a8420

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

@@ -1,10 +1,14 @@
+import { getChromeStorage } from '@/uilts/chromeExtension.js'
+
 export const closeAchPayNoticeHandler = async () => {
 export const closeAchPayNoticeHandler = async () => {
     let {id} = await getCurrentTab();
     let {id} = await getCurrentTab();
 
 
     chrome.tabs.remove(
     chrome.tabs.remove(
-        id,
-        () => {
-            // chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab.index })
+        id, () => {
+            getChromeStorage('achPayInfo', (res) => {
+                chrome.storage.local.remove("achPayInfo");
+                chrome.tabs.highlight({ windowId: res.tab.windowId, tabs: res.tab.index })
+            })
         }
         }
     )
     )
 }
 }

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

@@ -200,7 +200,7 @@ const withdrawCalcAmountDebounce = debounce(function () {
  */
  */
 const withdraw = () => {
 const withdraw = () => {
     console.log("requestWithdrawParams.value", requestWithdrawParams.value);
     console.log("requestWithdrawParams.value", requestWithdrawParams.value);
-    if (withdrawIng.value) {
+    if (withdrawIng.value || calcReq.value || showWithdrawError.value || showWithdrawIptError.value) {
         return;
         return;
     }
     }
 
 

+ 7 - 4
src/view/iframe/ach-pay/cashier.vue

@@ -43,9 +43,13 @@ let pageData = reactive({
 const getLocalPayInfo = async () => {
 const getLocalPayInfo = async () => {
     let payInfo = await getChromeStorage('achPayInfo');
     let payInfo = await getChromeStorage('achPayInfo');
 
 
-    console.log(payInfo,'payInfo');
-    if(payInfo) {
-        chrome.storage.local.remove("achPayInfo");
+    if(payInfo && payInfo.amountValue) {
+        let achPayInfo = {
+            amountValue: '',
+            tab: payInfo.tab
+        };
+        setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+
         usdRechargeRequestByAchpay({
         usdRechargeRequestByAchpay({
             params: {
             params: {
                 amountValue: payInfo.amountValue
                 amountValue: payInfo.amountValue
@@ -54,7 +58,6 @@ const getLocalPayInfo = async () => {
             if(res.code == 0) {
             if(res.code == 0) {
                 pageData.formData = res.data;
                 pageData.formData = res.data;
                 nextTick(() => {
                 nextTick(() => {
-                    console.log('form', formDom.value,   pageData.formData);
                     formDom.value && formDom.value.submit();
                     formDom.value && formDom.value.submit();
                 })
                 })
             }
             }

+ 13 - 5
src/view/iframe/publish/components/pay-button.vue

@@ -113,11 +113,19 @@ const clickPayUSD = () => {
         setTimeout(() => {
         setTimeout(() => {
             emits("showDepositMask", {});
             emits("showDepositMask", {});
         }, 1000)
         }, 1000)
-        let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
-        setChromeStorage({ achPayInfo : JSON.stringify({'amountValue': props.finalAmountData.rechargeAmountValue})})    
-        chrome.tabs.create({
-            url: guideUrl
-        });
+        chrome.tabs.getCurrent(tab =>{
+            let achPayInfo = {
+                amountValue: props.finalAmountData.rechargeAmountValue,
+                tab: tab
+            };
+            let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
+            setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+
+            chrome.tabs.create({
+                url: guideUrl
+            });
+        })
+
     } else {
     } else {
         balancePay();
         balancePay();
     }
     }

+ 7 - 1
src/view/popup/currency-detail.vue

@@ -152,7 +152,13 @@ const clickDeposit = () => {
       showCurrencySelect.value = true;
       showCurrencySelect.value = true;
       currencyOpertionType = "DEPOSIT";
       currencyOpertionType = "DEPOSIT";
     } else if(currenciesData.value.length == 1){
     } else if(currenciesData.value.length == 1){
-      depositHandle(currenciesData.value[0]);
+      let currencyInfo = currenciesData.value[0];
+      if(currencyInfo.currencyCode == 'USD') {
+        // 法币充值
+          
+      } else {
+        depositHandle(currencyInfo);
+      }
     }
     }
 }
 }