Browse Source

[edit][chromeExtensionUrl]

zhangwei 2 years ago
parent
commit
d9943eceaf

+ 6 - 5
src/logic/content/ParseCard.js

@@ -1,6 +1,7 @@
 import ToolBox from '@/view/content/tool-box/index.vue'
 import { createApp } from 'vue'
 import { getStorage, setStorage } from '@/uilts/help'
+import { chromeExtensionUrl } from '@/uilts/chromeExtension'
 // 解析卡片类
 // 1.dom匹配
 // 2.找出网页匹配 获取twitterid
@@ -283,7 +284,7 @@ class ParseCard {
             tweet_str = `&tweetId=${tweet_Id}`
         }
         _iframe.id = post_Id
-        _iframe_url = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/tool-box.html') + `?page_type=${'card'}&postId=${post_Id}&tweetId=${tweet_Id}`;
+        _iframe_url = chromeExtensionUrl + ('iframe/tool-box.html') + `?page_type=${'card'}&postId=${post_Id}&tweetId=${tweet_Id}`;
         _iframe.allow = "camera *;microphone *"
         // debugger mode
         if (window.location.href.includes('denet_debugger')) {
@@ -302,7 +303,7 @@ class ParseCard {
             tweet_str = `&tweetId=${tweet_Id}`
         }
         _iframe.id = post_Id
-        _iframe_url = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}&page_type=${page_type}`;
+        _iframe_url = chromeExtensionUrl + ('iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}&page_type=${page_type}`;
         // debugger mode
         if (window.location.href.includes('denet_debugger')) {
             _iframe_url = _iframe_url + '&denet_debugger=1'
@@ -319,21 +320,21 @@ class ParseCard {
         let projectId = project_arr[0]
         let _iframe = document.createElement('iframe')
         _iframe.id = project_Id
-        _iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/nft-card.html') + `?projectId=${projectId}&tweetId=${tweet_Id}&twitterAccount=${project_arr[1]}`;
+        _iframe.src = chromeExtensionUrl + ('iframe/nft-card.html') + `?projectId=${projectId}&tweetId=${tweet_Id}&twitterAccount=${project_arr[1]}`;
         _iframe.style.cssText = 'border:medium none; width:375px; min-height:300px;'
         return _iframe
     }
     createNftGroupIframe({ project_Id, tweet_Id }) {
         let _iframe = document.createElement('iframe')
         _iframe.id = project_Id
-        _iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/nft-group-card.html') + `?projectId=${project_Id}&tweet_Id=${tweet_Id}`;
+        _iframe.src = chromeExtensionUrl + ('iframe/nft-group-card.html') + `?projectId=${project_Id}&tweet_Id=${tweet_Id}`;
         _iframe.style.cssText = 'border:medium none; width:505px; min-height:180px;'
         return _iframe
     }
     createTreasureIframe(params = { page_type, tweet_Id, post_Id, invite_code }) {
         let _iframe = document.createElement('iframe')
         _iframe.id = params.post_Id
-        _iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/treasure-hunt.html') + `?params=${JSON.stringify(params)}`;
+        _iframe.src = chromeExtensionUrl + ('iframe/treasure-hunt.html') + `?params=${JSON.stringify(params)}`;
         _iframe.style.cssText = 'border:medium none; width:375px; min-height:500px; border: 1px solid #DCDCDC; border-radius: 20px;'
         return _iframe
     }

+ 4 - 2
src/logic/content/ToolBox.js

@@ -1,4 +1,6 @@
 import { $ } from "@/uilts/help";
+import { chromeExtensionUrl } from '@/uilts/chromeExtension'
+
 export let toolbox_fixed_tweetId = ''
 
 export const toolBox = new class ToolBox {
@@ -18,7 +20,7 @@ export const toolBox = new class ToolBox {
             display:none;
             border:medium none;  filter: drop-shadow(rgba(0, 0, 0, 0.2) 0px 4px 20px);
             `
-        iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/tool-box.html') + `?page_type=${'full'}`;
+        iframe.src = chromeExtensionUrl + ('iframe/tool-box.html') + `?page_type=${'full'}`;
         iframe.allow = "camera *;microphone *"
         document.body.append(iframe)
     }
@@ -59,7 +61,7 @@ export const toolBox = new class ToolBox {
     // 购买NFT
     buyNft(req) {
         let iframe = document.createElement('iframe')
-        iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/tool-box-buy-nft.html') + `?postId=${req.data.postId}`;
+        iframe.src = chromeExtensionUrl + ('iframe/tool-box-buy-nft.html') + `?postId=${req.data.postId}`;
         let ifAppend = document.querySelector('#denet-tool-box-buy-nft')
         if (ifAppend) return;
         let div = document.createElement(`div`);

+ 3 - 3
src/logic/content/nft.js

@@ -1,6 +1,6 @@
 import { getOffsetRect, nextTick } from '@/uilts/help'
 import { listJoinNftGroup } from '@/http/nft';
-import { getChromeStorage } from '@/uilts/chromeExtension.js'
+import { getChromeStorage, chromeExtensionUrl } from '@/uilts/chromeExtension.js'
 import { _setPublishContent, publishNFTTweetPost, bindTwitterArt, bindTwitterArtMethod } from './twitter';
 import { jumpTwitterDetailByAlert } from '@/logic/content/help/twitter.js'
 import Report from "@/log-center/log"
@@ -61,7 +61,7 @@ export const showNFTGroupList = (e) => {
     let wHeight = document.body.offsetHeight || document.body.clientHeight;
     if ((top + height + 290) > wHeight) oTop = top - 290;
     let iframe = document.createElement('iframe');
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/nft-group.html`)
+    iframe.src = chromeExtensionUrl + (`iframe/nft-group.html`)
     iframe.style.cssText = 'border:medium none; width:315px; height:260px;';
     let html = document.createElement('div');
     html.id = 'de-nft-group-list';
@@ -200,7 +200,7 @@ export const addJoinedGroupList = () => {
 
         let iframe = document.createElement('iframe');
         iframe.id = 'de-joined-group-list';
-        iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/joined-group-list.html');
+        iframe.src = chromeExtensionUrl + ('iframe/joined-group-list.html');
         iframe.style.cssText = `border: medium none;height: 120px;border-radius: 16px;margin-bottom: 16px`
 
         let iframeContent = document.getElementById('de-joined-group-list');

+ 52 - 51
src/logic/content/twitter.js

@@ -1,7 +1,8 @@
-import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
+import { getChromeStorage, setChromeStorage, chromeExtensionUrl } from '@/uilts/chromeExtension.js'
 import { throttle, getQueryString, getCookie, nextTick, getQueryStringByUrl, getStorage, setStorage } from '@/uilts/help'
 import { discordAuthRedirectUri, iframeHost } from '@/http/configAPI'
 import { reportSrcPublishEvent } from '@/http/publishApi'
+
 import Report from "@/log-center/log"
 import { fetchAddFinishEvent } from '@/logic/background/fetch/facebook';
 import { showNFTGroupIcon, hideNFTGroupList, checkUserJoinGroup, elemAddEventListener, addJoinedGroupList } from '@/logic/content/nft';
@@ -398,7 +399,7 @@ function _addIframe() {
     // let span = document.createElement('span');
     // const shadowRoot = span.attachShadow({mode: 'closed'})
     let iframe = document.createElement('iframe');
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/publish.html')
+    iframe.src = chromeExtensionUrl + ('iframe/publish.html')
     iframe.id = 'iframe-content'
     iframe.style.cssText = 'position:fixed;top:0px;right:0;display:block; width:100%;height:100%;z-index:10000; border: medium none;display:none;background: rgba(255,255,255,0);';
     // shadowRoot.appendChild(iframe);
@@ -421,9 +422,9 @@ function addPublishTipsIframe(params = {}) {
             let iframe = document.createElement('iframe');
             iframe.id = 'de-publish-tips'
             if (params.type == 'nft') {
-                iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/publish-tips.html?type="nft"');
+                iframe.src = chromeExtensionUrl + ('iframe/publish-tips.html?type="nft"');
             } else {
-                iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/publish-tips.html');
+                iframe.src = chromeExtensionUrl + ('iframe/publish-tips.html');
             }
 
             iframe.style.cssText = `border: medium none; width:270px;height:500px;position: fixed; right: ${right}px; top: 5%;z-index: -1`
@@ -440,7 +441,7 @@ export function noticeBindTweet(params) {
     hidePopupPage();
     let iframe = document.createElement('iframe');
     iframe.id = 'de-notice-bind-tweet';
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/bind-tweet.html') + `?params=${JSON.stringify(params)}`;
+    iframe.src = chromeExtensionUrl + ('iframe/bind-tweet.html') + `?params=${JSON.stringify(params)}`;
     iframe.style.cssText = `border: medium none; width:400px;min-height:313px;position: fixed; right: 16px; top: 16px;border-radius: 20px;`
     let iframeContent = document.getElementById('de-notice-bind-tweet');
     if (!iframeContent) {
@@ -1027,25 +1028,25 @@ export function init() {
 }
 
 export const getTweetUserFollowStatus = (params) => {
-  let {tweetId, userList} = params.data;
-  let promiseList = [];
-  for(let i = 0; i < userList.length; i++) {
-    promiseList[i] = TwitterApiUserByScreenNameReq({screen_name: userList[i]['name']});
-  }
-
-  Promise.all(promiseList).then((res) => {
-    let list = [];
-    if(res && res.length) {
-      for(let i = 0; i < res.length; i++) {
-        let item = res[i];
-        if(item && item.data && item.data.data) {
-          list.push(item.data.data)
+    let { tweetId, userList } = params.data;
+    let promiseList = [];
+    for (let i = 0; i < userList.length; i++) {
+        promiseList[i] = TwitterApiUserByScreenNameReq({ screen_name: userList[i]['name'] });
+    }
+
+    Promise.all(promiseList).then((res) => {
+        let list = [];
+        if (res && res.length) {
+            for (let i = 0; i < res.length; i++) {
+                let item = res[i];
+                if (item && item.data && item.data.data) {
+                    list.push(item.data.data)
+                }
+            }
         }
-      }
-    }
 
-    chrome.runtime.sendMessage({ actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES', data: list, tweetId }, () => { })
-  })
+        chrome.runtime.sendMessage({ actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES', data: list, tweetId }, () => { })
+    })
 }
 
 function onPageVisbile() {
@@ -1411,7 +1412,7 @@ export function showJoinDialog(data) {
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'block'
     iframe.contentWindow.postMessage({ actionType: 'SHOW_JOIN_DATA', data }, '*');
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/buy-nft.html#/group?params=${JSON.stringify(data)}&time=${new Date().getTime()}`)
+    iframe.src = chromeExtensionUrl + (`iframe/buy-nft.html#/group?params=${JSON.stringify(data)}&time=${new Date().getTime()}`)
 }
 
 const TwitterFollowAPI = (item, tweet_Id) => {
@@ -1560,33 +1561,33 @@ const TwitterApiCreateTweet = ({ text, tweet_Id }) => {
 }
 
 const TwitterApiUserByScreenNameReq = (params) => {
-  let {screen_name} = params || {};
-  return axios.get(`https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22${screen_name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`, {
-      headers: {
-          "accept": "*/*",
-          "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
-          "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
-          "content-type": "application/json",
-          "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
-          "sec-ch-ua-mobile": "?0",
-          "sec-ch-ua-platform": "\"Windows\"",
-          "sec-fetch-dest": "empty",
-          "sec-fetch-mode": "cors",
-          "sec-fetch-site": "same-origin",
-          "x-csrf-token": getCookie('ct0'),
-          "x-twitter-active-user": "yes",
-          "x-twitter-auth-type": "OAuth2Session",
-          "x-twitter-client-language": "en"
-      },
-  })
+    let { screen_name } = params || {};
+    return axios.get(`https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22${screen_name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`, {
+        headers: {
+            "accept": "*/*",
+            "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
+            "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
+            "content-type": "application/json",
+            "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
+            "sec-ch-ua-mobile": "?0",
+            "sec-ch-ua-platform": "\"Windows\"",
+            "sec-fetch-dest": "empty",
+            "sec-fetch-mode": "cors",
+            "sec-fetch-site": "same-origin",
+            "x-csrf-token": getCookie('ct0'),
+            "x-twitter-active-user": "yes",
+            "x-twitter-auth-type": "OAuth2Session",
+            "x-twitter-client-language": "en"
+        },
+    })
 }
 
 
 export const TwitterApiUserByScreenName = (params, cb) => {
-    let { screen_name, tweetId = '', objectType = ''} = params;
+    let { screen_name, tweetId = '', objectType = '' } = params;
 
-    TwitterApiUserByScreenNameReq({screen_name}).then(function (response) {
-      chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: response.data.data || {}, tweetId, objectType }, () => { })
+    TwitterApiUserByScreenNameReq({ screen_name }).then(function (response) {
+        chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: response.data.data || {}, tweetId, objectType }, () => { })
     }).catch(function (err) {
         chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: {}, tweetId, objectType }, () => { })
     });
@@ -1745,7 +1746,7 @@ const initGroupTip = () => {
         if (iframe_banner) {
             if (twitterAccount != getQueryStringByUrl(iframe_banner.src, 'twitterAccount')) {
                 iframe_banner.style.display = 'none'
-                // iframe_banner.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
+                // iframe_banner.src = chromeExtensionUrl + (`iframe/group-card.html?twitterAccount=${twitterAccount}`)
                 iframe_banner.contentWindow.postMessage({ actionType: 'SHOW_BANNER', twitterAccount }, '*');
             }
             return
@@ -1755,7 +1756,7 @@ const initGroupTip = () => {
             let iframe = document.createElement('iframe')
             iframe.id = 'denet_group_banner'
             iframe.style.cssText = 'border: medium none; display:none; width:100%; height:100px;'
-            iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
+            iframe.src = chromeExtensionUrl + (`iframe/group-card.html?twitterAccount=${twitterAccount}`)
             // iframe.contentWindow.postMessage({ actionType: 'SHOW_BANNER', twitterAccount }, '*');
             if (dom && !dom.parentNode.children[0].querySelector('iframe')) {
                 // dom.parentNode.insertBefore(iframe, dom)
@@ -1786,7 +1787,7 @@ export const showBuyNFT = ({ nft_project_Id, post_Id = '' }) => {
     }
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'block'
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/buy-nft.html#/?nftProjectId=${nft_project_Id}&postId=${post_Id}`)
+    iframe.src = chromeExtensionUrl + (`iframe/buy-nft.html#/?nftProjectId=${nft_project_Id}&postId=${post_Id}`)
 }
 
 const initBuyNFT = () => {
@@ -1805,7 +1806,7 @@ export const showNFTCard = () => {
     let where = isTwitter && userElem && tabIndex;
     if (where) {
         let iframe = document.createElement('iframe');
-        iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + (`/iframe/nft-card.html`)
+        iframe.src = chromeExtensionUrl + (`iframe/nft-card.html`)
         iframe.style.cssText = 'border:medium none; width:100%; height:290px;';
         let nftElement = document.createElement('div');
         nftElement.id = 'de-nft-node';
@@ -1846,7 +1847,7 @@ export const appendPopupPage = (params = {}) => {
 
     let iframe = document.createElement('iframe');
     iframe.id = 'de-popup-page';
-    iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/popup-page.html') + `#${path}`;
+    iframe.src = chromeExtensionUrl + ('iframe/popup-page.html') + `#${path}`;
     iframe.style.cssText = `border: medium none; width: 375px !important;
         height: 650px;position: fixed; right: 16px; top: 16px;background: #FFFFFF;border: 0.5px solid #919191;box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);box-sizing: border-box;z-index: 90000;
         animation-duration: 0.5s !important;
@@ -1893,7 +1894,7 @@ export const showPopupPage = (params = {}) => {
     }
     if (iframe) {
         if (path) {
-            iframe.src = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/popup-page.html') + `#${path}`;
+            iframe.src = chromeExtensionUrl + ('iframe/popup-page.html') + `#${path}`;
         }
         iframe.style.transform = 'translateX(-' + 395 + 'px)';
 

+ 1 - 0
src/uilts/chromeExtension.js

@@ -68,6 +68,7 @@ export function getChromeStorage(key = '', callback) {
 //     } catch {
 //     }
 // }
+export let chromeExtensionUrl = chrome.runtime.getURL('/')
 
 export function setChromeCookie({
     name,

+ 26 - 27
src/view/iframe/buy-nft/buy/pay.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="dialog" :style="{'height': dialogStyle.height + 'px'}">
+    <div class="dialog" :style="{ 'height': dialogStyle.height + 'px' }">
         <!-- home -->
         <div class="area-title">
             <img :src="require('@/assets/svg/icon-back.svg')" @click="clickBack" />
@@ -7,8 +7,7 @@
         </div>
         <!-- 内容 -->
         <div class="area-content">
-            <div
-                class="left"
+            <div class="left"
                 :class="{ auto: tempCurrentCurrencyInfo.currencyCode === 'USD' && Number(finalAmountData.rechargeAmountValue) <= 0 }">
                 <img :src="require('@/assets/img/img-box5.png')" v-show="pay_info.home.sale_plan.itemCount == 5"
                     alt="" />
@@ -22,8 +21,7 @@
                     </div>
                 </div>
             </div>
-            <div
-                class="right"
+            <div class="right"
                 :class="{ none: tempCurrentCurrencyInfo.currencyCode === 'USD' && Number(finalAmountData.rechargeAmountValue) <= 0 }">
                 <div class="card-content" v-if="tempCurrentCurrencyInfo.currencyCode">
                     <template v-if="tempCurrentCurrencyInfo.currencyCode !== 'USD'">
@@ -49,8 +47,7 @@
                             <img class="img" :src="require('@/assets/subject/top-01.svg')" />
                             <div class="font">Deposit to Send Giveaway</div>
                         </div>
-                        <payment-info-usd
-                            :finalAmountData="finalAmountData">
+                        <payment-info-usd :finalAmountData="finalAmountData">
                         </payment-info-usd>
                     </template>
                 </div>
@@ -104,19 +101,19 @@
                         <div class="desc">Balance</div>
                         <div class="price">
                             $
-                            {{tempCurrentCurrencyInfo.balance}}
+                            {{ tempCurrentCurrencyInfo.balance }}
                         </div>
                     </div>
-                    <img class="refresh"
-                        :class="{ 'icon-refresh-rotate': refreshRotate }"
-                        :src=" require('@/assets/svg/icon-form-refresh.svg')"
-                        @click="updateCurrencyBanlce"/>
+                    <img class="refresh" :class="{ 'icon-refresh-rotate': refreshRotate }"
+                        :src="require('@/assets/svg/icon-form-refresh.svg')" @click="updateCurrencyBanlce" />
                 </div>
                 <!-- Play -->
                 <div class="buy1 usd" @click="clickPayUSD">
                     <div class="left">Pay</div>
                     <div class="right">
-                        {{ finalAmountData.rechargeAmountValue > 0 ? finalAmountData.rechargeAmountValue : finalAmountData.orderAmountValue }}
+                        {{ finalAmountData.rechargeAmountValue > 0 ? finalAmountData.rechargeAmountValue :
+                                finalAmountData.orderAmountValue
+                        }}
                         {{ pay_info.home.sale_plan.currencyInfo.tokenSymbol }}
                     </div>
                 </div>
@@ -125,10 +122,7 @@
     </div>
 
     <!-- 预览页充值 -->
-    <message-box
-        :dialogVisible="showDepositMessageBox"
-        title="Is the Deposit Completed?"
-        @cancel="depositAchCancel"
+    <message-box :dialogVisible="showDepositMessageBox" title="Is the Deposit Completed?" @cancel="depositAchCancel"
         @confirm="depositAchConfirm">
     </message-box>
 </template>
@@ -145,7 +139,7 @@ import messageBox from "@/view/components/message-box.vue";
 import BtnLoading from '../components/btn-loading.vue'
 import { payNftMysteryBoxWithBalance } from "@/http/pay";
 import { calcRechargePayAmount } from "@/http/account";
-import { getChromeStorage, setChromeStorage } from "@/uilts/chromeExtension"
+import { getChromeStorage, setChromeStorage, chromeExtensionUrl } from "@/uilts/chromeExtension"
 import { ElMessage } from 'element-plus'
 import "element-plus/es/components/message/style/css";
 import { sendChromeTabMessage } from '@/uilts/chromeExtension.js';
@@ -181,7 +175,7 @@ let dialogStyle = reactive({
 
 const calcRechPayAmount = async (params) => {
     let res = await calcRechargePayAmount({
-        params : params
+        params: params
     })
 
     if (res.code == 0) {
@@ -285,17 +279,17 @@ const clickPlay = () => {
 }
 
 const clickPayUSD = () => {
-    if(Number(finalAmountData.value.rechargeAmountValue) > 0) {
+    if (Number(finalAmountData.value.rechargeAmountValue) > 0) {
         setTimeout(() => {
             showDepositMessageBox.value = true;
         }, 1000)
-        chrome.tabs.getCurrent(tab =>{
+        chrome.tabs.getCurrent(tab => {
             let achPayInfo = {
                 amountValue: finalAmountData.value.rechargeAmountValue,
                 tab: tab
             };
-            let guideUrl = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/ach-cashier.html');
-            setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+            let guideUrl = chromeExtensionUrl + ('iframe/ach-cashier.html');
+            setChromeStorage({ achPayInfo: JSON.stringify(achPayInfo) });
 
             chrome.tabs.create({
                 url: guideUrl
@@ -315,7 +309,7 @@ let tempCurrentCurrencyInfo = ref({});
 
 const refreshRotate = ref(false);
 const updateCurrencyBanlce = () => {
-    if(!refreshRotate.value) {
+    if (!refreshRotate.value) {
         refreshRotate.value = true;
         getCurrencyInfo()
         setTimeout(() => {
@@ -362,7 +356,7 @@ const amountInterval = () => {
 
 const setDialogStyle = () => {
     let clientHeight = window.innerHeight;
-    if(clientHeight >= 840) {
+    if (clientHeight >= 840) {
         dialogStyle.height = 800;
     } else {
         dialogStyle.height = clientHeight - 40;
@@ -460,7 +454,7 @@ onUnmounted(() => {
 
             .tip {
                 margin-top: 15px;
-                font-size: 16px;    
+                font-size: 16px;
                 display: flex;
                 justify-content: space-between;
 
@@ -480,7 +474,7 @@ onUnmounted(() => {
         .right {
             width: 400px;
             margin: 30px 56px 0px 30px;
-            
+
             &.none {
                 display: none;
             }
@@ -649,23 +643,28 @@ onUnmounted(() => {
 .balance {
     display: flex;
     margin-right: 20px;
+
     .icon {
         width: 40px;
         height: 40px;
     }
+
     .con {
         padding: 0 5px;
+
         .desc {
             color: rgba($color: #000000, $alpha: 0.5);
             font-size: 12px;
             margin-bottom: 4px;
         }
+
         .price {
             font-size: 14px;
             font-weight: bold;
             word-break: break-all;
         }
     }
+
     .refresh {
         width: 40px;
         cursor: pointer;

+ 13 - 21
src/view/iframe/publish/components/give-dialog-head.vue

@@ -4,35 +4,25 @@
             <!-- 关闭按钮 -->
             <div class="close-btn" @click="close">
                 <template v-if="publishType == 'TOOL_BOX'">
-                    <img  class="icon-close"
-                    :src="require('@/assets/svg/icon-close.svg')"
-                    v-if="toolBoxPageData.activePage == 'EDITOR'"/>
-                    <img class="icon-close"
-                        :src="require('@/assets/svg/icon-back.svg')"
-                        v-else/>
+                    <img class="icon-close" :src="require('@/assets/svg/icon-close.svg')"
+                        v-if="toolBoxPageData.activePage == 'EDITOR'" />
+                    <img class="icon-close" :src="require('@/assets/svg/icon-back.svg')" v-else />
                 </template>
                 <template v-else>
-                    <img  class="icon-close"
-                    :src="require('@/assets/svg/icon-close.svg')"
-                    v-if="showComType == 'default'"/>
-                    <img class="icon-close"
-                        :src="require('@/assets/svg/icon-back.svg')"
-                        v-else/>
+                    <img class="icon-close" :src="require('@/assets/svg/icon-close.svg')"
+                        v-if="showComType == 'default'" />
+                    <img class="icon-close" :src="require('@/assets/svg/icon-back.svg')" v-else />
                 </template>
             </div>
             <!-- 标题 -->
             <div class="title">
-                {{title}}
+                {{ title }}
             </div>
         </div>
         <div class="right">
             <!-- 更多按钮 -->
-            <img :src="require('@/assets/svg/icon-more-l.svg')"
-                class="more"
-                @click="showMoreOption = true">
-            <div class="area-option" 
-                v-if="showMoreOption" 
-                @click="showMoreOption = false">
+            <img :src="require('@/assets/svg/icon-more-l.svg')" class="more" @click="showMoreOption = true">
+            <div class="area-option" v-if="showMoreOption" @click="showMoreOption = false">
                 <div class="option">
                     <div class="item" @click="goTransactionsList()">
                         <img :src="require('@/assets/svg/icon-menu.svg')">
@@ -46,6 +36,7 @@
 
 <script setup>
 import { ref, defineEmits, defineProps } from "vue";
+import { chromeExtensionUrl } from "@/uilts/chromeExtension"
 
 const props = defineProps({
     publishType: {
@@ -76,7 +67,7 @@ const emits = defineEmits(["close"]);
 let showMoreOption = ref(false);
 
 const goTransactionsList = () => {
-    window.open(`${'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/home.html#/transactions')}`)
+    window.open(`${chromeExtensionUrl + ('iframe/home.html#/transactions')}`)
 }
 
 const close = () => {
@@ -98,6 +89,7 @@ const close = () => {
     .left {
         display: flex;
         align-items: center;
+
         .title {
             font-size: 16px;
             font-weight: 500;
@@ -161,7 +153,7 @@ const close = () => {
                 }
 
                 .item:hover {
-                        background: #F5F5F5;
+                    background: #F5F5F5;
                 }
             }
         }

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

@@ -1,13 +1,13 @@
 <template>
-<!-- pay 支付按钮 -->
+    <!-- pay 支付按钮 -->
     <div class="pay-wrapper">
         <slot name="balance"></slot>
         <div class="pay-btn">
-            <div class="iframe-pay"
-                v-show="currentCurrencyInfo.currencyCode == 'USD'">
-                <div class="token-pay"
-                    @click="clickPayUSD">
-                    Pay ${{finalAmountData.rechargeAmountValue > 0 && USDepositStatus != 'SUCCESS' ? finalAmountData.rechargeAmountValue : finalAmountData.orderAmountValue}}
+            <div class="iframe-pay" v-show="currentCurrencyInfo.currencyCode == 'USD'">
+                <div class="token-pay" @click="clickPayUSD">
+                    Pay ${{ finalAmountData.rechargeAmountValue > 0 && USDepositStatus != 'SUCCESS' ?
+                            finalAmountData.rechargeAmountValue : finalAmountData.orderAmountValue
+                    }}
                 </div>
 
                 <!-- <iframe
@@ -15,11 +15,9 @@
                     ref="iframe"
                     :src="`${payConfig.paypalHtml}?paypalClientId=${payConfig.paypalClientId}&amount=${props.finalAmountData.finalAmountValue}`"></iframe> -->
             </div>
-            <div class="token-pay"
-                :class="{ disabled: Number(currentCurrencyInfo.balance) < Number(payConfig.amount) }"
-                v-if="currentCurrencyInfo.currencyCode != 'USD'"
-                @click="balancePay">
-                Pay {{payConfig.amount || 0}} {{currentCurrencyInfo.tokenSymbol}}
+            <div class="token-pay" :class="{ disabled: Number(currentCurrencyInfo.balance) < Number(payConfig.amount) }"
+                v-if="currentCurrencyInfo.currencyCode != 'USD'" @click="balancePay">
+                Pay {{ payConfig.amount || 0 }} {{ currentCurrencyInfo.tokenSymbol }}
             </div>
         </div>
     </div>
@@ -30,9 +28,9 @@ import { onMounted, ref, defineProps, defineEmits, watch, defineExpose } from "v
 
 import { PlayType } from '@/types';
 
-import {payTaskLuckdropWithBalance} from "@/http/publishApi"
+import { payTaskLuckdropWithBalance } from "@/http/publishApi"
 import Report from "@/log-center/log"
-import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
+import { setChromeStorage, getChromeStorage, chromeExtensionUrl } from "@/uilts/chromeExtension"
 
 const props = defineProps({
     finalAmountData: {
@@ -99,7 +97,7 @@ const balancePay = () => {
     }, {
         type: Report.getCurrentBizType(props.bizType)
     });
-    if(payIng) {
+    if (payIng) {
         return;
     }
     payIng = true;
@@ -109,8 +107,8 @@ const balancePay = () => {
             postId: props.payConfig.postId
         }
     }).then(res => {
-        if(res.code == 0) {
-            emits("payFinish", {...res.data});
+        if (res.code == 0) {
+            emits("payFinish", { ...res.data });
         }
         payIng = false;
     }).catch(() => {
@@ -119,17 +117,17 @@ const balancePay = () => {
 }
 
 const clickPayUSD = () => {
-    if(props.finalAmountData.rechargeAmountValue > 0 && props.USDepositStatus != 'SUCCESS') {
+    if (props.finalAmountData.rechargeAmountValue > 0 && props.USDepositStatus != 'SUCCESS') {
         setTimeout(() => {
             emits("showDepositMask", {});
         }, 1000)
-        chrome.tabs.getCurrent(tab =>{
+        chrome.tabs.getCurrent(tab => {
             let achPayInfo = {
                 amountValue: props.finalAmountData.rechargeAmountValue,
                 tab: tab
             };
-            let guideUrl = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/ach-cashier.html');
-            setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+            let guideUrl = chromeExtensionUrl + ('iframe/ach-cashier.html');
+            setChromeStorage({ achPayInfo: JSON.stringify(achPayInfo) });
 
             chrome.tabs.create({
                 url: guideUrl
@@ -203,13 +201,14 @@ defineExpose({
 
             .icon {
                 width: 14px;
-                margin-left:6px;
+                margin-left: 6px;
             }
 
             .desc {
-                margin-right:6px
+                margin-right: 6px
             }
         }
+
         .msg {
             font-size: 13px;
             color: #898989;
@@ -232,6 +231,7 @@ defineExpose({
             padding: 0 30px;
             word-break: break-all;
             cursor: pointer;
+
             &.disabled {
                 background: #DEDEDE;
             }

+ 16 - 15
src/view/iframe/red-packet/luck-draw.vue

@@ -200,9 +200,10 @@
                     </div>
                 </div>
             </div>
-            <get-more :reportData="{pageSource: Report.pageSource.received_success_page,
-                                    postId: state.postId
-                                    }"></get-more>
+            <get-more :reportData="{
+                pageSource: Report.pageSource.received_success_page,
+                postId: state.postId
+            }"></get-more>
         </div>
 
 
@@ -231,9 +232,9 @@
                 totalCount: state.detail.totalCount,
                 amountValue: state.detail.amountValue,
                 tokenSymbol: state.detail.currencySymbol,
-                currencyCode: state.detail.amountCurrencyCode,
-                currencyIconUrl: state.detail.currencyIconPath,
-                type: PlayType.lottery,
+                encyCode: state.detail.amountCurrencyCode,
+                encyIconUrl: state.detail.currencyIconPath,
+                pe: PlayType.lottery,
                 validityDuration: state.count_down_time,
                 countDown: state.count_down_time,
                 userInfo: {
@@ -270,7 +271,7 @@
                 </div>
             </div>
             <div class="luck-list" @scroll="handleScroll">
-                <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
+                <div class="luck-item" v-for="item, i in     state.detail.allReceived" v-bind:key="i">
                     <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
                         @click="openTwitterDetail(item)" />
                     <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
@@ -349,10 +350,10 @@
                     <img :src="require('@/assets/svg/icon-win-time.svg')" alt />
                     <span>{{ state.count_down_time || '' }}</span>
                 </div>
-                <get-more :style_type="2"
-                          :reportData="{pageSource: Report.pageSource.waitingLotteryPage,
-                                        postId: state.postId
-                                      }"></get-more>
+                <get-more :style_type="2" :reportData="{
+                    pageSource: Report.pageSource.waitingLotteryPage,
+                    postId: state.postId
+                }"></get-more>
                 <div class="notification_switch" v-if="state.notification_show">
                     <span>Announcement Notification</span>
                     <a-switch v-model:checked="state.notification_switch" @change="changeNotification" />
@@ -410,8 +411,8 @@
                 </div>
             </div>
             <get-more :reportData="{
-              pageSource: Report.pageSource.missingLotteryPage,
-              postId: state.postId
+                pageSource: Report.pageSource.missingLotteryPage,
+                postId: state.postId
             }" v-if="state.close_status != '等待结果'"></get-more>
         </div>
 
@@ -457,7 +458,7 @@ import FontAmount from '@/view/components/font-amount.vue'
 import FontZoom from '@/view/components/font-zoom.vue'
 import ComponentZoom from '@/view/components/component-zoom.vue'
 import GetMore from '@/view/iframe/publish/components/get-more.vue'
-import { setChromeStorage, getChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
+import { setChromeStorage, getChromeStorage, sendChromeTabMessage, chromeExtensionUrl } from '@/uilts/chromeExtension.js'
 import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
@@ -603,7 +604,7 @@ async function clickLikeBtn() {
     });
 }
 function clickDone() {
-    window.open(`${'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/home.html')}`)
+    window.open(`${chromeExtensionUrl + ('iframe/home.html')}`)
     // 埋点
     Report.reportLog({
         objectType: Report.objectType.wallet_button,

+ 9 - 9
src/view/iframe/red-packet/red-packet.vue

@@ -210,10 +210,10 @@
           </div>
         </div>
       </div>
-      <get-more  :reportData="{
-                    pageSource: Report.pageSource.received_success_page,
-                    postId: state.postId
-                  }" ></get-more>
+      <get-more :reportData="{
+        pageSource: Report.pageSource.received_success_page,
+        postId: state.postId
+      }"></get-more>
     </div>
 
 
@@ -368,9 +368,9 @@
         </div>
       </div>
       <get-more :reportData="{
-                    pageSource: Report.pageSource.expiredPage,
-                    postId: state.postId
-                  }" ></get-more>
+        pageSource: Report.pageSource.expiredPage,
+        postId: state.postId
+      }"></get-more>
     </div>
 
 
@@ -413,7 +413,7 @@ import { message } from 'ant-design-vue';
 import FontAmount from '@/view/components/font-amount.vue'
 import FontZoom from '@/view/components/font-zoom.vue'
 import GetMore from '@/view/iframe/publish/components/get-more.vue'
-import { setChromeStorage, getChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
+import { setChromeStorage, getChromeStorage, sendChromeTabMessage, chromeExtensionUrl } from '@/uilts/chromeExtension.js'
 import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
@@ -552,7 +552,7 @@ async function clickLikeBtn() {
   });
 }
 function clickDone() {
-  window.open(`${'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/home.html')}`)
+  window.open(`${chromeExtensionUrl + ('iframe/home.html')}`)
   // 埋点
   Report.reportLog({
     objectType: Report.objectType.wallet_button,

+ 178 - 187
src/view/popup/currency-detail.vue

@@ -1,34 +1,27 @@
 <template>
   <div class="currency-detail-page">
-    <v-head :title="currencyInfo.tokenSymbol" 
-            :show_more="false"
-            :show_refresh="true"
-            :show_list="true"
-            :transactionsRouterParams="{
-              backUrl: 'back'
-            }"
-            back_url="/"
-            @on-refresh="onRefresh" />
+    <v-head :title="currencyInfo.tokenSymbol" :show_more="false" :show_refresh="true" :show_list="true"
+      :transactionsRouterParams="{
+        backUrl: 'back'
+      }" back_url="/" @on-refresh="onRefresh" />
     <div class="top">
-      <img
-        class="icon-currency"
-        :src="currencyInfo.iconPath"/>
+      <img class="icon-currency" :src="currencyInfo.iconPath" />
       <div class="amount">
         <div class="balance"
-            :class="{'direction-column': (currencyInfo.totalBalance.length + currencyInfo.tokenSymbol.length) > 15}">
+          :class="{ 'direction-column': (currencyInfo.totalBalance.length + currencyInfo.tokenSymbol.length) > 15 }">
           <a-tooltip :title="currencyInfo.totalBalance">
-              {{ getBit(currencyInfo.totalBalance) }}
-          </a-tooltip> 
+            {{ getBit(currencyInfo.totalBalance) }}
+          </a-tooltip>
           <template v-if="currencyInfo.totalBalance.length + currencyInfo.tokenSymbol.length < 16">
             &nbsp;&nbsp;
           </template>
           <span class="symbol">
-            {{currencyInfo.tokenSymbol}}
+            {{ currencyInfo.tokenSymbol }}
           </span>
         </div>
         <div class="final">
-          <a-tooltip :title="'$'+currencyInfo.totalUsdEstimateBalance">
-              ${{ getBit(currencyInfo.totalUsdEstimateBalance) }}
+          <a-tooltip :title="'$' + currencyInfo.totalUsdEstimateBalance">
+            ${{ getBit(currencyInfo.totalUsdEstimateBalance) }}
           </a-tooltip>
         </div>
       </div>
@@ -36,7 +29,7 @@
     <div class="bottom">
       <template v-if="showSendBtn">
         <div class="btn send-btn" v-if="enableRecharge == 1" @click="showSendGiveawayDialog(currencyInfo)">
-          <img :src="require('@/assets/svg/icon-send-giveaway.svg')" /> 
+          <img :src="require('@/assets/svg/icon-send-giveaway.svg')" />
           Send Giveaway
         </div>
         <div class="btn-wrapper">
@@ -51,23 +44,15 @@
     </div>
 
     <template v-if="showCurrencySelect">
-        <div class="selectDiv">
-            <currency-select 
-                ref="currencySelectDom"
-                :list="currenciesData"
-                @selectCurrency="selectCurrency">
-            </currency-select>
-        </div>
-        <div class="selectBg" @click="showCurrencySelect = false"></div>
+      <div class="selectDiv">
+        <currency-select ref="currencySelectDom" :list="currenciesData" @selectCurrency="selectCurrency">
+        </currency-select>
+      </div>
+      <div class="selectBg" @click="showCurrencySelect = false"></div>
     </template>
-    <input-action-sheet 
-      :visible="showDepositInput"
-      title="Enter the USD amount to be deposited"
-      :desc="depositDesc"
-      position="absolute"
-      @onInput="onDepositAmountInput"
-      @cancel="cancelDeposit"
-      @confirm="confirmDeposit"></input-action-sheet>
+    <input-action-sheet :visible="showDepositInput" title="Enter the USD amount to be deposited" :desc="depositDesc"
+      position="absolute" @onInput="onDepositAmountInput" @cancel="cancelDeposit" @confirm="confirmDeposit">
+    </input-action-sheet>
   </div>
 </template>
 
@@ -78,7 +63,7 @@ import Report from "@/log-center/log";
 import { getStorage } from "@/uilts/help";
 
 import { getCurrencyInfoBySymbol, syncChainTokenRechargeRecord } from "@/http/publishApi";
-import {setChromeStorage} from "@/uilts/chromeExtension"
+import { setChromeStorage, chromeExtensionUrl } from "@/uilts/chromeExtension"
 
 import VHead from '@/view/popup/components/head.vue'
 import currencySelect from "@/view/components/currency-select.vue";
@@ -109,42 +94,42 @@ let finalAmountData = ref({});
 
 
 const selectCurrency = (params) => {
-    showCurrencySelect.value = false;
-    let {enableRecharge, enableWithdraw} = params;
+  showCurrencySelect.value = false;
+  let { enableRecharge, enableWithdraw } = params;
 
-    if(currencyOpertionType == 'WITHDRAW') {
-      if(enableWithdraw != 1) {
-        return;
-      }
-      withdrawHandle(params);
-    } else if(currencyOpertionType == 'DEPOSIT') {
-      if(enableRecharge != 1) {
-        return;
-      }
-      depositHandle(params);
-    } else if(currencyOpertionType == 'SEND') {
-      if(enableRecharge != 1) {
-        return;
-      }
-      showSendGiveawayDialog(params);
+  if (currencyOpertionType == 'WITHDRAW') {
+    if (enableWithdraw != 1) {
+      return;
     }
+    withdrawHandle(params);
+  } else if (currencyOpertionType == 'DEPOSIT') {
+    if (enableRecharge != 1) {
+      return;
+    }
+    depositHandle(params);
+  } else if (currencyOpertionType == 'SEND') {
+    if (enableRecharge != 1) {
+      return;
+    }
+    showSendGiveawayDialog(params);
+  }
 }
 
 let withdraw_info = inject('withdraw_info')
 // 点击提现
 const clickWithdraw = () => {
-    Report.reportLog({
-        pageSource: Report.pageSource.denetHomePage,
-        businessType: Report.businessType.buttonClick,
-        objectType: Report.objectType.withdrawButton
-    });
+  Report.reportLog({
+    pageSource: Report.pageSource.denetHomePage,
+    businessType: Report.businessType.buttonClick,
+    objectType: Report.objectType.withdrawButton
+  });
 
-    if(currenciesData.value.length > 1) {
-      showCurrencySelect.value = true;
-      currencyOpertionType = "WITHDRAW";
-    } else if(currenciesData.value.length == 1){
-      withdrawHandle(currenciesData.value[0]);
-    }
+  if (currenciesData.value.length > 1) {
+    showCurrencySelect.value = true;
+    currencyOpertionType = "WITHDRAW";
+  } else if (currenciesData.value.length == 1) {
+    withdrawHandle(currenciesData.value[0]);
+  }
 }
 
 const withdrawHandle = (_params) => {
@@ -159,12 +144,12 @@ const withdrawHandle = (_params) => {
   withdraw_info.icon_net = require('@/assets/svg/icon-BNB.svg')
 
   if (_params.currencyCode == 'USD') {
-      withdraw_info.currency_code = _params.currencyCode
-      withdraw_info.paypal.amount_value = _params.balance
-      router.push('/withdraw/paypal')
+    withdraw_info.currency_code = _params.currencyCode
+    withdraw_info.paypal.amount_value = _params.balance
+    router.push('/withdraw/paypal')
   } else {
-      console.log(withdraw_info.chainInfo.iconPath)
-      router.push('/withdraw/info')
+    console.log(withdraw_info.chainInfo.iconPath)
+    router.push('/withdraw/info')
   }
 }
 
@@ -173,45 +158,45 @@ const withdrawHandle = (_params) => {
 let top_up_info = inject('top_up_info');
 
 const clickDeposit = () => {
-    Report.reportLog({
-        pageSource: Report.pageSource.denetHomePage,
-        businessType: Report.businessType.buttonClick,
-        objectType: Report.objectType.topupButton
-    });
+  Report.reportLog({
+    pageSource: Report.pageSource.denetHomePage,
+    businessType: Report.businessType.buttonClick,
+    objectType: Report.objectType.topupButton
+  });
 
-    if(currenciesData.value.length > 1) {
-      showCurrencySelect.value = true;
-      currencyOpertionType = "DEPOSIT";
-    } else if(currenciesData.value.length == 1){
-      let currencyInfo = currenciesData.value[0];
-      if(currencyInfo.currencyCode == 'USD') {
-        // 法币充值
-        showDepositInput.value = true;
-        setDepositDesc();
-          
-      } else {
-        depositHandle(currencyInfo);
-      }
+  if (currenciesData.value.length > 1) {
+    showCurrencySelect.value = true;
+    currencyOpertionType = "DEPOSIT";
+  } else if (currenciesData.value.length == 1) {
+    let currencyInfo = currenciesData.value[0];
+    if (currencyInfo.currencyCode == 'USD') {
+      // 法币充值
+      showDepositInput.value = true;
+      setDepositDesc();
+
+    } else {
+      depositHandle(currencyInfo);
     }
+  }
 }
 
 const setDepositDesc = async () => {
   let res = await payCalcFee({
-      params: {
-          amountValue: 0,
-          currencyCode: currencyInfo.value.currencyCode,
-          payChannel: 'ach',
-      },
+    params: {
+      amountValue: 0,
+      currencyCode: currencyInfo.value.currencyCode,
+      payChannel: 'ach',
+    },
   });
-  if(res.code == 0) {
-    let {feeDesc} = res.data;
+  if (res.code == 0) {
+    let { feeDesc } = res.data;
     depositDesc.value = `${feeDesc}`;
   }
 }
 
 const depositHandle = (_params) => {
   top_up_info.token = _params.currencyName || ''
-  top_up_info.token_chain = _params.tokenChain 
+  top_up_info.token_chain = _params.tokenChain
   top_up_info.token_symbol = _params.tokenSymbol || ''
   top_up_info.currency_code = _params.currencyCode
   top_up_info.icon_token = _params.iconPath || ''
@@ -219,21 +204,21 @@ const depositHandle = (_params) => {
   top_up_info.chainInfo = {
     ..._params.chainInfo
   };
-  
+
   router.push('/top-up/info');
 };
 
 
 const asyncTokenRechRecord = (currencyCode = '', cb) => {
-    syncChainTokenRechargeRecord({
-        params: {
-            currencyCode: currencyCode
-        }
-    }).then(res => {
-      cb && cb(res.data)
-    }).catch((err) => {
-      cb && cb()
-    })
+  syncChainTokenRechargeRecord({
+    params: {
+      currencyCode: currencyCode
+    }
+  }).then(res => {
+    cb && cb(res.data)
+  }).catch((err) => {
+    cb && cb()
+  })
 }
 
 const onRefresh = () => {
@@ -243,11 +228,11 @@ const onRefresh = () => {
         symbol: currencyInfo.value.tokenSymbol
       }
     }).then(res => {
-      if(res.code == 0) {
-        if(res.data && res.data.currencyCategories && res.data.currencyCategories.length) {
+      if (res.code == 0) {
+        if (res.data && res.data.currencyCategories && res.data.currencyCategories.length) {
           let data = res.data.currencyCategories[0].data;
-          if(data.length) {
-            let {totalBalance = '', totalUsdEstimateBalance = ''} = data[0] || {};
+          if (data.length) {
+            let { totalBalance = '', totalUsdEstimateBalance = '' } = data[0] || {};
             currencyInfo.value.totalBalance = totalBalance;
             currencyInfo.value.totalUsdEstimateBalance = totalUsdEstimateBalance;
           }
@@ -258,23 +243,23 @@ const onRefresh = () => {
 };
 
 const showSendGiveawayDialog = (params = {}) => {
-  if(currenciesData.value.length > 1 && currencyOpertionType != 'SEND') {
-      showCurrencySelect.value = true;
-      currencyOpertionType = "SEND";
+  if (currenciesData.value.length > 1 && currencyOpertionType != 'SEND') {
+    showCurrencySelect.value = true;
+    currencyOpertionType = "SEND";
   } else {
-      setLocalSelectCurrencyInfo(params)
-      setTimeout(() => {
-        chrome.runtime.sendMessage({ 
-          actionType: "POPUP_SHOW_DENET_PUBLISH_DIALOG", 
-          data: { } 
+    setLocalSelectCurrencyInfo(params)
+    setTimeout(() => {
+      chrome.runtime.sendMessage({
+        actionType: "POPUP_SHOW_DENET_PUBLISH_DIALOG",
+        data: {}
       });
-      }, 600)
-      currencyOpertionType = '';
+    }, 600)
+    currencyOpertionType = '';
   }
 };
 
 const setLocalSelectCurrencyInfo = (params = {}) => {
-    setChromeStorage({ selectCurrencyInfo : JSON.stringify(params)})    
+  setChromeStorage({ selectCurrencyInfo: JSON.stringify(params) })
 }
 
 const cancelDeposit = () => {
@@ -282,7 +267,7 @@ const cancelDeposit = () => {
 }
 
 const confirmDeposit = (params) => {
-  if(reqCalcIng) {
+  if (reqCalcIng) {
     return;
   }
 
@@ -290,16 +275,18 @@ const confirmDeposit = (params) => {
   depositDesc.value = '';
 
   let achPayInfo = {
-      amountValue: finalAmountData.value.finalAmountValue
+    amountValue: finalAmountData.value.finalAmountValue
   };
-  let guideUrl = 'chrome-extension://omadcdhfdfhbklafpaddghnjimpfemgh' + ('/iframe/ach-cashier.html');
-  setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+  let guideUrl = chromeExtensionUrl + ('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',
-    path
-  })});
+  setChromeStorage({
+    achPayData: JSON.stringify({
+      form: 'popupPage',
+      path
+    })
+  });
 
   chrome.tabs.create({
     url: guideUrl
@@ -307,23 +294,23 @@ const confirmDeposit = (params) => {
 }
 
 const onDepositAmountInput = async (params = {}) => {
-  let {inputVal} = params;
+  let { inputVal } = params;
   reqCalcIng = true;
-  if(inputVal === '') {
+  if (inputVal === '') {
     inputVal = 0;
   }
   let res = await payCalcFee({
-      params: {
-          amountValue: inputVal,
-          currencyCode: currencyInfo.value.currencyCode,
-          payChannel: 'ach',
-      },
+    params: {
+      amountValue: inputVal,
+      currencyCode: currencyInfo.value.currencyCode,
+      payChannel: 'ach',
+    },
   });
   reqCalcIng = false;
-  if(res.code == 0) {
-    let {feeAmountValue, feeDesc} = res.data;
+  if (res.code == 0) {
+    let { feeAmountValue, feeDesc } = res.data;
     finalAmountData.value = res.data;
-    if(inputVal === 0) {
+    if (inputVal === 0) {
       depositDesc.value = `${feeDesc}`;
     } else {
       depositDesc.value = `Charge Fee:${feeAmountValue} USD(${feeDesc})`;
@@ -333,47 +320,47 @@ const onDepositAmountInput = async (params = {}) => {
 
 
 const onMessage = () => {
-    chrome.runtime.onMessage.addListener(msgListener)
+  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;
-    }
+  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],
-        totalBalance,
-        totalUsdEstimateBalance
-      };
-      if(currencies.length == 1) {
-        enableRecharge.value = currencyInfo.value.enableRecharge;
-        enableWithdraw.value = currencyInfo.value.enableWithdraw;
-      }
-    } 
-    if(window.location.pathname.indexOf('/home.html') > -1) {
-      showSendBtn.value = false;
-    } else {
-      showSendBtn.value = true;
+  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],
+      totalBalance,
+      totalUsdEstimateBalance
+    };
+    if (currencies.length == 1) {
+      enableRecharge.value = currencyInfo.value.enableRecharge;
+      enableWithdraw.value = currencyInfo.value.enableWithdraw;
     }
-    onMessage();
+  }
+  if (window.location.pathname.indexOf('/home.html') > -1) {
+    showSendBtn.value = false;
+  } else {
+    showSendBtn.value = true;
+  }
+  onMessage();
 })
 
 onBeforeUnmount(() => {
-    chrome.runtime.onMessage.removeListener(msgListener);
+  chrome.runtime.onMessage.removeListener(msgListener);
 })
 
 </script>
@@ -406,6 +393,7 @@ onBeforeUnmount(() => {
       justify-content: center;
       flex-direction: column;
       width: 100%;
+
       .balance {
         padding: 0 18px;
         box-sizing: border-box;
@@ -415,7 +403,7 @@ onBeforeUnmount(() => {
         align-items: center;
         justify-content: center;
 
-        .symbol{
+        .symbol {
           word-break: break-all;
         }
       }
@@ -433,6 +421,7 @@ onBeforeUnmount(() => {
       }
     }
   }
+
   .bottom {
     height: 162px;
     padding: 0 20px;
@@ -469,6 +458,7 @@ onBeforeUnmount(() => {
       margin-bottom: 18px;
       background: #1d9bf0;
       color: #fff;
+
       img {
         width: 19px;
         height: 19px;
@@ -505,25 +495,26 @@ onBeforeUnmount(() => {
 
 
   .selectDiv {
-      position: absolute;
-      z-index: 1000;
-      width: 100%;
-      max-height: 480px;
-      padding-bottom: 30px;
-      left: 0;
-      bottom: 0;
-      background-color: #fff;
-      border-radius: 20px 20px 0 0;
-      overflow-y: auto;
+    position: absolute;
+    z-index: 1000;
+    width: 100%;
+    max-height: 480px;
+    padding-bottom: 30px;
+    left: 0;
+    bottom: 0;
+    background-color: #fff;
+    border-radius: 20px 20px 0 0;
+    overflow-y: auto;
   }
+
   .selectBg {
-      position: absolute;
-      z-index: 999;
-      top: 0;
-      left: 0;
-      width: 100%;
-      height: 100%;
-      background: rgba($color: #000000, $alpha: 0.6);
+    position: absolute;
+    z-index: 999;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba($color: #000000, $alpha: 0.6);
   }
 }
 </style>