Bläddra i källkod

Merge branch 'dev_1.0.7' of DeNet/de-net into master

zhangwei 2 år sedan
förälder
incheckning
a0ede88ad4

BIN
src/assets/img/icon-loading-redbag.gif


+ 28 - 1
src/entry/background.js

@@ -13,9 +13,12 @@ import {
     setMessageCount,
     discordLoginCode,
     saveDiscordAuthWindowId,
-    onDisconnectHandler
+    onDisconnectHandler,
+    getMessageInfo
 } from "@/logic/background/twitter";
 
+import { PingPong } from "@/logic/background/help";
+
 import {
     facebookShareSuccess
 } from "@/logic/background/facebook";
@@ -39,10 +42,31 @@ chrome.runtime.onInstalled.addListener(onInstalledMethod);
 
 chrome.runtime.onMessage.addListener(onMessageMethod);
 
+// 定时器
+chrome.alarms.onAlarm.addListener(function (alarm) {
+    // console.log("onAlarm-", alarm);
+    switch (alarm.name) {
+        case 'denetChromeAlarm':
+            getMessageInfo();
+            break
+        case 'PingPong':
+            PingPong()
+            break;
+    }
+});
+
 function onInstalledMethod() {
     onInstalledCreateTab()
     onInstalledMid()
     onInstalledUserSet()
+    
+    // pingpang
+    chrome.alarms.create('PingPong', {
+        //1分鐘之後開始(該值不能小於1) 
+        delayInMinutes: 2,
+        //開始後每一分鐘執行一次(該值不能小于1) 
+        periodInMinutes: 4
+    });
 }
 
 function onMessageMethod(req, sender, sendResponse) {
@@ -87,6 +111,9 @@ function onMessageMethod(req, sender, sendResponse) {
             case 'CONTENT_FACEBOOK_SHARE_SUCCESS':
                 facebookShareSuccess(req, sender);
                 break;
+            case 'CONTENT_PONG':
+                console.log('CONTENT_PONG')
+                break
         }
     }
 }

+ 0 - 2
src/entry/content.js

@@ -20,13 +20,11 @@ import {
     doTaskTwitterAPI,
     onTweetReplyClick
 } from "@/logic/content/twitter.js";
-import { duration } from "moment";
 
 import {
     initFacebookContent
 } from "@/logic/content/facebook.js"
 
-
 chrome.storage.onChanged.addListener(changes => {
     initExecuteScript(changes)
 })

+ 10 - 0
src/entry/content_help.js

@@ -0,0 +1,10 @@
+
+chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+    sendResponse('')
+    switch (req.actionType) {
+        case 'BACK_PING':
+            console.log('BACK_PING')
+            chrome.runtime.sendMessage({ actionType: "CONTENT_PONG", data: '1' }, (res) => { console.log(res) })
+            break
+    }
+})

+ 1 - 1
src/http/configAPI.js

@@ -1,4 +1,4 @@
-export const appVersionCode = 6
+export const appVersionCode = 7
 
 const api = {
 	production: 'https://api.denetme.net',

+ 2 - 2
src/http/publishApi.js

@@ -61,7 +61,7 @@ export function getUser(params) {
 
 export function getCurrencyInfo(params) {
   return service({
-    url: `/currency/getCurrencyInfo`,
+    url: `/currency/v2/getCurrencyInfo`,
     method: 'post',
     data: params
   })
@@ -69,7 +69,7 @@ export function getCurrencyInfo(params) {
 
 export function searchCurrencyInfo(params) {
   return service({
-    url: `/currency/searchCurrencyInfo`,
+    url: `/currency/v2/searchCurrencyInfo`,
     method: 'post',
     data: params
   })

+ 11 - 0
src/logic/background/help.js

@@ -0,0 +1,11 @@
+// 每4分钟调用一次,保持background一直有效
+export function PingPong(){
+    chrome.tabs.query({}, (tabs = []) => {
+        if (tabs.length) {
+            let tab = tabs.filter((item) => { return item.active == true })
+            if (tab.length) {
+                chrome.tabs.sendMessage(tab[0].id, { actionType: 'BACK_PING' }, (res) => { console.log(res) });
+            }
+        }
+    })
+}

+ 8 - 11
src/logic/background/twitter.js

@@ -2,7 +2,6 @@ import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fet
 import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie, getChromeStorage, removeChromeCookie } from '@/uilts/chromeExtension.js'
 import { guid } from '@/uilts/help.js'
 import { pageUrl, discordAuthRedirectUri } from '@/http/configAPI'
-import { trueDependencies } from 'mathjs'
 
 let authToken = ''
 let consumerKey = ''
@@ -26,7 +25,7 @@ export function twitterPinLoginToken() {
     getChromeStorage('userInfo', (res) => {
         // 没有登陆
         if (!res) {
-            if(tab_flag == false){
+            if (tab_flag == false) {
                 return
             }
             tab_flag = false
@@ -40,12 +39,12 @@ export function twitterPinLoginToken() {
                             chrome.tabs.create({
                                 url: `https://api.twitter.com/oauth/authorize?oauth_token=${res.data.authToken}`
                             })
-                        }else{
+                        } else {
                             chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab.index })
                         }
                     })
                 }
-            }).catch(()=>{
+            }).catch(() => {
                 tab_flag = true
             })
         }
@@ -195,6 +194,10 @@ export function onInstalledUserSet() {
         // 无刷新插入js
         chrome.tabs.query({}, (tab) => {
             for (let i in tab) {
+                chrome.scripting.executeScript({
+                    target: { tabId: tab[i].id },
+                    files: ['js/content_help.js']
+                }, () => { })
                 if (tab[i].url.indexOf('twitter.com') >= 0 || tab[i].url.indexOf('facebook.com') >= 0) {
                     chrome.scripting.executeScript({
                         target: { tabId: tab[i].id },
@@ -306,13 +309,7 @@ function createAlarm() {
     };
 
     //每次加載就清空定時器
-    chrome.alarms.clearAll();
-
-    chrome.alarms.onAlarm.addListener(function (alarm) {
-        console.log("onAlarm-", alarm);
-        getMessageInfo();
-    });
-
+    chrome.alarms.clear('denetChromeAlarm');
     //創造定時器
     chrome.alarms.create('denetChromeAlarm', alarmInfo);
 }

+ 60 - 19
src/logic/content/ParseCard.js

@@ -27,18 +27,52 @@ class ParseCard {
         }
         return de_net_card
     }
+    // 兼容mask
+    compatibleMask(article) {
+        let has_denet = false
+        try {
+            let arr_span = article.querySelectorAll('span') || []
+            let arr_shadow = []
+            arr_span.forEach((item) => {
+                if (item.shadowRoot) {
+                    arr_shadow.push(item.shadowRoot)
+                }
+            })
+            let item
+            for (let i in arr_shadow) {
+                item = arr_shadow[i].childNodes
+                if(has_denet){
+                    break
+                }
+                if (item) {
+                    for (let j in item) {
+                        if (item[j].innerText && item[j].innerText.includes('#DeNet')) {
+                            has_denet = true
+                            break
+                        }
+                    }
+                }
+            }
+        } catch (error) {
+        }
+        // 是否有#DeNet
+        return has_denet
+    }
     parseAllDeNetCard() {
         let de_net_card = []
-        let arr_article = document.querySelectorAll('article') || []
-        let _txt
-        for (let i in arr_article) {
-            _txt = arr_article[i].innerText || ''
-            if (_txt.includes('#DeNet') && !this.isHasIframeByArticle(arr_article[i])) {
-                de_net_card.push({
-                    time: new Date().getTime(),
-                    dom: arr_article[i]
-                })
+        try {
+            let arr_article = document.querySelectorAll('article') || []
+            let _txt
+            for (let i in arr_article) {
+                _txt = arr_article[i].innerText || ''                
+                if ((_txt.includes('#DeNet') || this.compatibleMask(arr_article[i])) && !this.isHasIframeByArticle(arr_article[i])) {
+                    de_net_card.push({
+                        time: new Date().getTime(),
+                        dom: arr_article[i]
+                    })
+                }
             }
+        } catch (error) {
         }
         return de_net_card
     }
@@ -70,7 +104,7 @@ class ParseCard {
         a_arr = Array.from(a_arr).reverse()
         for (let i in a_arr) {
             // 获取推特id
-            if (a_arr[i].href.indexOf('facebook.com') > 0) {
+            if (a_arr[i].href.indexOf('facebook.com') > 0 && a_arr[i].href.indexOf('denetme') > 0) {
                 let faceUrl = new URL(a_arr[i].href);
                 let faceSearch = new URLSearchParams(faceUrl.search);
                 let faceJumpUrl = decodeURIComponent(faceSearch.get('u'));
@@ -78,7 +112,7 @@ class ParseCard {
                     let urlArr = new URL(faceJumpUrl);
                     let searchArr = new URLSearchParams(urlArr.search);
                     let deUrlParams = searchArr.get('deUrlParams') || '{}';
-                        deUrlParams = JSON.parse(deUrlParams);
+                    deUrlParams = JSON.parse(deUrlParams);
                     if (!tweet_Id) {
                         tweet_Id = deUrlParams.tweetId;
                     }
@@ -94,7 +128,7 @@ class ParseCard {
                     let urlArr = new URL(a_arr[i].href);
                     let searchArr = new URLSearchParams(urlArr.search);
                     let deUrlParams = searchArr.get('deUrlParams') || '{}';
-                        deUrlParams = JSON.parse(deUrlParams);
+                    deUrlParams = JSON.parse(deUrlParams);
                     if (!tweet_Id) {
                         tweet_Id = deUrlParams.tweetId;
                     }
@@ -132,7 +166,7 @@ class ParseCard {
         let json_data = []
         this.parseFaceBookCard().forEach((item) => {
             let _obj = this.parseFaceBookParmas(item.dom)
-            if (_obj.tweet_Id && _obj.short_url && _obj.dom_card) {
+            if (_obj.short_url && _obj.dom_card) {
                 _obj.time = item.time
                 json_data.push(_obj)
             }
@@ -194,10 +228,14 @@ class ParseCard {
         return _array
     }
 
-    createIframe({ post_Id, tweet_Id, tweet_author }, if_center = false) {
+    createIframe({ post_Id = '', tweet_Id = '', tweet_author = '' }, if_center = false) {
         let _iframe = document.createElement('iframe')
+        let tweet_str = '';
+        if (tweet_Id) {
+            tweet_str = `&tweetId=${tweet_Id}`;
+        }
         _iframe.id = post_Id
-        _iframe.src = chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}&tweetId=${tweet_Id}&tweet_author=${tweet_author}&window_origin=${window.location.origin}`;
+        _iframe.src = chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}`;
         _iframe.style.cssText = 'border:medium none; width:375px; min-height:500px;'
         if (if_center) {
             _iframe.style.cssText = 'border:medium none; width:375px; min-height:500px; display:block; margin:auto;'
@@ -308,19 +346,22 @@ class ParseCard {
         if (!dom_card || !dom_card.parentElement) {
             return
         }
-        let dom = dom_card.querySelector('div[id^=jsc_c_][class=l9j0dhe7]')
-        dom.style = 'min-height:500px'
+        let dom = dom_card.querySelector('div[id^=jsc_c_]').parentElement
+            dom.style = 'min-height:500px'
         if (dom) {
             for (let i = 0; i < dom.childNodes.length; i++) {
-                if (dom.children[i].tagName.toLowerCase() != 'iframe') {
+                if (dom.children[i].tagName.toLowerCase() != 'iframe' && (i !== 0)) {
                     dom.children[i].style.display = 'none'
                 }
             }
 
+            if (dom.nextElementSibling && dom.nextElementSibling.id && dom.nextElementSibling.id.indexOf('jsc_c_') >= 0) {
+                dom.nextElementSibling.style.display = 'none'
+            }
             let originUrl = new URL(short_url);
             let post_Id = originUrl.pathname.slice(1);
 
-            dom.appendChild(this.createIframe({ post_Id, tweet_Id, tweet_author }, true))
+            dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
         }
     }
 }

+ 60 - 49
src/logic/content/twitter.js

@@ -73,7 +73,7 @@ export function hideIframeHandler() {
  * 展示twitter原生发布框
  */
 let tweetPublishStore = {
-    showPublishDialog : false
+    showPublishDialog: false
 }
 export function showTwitterPublishDialogHandler(publishRes) {
     let bigBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
@@ -126,7 +126,7 @@ function addPinedPop() {
     popWrapper.appendChild(contentDom);
 
     let layersDom = document.getElementById('layers');
-    if(layersDom) {
+    if (layersDom) {
         layersDom.appendChild(popWrapper);
     } else {
         document.querySelector('body').appendChild(popWrapper);
@@ -192,33 +192,33 @@ function onClosePublishDialogHandle(dom, params) {
     dom.querySelector('div[role="group"]').addEventListener('click', function () {
         setTimeout(() => {
             let parent = document.querySelector('div[data-testid="confirmationSheetDialog"]');
-             if(parent) {
-                 let btnArr = parent.querySelectorAll('div[role=button]')
-                 for(let i = 0; i < btnArr.length; i++) {
-                     let btn = btnArr[i];
-                     btn.addEventListener('click', function() {
+            if (parent) {
+                let btnArr = parent.querySelectorAll('div[role=button]')
+                for (let i = 0; i < btnArr.length; i++) {
+                    let btn = btnArr[i];
+                    btn.addEventListener('click', function () {
                         tweetPublishStore.showPublishDialog = false;
                         let taskLuckdropId = JSON.parse(params.postBizData).taskLuckdropId;
-                        noticeBindTweet({ postId: params.postId, taskLuckdropId});
-                     })
-                 }
-             } else {
-                 setTimeout(() => {
+                        noticeBindTweet({ postId: params.postId, taskLuckdropId });
+                    })
+                }
+            } else {
+                setTimeout(() => {
                     let dialog = document.querySelector('div[role="dialog"]');
-                    if(!dialog) {
+                    if (!dialog) {
                         tweetPublishStore.showPublishDialog = false;
                     }
-                 }, 800)
-             }
+                }, 800)
+            }
         }, 1000)
-     })
+    })
 }
 
 function checkIsShowReSend(dom, params) {
     let str = dom.querySelector('div[data-contents="true"]').innerHTML;
     if (str.indexOf(params.postId) < 0) {
         let taskLuckdropId = JSON.parse(params.postBizData).taskLuckdropId;
-        noticeBindTweet({ postId: params.postId, taskLuckdropId});
+        noticeBindTweet({ postId: params.postId, taskLuckdropId });
     }
 }
 
@@ -331,17 +331,17 @@ function _addIframe() {
     let iframeContent = document.getElementById('iframe-content');
     if (!iframeContent) {
         let layersDom = document.getElementById('layers');
-        if(layersDom) {
+        if (layersDom) {
             layersDom.appendChild(iframe);
         } else {
             document.querySelector('body').appendChild(iframe);
         }
-        
+
     }
 }
 
 function addPublishTipsIframe(params = {}) {
-    let {time = 1000} = params;
+    let { time = 1000 } = params;
     setTimeout(() => {
         let dialog = document.querySelector('div[role="dialog"]').querySelector('div[role="dialog"]')
 
@@ -421,7 +421,7 @@ const _setPublishContent = throttle(function (content) {
     if (!isSetContent) {
         isSetContent = true;
         let inputEle = document.querySelector('div[contenteditable="true"]');
-        if(inputEle) {
+        if (inputEle) {
             inputEle.focus();
         }
         setTimeout(() => {
@@ -546,20 +546,20 @@ function addSliderNavDeBtn(isSmall = false) {
 function onWindowResize() {
     window.onresize = throttle(function () {
         try {
-            if(tweetPublishStore.showPublishDialog) {
+            if (tweetPublishStore.showPublishDialog) {
                 let dialog = document.querySelector('div[role="dialog"]');
                 let dePublishTips = document.getElementById('de-publish-tips');
-                if(dialog && !dePublishTips) {
-                    addPublishTipsIframe({time: 0});
-                } else if(dialog && dePublishTips){
+                if (dialog && !dePublishTips) {
+                    addPublishTipsIframe({ time: 0 });
+                } else if (dialog && dePublishTips) {
                     let dialogContent = dialog.querySelector('div[role=dialog]')
-                    if(dialogContent) {
+                    if (dialogContent) {
                         let right = dialogContent.offsetLeft - 15 - 266;
                         dePublishTips.style.right = right + 'px';
                     }
                 }
             }
-            
+
             if (window.innerWidth < 1273) {
                 let bigBtn = document.querySelector('#de-btn');
                 bigBtn && bigBtn.remove();
@@ -717,16 +717,8 @@ const createIframe = ({ url, tweet_Id }, callback) => {
     }
 }
 
-// 初始化
-export function init() {
-    getDiscordAuthCode();
-    let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
-    if (where) {
-        return
-    }
-    twitterPinLogin();
-    // 渲染dom
 
+function initParseCard() {
     let timer = setInterval(() => {
         let inTwitter = window.location.href.includes('twitter.com');
         let inTwitterNode = document.querySelector('main');
@@ -762,6 +754,25 @@ export function init() {
             }, 1000)
         }
     }, 1000);
+}
+let inited = false
+// 初始化
+export function init() {
+    if(inited){
+        return 
+    }
+    inited = true
+    console.log('init')
+
+    getDiscordAuthCode();
+    let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
+    if (where) {
+        return
+    }
+    twitterPinLogin();
+    // 渲染dom
+    initParseCard()
+
     renderDom();
     checkTwitterTaskState();
 
@@ -794,7 +805,7 @@ export function init() {
 function checkHasSliderDeBtn() {
     let deBtn = document.getElementById('de-btn');
     let deBtn3 = document.getElementById('de-btn3');
-    if(!deBtn && !deBtn3) {
+    if (!deBtn && !deBtn3) {
         addSliderNavDeBtn();
     }
 }
@@ -827,12 +838,12 @@ export function replyHandle(params) {
     let pathNameArr = window.location.pathname.split('/');
     if (pathNameArr.length >= 2 && pathNameArr[pathNameArr.length - 2] == 'status') {
         let tweetReply = document.querySelector('div[data-testid="tweetButtonInline"]');
-        if(tweetReply) {
-            tweetReply.addEventListener('click', function() {
+        if (tweetReply) {
+            tweetReply.addEventListener('click', function () {
                 let eleList = tweetReply.parentNode.parentNode.parentNode.parentNode.parentNode.querySelectorAll('span[data-text="true"]');
                 reportReplyResult(eleList, params, () => {
                     // iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: {} }, '*');
-                    chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data : {postId: params.postId}}, () => { })
+                    chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data: { postId: params.postId } }, () => { })
                 });
             })
         }
@@ -853,36 +864,36 @@ export function onTweetReplyClick(params) {
 function onReplyDialogOpen(params, iframe) {
     setTimeout(() => {
         let dialog = document.querySelector('div[role="dialog"]');
-        let replyBtn; 
-        
+        let replyBtn;
+
         if (dialog) {
-            let dialogContent  = dialog.querySelector('div[role="dialog"]');
+            let dialogContent = dialog.querySelector('div[role="dialog"]');
             replyBtn = dialog.querySelector('div[data-testid="toolBar"]').querySelector('div[data-testid="tweetButton"]');
-            if(dialogContent) {
+            if (dialogContent) {
                 let width = dialogContent.offsetWidth;
                 let ele = document.createElement('div');
                 ele.innerText = 'Tag 3 friends to complete the task';
                 ele.style.cssText = `width: ${width}px; height: 38px; color: #fff; font-weight: 600;
                 font-size: 16px; display: flex; align-items: center; justify-content: center; background: #1D9BF0;
                 opacity: 0.8; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000`;
-    
+
                 dialogContent.style.top = '80px';
                 dialogContent.parentNode.appendChild(ele);
             }
         } else {
             dialog = document.querySelector('main[role="main"]');
-            if(dialog) {
+            if (dialog) {
                 replyBtn = dialog.querySelector('div[data-testid="tweetButton"]');
             }
         }
 
-        if(dialog && replyBtn) {
+        if (dialog && replyBtn) {
             replyBtn.addEventListener('click', function () {
                 let eleList = dialog.querySelector('div[contenteditable="true"]').querySelectorAll('span[data-text="true"]');
                 reportReplyResult(eleList, params, () => {
                     // 上報完成
                     // iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: {} }, '*');
-                    chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data : {postId: params.postId}}, () => { })
+                    chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data: { postId: params.postId } }, () => { })
                 })
             });
         }
@@ -1027,7 +1038,7 @@ export function checkTwitterTaskState() {
 
 export function getTweetAuthorByDom(params) {
     let iframe = document.getElementById(params.postId);
-    if(!iframe) {
+    if (!iframe) {
         return;
     }
     let fullNameDom;

+ 9 - 1
src/manifest.json

@@ -2,7 +2,7 @@
     "manifest_version": 3,
     "name": "DeNet",
     "description": "Growing more twitter followers with Denet",
-    "version": "1.0.6",
+    "version": "1.0.7",
     "background": {
         "service_worker": "/js/background.js"
     },
@@ -16,6 +16,13 @@
         "default_popup": "popup.html"
     },
     "content_scripts": [
+        {
+            "matches":["<all_urls>"],
+            "run_at": "document_start",
+            "js": [
+                "/js/content_help.js"
+            ]
+        },
         {
             "matches": [
                 "https://*.twitter.com/*",
@@ -33,6 +40,7 @@
         }
     ],
     "host_permissions": [
+        "<all_urls>",
         "*://*.twitter.com/*",
         "*://twitter.com/*",
         "*://*.facebook.com/*",

+ 18 - 18
src/view/components/currency-list.vue

@@ -22,24 +22,24 @@
                             {{ item.type == 1 ? 'Cash' : 'Crypto' }}
                         </div>
                         <div class="item-detail" v-for="(data, idx) in item.data" :key="idx"
-                            @click="selectCurrency(data)">
+                            @click="selectCurrency(data.currencies)">
                             <div class="left">
-                                <img class="icon-currency" :src="data.iconPath" />
+                                <img class="icon-currency" :src="data.currencies[0].iconPath" />
                                 <div class="currency-info">
-                                    <div class="name">{{ data.currencyCode == 'USD' ? 'USD' : data.tokenSymbol }}</div>
-                                    <div class="desc">{{ data.currencyCode == 'USD' ? 'Paypal' : data.currencyName }}
+                                    <div class="name">{{ data.currencies[0].currencyCode == 'USD' ? 'USD' : data.currencies[0].tokenSymbol }}</div>
+                                    <div class="desc">{{ data.currencies[0].currencyCode == 'USD' ? 'Paypal' : data.currencies[0].currencyName }}
                                     </div>
                                 </div>
                             </div>
                             <div class="right">
                                 <div class="num">
-                                    <a-tooltip :title="data.balance">
-                                        {{ getBit(data.balance) }}
+                                    <a-tooltip :title="data.totalBalance">
+                                        {{ getBit(data.totalBalance) }}
                                     </a-tooltip>
                                 </div>
-                                <div class="amount" v-if="data.currencyType == 2">
-                                    <a-tooltip :title="'$'+data.usdEstimateBalance">
-                                        ${{ getBit(data.usdEstimateBalance) }}
+                                <div class="amount" v-if="data.currencies[0].currencyType == 2">
+                                    <a-tooltip :title="'$'+data.totalUsdEstimateBalance">
+                                        ${{ getBit(data.totalUsdEstimateBalance) }}
                                     </a-tooltip>
                                 </div>
                             </div>
@@ -53,23 +53,23 @@
             </div>
             <!-- 显示搜索结果列表 -->
             <div class="search-list" v-else>
-                <div class="item-detail" v-for="(data, idx) in searchList" :key="idx" @click="selectCurrency(data)">
+                <div class="item-detail" v-for="(data, idx) in searchList" :key="idx" @click="selectCurrency(data.currencies)">
                     <div class="left">
-                        <img class="icon-currency" :src="data.iconPath" />
+                        <img class="icon-currency" :src="data.currencies[0].iconPath" />
                         <div class="currency-info">
-                            <div class="name">{{ data.currencyCode == 'USD' ? 'USD' : data.tokenSymbol }}</div>
-                            <div class="desc">{{ data.currencyName }}</div>
+                            <div class="name">{{ data.currencies[0].currencyCode == 'USD' ? 'USD' : data.currencies[0].tokenSymbol }}</div>
+                            <div class="desc">{{ data.currencies[0].currencyName }}</div>
                         </div>
                     </div>
                     <div class="right">
                         <div class="num">
-                            <a-tooltip :title="data.balance">
-                                {{ getBit(data.balance) }}
+                            <a-tooltip :title="data.currencies[0].balance">
+                                {{ getBit(data.currencies[0].balance) }}
                             </a-tooltip>
                         </div>
-                        <div class="amount" v-if="data.currencyType == 2">
-                            <a-tooltip :title="'$'+data.usdEstimateBalance">
-                                ${{ getBit(data.usdEstimateBalance) }}
+                        <div class="amount" v-if="data.currencies[0].currencyType == 2">
+                            <a-tooltip :title="'$'+data.currencies[0].usdEstimateBalance">
+                                ${{ getBit(data.currencies[0].usdEstimateBalance) }}
                             </a-tooltip>
                         </div>
                     </div>

+ 122 - 0
src/view/components/currency-select.vue

@@ -0,0 +1,122 @@
+<!-- 货币列表 -->
+<template>
+    <div class="list-item" v-for="(item, index) in props.list" :key="index">
+        <div class="item-title">
+            <img class="icon" :src="item.chainInfo.iconPath" />
+            {{item.chainInfo.chainName}}
+        </div>
+        <div class="item-detail" @click="selectCurrency(item)">
+            <div class="left">
+                <img class="icon-currency" :src="item.iconPath" />
+                <div class="currency-info">
+                    <div class="name">{{ item.currencyCode == 'USD' ? 'USD' : item.tokenSymbol }}</div>
+                    <div class="desc">{{ item.currencyCode == 'USD' ? 'Paypal' : item.currencyName }}</div>
+                </div>
+            </div>
+            <div class="right">
+                <div class="num">
+                    <a-tooltip :title="item.balance">
+                        {{ getBit(item.balance) }}
+                    </a-tooltip>
+                </div>
+                <div class="amount" v-if="item.currencyType == 2">
+                    <a-tooltip :title="'$'+item.usdEstimateBalance">
+                        ${{ getBit(item.usdEstimateBalance) }}
+                    </a-tooltip>
+                </div>
+            </div>
+        </div>
+    </div>
+    
+</template>
+
+<script setup>
+import { defineProps, defineEmits } from 'vue';
+import { getBit } from "@/uilts/help";
+
+let props = defineProps({
+    list: {
+        type: Array,
+        default: [],
+    }
+})
+let emits = defineEmits(['selectCurrency']);
+let selectCurrency = (params) => {
+    emits('selectCurrency', params);
+}
+</script>
+
+<style scoped lang="scss">
+.list-item {
+    .item-title {
+        display: flex;
+        align-items: center;
+        height: 42px;
+        padding: 0 10px;
+        box-sizing: border-box;
+        background: #f7f7f7;
+        font-weight: 500;
+        font-size: 14px;
+        color: #a2a2a2;
+
+        .icon {
+            width: 24px;
+            height: 24px;
+            margin-right: 6px;
+        }
+    }
+    .item-detail {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 12px 20px;
+        box-sizing: border-box;
+        cursor: pointer;
+
+        .left {
+            display: flex;
+
+            .icon-currency {
+                width: 24px;
+                height: 24px;
+                margin-right: 12px;
+            }
+
+            .currency-info {
+                .name {
+                    font-weight: 500;
+                    font-size: 15px;
+                    margin-bottom: 5px;
+                }
+
+                .desc {
+                    font-weight: 400;
+                    font-size: 12px;
+                    color: #a2a2a2;
+                }
+            }
+        }
+
+        .right {
+            text-align: right;
+            max-width: calc(100% - 150px);
+            
+            .num, .amount {
+                word-break: break-all;
+            }
+
+            .num {
+                font-weight: 500;
+                font-size: 15px;
+                margin-bottom: 5px;
+            }
+
+            .amount {
+                font-weight: 400;
+                font-size: 12px;
+                color: #a2a2a2;
+            }
+        }
+    }
+}
+</style>

+ 3 - 0
src/view/iframe/publish/components/follow-input.vue

@@ -220,6 +220,9 @@ const rectClick = (event) => {
 }
 
 const getTwitterUsers = (query, cb) => {
+    if(query.indexOf('@') > -1) {
+        return;
+    }
     searchTwitterUser({
         params: {
             name : query

+ 57 - 16
src/view/iframe/publish/components/top-up.vue

@@ -14,16 +14,18 @@
                         />{{currentCurrencyInfo.tokenSymbol}}
                     </div>  
                 </div>
-                <div class="item">
-                    <div class="label">
-                        Deposit network
-                    </div>
+                <div class="item" :class="{ position: props.list.length > 1 }" @mouseover="showCurrencyLayer" @mouseout="hideCurrencyLayer">
+                    <div class="label">Deposit network</div>
                     <div class="content">
-                        <img
-                            class="icon"
-                            :src="require('@/assets/svg/icon-BNB.svg')"
-                        />
-                        BNB Smart Chain (BEP20)
+                        <img class="icon" :src="currentCurrencyInfo.chainInfo.iconPath" />
+                        {{ currentCurrencyInfo.chainInfo.chainName }}
+                        <img v-if="props.list.length > 1" class="down" :src=" require('@/assets/svg/icon-botton-up.svg') " />
+                    </div>
+                    <div class="currency-pop-select" v-show="showCurrencySelect">
+                        <currency-select
+                            :list="props.list"
+                            @selectCurrency="selectCurrency">
+                        </currency-select>
                     </div>
                 </div>
             </div>
@@ -35,7 +37,7 @@
             <div class="tips-box">
                 <img class="icon" :src="require('@/assets/svg/icon-top-up-tips-warning.svg')" >
                 <div>
-                    Make sure you also selected <span class="blod">BNB Smart Chain (BEP20)</span> as the network on the platform where you are withdrawing funds for this deposit. Otherwise, you'll lose your assets.
+                    Make sure you also selected <span class="blod">{{ currentCurrencyInfo.chainInfo.chainName }}</span> as the network on the platform where you are withdrawing funds for this deposit. Otherwise, you'll lose your assets.
                 </div>
             </div>
         </div>
@@ -47,13 +49,14 @@
 
 <script setup>
 /* eslint-disable */
-import { defineProps, defineEmits, onMounted, ref } from "vue";
+import { defineProps, defineEmits, onMounted, ref, watch } from "vue";
 import { getTokenRechargeAddress } from "@/http/pay";
 import { ElMessage } from 'element-plus'
+import currencySelect from "@/view/components/currency-select.vue";
 
 let QRCode = require('qrcode')
 let ClipboardJS = require('clipboard')
-
+let showCurrencySelect = ref(false);
 let tokenRechargeAddress = ref('');
 
 const props = defineProps({
@@ -66,7 +69,11 @@ const props = defineProps({
     asyncIng: {
         type: Boolean,
         default: false
-    }
+    },
+    list: {
+        type: Array,
+        default: []
+    },
 })
 
 const emits = defineEmits(['doneHandle']);
@@ -117,6 +124,20 @@ const copyToken = () => {
     });
 }
 
+const selectCurrency = (params) => {
+    showCurrencySelect.value = false;
+    emits('selectCurrency', params, false);
+}
+
+const showCurrencyLayer = () => {
+    if (props.list.length > 1) {
+        showCurrencySelect.value = true;
+    }
+}
+
+const hideCurrencyLayer = () => {
+    showCurrencySelect.value = false;
+}
 
 const doneHandle = () => {
     emits('topUpDone', {});
@@ -140,7 +161,7 @@ const getTokenAddress = () => {
 
 onMounted(() => {
     getTokenAddress();
-}) 
+})
 
 </script>
 
@@ -153,7 +174,6 @@ onMounted(() => {
     position: relative;
     .content-wrapper {
         height: calc(100% - 60px);
-        overflow-y: scroll;
         .top {
             width: 100%;
             display: flex;
@@ -168,6 +188,7 @@ onMounted(() => {
                 }
 
                 .content {
+                    position: relative;
                     height: 44px;
                     width: 100%;
                     border-radius: 8px;
@@ -183,8 +204,28 @@ onMounted(() => {
                         height: 20px;
                         margin-right: 6px;
                     }
+                    .down {
+                        position: absolute;
+                        right: 10px;
+                        width: 12px;
+                    }
+                }
+                &.position {
+                    position: relative;
+                    cursor: pointer;
+                    .currency-pop-select {
+                        position: absolute;
+                        width: 375px;
+                        max-height: 480px;
+                        top: 66px;
+                        right: 0px;
+                        z-index: 1000;
+                        box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.3);
+                        background-color: #fff;
+                        border-radius: 20px;
+                        overflow-y: scroll;
+                    }
                 }
-
             }
         }
         .qrcode-wrapper {

+ 55 - 12
src/view/iframe/publish/components/top-up2.vue

@@ -10,14 +10,18 @@
                 />{{currentCurrencyInfo.tokenSymbol}}
             </div>
         </div>
-        <div class="item">
+        <div class="item" :class="{ position: props.list.length > 1 }" @mouseover="showCurrencyLayer" @mouseout="hideCurrencyLayer">
             <div class="token-l">Network</div>
             <div class="token-r">
-                <img
-                    class="icon"
-                    :src="require('@/assets/svg/icon-BNB.svg')"
-                />
-                BNB Smart Chain (BEP20)
+                <img class="icon" :src="currentCurrencyInfo.chainInfo.iconPath" />
+                {{ currentCurrencyInfo.chainInfo.chainName }}
+                <img v-if="props.list.length > 1" class="down" :src=" require('@/assets/svg/icon-botton-up.svg') " />
+            </div>
+            <div class="currency-pop-select" v-show="showCurrencySelect">
+                <currency-select
+                    :list="props.list"
+                    @selectCurrency="selectCurrency">
+                </currency-select>
             </div>
         </div>
         <div class="item none">
@@ -32,21 +36,22 @@
                 <div class="copy-btn" :data-clipboard-text="tokenRechargeAddress">copy</div>
             </div>
         </div>
-        <div class="desc">Make sure you also selected <span class="blod">BNB Smart Chain (BEP20)</span> as the network on the platform where you are withdrawing funds for this deposit. Otherwise, you'll lose your assets.</div>
+        <div class="desc">Make sure you also selected <span class="blod">{{ currentCurrencyInfo.chainInfo.chainName }}</span> as the network on the platform where you are withdrawing funds for this deposit. Otherwise, you'll lose your assets.</div>
     </div>
 </template>
 
 <script setup>
 /* eslint-disable */
-import { defineProps, defineEmits, onMounted, ref } from "vue";
+import { defineProps, defineEmits, onMounted, ref, watch } from "vue";
 import { getTokenRechargeAddress } from "@/http/pay";
 import { ElMessage } from 'element-plus'
+import currencySelect from "@/view/components/currency-select.vue";
 
 let QRCode = require('qrcode')
 let ClipboardJS = require('clipboard')
 
 let tokenRechargeAddress = ref('');
-
+let showCurrencySelect = ref(false);
 const props = defineProps({
     currentCurrencyInfo: {
         type: Object,
@@ -57,10 +62,14 @@ const props = defineProps({
     asyncIng: {
         type: Boolean,
         default: false
-    }
+    },
+    list: {
+        type: Array,
+        default: []
+    },
 })
 
-const emits = defineEmits(['doneHandle']);
+const emits = defineEmits(['doneHandle', 'selectCurrency']);
 
 const createQRCode = (str) => {
     var canvas = document.getElementById('canvas')
@@ -107,6 +116,20 @@ const copyToken = () => {
     });
 }
 
+const selectCurrency = (params) => {
+    showCurrencySelect.value = false;
+    emits('selectCurrency', params, false);
+}
+
+const showCurrencyLayer = () => {
+    if (props.list.length > 1) {
+        showCurrencySelect.value = true;
+    }
+}
+
+const hideCurrencyLayer = () => {
+    showCurrencySelect.value = false;
+}
 
 const doneHandle = () => {
     emits('topUpDone', {});
@@ -130,7 +153,7 @@ const getTokenAddress = () => {
 
 onMounted(() => {
     getTokenAddress();
-}) 
+})
 
 </script>
 
@@ -158,6 +181,10 @@ onMounted(() => {
         .token-r {
             font-size: 16px;
             font-weight: 500;
+            .down {
+                width: 9px;
+                margin-left: 4px;
+            }
         }
         img {
             width: 20px;
@@ -165,6 +192,22 @@ onMounted(() => {
             vertical-align: middle;
             margin-right: 6px;
         }
+        &.position {
+            position: relative;
+            cursor: pointer;
+            .currency-pop-select {
+                position: absolute;
+                width: 375px;
+                max-height: 480px;
+                top: 36px;
+                right: 0px;
+                z-index: 1000;
+                box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.3);
+                background-color: #fff;
+                border-radius: 20px;
+                overflow-y: scroll;
+            }
+        }
     }
     .desc {
         color: #A9A9A9;

+ 60 - 8
src/view/iframe/publish/give-dialog.vue

@@ -5,8 +5,8 @@
                 height: dialogHeight + 'px',
                 width: showComType != 'preview' ? '600px' : '880px'}">   
             <div class="pop-mask"  
-                v-show="showCurrencyPop" 
-                @click.stop="showCurrencyPop = false"></div>
+                v-show="showCurrencyPop || showCurrencySelect" 
+                @click.stop="showCurrencyPop = false; showCurrencySelect=false"></div>
 
             <!-- 头部 -->
             <div class="head">
@@ -65,6 +65,13 @@
                             @selectCurrency="selectCurrency"
                             @setCurrencyList="setCurrentCurrencyInfo"></currency-list>
                     </div>
+                    <div class="currency-pop-select" v-show="showCurrencySelect">
+                        <currency-select 
+                            ref="currencySelectDom"
+                            :list="tempCurrentCurrencyList"
+                            @selectCurrency="selectCurrencyAfter">
+                        </currency-select>
+                    </div>
 
                     <div class="left" v-if="showComType != 'preview'">
                         <div class="gift-pack-wrapper">
@@ -452,7 +459,7 @@ import {create, all} from "mathjs";
 
 import messageBox from "@/view/components/message-box.vue";
 import currencyList from "@/view/components/currency-list.vue";
-
+import currencySelect from "@/view/components/currency-select.vue";
 import previewCard from "@/view/iframe/publish/components/preview-card";
 import followInput from "@/view/iframe/publish/components/follow-input";
 import paypalButton from "@/view/iframe/publish/components/paypal-button";
@@ -467,6 +474,7 @@ const math = create(all, config);
 
 //临时货币信息
 let tempCurrentCurrencyInfo = ref({});
+let tempCurrentCurrencyList = ref([]);
 
 let paypalClientId = ref("");
 let payConfig = ref({});
@@ -518,6 +526,7 @@ let showMessageBox = ref(false);
 
 // 展示货币列表pop
 let showCurrencyPop = ref(false);
+let showCurrencySelect = ref(false);
 
 // 展示更多按钮下的选项
 let showMoreOption = ref(false);
@@ -767,24 +776,40 @@ const confirm = () => {
  * 货币列表-选中货币
  */
 const selectCurrency = (params) => {
+    tempCurrentCurrencyList.value = params;
+    depositGuide.value = false;
+    if (params.length > 1) {
+        showCurrencyPop.value = false;
+        showCurrencySelect.value = true;
+    } else {
+        selectCurrencyAfter(params[0])
+    }
+};
+
+const selectCurrencyAfter = (params, openWindow = true) => {
     tempCurrentCurrencyInfo.value = params;
     depositGuide.value = false;
-    if(params.currencyCode != "USD" && params.balance < params.minAmount) {
+    showCurrencySelect.value = false;
+    currentCurrencyInfo.value = params;
+    setLocalSelectCurrencyInfo(currentCurrencyInfo.value);
+    if (openWindow === false) {
+        return
+    };
+    if (params.currencyCode != "USD" && params.balance < params.minAmount) {
         let tokenSymbol = params.currencyCode == 'USD' ? 'USD' : params.tokenSymbol;
         messageBoxBlock({
             title: `Whether to deposit ${tokenSymbol}`,
             content: `Insufficient ${tokenSymbol} balance`,
         });
     } else {
-        currentCurrencyInfo.value = params;
-        setLocalSelectCurrencyInfo(currentCurrencyInfo.value);
+        setCurrentCurrencyListInfo(tempCurrentCurrencyList.value);
         showCurrencyPop.value = false;
         finalAmountData.value.currencyCode = currentCurrencyInfo.value.currencyCode;
         calcDomZoom();
         resetFormIpt();
         onIptSetErrorTxt();
     }
-};
+}
 
 const calcDomZoom = () => {
     nextTick(() => {
@@ -806,6 +831,10 @@ const setLocalSelectCurrencyInfo = (params = {}) => {
     setChromeStorage({ selectCurrencyInfo : JSON.stringify(params)})    
 }
 
+const setCurrentCurrencyListInfo = (params = {}) => {
+    setChromeStorage({ selectCurrencyList : JSON.stringify(params)})    
+}
+
 /**
  * 获取完货币列表
  */
@@ -833,8 +862,10 @@ const messageBoxConfirm = () => {
 const messageBoxCancel = () => {
     currentCurrencyInfo.value = tempCurrentCurrencyInfo.value;
     setLocalSelectCurrencyInfo(currentCurrencyInfo.value);
+    setCurrentCurrencyListInfo(tempCurrentCurrencyList.value);
     showMessageBox.value = false;
     showCurrencyPop.value = false;
+    showCurrencySelect.value = false;
     calcDomZoom();
     resetFormIpt();
     onIptSetErrorTxt();
@@ -860,6 +891,7 @@ const topUpDone = () => {
     depositGuide.value = false;
     asyncIng.value = false;
     showCurrencyPop.value = false;
+    showCurrencySelect.value = false;
     showComType.value = 'default';
     calcDomZoom();
     onIptSetErrorTxt()
@@ -922,7 +954,7 @@ const submitRequest = async () => {
         item.type = formList[i]["type"];
         if (item.type == 1 && atUserList.value.length) {
             // follow 参数
-            let relatedUsers = atUserList.value;
+            let relatedUsers = atUserList.value.filter(item => item.name);
             item.relatedUsers = relatedUsers;
             finishConditions.push(item);
         } else  if (formList[i]["type"] == 7) {
@@ -1001,6 +1033,7 @@ const initParams = () => {
     submitIng.value = false;
     isBack.value = false;
     showCurrencyPop.value = false;
+    showCurrencySelect.value = false;
     openAntiBot.value = false;
 
     tempCurrentCurrencyInfo.value = {};
@@ -1456,6 +1489,12 @@ const getCurrencyInfo = async () => {
                 });
             }
         })
+
+        getChromeStorage('selectCurrencyList', (res) => {
+            if (showCurrencySelect.value === false) {
+                tempCurrentCurrencyList.value = res;
+            }
+        })
     }
 }
 
@@ -1621,6 +1660,19 @@ onMounted(() => {
                 border-radius: 20px;
                 overflow-y: scroll;
             }
+            
+            .currency-pop-select {
+                position: absolute;
+                width: 375px;
+                max-height: 480px;
+                top: 85px;
+                left: 88px;
+                z-index: 1000;
+                box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.3);
+                background-color: #fff;
+                border-radius: 20px;
+                overflow-y: scroll;
+            }
 
             .left,
             .right {

+ 31 - 4
src/view/iframe/red-packet/red-packet.vue

@@ -215,7 +215,7 @@
         <div class="txt">{{ state.detail.currencySymbol }} GIVEAWAY</div>
         <div class="coin">
           <img :src="state.detail.currencyIconPath" alt />
-          <font-amount :amount="state.detail.amountValue" style="color:#fff;margin-left:10px;"></font-amount>
+          <font-amount :amount="state.detail.amountValue" style="color:#fff;"></font-amount>
         </div>
         <div class="people">{{ state.detail.totalCount }} WINNERS TO SHARE</div>
       </div>
@@ -353,6 +353,10 @@
       <img :src="require('@/assets/svg/icon-loading.svg')" alt />
     </div>
 
+    <div v-show="state.loading_redbag" class="redbag">
+      <img :src="require('@/assets/img/icon-loading-redbag.gif')" alt />
+    </div>
+
   </div>
   <div style="width: 100%; height: 30px; position: fixed; color: red; top:0;" v-if="state.process_mode != 'production'">
     {{ state.detail.validity }}</div>
@@ -391,7 +395,8 @@ let facebookAppConfig = {
 
 let state = reactive({
   status: '',
-  loading_show: true,
+  loading_show: false,
+  loading_redbag: true,
   detail: {},
   luck_list_end: false,
   page_index: 1,
@@ -1029,6 +1034,8 @@ function init(initParams) {
       }
       state.detail = JSON.parse(res.data.postBizData)
       state.detail.taskCondition = state.detail.taskCondition || []
+      state.tweetId = state.srcContentId;
+      state.tweet_author = state.detail.postUserInfo && state.detail.postUserInfo.nickName || '';
       // 不要删除这个console
       console.log('postBizData',state.detail)
       checkFacebookReply();
@@ -1036,6 +1043,8 @@ function init(initParams) {
     } else {
       handleErrorCode(res)
     }
+  }).finally(() => {
+      state.loading_redbag = false
   })
 }
 
@@ -1159,9 +1168,11 @@ const doTaskReport = (req, sender) => {
 onMounted(() => {
   state.process_mode = process.env.NODE_ENV
   state.postId = getQueryString('postId')
-  state.tweetId = getQueryString('tweetId')
-  state.tweet_author = getQueryString('tweet_author');
   state.window_origin = getQueryString('window_origin');
+  if (state.window_origin.indexOf('twitter.com') > -1) {
+    state.tweetId = getQueryString('tweetId')
+    state.tweet_author = getQueryString('tweet_author');
+  }
 
   getTweetAuthor();
 
@@ -1804,6 +1815,22 @@ body {
     }
   }
 
+  .redbag {
+    z-index: 222;
+    text-align: center;
+    width: 375px;
+    height: 500px;
+    position: fixed;
+    top: 0;
+    left: 0;
+
+    img {
+      margin-top: 172px;
+      width: 130px;
+      height: 130px;
+    }
+  }
+
   .error {
     width: 100%;
     height: 100%;

+ 46 - 2
src/view/popup/top-up/home.vue

@@ -2,6 +2,16 @@
     <!-- 公共组件 -->
     <div class="info">
         <v-head :title="'Deposit'" :show_more="true" :show_help="false" :back_url="'/'"></v-head>
+        <template v-if="showCurrencySelect">
+            <div class="selectDiv">
+                <currency-select 
+                    ref="currencySelectDom"
+                    :list="tempCurrentCurrencyList"
+                    @selectCurrency="selectCurrencyAfter">
+                </currency-select>
+            </div>
+            <div class="selectBg" @click="showCurrencySelect = false"></div>
+        </template>
         <currency-list style="height: calc(100% - 48px);" @selectCurrency="selectCurrency" :page="'top-up'"></currency-list>
     </div>
 
@@ -10,20 +20,33 @@
 <script setup>
 import VHead from '@/view/popup/components/head.vue'
 import CurrencyList from "@/view/components/currency-list.vue";
-import { inject, onMounted } from 'vue'
+import currencySelect from "@/view/components/currency-select.vue";
+import { inject, onMounted, ref } from 'vue'
 import router from "@/router/popup.js";
 import Report from "@/log-center/log";
 
 let top_up_info = inject('top_up_info')
+let showCurrencySelect = ref(false)
+let tempCurrentCurrencyList = ref([])
 
-function selectCurrency(_params) {
+function selectCurrency(params) {
+    tempCurrentCurrencyList.value = params;
+    if (params.length > 1) {
+        showCurrencySelect.value = true;
+    } else {
+        selectCurrencyAfter(params[0])
+    }
+}
+function selectCurrencyAfter(_params) {
     top_up_info.token = _params.currencyName || ''
     top_up_info.token_chain = _params.tokenChain 
+    top_up_info.chainInfo = _params.chainInfo
     // top_up_info.token_chain = 'BNB Smart Chain (BEP20)'
     top_up_info.token_symbol = _params.tokenSymbol || ''
     top_up_info.currency_code = _params.currencyCode
     top_up_info.icon_token = _params.iconPath || ''
     top_up_info.icon_net = require('@/assets/svg/icon-BNB.svg')
+    showCurrencySelect.value = false
     router.push({ path: '/top-up/info'});
 }
 
@@ -41,4 +64,25 @@ onMounted(() => {
     height: 100%;
     overflow: hidden;
 }
+.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: scroll;
+}
+.selectBg {
+    position: absolute;
+    z-index: 999;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba($color: #000000, $alpha: 0.6);
+}
 </style>

+ 3 - 3
src/view/popup/top-up/info.vue

@@ -18,9 +18,9 @@
                 <div class="net">
                     <div class="title">NetWork</div>
                     <div class="box">
-                        <img :src="top_up_info.icon_net" alt="">
+                        <img :src="top_up_info.chainInfo.iconPath" alt="">
                         <!-- <span>{{ top_up_info.token_chain }}</span> -->
-                        <span>BNB Smart Chain (BEP20)</span>
+                        <span>{{top_up_info.chainInfo.chainName}}</span>
                     </div>
                 </div>
             </div>
@@ -36,7 +36,7 @@
                 </div>
                 <div class="tips-content">
                     <p>Make sure you also selected </p>
-                    <p style="color: red;">BNB Smart Chain (BEP20) </p>
+                    <p style="color: red;">{{top_up_info.chainInfo.chainName}} </p>
                     <p>as the Network on the platform where you are withdrawing funds for this deposiit. Otherwise,
                         you'll lose your assets.</p>
                 </div>

+ 49 - 3
src/view/popup/withdraw/home.vue

@@ -2,6 +2,16 @@
     <!-- 公共组件 -->
     <div class="info">
         <v-head :title="'Withdraw'" :show_more="true" :show_help="true" :back_url="'/'"></v-head>
+        <template v-if="showCurrencySelect">
+            <div class="selectDiv">
+                <currency-select 
+                    ref="currencySelectDom"
+                    :list="tempCurrentCurrencyList"
+                    @selectCurrency="selectCurrencyAfter">
+                </currency-select>
+            </div>
+            <div class="selectBg" @click="showCurrencySelect = false"></div>
+        </template>
         <currency-list style="height: calc(100% - 48px);" :filterEmptyBalance="true" @selectCurrency="selectCurrency" ></currency-list>
     </div>
 
@@ -10,18 +20,33 @@
 <script setup>
 import VHead from '@/view/popup/components/head.vue'
 import CurrencyList from "@/view/components/currency-list.vue";
+import currencySelect from "@/view/components/currency-select.vue";
 import router from "@/router/popup.js";
 import Report from "@/log-center/log";
-import { inject, onMounted } from 'vue'
+import { inject, onMounted, ref } from 'vue'
+
 let withdraw_info = inject('withdraw_info')
+let showCurrencySelect = ref(false)
+let tempCurrentCurrencyList = ref([])
 
-function selectCurrency(_params) {
+function selectCurrency(params) {
+    tempCurrentCurrencyList.value = params;
+    if (params.length > 1) {
+        showCurrencySelect.value = true;
+    } else {
+        selectCurrencyAfter(params[0])
+    }
+}
 
+function selectCurrencyAfter(_params) {
     if (_params.currencyCode == 'USD') {
         withdraw_info.currency_code = _params.currencyCode
+        withdraw_info.chainInfo = _params.chainInfo
+        showCurrencySelect.value = false
         router.push('/withdraw/paypal')
     } else {
         withdraw_info.source = 'home'
+        withdraw_info.chainInfo = _params.chainInfo
         withdraw_info.balance = _params.balance
         withdraw_info.token_symbol = _params.tokenSymbol || ''
         withdraw_info.currency_name = _params.currencyName || ''
@@ -30,9 +55,9 @@ function selectCurrency(_params) {
         withdraw_info.currency_code = _params.currencyCode
         withdraw_info.icon_token = _params.iconPath || ''
         withdraw_info.icon_net = require('@/assets/svg/icon-BNB.svg')
+        showCurrencySelect.value = false
         router.push('/withdraw/info')
     }
-
 }
 
 onMounted(() => {
@@ -49,4 +74,25 @@ onMounted(() => {
     height: 100%;
     overflow: hidden;
 }
+.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: scroll;
+}
+.selectBg {
+    position: absolute;
+    z-index: 999;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba($color: #000000, $alpha: 0.6);
+}
 </style>

+ 2 - 2
src/view/popup/withdraw/info.vue

@@ -16,9 +16,9 @@
         <div class="net">
           <div class="title">Withdrawal Network</div>
           <div class="box">
-            <img :src="withdraw_info.icon_net" alt="">
+            <img :src="withdraw_info.chainInfo.iconPath" alt="">
             <!-- <span>{{ withdraw_info.token_chain }}</span> -->
-            <span>BNB Smart Chain (BEP20)</span>
+            <span>{{withdraw_info.chainInfo.chainName}}</span>
             <!-- <img :src="require('@/assets/svg/icon-botton-up.svg')" alt="" class="up"> -->
           </div>
         </div>