Bläddra i källkod

Merge branch 'test' of DeNet/de-net into master

zhangwei 2 år sedan
förälder
incheckning
b26e376a17
40 ändrade filer med 1302 tillägg och 402 borttagningar
  1. BIN
      src/assets/img/img-preview-bg-after.png
  2. BIN
      src/assets/img/img-preview-bg-before.png
  3. BIN
      src/assets/subject/icon-balance.png
  4. 3 0
      src/assets/subject/icon-balance.svg
  5. 3 0
      src/assets/subject/icon-refresh.svg
  6. 4 0
      src/assets/subject/top-01.svg
  7. 4 0
      src/assets/subject/top-02.svg
  8. 4 0
      src/assets/subject/top-03.svg
  9. 4 0
      src/assets/svg/icon-global-tip.svg
  10. 1 0
      src/assets/svg/icon-website.svg
  11. 7 2
      src/entry/background.js
  12. 6 0
      src/entry/content.js
  13. 1 1
      src/http/configAPI.js
  14. 62 0
      src/http/fetch.js
  15. 8 0
      src/http/messageApi.js
  16. 13 0
      src/http/redPacket.js
  17. 29 9
      src/http/request.js
  18. 2 2
      src/iframe/home.js
  19. 3 3
      src/iframe/publish.js
  20. 2 1
      src/iframe/red-packet.js
  21. 40 150
      src/logic/background/fetch/twitter.js
  22. 66 33
      src/logic/background/twitter.js
  23. 120 6
      src/logic/content/twitter.js
  24. 1 1
      src/manifest.json
  25. 5 6
      src/rules/rules_1.json
  26. 11 0
      src/uilts/help.js
  27. 22 6
      src/view/components/currency-list.vue
  28. 12 2
      src/view/components/font-amount.vue
  29. 58 0
      src/view/components/global-tip.vue
  30. 37 20
      src/view/components/popup-transactions.vue
  31. 8 32
      src/view/iframe/publish/components/paypal-button.vue
  32. 12 18
      src/view/iframe/publish/components/preview-card.vue
  33. 221 0
      src/view/iframe/publish/components/top-up2.vue
  34. 251 23
      src/view/iframe/publish/give-dialog.vue
  35. 3 1
      src/view/iframe/publish/publish.vue
  36. 224 65
      src/view/iframe/red-packet/red-packet.vue
  37. 47 18
      src/view/popup/popup.vue
  38. 1 1
      src/view/popup/top-up/home.vue
  39. 2 1
      src/view/popup/withdraw/info.vue
  40. 5 1
      vue.config.js

BIN
src/assets/img/img-preview-bg-after.png


BIN
src/assets/img/img-preview-bg-before.png


BIN
src/assets/subject/icon-balance.png


+ 3 - 0
src/assets/subject/icon-balance.svg

@@ -0,0 +1,3 @@
+<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M3.64621 10.5473H4.03598L4.77121 7.06808C5.04442 5.78237 6.17746 4.89844 7.44308 4.89844C7.6279 4.89844 7.82076 4.91853 8.0096 4.95871L34.5797 10.5757L34.5626 10.5736C35.8926 10.7584 36.9141 11.898 36.9141 13.2795V32.6456C36.9141 34.1563 35.6926 35.3777 34.1819 35.3777H3.64621C2.13549 35.3777 0.914062 34.1563 0.914062 32.6456V13.2795C0.914062 11.7688 2.13549 10.5473 3.64621 10.5473ZM22.7863 10.5473H6.49893L7.12969 7.5663C7.16585 7.39755 7.31451 7.30915 7.44308 7.30915C7.46412 7.30915 7.48211 7.31221 7.50237 7.31567L7.51138 7.31719L22.7863 10.5473ZM34.4752 20.1181V25.04H26.3592C25.0011 25.04 23.8962 23.9351 23.8962 22.577C23.8962 21.219 25.0011 20.1141 26.3592 20.1141H34.4752V20.1181ZM34.5033 32.6456V27.4547H26.3592C23.6672 27.4547 21.4855 25.273 21.4855 22.581C21.4855 19.8891 23.6672 17.7074 26.3592 17.7074H34.5033V13.2795C34.5033 13.1027 34.3587 12.9581 34.1819 12.9581H3.64621C3.46942 12.9581 3.32478 13.1027 3.32478 13.2795V32.6456C3.32478 32.8223 3.46942 32.967 3.64621 32.967H34.1819C34.3587 32.967 34.5033 32.8223 34.5033 32.6456ZM25.5094 22.5793C25.5094 21.8119 26.1321 21.1891 26.8996 21.1891C27.667 21.1891 28.2897 21.8119 28.2897 22.5793C28.2897 23.3467 27.667 23.9695 26.8996 23.9695C26.1321 23.9695 25.5094 23.3467 25.5094 22.5793Z" fill="black"/>
+</svg>

+ 3 - 0
src/assets/subject/icon-refresh.svg

@@ -0,0 +1,3 @@
+<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.21664 9.31085C4.21664 9.31085 6.4009 5.93844 9.85712 4.12882C13.3133 2.31927 17.5714 2.84021 20.364 4.59492C23.1566 6.34973 24.0968 7.83024 24.0968 7.83024L26.5022 6.45938C26.5022 6.45938 27 6.21265 27 6.78841V15.3978C27 15.3978 27 16.1655 26.4193 15.8912C25.9308 15.6607 20.648 12.655 18.9833 11.7067C18.0691 11.2988 18.8723 10.9673 18.8723 10.9673L21.1935 9.63986C21.1935 9.63986 19.8695 7.98074 17.9315 7.10206C15.8571 6.02069 13.9151 5.89246 11.5362 6.79105C9.985 7.37687 8.15868 8.87707 6.84323 11.093L4.21664 9.31085ZM25.7834 20.6891C25.7834 20.6891 23.5991 24.0616 20.1429 25.8711C16.6866 27.6807 12.4286 27.1599 9.63599 25.4051C6.84326 23.6503 5.90327 22.1697 5.90327 22.1697L3.4977 23.5405C3.4977 23.5405 3 23.7874 3 23.2115V14.6022C3 14.6022 3 13.8346 3.58058 14.1087C4.06912 14.3394 9.35204 17.345 11.0167 18.2933C11.9309 18.7013 11.1278 19.0326 11.1278 19.0326L8.80649 20.3601C8.80649 20.3601 10.1306 22.0192 12.0685 22.8979C14.1428 23.9792 16.0848 24.1075 18.4638 23.2089C20.0149 22.623 21.8412 21.123 23.1566 18.9069L25.7834 20.6891Z" fill="#1D9BF0"/>
+</svg>

+ 4 - 0
src/assets/subject/top-01.svg

@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="10" cy="10" r="10" fill="#1F2326"/>
+<path d="M9.30176 14.5H11.3457V4.63574H9.29492L6.74512 6.40625V8.26562L9.26074 6.5293H9.30176V14.5Z" fill="white"/>
+</svg>

+ 4 - 0
src/assets/subject/top-02.svg

@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="10" cy="10" r="10" fill="#1F2326"/>
+<path d="M6.35645 7.60254V7.63672H8.27051V7.60254C8.27051 6.69336 8.97461 6.02344 9.93164 6.02344C10.8477 6.02344 11.4971 6.61133 11.4971 7.34961C11.4971 8.0332 11.1895 8.53223 10.1914 9.53027L6.47266 13.1123V14.5H13.6436V12.8594H9.19336V12.8184L11.5996 10.501C12.6865 9.4209 13.5068 8.49805 13.5068 7.26758C13.5068 5.62012 12.0781 4.41699 10 4.41699C7.84668 4.41699 6.35645 5.73633 6.35645 7.60254Z" fill="white"/>
+</svg>

+ 4 - 0
src/assets/subject/top-03.svg

@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="10" cy="10" r="10" fill="#1F2326"/>
+<path d="M8.6875 10.1934H9.9043C11.0186 10.1934 11.6953 10.7402 11.6953 11.6426C11.6953 12.4766 10.9707 13.0576 9.93848 13.0576C8.85156 13.0576 8.16797 12.5107 8.10645 11.6768H6.13086C6.22656 13.4951 7.68262 14.7188 9.91113 14.7188C12.1875 14.7188 13.7939 13.543 13.7939 11.7725C13.7939 10.4053 12.8438 9.5166 11.374 9.39355V9.35254C12.584 9.13379 13.4111 8.25879 13.4111 7.04883C13.4111 5.46973 12.0098 4.41699 9.95898 4.41699C7.81934 4.41699 6.39746 5.60645 6.32227 7.43164H8.22266C8.27734 6.57031 8.91309 6.00293 9.87012 6.00293C10.8955 6.00293 11.4629 6.5293 11.4629 7.3291C11.4629 8.14258 10.8271 8.70312 9.88379 8.70312H8.6875V10.1934Z" fill="white"/>
+</svg>

+ 4 - 0
src/assets/svg/icon-global-tip.svg

@@ -0,0 +1,4 @@
+<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="7.5" cy="7.5" r="7.5" fill="#DCA550"/>
+<path d="M6.76318 8.39551H8.1167L8.24561 3.25H6.63428L6.76318 8.39551ZM7.43994 11.0649C7.92871 11.0649 8.31543 10.6943 8.31543 10.2217C8.31543 9.74902 7.92871 9.37842 7.43994 9.37842C6.95117 9.37842 6.56445 9.74902 6.56445 10.2217C6.56445 10.6943 6.95117 11.0649 7.43994 11.0649Z" fill="#262626"/>
+</svg>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
src/assets/svg/icon-website.svg


+ 7 - 2
src/entry/background.js

@@ -21,11 +21,16 @@ setMessageCount();
 
 // 消息通讯
 chrome.runtime.onConnect.addListener(function (port) {
-    port.onDisconnect.addListener(function() {
+    port.onDisconnect.addListener(function () {
         onDisconnectHandler(port);
     });
 });
 
+// 当有可用更新时触发
+chrome.runtime.onUpdateAvailable.addListener(() => {
+    chrome.runtime.reload()
+})
+
 chrome.runtime.onInstalled.addListener(onInstalledMethod);
 
 chrome.runtime.onMessage.addListener(onMessageMethod);
@@ -58,7 +63,7 @@ function onMessageMethod(req, sender, sendResponse) {
             case 'CONTENT_SEND_CODE':
                 twitterPinLoginCode(sender, req.code);
             case 'CONTENT_TWITTER_LOGIN':
-                if(req.data){
+                if (req.data) {
                     twitterPinLoginToken()
                 }
                 break

+ 6 - 0
src/entry/content.js

@@ -35,6 +35,9 @@ window.onmessage = (res) => {
             case "IFRAME_SHOW_TWITTER_PUBLISH_DIALOG":
                 showTwitterPublishDialogHandler(res.data.publishRes);
                 break;
+            // case "IFRAME_DO_TASK":
+            //     findTweetByIdDoTask(res.data.task_data, res.data.task_type)
+            //     break
         }
     }
 };
@@ -53,6 +56,9 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
             console.log('BACK_TWITTER_SHORT_URL')
             changeQueueNum(1)
             break
+        case 'TIME':
+            alert('time')
+            break
     }
 })
 

+ 1 - 1
src/http/configAPI.js

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

+ 62 - 0
src/http/fetch.js

@@ -0,0 +1,62 @@
+import { appVersionCode, baseAPIUrl } from '@/http/configAPI.js'
+import { getChromeStorage } from '@/uilts/chromeExtension.js'
+
+export async function commonFetch({ url, method = 'POST' , params = {}, baseInfo = {}}) {
+
+    let storage_mid = await getChromeStorage('mid') || ''
+    const { mid } = storage_mid || {}
+    if (!baseInfo.token || !baseInfo.uid) {
+        const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
+        baseInfo.token = token
+        baseInfo.uid = uid
+    }
+    baseInfo.mid = mid
+    baseInfo.appVersionCode = appVersionCode
+    baseInfo.machineCode = mid
+    baseInfo.appType = 1
+    baseInfo.loginUid = baseInfo.uid
+
+    return new Promise(function (resolve, reject) {
+        let _url = baseAPIUrl + url
+        fetch(_url, {
+            method: method, // or 'PUT'
+            headers: {
+                'Content-Type': 'application/json',
+            },
+            body: JSON.stringify({
+                "baseInfo": baseInfo,
+                "params": params
+            }),
+        })
+            .then(response => response.json())
+            .then(data => {
+                switch (data.code.toString()) {
+                    // twitter授权失效
+                    case '1003':
+                        chrome.storage.local.remove("userInfo");
+                        chrome.runtime.sendMessage(
+                            { actionType: "POPUP_LOGIN", data: "" },
+                            (response) => {
+                                console.log("res", response);
+                            }
+                        )
+                        break;
+                    // 登陆token失效
+                    case '-107':
+                        chrome.storage.local.remove("userInfo");
+                        chrome.runtime.sendMessage(
+                            { actionType: "POPUP_LOGIN", data: "" },
+                            (response) => {
+                                console.log("res", response);
+                            }
+                        )
+                        break;
+                }
+
+                resolve(data);
+            })
+            .catch((error) => {
+                reject(error);
+            });
+    })
+}

+ 8 - 0
src/http/messageApi.js

@@ -16,3 +16,11 @@ export function getAllMessageInfo(params) {
     })
 }
 
+
+export function getAppNotification(params) {
+    return service({
+        url: `/base/config/getAppNotification`,
+        method: 'post',
+        data: params
+    })
+}

+ 13 - 0
src/http/redPacket.js

@@ -82,3 +82,16 @@ export function terminatedLuckdrop(params){
     data: params
   }) 
 }
+
+
+// 上报红包任务完成事件
+// 1 Twitter follow Twitter ScreenName
+// 2 Tweet like
+// 3 Retweet
+export function addFinishEvent(params){
+  return service({
+    url: `/post/luckdrop/addFinishEvent`,
+    method: 'post',
+    data: params
+  })
+}

+ 29 - 9
src/http/request.js

@@ -25,8 +25,8 @@ function checkParams(config) {
       ...config.params
     }
 
-    let {pageSource} = params.params || {};
-    if(pageSource) {
+    let { pageSource } = params.params || {};
+    if (pageSource) {
       delete params.params.pageSource;
     }
 
@@ -37,7 +37,7 @@ function checkParams(config) {
         appVersionCode,
         loginUid: uid,
         uid,
-        appType:1,
+        appType: 1,
         machineCode: mid,
         pageSource: pageSource || ''
       }
@@ -50,8 +50,8 @@ function checkParams(config) {
     let data = {
       ...config.data
     }
-    let {pageSource} = data.params || {};
-    if(pageSource) {
+    let { pageSource } = data.params || {};
+    if (pageSource) {
       delete data.params.pageSource;
     }
 
@@ -62,7 +62,7 @@ function checkParams(config) {
         appVersionCode,
         loginUid: uid,
         uid,
-        appType:1,
+        appType: 1,
         machineCode: mid,
         pageSource: pageSource || ''
       }
@@ -74,9 +74,7 @@ function checkParams(config) {
 
 // request拦截器
 service.interceptors.request.use(async (config) => {
-  if (!userInfo) {
-    userInfo = await getChromeStorage('userInfo') || ''
-  }
+  userInfo = await getChromeStorage('userInfo') || ''
   if (!storage_mid) {
     storage_mid = await getChromeStorage('mid') || ''
   }
@@ -91,6 +89,28 @@ service.interceptors.request.use(async (config) => {
 service.interceptors.response.use(
   response => {
     const res = response.data;
+    switch (res.code.toString()) {
+      // twitter授权失效
+      case '1003':
+        chrome.storage.local.remove("userInfo");
+        chrome.runtime.sendMessage(
+          { actionType: "POPUP_LOGIN", data: "" },
+          (response) => {
+            console.log("res", response);
+          }
+        )
+        break;
+      // 登陆token失效
+      case '-107':
+        chrome.storage.local.remove("userInfo");
+        chrome.runtime.sendMessage(
+          { actionType: "POPUP_LOGIN", data: "" },
+          (response) => {
+            console.log("res", response);
+          }
+        )
+        break;
+    }
     return res
   },
   error => {

+ 2 - 2
src/iframe/home.js

@@ -6,14 +6,14 @@ const app = createApp(App)
 // 引入路由对象实例
 import router from '@/router/popup.js'
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
-import { Button, message } from "ant-design-vue";
+import { Button, message, Tooltip } from "ant-design-vue";
 
 message.config({
     top: `10px`,
     duration: 3,
     maxCount: 1,
 });
-
+app.use(Tooltip);
 app.use(Button);
 app.use(message);
 app.use(router)

+ 3 - 3
src/iframe/publish.js

@@ -3,10 +3,9 @@ import App from '@/view/iframe/publish/publish.vue'
 import ElementPlus from 'element-plus'
 import 'element-plus/dist/index.css'
 
-// import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
-
-import {Button,message} from "ant-design-vue";
+import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
 
+import {Button,message,Tooltip} from "ant-design-vue";
 
 message.config({
     top: `10px`,
@@ -17,6 +16,7 @@ message.config({
 const app = createApp(App);
 
 app.use(Button);
+app.use(Tooltip);
 app.use(message);
 app.use(ElementPlus);
 app.mount('#app');

+ 2 - 1
src/iframe/red-packet.js

@@ -5,11 +5,12 @@ const app = createApp(App)
 // 引入路由对象实例
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
 
-import { message } from "ant-design-vue";
+import { message, Tooltip } from "ant-design-vue";
 message.config({
     top: `10px`,
     duration: 3,
     maxCount: 1,
 });
+app.use(Tooltip);
 app.use(message)
 app.mount('#app')

+ 40 - 150
src/logic/background/fetch/twitter.js

@@ -1,66 +1,23 @@
-import { appVersionCode, baseAPIUrl } from '@/http/configAPI.js'
+import { commonFetch } from '@/http/fetch.js'
 import { getChromeStorage } from '@/uilts/chromeExtension.js'
-
 export async function fetchTtwitterRequestToken() {
-    let storage_mid = await getChromeStorage('mid') || ''
-    const { mid } = storage_mid || {}
-    return new Promise(function (resolve, reject) {
-        let _url = `${baseAPIUrl}/user/twitterRequestToken`
-        fetch(_url, {
-            method: 'POST', // or 'PUT'
-            headers: {
-                'Content-Type': 'application/json',
-            },
-            body: JSON.stringify({
-                "baseInfo": {
-                    appVersionCode,
-                    mid
-                },
-                "params": {
-                    "oauthCallback": "oob"
-                }
-            }),
-        })
-            .then(response => response.json())
-            .then(data => {
-                resolve(data);
-            })
-            .catch((error) => {
-                reject(error);
-            });
+    return commonFetch({
+        url: '/user/twitterRequestToken',
+        params: {
+            "oauthCallback": "oob"
+        }
     })
 }
 
-export async function fetchTwitterLogin(oauthToken, oauthVerifier, receivedIds = []) {
-    let storage_mid = await getChromeStorage('mid') || ''
-    const { mid } = storage_mid || {}
-    return new Promise(function (resolve, reject) {
-        let _url = `${baseAPIUrl}/user/twitterLogin`
-        fetch(_url, {
-            method: 'POST', // or 'PUT'
-            headers: {
-                'Content-Type': 'application/json',
-            },
-            body: JSON.stringify({
-                "baseInfo": {
-                    appVersionCode,
-                    mid
-                },
-                "params": {
-                    "oauthToken": oauthToken,
-                    "oauthVerifier": oauthVerifier,
-                    "receivedIds": receivedIds
-                }
-            }),
-        })
-            .then(response => response.json())
-            .then(data => {
-                resolve(data);
-            })
-            .catch((error) => {
-                reject(error);
-            });
-
+export async function fetchTwitterLogin(oauthToken, consumerKey, oauthVerifier, receivedIds = []) {
+    return commonFetch({
+        url: '/user/twitterLogin',
+        params: {
+            "oauthToken": oauthToken,
+            "oauthVerifier": oauthVerifier,
+            "consumerKey": consumerKey,
+            "receivedIds": receivedIds
+        }
     })
 }
 // 请求推特短链接
@@ -77,112 +34,45 @@ export async function fetchTwitterShortUrl(url) {
 
 
 export async function fetchAllMessageInfo(params = {}) {
-    let storage_mid = await getChromeStorage('mid') || ''
     const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
-    const { mid } = storage_mid || {};
-    return new Promise(function (resolve, reject) {
-        if(!token) {
+    if (!token) {
+        return new Promise(function (resolve, reject) {
             resolve({});
-            return;
-        }
-        let _url = `${baseAPIUrl}/message/getStat`
-        fetch(_url, {
-            method: 'POST', 
-            headers: {
-                'Content-Type': 'application/json',
-            },
-            body: JSON.stringify({
-                "baseInfo": {
-                    appVersionCode,
-                    mid,
-                    machineCode: mid,
-                    token: token,
-                    uid,
-                    loginUid: uid,
-                    appType:1,
-                },
-                "params": params
-            }),
-        }).then(response => response.json())
-            .then(data => {
-                resolve(data);
-            })
-            .catch((error) => {
-                reject(error);
-            });
+        })
+    }
+    return commonFetch({
+        url: '/message/getStat',
+        params
     })
 }
 
 export async function fetchReadTaskAllMsg(params = {}) {
-    let storage_mid = await getChromeStorage('mid') || ''
     const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
-    const { mid } = storage_mid || {};
-    return new Promise(function (resolve, reject) {
-        if(!token) {
+    if (!token) {
+        return new Promise(function (resolve, reject) {
             resolve({});
-            return;
-        }
-        let _url = `${baseAPIUrl}/message/readAllMsgByType`
-        fetch(_url, {
-            method: 'POST', 
-            headers: {
-                'Content-Type': 'application/json',
-            },
-            body: JSON.stringify({
-                "baseInfo": {
-                    appVersionCode,
-                    mid,
-                    machineCode: mid,
-                    token: token,
-                    uid,
-                    loginUid: uid,
-                    appType:1,
-                },
-                "params": params
-            }),
-        }).then(response => response.json())
-            .then(data => {
-                resolve(data);
-            })
-            .catch((error) => {
-                reject(error);
-            });
+        })
+    }
+    return commonFetch({
+        url: '/message/readAllMsgByType',
+        params
     })
 }
 
 
 export async function getDiscordUserInfo(params = {}) {
-    let storage_mid = await getChromeStorage('mid') || ''
     const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
-    const { mid } = storage_mid || {};
-    return new Promise(function (resolve, reject) {
-        if(!token) {
+    if (!token) {
+        return new Promise(function (resolve, reject) {
             resolve({});
-        }
-        let _url = `${baseAPIUrl}/openapi/discord/token`
-        fetch(_url, {
-            method: 'POST', 
-            headers: {
-                'Content-Type': 'application/json',
-            },
-            body: JSON.stringify({
-                "baseInfo": {
-                    appVersionCode,
-                    mid,
-                    machineCode: mid,
-                    token: token,
-                    uid,
-                    loginUid: uid,
-                    appType:1,
-                },
-                "params": params
-            }),
-        }).then(response => response.json())
-            .then(data => {
-                resolve(data);
-            })
-            .catch((error) => {
-                reject(error);
-            });
+        })
+    }
+    return commonFetch({
+        url: '/openapi/discord/token',
+        baseInfo: {
+            token,
+            uid
+        },
+        params
     })
 }

+ 66 - 33
src/logic/background/twitter.js

@@ -1,19 +1,52 @@
 import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fetchAllMessageInfo, fetchReadTaskAllMsg, getDiscordUserInfo } from '@/logic/background/fetch/twitter.js'
-import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie ,getChromeStorage, removeChromeCookie} from '@/uilts/chromeExtension.js'
+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 = ''
+let tab_flag = true
+
+const isHasTabByUrl = (url, callback) => {
+    let item
+    chrome.tabs.query({}, (tab) => {
+        for (let i in tab) {
+            if (tab[i].url.indexOf(url) >= 0) {
+                item = tab[i]
+                break
+            }
+        }
+        callback(item)
+    })
+}
+
 export function twitterPinLoginToken() {
     // 1.判断是否登陆了
     getChromeStorage('userInfo', (res) => {
         // 没有登陆
         if (!res) {
+            if(tab_flag == false){
+                return
+            }
+            tab_flag = false
             fetchTtwitterRequestToken().then((res) => {
-                authToken = res.data.authToken
-                chrome.tabs.create({
-                    url: `https://api.twitter.com/oauth/authorize?oauth_token=${res.data.authToken}`
-                })
+                tab_flag = true
+                if (res.code == 0) {
+                    authToken = res.data.authToken
+                    consumerKey = res.data.consumerKey
+                    isHasTabByUrl('https://api.twitter.com/oauth/authorize?oauth_token', (tab) => {
+                        if (!tab) {
+                            chrome.tabs.create({
+                                url: `https://api.twitter.com/oauth/authorize?oauth_token=${res.data.authToken}`
+                            })
+                        }else{
+                            chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab.index })
+                        }
+                    })
+                }
+            }).catch(()=>{
+                tab_flag = true
             })
         }
     })
@@ -52,7 +85,7 @@ export function twitterPinLoginCode(sender, code) {
         }
         // 发送请求
         // token,code
-        fetchTwitterLogin(authToken, code, receivedIds).then(res => {
+        fetchTwitterLogin(authToken, consumerKey, code, receivedIds).then(res => {
             if (res.code == 0) {
                 setChromeStorage({ userInfo: JSON.stringify(res.data) })
                 // 获取全局消息数据
@@ -64,14 +97,14 @@ export function twitterPinLoginCode(sender, code) {
 }
 
 let discordAuthWindowId = '';
-export function saveDiscordAuthWindowId (params) {
-    let {windowId = ''} = params.data || {};
+export function saveDiscordAuthWindowId(params) {
+    let { windowId = '' } = params.data || {};
     discordAuthWindowId = windowId;
 }
 
-export function discordLoginCode({code}, sender) {
+export function discordLoginCode({ code }, sender) {
     console.log('sender', sender)
-    let {windowId, id} = sender.tab || {};
+    let { windowId, id } = sender.tab || {};
     chrome.tabs.remove(id);
 
     // 发送请求
@@ -82,7 +115,7 @@ export function discordLoginCode({code}, sender) {
         if (res.code == 0) {
             setTimeout(() => {
                 sendActivetabMessage({
-                    actionType: 'BACK_DISCORD_LOGIN_SUCCESS'    
+                    actionType: 'BACK_DISCORD_LOGIN_SUCCESS'
                 });
             })
         }
@@ -92,7 +125,7 @@ export function discordLoginCode({code}, sender) {
     //     chrome.windows.remove(
     //         windowId,
     //         function () {
-                
+
     //         }
     //     )
     // }
@@ -245,19 +278,19 @@ export function popupRePublish(req) {
 }
 
 export function setBadgeInfo(params) {
-    let {text = '', color = '#DF3535'} = params.data || {};
-    chrome.action.setBadgeText({text: text});
-    chrome.action.setBadgeBackgroundColor({color: color });
+    let { text = '', color = '#DF3535' } = params.data || {};
+    chrome.action.setBadgeText({ text: text });
+    chrome.action.setBadgeBackgroundColor({ color: color });
 }
 
 export function hideBadge() {
-    chrome.action.setBadgeText({text: ''});
-    chrome.action.setBadgeBackgroundColor({color: [0, 0, 0, 0]});
+    chrome.action.setBadgeText({ text: '' });
+    chrome.action.setBadgeBackgroundColor({ color: [0, 0, 0, 0] });
 }
 
-export async function setMessageCount () {
+export async function setMessageCount() {
     const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
-    if(token) {
+    if (token) {
         getMessageInfo();
         createAlarm();
     }
@@ -266,32 +299,32 @@ export async function setMessageCount () {
 function createAlarm() {
     let alarmInfo = {
         //1分鐘之後開始(該值不能小於1) 
-        delayInMinutes: 1, 
+        delayInMinutes: 1,
         //與上方等同的寫法是 
         // when : Date.now() + n,
         //開始後每一分鐘執行一次(該值不能小于1) 
-        periodInMinutes : 1 
+        periodInMinutes: 1
     };
 
     //每次加載就清空定時器
     chrome.alarms.clearAll();
-    
-    chrome.alarms.onAlarm.addListener(function(alarm) {
+
+    chrome.alarms.onAlarm.addListener(function (alarm) {
         console.log("onAlarm-", alarm);
         getMessageInfo();
     });
 
     //創造定時器
-    chrome.alarms.create('denetChromeAlarm',alarmInfo);
+    chrome.alarms.create('denetChromeAlarm', alarmInfo);
 }
 
-export  function getMessageInfo () {
+export function getMessageInfo() {
     fetchAllMessageInfo().then(res => {
-        if(res.code == 0) {
-            let {unReadCountTotal = 0 } = res.data;
-            if(unReadCountTotal > 0) {
-                let text = unReadCountTotal > 99 ? '99+' : unReadCountTotal+'';
-                setBadgeInfo({data: {text}});
+        if (res.code == 0) {
+            let { unReadCountTotal = 0 } = res.data;
+            if (unReadCountTotal > 0) {
+                let text = unReadCountTotal > 99 ? '99+' : unReadCountTotal + '';
+                setBadgeInfo({ data: { text } });
             } else {
                 hideBadge();
             }
@@ -299,11 +332,11 @@ export  function getMessageInfo () {
     })
 }
 
-export function readTaskAllMsg({msgType}, cb) {
+export function readTaskAllMsg({ msgType }, cb) {
     fetchReadTaskAllMsg({
         msgType // 1:任务红包 2:钱包明细
     }).then(res => {
-        if(res.code == 0) {
+        if (res.code == 0) {
             cb && cb();
         }
     });
@@ -312,7 +345,7 @@ export function readTaskAllMsg({msgType}, cb) {
 export const onDisconnectHandler = (port) => {
     if (port.name === "popup" || port.name === "popup_transactions") {
         let msgType = port.name === "popup" ? 1 : 2;
-        readTaskAllMsg({msgType},() => {
+        readTaskAllMsg({ msgType }, () => {
             getMessageInfo();
         })
     }

+ 120 - 6
src/logic/content/twitter.js

@@ -1,5 +1,5 @@
 import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
-import { throttle } from '@/uilts/help'
+import { throttle, getQueryString } from '@/uilts/help'
 import { discordAuthRedirectUri } from '@/http/configAPI'
 import { reportSrcPublishEvent } from '@/http/publishApi'
 import Report from "@/log-center/log"
@@ -411,7 +411,7 @@ function _createBtnDom() {
 
 function addSliderNavDeBtn(isSmall = false) {
     if (!isSmall) {
-        let bigDom = document.querySelector('h1[role]').parentNode.parentNode;
+        let bigDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
         let deBtn = document.getElementById('de-btn');
         if (bigDom && !deBtn) {
             bigDom.appendChild(dom.deBtn);
@@ -422,7 +422,7 @@ function addSliderNavDeBtn(isSmall = false) {
             });
         }
     } else {
-        let smallDom = document.querySelector('h1[role]').parentNode.parentNode;
+        let smallDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
         let deBtn3 = document.getElementById('de-btn3');
         if (smallDom && !deBtn3) {
             smallDom.appendChild(dom.deBtn3);
@@ -574,6 +574,16 @@ export function initExecuteScript(changes) {
         }
     }
 }
+
+const createIframe = ({ url, tweet_Id }, callback) => {
+    let iframe = document.createElement('iframe')
+    iframe.id = `tweetId${tweet_Id}`
+    iframe.src = url
+    iframe.onload = () => {
+        callback()
+    }
+}
+
 // 初始化
 export function init() {
     getDiscordAuthCode();
@@ -595,7 +605,6 @@ export function init() {
                     onChangePageMain(targetNode)
                     changeQueueNum(1)
                 }
-                console.log('queue_num', queue_num)
                 if (queue_num <= 0) {
                     return
                 }
@@ -606,8 +615,7 @@ export function init() {
         }
     }, 1000);
     renderDom();
-
-
+    checkTwitterTaskState()
     getChromeStorage("popupShowPublishDialog", (res) => {
         console.log("popupShowPublishDialog", res);
         if (res && res.show) {
@@ -629,4 +637,110 @@ export function init() {
             }, 800);
         }
     });
+}
+
+// 根据推特id找到dom,完成任务
+export function findTweetByIdDoTask({ tweet_Id = '', follow_names = [] }, task_type = 'like') {
+    // 1.根据推特ID寻找推文,获取卡片
+    // 获取所有卡片参数
+    let card_json_data = parseCard.parseAllDeNetCardParmas()
+    let result = card_json_data.filter((item) => { return item.tweet_Id == tweet_Id }) || []
+    if (result.length < 1) {
+        return
+    }
+    result = result[0]
+
+    switch (task_type) {
+        case 'like':
+            // https://twitter.com/intent/retweet?tweet_id=1525900221628223491
+            if (result.dom_card) {
+                result.dom_card.querySelector('div[data-testid=like]').click()
+                result.dom_card.querySelector('iframe').contentWindow.postMessage({ actionType: 'CONTENT_DONE_TASK', task_type, }, '*');
+            }
+            break;
+        case 'retweet':
+            if (result.dom_card) {
+                result.dom_card.querySelector('div[data-testid=retweet]').click()
+                result.dom_card.querySelector('div[data-testid=retweetConfirm]').click()
+            }
+            break
+        case 'follow':
+            follow_names.forEach((item) => {
+                window.open(`https://twitter.com/intent/follow?screen_name=${item}&tweet_Id=${tweet_Id}`)
+            })
+            break
+    }
+}
+
+function clickByDataTestId(e, id, callback) {
+    if (e.target.dataset && e.target.dataset.testid && e.target.dataset.testid == id) {
+        callback()
+    } else if (e.target.closest('div[data-testid=' + id + ']')) {
+        callback()
+    }
+}
+
+// 校验关注推特状态 
+export function checkTwitterTaskState() {
+    let task_type = ''
+    let url = window.location.href
+    let tweet_Id
+    let task_data = {
+        follow_name: ''
+    }
+    // 校验当前链接
+    if (url.includes('https://twitter.com/intent/retweet')) {
+        task_type = 'retweet'
+    } else if (url.includes('https://twitter.com/intent/follow')) {
+        task_type = 'follow'
+        task_data.follow_name = getQueryString('screen_name')
+    } else if (url.includes('https://twitter.com/intent/like')) {
+        task_type = 'like'
+    } else {
+        return
+    }
+    tweet_Id = getQueryString('tweet_id')
+
+    // let root_status
+    document.body.addEventListener('click', (e) => {
+        // 点击 确认
+        clickByDataTestId(e, 'confirmationSheetConfirm', () => {
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: true }, () => { })
+        })
+        // 点击取消
+        clickByDataTestId(e, 'confirmationSheetCancel', () => {
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: false }, () => { })
+        })
+        // 点击 蒙层
+        if (e.target && e.target.nextSibling && e.target.nextSibling.dataset && e.target.nextSibling.dataset.testid == 'confirmationSheetDialog') {
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: false }, () => { })
+        }
+    }, true)
+
+    let timer = setInterval(() => {
+        // 喜欢
+        if (document.querySelector('div[data-testid=unlike]') && task_type == 'like') {
+            clearInterval(timer)
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: true }, () => { })
+        }
+        // 转推
+        if (document.querySelector('div[data-testid=unretweet]') && task_type == 'retweet') {
+            clearInterval(timer)
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: true }, () => { })
+        }
+        // 关注
+        if (task_type == 'follow') {
+            let follow_area = document.querySelector('div[data-testid=placementTracking]')
+            if (follow_area && follow_area.querySelectorAll('div')) {
+                follow_area = follow_area.querySelectorAll('div')
+                clearInterval(timer)
+                for (let i in follow_area) {
+                    if (follow_area[i] && follow_area[i].dataset && follow_area[i].dataset.testid && follow_area[i].dataset.testid.indexOf('unfollow') > 0) {
+                        chrome.runtime.sendMessage({ actionType: "DO_TASK", tweet_Id, task_type, task_data, task_done: true }, () => { })
+                        break
+                    }
+                }
+            }
+        }
+    }, 1000)
 }

+ 1 - 1
src/manifest.json

@@ -2,7 +2,7 @@
     "manifest_version": 3,
     "name": "DeNet",
     "description": "Growing more twitter followers with Denet",
-    "version": "1.0.3",
+    "version": "1.0.4",
     "background": {
         "service_worker": "/js/background.js"
     },

+ 5 - 6
src/rules/rules_1.json

@@ -1,20 +1,19 @@
 [
     {
         "id": 1,
+        "priority":1,
         "condition": {
+            "urlFilter": "twitter.com"
         },
         "action": {
             "type": "modifyHeaders",
             "responseHeaders": [
                 {
                     "header": "X-Frame-Options",
-                    "operation": "remove"
-                },
-                {
-                    "header": "Content-Security-Policy",
-                    "operation": "remove"
+                    "operation": "set",
+                    "value":"ALLOW-FROM  https://twitter.com"
                 }
             ]
         }
     }
-]
+]

+ 11 - 0
src/uilts/help.js

@@ -76,4 +76,15 @@ export function scaleNumber(num) {
       val,
       scale
     };
+}
+
+export function getBit (value) {
+  const reg = /([0-9]+\.[0-9]{4})[0-9]*/;
+  if(value) {
+    let str = value.toString();
+    str = str.replace(reg,"$1");
+    return str;
+  } else {
+    return value;
+  }
 }

+ 22 - 6
src/view/components/currency-list.vue

@@ -32,8 +32,16 @@
                                 </div>
                             </div>
                             <div class="right">
-                                <div class="num">{{ data.balance }}</div>
-                                <div class="amount" v-if="data.currencyType == 2">${{ data.usdEstimateBalance }}</div>
+                                <div class="num">
+                                    <a-tooltip :title="data.balance">
+                                        {{ getBit(data.balance) }}
+                                    </a-tooltip>
+                                </div>
+                                <div class="amount" v-if="data.currencyType == 2">
+                                    <a-tooltip :title="'$'+data.usdEstimateBalance">
+                                        ${{ getBit(data.usdEstimateBalance) }}
+                                    </a-tooltip>
+                                </div>
                             </div>
                         </div>
                     </template>
@@ -54,8 +62,16 @@
                         </div>
                     </div>
                     <div class="right">
-                        <div class="num">{{ data.balance }}</div>
-                        <div class="amount" v-if="data.currencyType == 2">${{ data.usdEstimateBalance }}</div>
+                        <div class="num">
+                            <a-tooltip :title="data.balance">
+                                {{ getBit(data.balance) }}
+                            </a-tooltip>
+                        </div>
+                        <div class="amount" v-if="data.currencyType == 2">
+                            <a-tooltip :title="'$'+data.usdEstimateBalance">
+                                ${{ getBit(data.usdEstimateBalance) }}
+                            </a-tooltip>
+                        </div>
                     </div>
                 </div>
                 <div class="no-data" v-if="!searchList.length">
@@ -70,7 +86,7 @@
 /* eslint-disable */
 import { defineEmits, ref, onMounted, defineProps, defineExpose } from "vue";
 import { getCurrencyInfo, searchCurrencyInfo, syncChainTokenRechargeRecord } from "@/http/publishApi";
-import { debounce } from "@/uilts/help";
+import { debounce, getBit } from "@/uilts/help";
 
 const props = defineProps({
     page: {
@@ -211,7 +227,7 @@ const asyncTokenRechRecord = (cb) => {
     })
 }
 
-const listScroll = () => {
+const listScroll = (e) => {
     let wrapperHeight = listWrapperDom.value.offsetHeight;
     let listContentHeight = listContentDom.value.offsetHeight;
     let scrollTop = e.target.scrollTop || 0;

+ 12 - 2
src/view/components/font-amount.vue

@@ -1,8 +1,13 @@
 <template>
-    <span :style="{ fontSize: amount_font_size + 'px' }">{{ amount }}</span>
+    <div :style="{ fontSize: amount_font_size + 'px' }">
+        <a-tooltip :title="amount" >
+           <span class="content">{{ getBit(amount) }}</span>
+        </a-tooltip>
+    </div>
 </template>
 <script setup>
 import { ref, defineProps, onMounted, watch } from 'vue'
+import { getBit } from "@/uilts/help";
 
 let props = defineProps({
     amount: {
@@ -35,7 +40,12 @@ onMounted(() => {
 
 </script>
 <style lang="scss" scoped>
-span {
+.content {
     word-break: break-all;
+    margin-left: 12px;
+    font-weight: 800;
+    font-size: 60px;
+    line-height: 76px;
+    color: #FFFFFF;
 }
 </style>

+ 58 - 0
src/view/components/global-tip.vue

@@ -0,0 +1,58 @@
+<template>
+    <div class="global-tip" v-if="state.is_show == 1">
+        <img :src="require('@/assets/svg/icon-global-tip.svg')" alt="">
+        <p>{{ state.msg }}</p>
+    </div>
+</template>
+<script setup>
+import { onMounted, reactive, defineProps } from "vue";
+import { getAppNotification } from '@/http/messageApi.js'
+let props = defineProps({
+    type: String,
+})
+// 显示位置:1-红包主体,2-发布器,3-插件主体
+
+let state = reactive({
+
+})
+
+onMounted(() => {
+    getAppNotification().then((res) => {
+        if (res.code == 0) {
+            res.data.forEach((item) => {
+                if (props.type == item.type) {
+                    state.is_show = item.isShow
+                    state.msg = item.message
+                }
+            })
+        }
+    })
+})
+
+</script>
+<style lang="scss" scoped>
+.global-tip {
+    position: absolute;
+    z-index: 999;
+    display: flex;
+    height: 40px;
+    background: #000000;
+    opacity: 0.7;
+    align-items: center;
+    width: 100%;
+
+    img {
+        width: 15px;
+        height: 15px;
+        margin-left: 17px;
+        margin-right: 10px;
+    }
+
+    p {
+        color: #DCA550;
+        flex: 1;
+        margin: 0;
+        padding: 0;
+    }
+}
+</style>

+ 37 - 20
src/view/components/popup-transactions.vue

@@ -16,7 +16,7 @@
             <div>
                 <div class="cell" v-for="(item, index) in dataList" :key="index">
                     <red-dot class="red-dots"
-                        v-if="item.unReadMsgCount > 0"></red-dot> 
+                        v-if="item.unReadMsgCount > 0 && isReadMsg"></red-dot> 
                     <div class="img-wrapper">
                         <!-- 收入- 任务红包领取 -->
                         <template v-if="item.bizType == 1">
@@ -89,7 +89,9 @@
                                         <div>
                                             <div class="balance">
                                                 <span class="amount">
-                                                    -{{ item.trxAmountValue || 0 }}
+                                                    <a-tooltip :title="'-'+item.trxAmountValue">
+                                                        -{{ getBit(item.trxAmountValue) || 0 }}
+                                                    </a-tooltip>
                                                 </span>
                                                 <span class="name">{{ item.trxAmountCurrencyInfo.tokenSymbol }}</span>
                                                 <img :src="item.trxAmountCurrencyInfo.iconPath" alt="">
@@ -101,7 +103,11 @@
                                     </template>
                                     <template v-else-if="item.bizData.withdrawStatus == 2">
                                         <div class="balance">
-                                            <span class="amount">-{{ item.trxAmountValue || 0 }}</span>
+                                            <span class="amount">
+                                                <a-tooltip :title="'-'+item.trxAmountValue">
+                                                    -{{ getBit(item.trxAmountValue) || 0 }}
+                                                </a-tooltip>
+                                            </span>
                                             <span class="name">{{ item.trxAmountCurrencyInfo.tokenSymbol }}</span>
                                             <img :src="item.trxAmountCurrencyInfo.iconPath" alt="">
                                         </div>
@@ -109,7 +115,11 @@
                                     <template v-else-if="item.bizData.withdrawStatus == 3">
                                         <div>
                                             <div class="balance">
-                                                <span class="amount">-{{ item.trxAmountValue || 0 }}</span>
+                                                <span class="amount"> 
+                                                    <a-tooltip :title="'-'+item.trxAmountValue">
+                                                        -{{ getBit(item.trxAmountValue) || 0 }}
+                                                    </a-tooltip>
+                                                </span>
                                                 <span class="name">{{ item.trxAmountCurrencyInfo.tokenSymbol }}</span>
                                                 <img :src="item.trxAmountCurrencyInfo.iconPath" alt="">
                                             </div>
@@ -119,7 +129,11 @@
                                         </div>
                                     </template>
                                     <template v-else>
-                                        <span class="amount">-{{ item.trxAmountValue || 0 }}</span>
+                                        <span class="amount">
+                                            <a-tooltip :title="'-'+item.trxAmountValue">
+                                                -{{ getBit(item.trxAmountValue) || 0 }}
+                                            </a-tooltip>
+                                        </span>
                                         <span class="name">{{ item.trxAmountCurrencyInfo.tokenSymbol }}</span>
                                         <img :src="item.trxAmountCurrencyInfo.iconPath" alt="">
                                     </template>
@@ -127,7 +141,10 @@
                                 <!-- 收入 -->
                                 <template v-else>
                                     <span class="amount">
-                                        <template v-if="item.bizType == -2">-</template>{{ item.trxAmountValue || 0 }}
+                                        <template v-if="item.bizType == -2">-</template>
+                                        <a-tooltip :title="item.bizType == -2 ? '-' + item.trxAmountValue : item.trxAmountValue">
+                                            {{ getBit(item.trxAmountValue) || 0 }}
+                                        </a-tooltip>
                                     </span>
                                     <span class="name">{{ item.trxAmountCurrencyInfo.tokenSymbol }}</span>
                                     <img :src="item.trxAmountCurrencyInfo.iconPath" alt="">
@@ -150,6 +167,8 @@ import redDot from "@/view/components/red-dot.vue";
 import { transactionsList } from "@/http/account";
 import { readAllMsgByType, getAllMessageInfo } from "@/http/messageApi"
 import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
+import { getBit } from "@/uilts/help";
+
 var moment = require('moment');
 
 let dataList = ref([]);
@@ -164,6 +183,8 @@ let listReqParams = {
     loadMore: false,
 };
 
+let isReadMsg = ref(true);
+
 const getTransactionsList = () => {
     transactionsList({
         params: listReqParams.params,
@@ -198,23 +219,19 @@ onMounted(() => {
     }).then(res => {
         setMessageCount();
     });
+    setTimeout(() => {
+        isReadMsg.value = false;
+        readAllMsgByType({
+            params: {
+                msgType: 2 // 1:任务红包 2:钱包明细
+            }
+        }).then(res => {
+            setMessageCount();
+        })
+    }, 2000)
     getTransactionsList();
 });
 
-onBeforeUnmount(() => {
-    readAllMsgByType({
-        params: {
-            msgType: 1 // 1:任务红包 2:钱包明细
-        }
-    });
-    readAllMsgByType({
-        params: {
-            msgType: 2
-        }
-    });
-})
-
-
 const setMessageCount = () => {
     getAllMessageInfo({params: {
     }}).then(res => {

+ 8 - 32
src/view/iframe/publish/components/paypal-button.vue

@@ -1,34 +1,7 @@
 <template>
 <!-- paypal 支付按钮 -->
     <div class="pay-wrapper">
-        <div class="pay-msg">
-            <div class="row">
-                <template v-if="currentCurrencyInfo.currencyCode == 'USD'">
-                    Pay ${{finalAmountData.finalAmountValue || 0}} 
-                    <span>
-                        (Available ${{finalAmountData.requestAmountValue}})
-                    </span>
-                </template>
-                <template v-else>
-                    <span class="desc">
-                        Pay
-                    </span>
-                    {{payConfig.amount || 0}}
-                    <img :src="currentCurrencyInfo.iconPath" class="icon">
-                    <span>
-                        {{currentCurrencyInfo.tokenSymbol}}
-                    </span>
-                </template>
-            </div>
-            <div class="msg">
-                <template v-if="currentCurrencyInfo.currencyCode == 'USD'">
-                    {{payConfig.feeDesc}}
-                </template>
-                <template v-else>
-                    (Balance: {{currentCurrencyInfo.balance}})
-                </template>
-            </div>
-        </div>
+        <slot name="balance"></slot>
         <div class="pay-btn">
             <div class="iframe-pay"
                 v-show="currentCurrencyInfo.currencyCode == 'USD'"
@@ -39,9 +12,10 @@
                     :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="tokenPay">
-                Pay Now
+                Pay {{payConfig.amount || 0}} {{currentCurrencyInfo.tokenSymbol}}
             </div>
         </div>
     </div>
@@ -165,7 +139,7 @@ onMounted(() => {
     position: absolute;
     left: 0;
     bottom: 0;
-    box-shadow: 0 -4px 8px -3px #00000026;
+    box-shadow: 0px -1px 0px #ECECEC;
     border-bottom-right-radius: 16px;
     padding: 12px 30px;
     box-sizing: border-box;
@@ -209,11 +183,9 @@ onMounted(() => {
     }
 
     .pay-btn {
-        width: 206px;
         height: 48px;
 
         .token-pay {
-            width: 100%;
             height: 100%;
             background: #1D9BF0;
             border-radius: 10000px;
@@ -224,6 +196,10 @@ onMounted(() => {
             font-size: 18px;
             color: #fff;
             cursor: pointer;
+            padding: 0 30px;
+            &.disabled {
+                background: #DEDEDE;
+            }
         }
 
         .iframe-pay {

+ 12 - 18
src/view/iframe/publish/components/preview-card.vue

@@ -2,11 +2,6 @@
 <template>
     <div class="wrapper">
         <div class="card-container">
-            <div class="preview-txt">
-                <span>{{installStatus ? 'After' : 'Before'}}</span>
-                DeNet installed
-            </div>
-
             <!-- 安装之后的卡片样式 -->
             <div v-show="installStatus" class="left" :style="{'width': reviewCanvasParams.width+ 'px'}">
                 <div class="head" :style="{'zoom': reviewCanvasParams.zoom}">
@@ -90,7 +85,7 @@
 </template>
 
 <script setup>
-import { ref, defineProps, onMounted, nextTick, watch, reactive } from "vue";
+import { ref, defineProps, onMounted, nextTick, watch, reactive, inject, onUnmounted } from "vue";
 
 import customCardCover from '@/view/components/custom-card-cover.vue'
 
@@ -102,8 +97,8 @@ let reviewCanvasParams = reactive({
     width: 396,
     zoom: 1
 });
-
-let installStatus = ref(false);
+let timer = ref(null);
+let installStatus = inject('installStatus');
 
 defineProps({
     postData: {
@@ -191,7 +186,8 @@ onMounted(() => {
         if(res) {
             getUserName(res.nickName);
         }
-        setInterval(() => {
+        clearInterval(timer.value);
+        timer.value = setInterval(() => {
             installStatus.value = !installStatus.value;
         }, 3000)
     });
@@ -200,17 +196,18 @@ onMounted(() => {
     })
 })
 
+onUnmounted(() => {
+    clearInterval(timer.value);
+})
+
 </script>
 
 <style lang="scss" scoped>
 .wrapper {
     width: 100%;
     height: 100%;
-    padding: 10px 16px;
     box-sizing: border-box;
-    border-bottom-right-radius: 16px;
     overflow-y: auto;
-    padding-bottom: 80px;
     display: flex;
 
     &::-webkit-scrollbar {
@@ -223,7 +220,6 @@ onMounted(() => {
         background: #ffffff;
         box-sizing: border-box;
         border-radius: 20px;
-        padding: 0 6px;
         display: flex;
         align-items: center;
 
@@ -239,7 +235,7 @@ onMounted(() => {
         .head {
             position: absolute;
             z-index: 1100;
-            top: 136px;
+            top: 132px;
             left: 17px;
             display: flex;
 
@@ -274,6 +270,7 @@ onMounted(() => {
             width: 387px;
             height: 100%;
             background-size: contain;
+            background-repeat: no-repeat;
             .tips {
                 right: 15px !important;
             }
@@ -310,11 +307,8 @@ onMounted(() => {
         .content-before {
             background: url('@/assets/img/img-preview-bg-before.png');
             background-size: contain;
+            background-repeat: no-repeat;
             height: 100%;
-            .head {
-                top: 138px !important;
-                left: 17px !important;
-            }
             .card-wrapper {
                 width: 491px;
                 border: 1px solid #D1D9DD;

+ 221 - 0
src/view/iframe/publish/components/top-up2.vue

@@ -0,0 +1,221 @@
+<!-- 充值 -->
+<template>
+    <div class="token-content">
+        <div class="item">
+            <div class="token-l">Recommended Deposit</div>
+            <div class="token-r">
+                <img
+                    class="icon"
+                    :src="currentCurrencyInfo.iconPath"
+                />{{currentCurrencyInfo.tokenSymbol}}
+            </div>
+        </div>
+        <div class="item">
+            <div class="token-l">Network</div>
+            <div class="token-r">
+                <img
+                    class="icon"
+                    :src="require('@/assets/svg/icon-BNB.svg')"
+                />
+                BNB Smart Chain (BEP20)
+            </div>
+        </div>
+        <div class="item none">
+            <div class="token-l">Address</div>
+        </div>
+        <div class="qrCode">
+            <div class="canvas">
+                <canvas id="canvas"></canvas>
+            </div>
+            <div class="code">
+                <div class="address">{{tokenRechargeAddress}}</div>
+                <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>
+</template>
+
+<script setup>
+/* eslint-disable */
+import { defineProps, defineEmits, onMounted, ref } from "vue";
+import { getTokenRechargeAddress } from "@/http/pay";
+import { ElMessage } from 'element-plus'
+
+let QRCode = require('qrcode')
+let ClipboardJS = require('clipboard')
+
+let tokenRechargeAddress = ref('');
+
+const props = defineProps({
+    currentCurrencyInfo: {
+        type: Object,
+        default: () => {
+
+        }
+    },
+    asyncIng: {
+        type: Boolean,
+        default: false
+    }
+})
+
+const emits = defineEmits(['doneHandle']);
+
+const createQRCode = (str) => {
+    var canvas = document.getElementById('canvas')
+    QRCode.toCanvas(canvas, str, {
+        width: 130,
+        height: 130,
+        scale: 1,
+        color: {
+            dark: '#000', // 二维码前景颜色
+            light: '#fff' // 二维码背景颜色
+        }
+    }, function (error) {
+        if (error) console.error(error)
+        console.log('success!');
+    })
+}
+const copyToken = () => {
+    var clipboard = new ClipboardJS('.copy-btn');
+    clipboard.on('success', function (e) {
+        ElMessage({
+            message: 'copy success',
+            grouping: true,
+            type: 'success',
+            offset: -16,
+            appendTo: document.body
+
+        })
+        console.info('Action:', e.action);
+        console.info('Text:', e.text);
+        console.info('Trigger:', e.trigger);
+
+        e.clearSelection();
+    });
+
+    clipboard.on('error', function (e) {
+        ElMessage({
+            message: 'copy error',
+            grouping: true,
+            type: 'error',
+            offset: -16
+        })
+        console.error('Action:', e.action);
+        console.error('Trigger:', e.trigger);
+    });
+}
+
+
+const doneHandle = () => {
+    emits('topUpDone', {});
+}
+
+const getTokenAddress = () => {
+    getTokenRechargeAddress({
+        params: {
+            tokenChain: props.currentCurrencyInfo.tokenChain
+        },
+    }).then((res) => {
+        if(res.code == 0) {
+            if (res.data && res.data.rechargeAddress) {
+                tokenRechargeAddress.value = res.data.rechargeAddress;
+                createQRCode(res.data.rechargeAddress)
+                copyToken()
+            }
+        }    
+    })
+}
+
+onMounted(() => {
+    getTokenAddress();
+}) 
+
+</script>
+
+<style scoped lang="scss">
+.token-content {
+    padding: 0 16px;
+    margin-bottom: 16px;
+    border-radius: 20px;
+    border: 1px solid #E6E6E6;
+    .item {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        clear: both;
+        height: 42px;
+        box-shadow: inset 0px -1px 0px #E6E6E6;
+        &.none {
+            box-shadow: unset;
+        }
+        .token-l {
+            font-size: 15px;
+            font-weight: 400;
+            color: #707070;
+        }
+        .token-r {
+            font-size: 16px;
+            font-weight: 500;
+        }
+        img {
+            width: 20px;
+            height: 20px;
+            vertical-align: middle;
+            margin-right: 6px;
+        }
+    }
+    .desc {
+        color: #A9A9A9;
+        font-size: 12px;
+        font-weight: 400;
+        margin-bottom: 20px;
+        span {
+            color: #ff0016;
+            font-weight: bold;
+        }
+    }
+    .qrCode {
+        display: flex;
+        margin-bottom: 12px;
+        .canvas {
+            overflow: hidden;
+            width: 130px;
+            height: 130px;
+            canvas {
+                transform: scale(1.24);
+            }
+        }
+        .code {
+            flex: 1;
+            padding: 0 20px;
+            display: flex;
+            align-items: center;
+            flex-direction: column;
+            justify-content: center;
+            .address {
+                font-size: 16px;
+                font-weight: 500;
+                line-height: 25px;
+                margin-bottom: 20px;
+                word-break: break-all;
+            }
+            .copy-btn {
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                cursor: pointer;
+                width: 100%;
+                height: 40px;
+                color: #1D9BF0;
+                font-size: 17px;
+                font-weight: 600;
+                text-align: center;
+                border: 1px solid #1D9BF0;
+                border-radius: 40px;
+            }
+        }
+    }
+}
+</style>

+ 251 - 23
src/view/iframe/publish/give-dialog.vue

@@ -3,7 +3,7 @@
         <div class="content"
             :style="{
                 height: dialogHeight + 'px',
-                width: showComType != 'preview' ? '600px' : 'auto'}">   
+                width: showComType != 'preview' ? '600px' : '880px'}">   
             <div class="pop-mask"  
                 v-show="showCurrencyPop" 
                 @click.stop="showCurrencyPop = false"></div>
@@ -77,6 +77,7 @@
 
                     <div class="right"  
                         :class="{'fill-right': showComType == 'preview'}">
+                        <global-tip :type="'2'"></global-tip>
                         <div class="form-wrapper"  v-if="showComType == 'default'">
                             <img
                                 class="img-mode"
@@ -144,7 +145,9 @@
                                         Balance
                                     </div>
                                     <div class="amount">
-                                        {{currentCurrencyInfo.balance}}
+                                        <a-tooltip :title="currentCurrencyInfo.balance">
+                                            {{ getBit(currentCurrencyInfo.balance) }}
+                                        </a-tooltip>
                                         <img
                                             :class="{ 'icon-refresh-rotate': refreshRotate }"
                                             @click="updateCurrencyBanlce"
@@ -273,16 +276,88 @@
 
                         <!-- 预览 -->
                         <template v-else-if="showComType == 'preview'">
-                            <preview-card
-                                :currentCurrencyInfo="currentCurrencyInfo"
-                                :postData="publishRes"
-                                :baseFormData="baseFormData"
-                                :amountFontSize="previewFontSize"
-                            ></preview-card>
+                            <div class="preview">
+                                <div
+                                    class="card"
+                                    :class="{ center: Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance) }">
+                                    <div class="card-title">
+                                        <img
+                                            class="img"
+                                            v-if="Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)"
+                                            :src=" require('@/assets/subject/top-01.svg') " />
+                                        <div class="font">
+                                            Preview: <span>{{installStatus ? 'After' : 'Before' }}</span> DeNet Installed
+                                        </div>
+                                    </div>
+                                    <div class="flash">
+                                        <preview-card
+                                            :currentCurrencyInfo="currentCurrencyInfo"
+                                            :postData="publishRes"
+                                            :baseFormData="baseFormData"
+                                            :amountFontSize="previewFontSize"
+                                        ></preview-card>
+                                    </div>
+                                </div>
+                                <!-- 需充值 -->
+                                <div class="card-content" v-if="Number(baseFormData.amountValue) > Number(currentCurrencyInfo.balance)">
+                                    <template v-if="currentCurrencyInfo.currencyCode === 'USD'">
+                                        <div class="card-title">
+                                            <img class="img" :src=" require('@/assets/subject/top-02.svg') " />
+                                            <div class="font">Deposit to Send Giveaway</div>
+                                        </div>
+                                        <div class="card-list">
+                                            <div class="item">
+                                                <div class="l">Giveaway Amount</div>
+                                                <div class="r"></div>
+                                            </div>
+                                            <div class="item">
+                                                <div class="l">Balance</div>
+                                                <div class="r"></div>
+                                            </div>
+                                            <div class="item">
+                                                <div class="l">Paypal charges fee ()</div>
+                                                <div class="r"></div>
+                                            </div>
+                                            <div class="item">
+                                                <div class="l">Deposit Amount</div>
+                                                <div class="r"></div>
+                                            </div>
+                                        </div>
+                                    </template>
+                                    <template v-else>
+                                        <div class="card-title">
+                                            <img class="img" :src=" require('@/assets/subject/top-02.svg') " />
+                                            <div class="font">Deposit to Send Giveaway</div>
+                                        </div>
+                                        <top-up2
+                                            :asyncIng="asyncIng"
+                                            :currentCurrencyInfo="tempCurrentCurrencyInfo"
+                                            @topUpDone="topUpDone">
+                                        </top-up2>
+                                        <div class="card-title">
+                                            <img class="img" :src=" require('@/assets/subject/top-03.svg') " />
+                                            <div class="font">Wait for the amount to arrive</div>
+                                        </div>
+                                        <div class="card-amount">
+                                            <img class="icon" src="@/assets/subject/icon-balance.png" />
+                                            <div class="con">
+                                                <div class="desc">Balance</div>
+                                                <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.tokenSymbol}}</div>
+                                            </div>
+                                            <img
+                                                class="refresh"
+                                                :class="{ 'icon-refresh-rotate': refreshRotate }"
+                                                @click="updateCurrencyBanlce"
+                                                :src=" require('@/assets/svg/icon-form-refresh.svg') "
+                                            />
+                                        </div>
+                                    </template>
+                                </div>
+                            </div>
                         </template>
 
                         <!-- paypal支付按钮 -->
-                        <div v-show="showComType == 'preview'">
+                        <div class="payment" v-show="showComType == 'preview'">
                             <paypal-button
                                 :finalAmountData="finalAmountData"
                                 :payConfig="{
@@ -294,7 +369,23 @@
                                 }"
                                 :currentCurrencyInfo="currentCurrencyInfo"
                                 @payPalFinsh="payPalFinsh"
-                            ></paypal-button>
+                            >
+                                <template v-slot:balance>
+                                    <div class="balance" v-if="Number(baseFormData.amountValue) <= Number(currentCurrencyInfo.balance)">
+                                        <img class="icon" src="@/assets/subject/icon-balance.png" />
+                                        <div class="con">
+                                            <div class="desc">Balance</div>
+                                            <div class="price">{{currentCurrencyInfo.balance}} {{currentCurrencyInfo.tokenSymbol}}</div>
+                                        </div>
+                                        <img
+                                            class="refresh"
+                                            :class="{ 'icon-refresh-rotate': refreshRotate }"
+                                            @click="updateCurrencyBanlce"
+                                            :src=" require('@/assets/svg/icon-form-refresh.svg') "
+                                        />
+                                    </div>
+                                </template>
+                            </paypal-button>
                         </div>
                     </div>
                 </div>
@@ -313,13 +404,13 @@
 </template>
 
 <script setup>
-import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick } from "vue";
+import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick, provide } from "vue";
 import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
 import { getInviteGuildInfo, saveInviteGuildInfo } from "@/http/discordApi";
 import { payCalcFee, getPayConfig } from "@/http/pay";
 import { getFrontConfig } from "@/http/account";
 import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
-import { debounce } from "@/uilts/help"
+import { debounce, getBit } from "@/uilts/help"
 import Report from "@/log-center/log"
 import { ElMessage, ElLoading } from "element-plus";
 import "element-plus/es/components/message/style/css";
@@ -333,6 +424,8 @@ 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";
 import topUp from "@/view/iframe/publish/components/top-up.vue";
+import topUp2 from "@/view/iframe/publish/components/top-up2.vue";
+import  GlobalTip  from '@/view/components/global-tip.vue'
 
 const config = {
     number: 'BigNumber',
@@ -345,6 +438,9 @@ let tempCurrentCurrencyInfo = ref({});
 let paypalClientId = ref("");
 let payConfig = ref({});
 let paypalHtml = ref("");
+let installStatus = ref(false);
+let timer = ref(null);
+provide('installStatus', installStatus)
 
 // 发布后返回的结果
 let publishRes = reactive({});
@@ -362,7 +458,7 @@ let currentComData = {
         title: "Giveaway",
     },
     preview: {
-        title: "Preview",
+        title: "Giveaway",
     },
     topUp: {
         title: "Deposit",
@@ -505,6 +601,14 @@ watch(
             setTimeout(() => {
                 setDialogHeight();
             }, 300);
+
+            // 更新余额
+            clearInterval(timer.value);
+            timer.value = setInterval(() => {
+                getCurrencyInfo();
+            }, 10000)
+        } else {
+            clearInterval(timer.value);
         }
     }
 );
@@ -1033,9 +1137,11 @@ const onIptSetErrorTxt = (params = {}) => {
                 setDiscordErrTxt({getDuildId: true});
             }
         }
-    } else if(currentCurrencyInfo.value.currencyCode != 'USD') {
-        depositGuide.value = true;
-        iptErrMsgTxt.value = `Insufficient ${currentCurrencyInfo.value.tokenSymbol} balance, please deposit`;
+    } else {
+
+        setDiscordErrTxt({getDuildId: true}, () => {
+            iptErrMsgTxt.value = '';
+        });
     } 
 }
 
@@ -1083,7 +1189,7 @@ const getDiscordIptData = () => {
 /**
  * 设置输入discord错误提示信息
  */
-const setDiscordErrTxt = (params = {showPop: false}) => {
+const setDiscordErrTxt = (params = {showPop: false}, cb) => {
     let discordData = getDiscordIptData() || {};
     if(discordData.checked) {
         if(discordData.text) {
@@ -1116,6 +1222,7 @@ const setDiscordErrTxt = (params = {showPop: false}) => {
                             }
                         }
                     }
+                    cb && cb(res)
                 })
             } else {
                 iptErrMsgTxt.value = discordIptErrTxt;
@@ -1130,6 +1237,8 @@ const setDiscordErrTxt = (params = {showPop: false}) => {
                 iptErrType = 'discord';
             }
         }
+    } else {
+        cb && cb();
     }
 }
 
@@ -1249,6 +1358,13 @@ const goTransactionsList = () => {
  */
 const getLocalCurrencyInfoByCode = () => {
     if(!currentCurrencyInfo.value.currencyCode) {
+        getCurrencyInfo();
+    }
+}
+
+const getCurrencyInfo = async () => {
+    let {accessToken = ''} = await getChromeStorage('userInfo') || {};
+    if (accessToken) {
         getChromeStorage('selectCurrencyInfo', (res) => {
             if(res && res.currencyCode) {
                 getCurrencyInfoByCode({
@@ -1293,7 +1409,7 @@ onMounted(() => {
     right: 0;
     bottom: 0;
     left: 0;
-    z-index: 2000;
+    z-index: 1000;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     overflow: auto;
@@ -1557,11 +1673,6 @@ onMounted(() => {
                                 cursor: pointer;
                                 margin-left: 8px;
                             }
-
-                            .icon-refresh-rotate {
-                                transform: rotate(360deg);
-                                transition-duration: 1s;
-                            }
                         }
 
                         .msg {
@@ -1845,4 +1956,121 @@ onMounted(() => {
         }
     }
 }
+
+.preview {
+    padding: 30px 40px;
+    .card {
+        float: left;
+        position: relative;
+        .flash {
+            overflow: hidden;
+            height: 460px;
+            border-radius: 26px;
+            border: solid 1px #ECECEC;
+        }
+        &.center {
+            margin-left: 50%;
+            transform: translateX(-50%);
+        }
+    }
+    .card-title {
+        height: 32px;
+        .img {
+            float: left;
+            width: 20px;
+            height: 20px;
+            margin-right: 8px;
+        }
+        .font {
+            float: left;
+            font-size: 17px;
+            font-weight: 500;
+            span {
+                color: #0091e9;
+            }
+        }
+    }
+    .card-content {
+        float: right;
+        width: 430px;
+    }
+    .card-amount {
+        overflow: hidden;
+        display: flex;
+        height: 80px;
+        padding: 20px;
+        border-radius: 20px;
+        border: 1px solid #E6E6E6;
+        .icon {
+            width: 40px;
+            height: 40px;
+        }
+        .con {
+            flex: 1;
+            padding: 0 10px;
+            .desc {
+                color: rgba($color: #000000, $alpha: 0.5);
+                font-size: 12px;
+                margin-bottom: 4px;
+            }
+            .price {
+                font-size: 16px;
+                font-weight: bold;
+            }
+        }
+        .refresh {
+            cursor: pointer;
+            width: 50px;
+            height: 50px;
+            margin-top: -5px;
+        }
+    }
+    .card-list {
+        padding: 20px;
+        border-radius: 20px;
+        border: 1px solid #E6E6E6;
+        .item {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            height: 47px;
+            font-size: 14px;
+            font-weight: 500;
+            box-shadow: inset 0px -1px 0px #EAEAEA;
+        }
+    }
+}
+
+.icon-refresh-rotate {
+    transform: rotate(360deg);
+    transition-duration: 1s;
+}
+
+.payment {
+    .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;
+            }
+        }
+        .refresh {
+            width: 40px;
+            cursor: pointer;
+            margin-left: -5px;
+        }
+    }
+}
 </style>

+ 3 - 1
src/view/iframe/publish/publish.vue

@@ -39,6 +39,8 @@ window.addEventListener("message", function (event) {
 </script>
 
 <style>
-.main_app {
+html, body {
+    background-color: rgba(255,255,255,0)!important;
+    line-height: unset !important;
 }
 </style>

+ 224 - 65
src/view/iframe/red-packet/red-packet.vue

@@ -1,6 +1,8 @@
 <!-- 红包任务页面 -->
 <template>
   <div class="content">
+    <!-- global-tip -->
+    <global-tip :type="'1'"></global-tip>
     <!-- open -->
     <div v-show="state.status == 'opened'" class="opened">
       <!-- <div class="header" :style="{ 'backgroundImage': `url(${require('@/assets/subject/001-back-head-top.svg')})` }">
@@ -132,9 +134,18 @@
       </div>
       <div class="luck-list-title">
         <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
-        <div> {{ state.detail.receiveAmountValue }} / {{ state.detail.amountValue || '' }} {{
-            state.detail.currencySymbol || ''
-        }}</div>
+        <div class="right">
+          <span class="text">
+            <a-tooltip :title="state.detail.receiveAmountValue">
+              {{ getBit(state.detail.receiveAmountValue) }}
+            </a-tooltip>
+            /
+            <a-tooltip :title="state.detail.amountValue">
+              {{ getBit(state.detail.amountValue) || '' }}
+            </a-tooltip>
+          </span>
+          {{ state.detail.currencySymbol || '' }}
+        </div>
       </div>
       <div class="luck-list max" @scroll="handleScroll($event)">
         <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
@@ -149,7 +160,11 @@
           </div>
           <div class="luck-money">
             <img :src="state.detail.currencyIconPath" alt />
-            <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
+            <div class="luck-money-txt">
+              <a-tooltip :title="item.amountValue">
+                {{ getBit(item.amountValue) }}
+              </a-tooltip>
+            </div>
           </div>
           <div class="luck-king" v-if="item.maxAmount">
             <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
@@ -175,7 +190,7 @@
         <div class="txt">{{ state.detail.currencySymbol }} GIVEAWAY</div>
         <div class="coin">
           <img :src="state.detail.currencyIconPath" alt />
-          <font-amount :amount="state.detail.amountValue"></font-amount>
+          <font-amount :amount="state.detail.amountValue" style="color:#fff;margin-left:10px;"></font-amount>
         </div>
         <div class="people">{{ state.detail.totalCount }} WINNERS TO SHARE</div>
       </div>
@@ -189,9 +204,19 @@
       </div>
       <div class="luck-list-title">
         <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
-        <div> {{ state.detail.receiveAmountValue }} / {{ state.detail.amountValue || '' }} {{
-            state.detail.currencySymbol || ''
-        }}</div>
+        <div class="right">
+          <span class="text">
+            <a-tooltip :title="state.detail.receiveAmountValue">
+              {{ getBit(state.detail.receiveAmountValue) }}
+            </a-tooltip>
+            /
+            <a-tooltip :title="state.detail.amountValue">
+              {{ getBit(state.detail.amountValue) || '' }}
+            </a-tooltip>
+          </span> {{
+              state.detail.currencySymbol || ''
+          }}
+        </div>
       </div>
       <div class="luck-list" @scroll="handleScroll">
         <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
@@ -205,7 +230,11 @@
           </div>
           <div class="luck-money">
             <img :src="state.detail.currencyIconPath" alt />
-            <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) }}</div>
+            <div class="luck-money-txt">
+              <a-tooltip :title="item.amountValue">
+                {{ getBit(item.amountValue) }}
+              </a-tooltip>
+            </div>
           </div>
 
           <div class="luck-king" v-if="item.maxAmount">
@@ -235,9 +264,19 @@
 
       <div class="luck-list-title">
         <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
-        <div> {{ state.detail.receiveAmountValue }} / {{ state.detail.amountValue || '' }} {{
-            state.detail.currencySymbol || ''
-        }}</div>
+        <div class="right">
+          <span class="text">
+            <a-tooltip :title="state.detail.receiveAmountValue">
+              {{ getBit(state.detail.receiveAmountValue) }}
+            </a-tooltip>
+            /
+            <a-tooltip :title="state.detail.amountValue">
+              {{ getBit(state.detail.amountValue || '') }}
+            </a-tooltip>
+          </span> {{
+              state.detail.currencySymbol || ''
+          }}
+        </div>
       </div>
 
       <div class="luck-list max" @scroll="handleScroll">
@@ -252,7 +291,11 @@
           </div>
           <div class="luck-money">
             <img :src="state.detail.currencyIconPath" alt />
-            <div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
+            <div class="luck-money-txt">
+              <a-tooltip :title="item.amountValue">
+                {{ getBit(item.amountValue) }}
+              </a-tooltip>
+            </div>
           </div>
           <div class="luck-king" v-if="item.maxAmount">
             <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
@@ -297,8 +340,8 @@ export default {
 </script>
 <script setup>
 import { onMounted, reactive, ref } from "vue";
-import { getPostDetail, getRedPacket, finishRedPacket, oneKeyLike, oneKeyReTweet, oneKeyFollow, getTaskDetail, getReceivedList } from '@/http/redPacket.js'
-import { getQueryString, guid } from '@/uilts/help.js'
+import { getPostDetail, getRedPacket, finishRedPacket, oneKeyLike, oneKeyReTweet, oneKeyFollow, getTaskDetail, getReceivedList, addFinishEvent } from '@/http/redPacket.js'
+import { getQueryString, guid, getBit } from '@/uilts/help.js'
 import { message } from 'ant-design-vue';
 import FontAmount from '@/view/components/font-amount.vue'
 import GetMore from '@/view/iframe/publish/components/get-more.vue'
@@ -307,6 +350,7 @@ import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
 import { discordAuthRedirectUri } from '@/http/configAPI'
+import GlobalTip from '@/view/components/global-tip.vue'
 
 var moment = require('moment');
 
@@ -336,11 +380,24 @@ let state = reactive({
 function clickRetry() {
   init()
 }
+
+let follow_open_tabs = []
+
 async function clickLikeBtn() {
   let _userInfo = await checkIsLogin()
   if (!_userInfo) {
     return
   }
+  // window.parent.postMessage({
+  //   actionType: "IFRAME_DO_TASK", task_data: {
+  //     tweet_Id: state.tweetId
+  //   }, task_type: 'like'
+  // }, "*");
+
+  if (state.detail.finishTaskType && state.detail.finishTaskType == 2) {
+    window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+    return
+  }
   state.loading_show = true
   oneKeyLike({
     params: {
@@ -353,10 +410,11 @@ async function clickLikeBtn() {
         state.done.like = true
       } else {
         state.done.like = false
+        window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
       }
     } else {
+      window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
       state.done.like = false
-      console.log(res)
     }
   })
   // 埋点
@@ -418,7 +476,10 @@ async function clickRetweetBtn() {
   if (!_userInfo) {
     return
   }
-
+  if (state.detail.finishTaskType && state.detail.finishTaskType == 2) {
+    window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
+    return
+  }
   state.loading_show = true
   oneKeyReTweet({
     params: {
@@ -430,11 +491,12 @@ async function clickRetweetBtn() {
       if (res.data.result) {
         state.done.retweet = true
       } else {
+        window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
         state.done.retweet = false
       }
     } else {
+      window.open(`https://twitter.com/retweet/like?tweet_id=${state.tweetId}`)
       state.done.retweet = false
-      console.log(res)
     }
   })
   // 埋点
@@ -477,16 +539,40 @@ function getValidity() {
   }, 1000)
 }
 
+const openFollowTabs = (arr_name) => {
+  let array_finish  = arr_name.filter((item) => { return !item.finished })
+  // let array_finish = state.detail.taskCondition[0].relatedUsers.filter((item) => { return item.finished == false })
+  let url
+  if (array_finish.length > 0) {
+    state.done.follow = false
+    // 打开标签页的方法
+    array_finish.forEach((item) => {
+      url = `https://twitter.com/intent/follow?screen_name=${item}&tweet_id=${state.tweetId}`
+      chrome.tabs.create({ url }, (tab) => {
+        if (follow_open_tabs.filter((item) => { return item.url == tab.url }).length == 0) {
+          follow_open_tabs.push(tab)
+        }
+      })
+    })
+  }
+}
+
 async function clickFollowAll(item, is_all) {
   let _userInfo = await checkIsLogin()
   if (!_userInfo) {
     return
   }
-  state.loading_show = true
   let arr_name = []
   for (let i in item) {
-    arr_name.push(item[i].name)
+    if (!item[i].finished) {
+      arr_name.push(item[i].name)
+    }
+  }
+  if (state.detail.finishTaskType && state.detail.finishTaskType == 2) {
+    openFollowTabs(arr_name)
+    return
   }
+  state.loading_show = true
   oneKeyFollow({
     params: {
       names: arr_name
@@ -496,34 +582,25 @@ async function clickFollowAll(item, is_all) {
     if (res.code == 0) {
       res.data.forEach((item1) => {
         state.detail.taskCondition[0].relatedUsers.forEach(item2 => {
-          if (item1.name == item2.name) {
+          if (item1.name == item2.name && item1.finished) {
             item2.finished = true
           }
         });
       })
-      let _len = state.detail.taskCondition[0].relatedUsers.filter((item) => { return item.finished == false }).length
-      if (_len > 0) {
-        state.done.follow = false
-      } else {
-        state.done.follow = true
-      }
-    } else {
-      state.detail.taskCondition[0].relatedUsers.forEach(item => {
-        item.finished = false
-      });
+      openFollowTabs(arr_name)
     }
   })
+
+  // -------- 埋点 --------
   let _log_obj = {
     pageSource: Report.pageSource.task_page,
     businessType: Report.businessType.buttonClick,
     objectType: Report.objectType.follow
   }
   if (is_all) {
-    // 埋点
     _log_obj.objectType = Report.objectType.follow_button
   }
   Report.reportLog(_log_obj);
-
 }
 
 
@@ -738,40 +815,108 @@ function init() {
     }
   })
 }
+
 function initTaskDetail() {
-  // 任务详情
-  getTaskDetail({
-    params: {
-      postId: state.postId
-    }
-  }).then((res) => {
-    if (res.code.toString()) {
-      for (let i in res.data) {
-        switch (res.data[i].type) {
-          case 1:
-            state.done.follow = res.data[i].finished
-            state.detail.taskCondition[0].relatedUsers = res.data[i].detail
-            break
-          case 2:
-            state.done.like = res.data[i].finished
-            break
-          case 3:
-            state.done.retweet = res.data[i].finished
-            break
-          case 7:
-            state.done.join_discord = res.data[i].finished
-            discordAuthorizeRequired = res.data[i].discordAuthorizeRequired
-            break
+  getChromeStorage('userInfo', (_userInfo) => {
+    if (_userInfo.uid) {
+      // 任务详情
+      getTaskDetail({
+        params: {
+          postId: state.postId
         }
-      }
-    } else {
-      handleErrorCode(res)
+      }).then((res) => {
+        if (res.code.toString()) {
+          for (let i in res.data) {
+            switch (res.data[i].type) {
+              case 1:
+                state.done.follow = res.data[i].finished
+                state.detail.taskCondition[0].relatedUsers = res.data[i].detail
+                break
+              case 2:
+                state.done.like = res.data[i].finished
+                break
+              case 3:
+                state.done.retweet = res.data[i].finished
+                break
+              case 7:
+                state.done.join_discord = res.data[i].finished
+                discordAuthorizeRequired = res.data[i].discordAuthorizeRequired
+                break
+            }
+          }
+        } else {
+          handleErrorCode(res)
+        }
+      })
     }
   })
 }
+
+let tab_index = 0
+const doTaskReport = (req, sender) => {
+  let follow_name = req.task_data.follow_name || ''
+  // 1 Twitter follow Twitter ScreenName
+  // 2 Tweet like
+  // 3 Retweet
+  let event_type = 0
+  switch (req.task_type) {
+    case 'retweet':
+      event_type = 3
+      state.done.retweet = req.task_done
+      chrome.tabs.remove(sender.tab.id)
+      break;
+    case 'like':
+      event_type = 2
+      state.done.like = req.task_done
+      chrome.tabs.remove(sender.tab.id)
+      break
+    case 'follow':
+      event_type = 1
+      chrome.tabs.remove(sender.tab.id)
+      // for (let i = 0; i < follow_open_tabs.length; i++) {
+      //   if (follow_open_tabs[i].id == sender.tab.id) {
+      //     follow_open_tabs.splice(i, 1)
+      //     break
+      //   }
+      // }
+      // chrome.tabs.getCurrent((tab) => {
+      //   if (follow_open_tabs.length > 0) {
+      //     tab_index = follow_open_tabs[follow_open_tabs.length - 1].index
+      //   } else {
+      //     tab_index = tab.index
+      //   }
+      //   chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab_index })
+      // })
+      let has_no_finished = false
+      state.detail.taskCondition[0].relatedUsers.forEach((item) => {
+        if (follow_name == item.name) {
+          item.finished = req.task_done
+        }
+      })
+      state.detail.taskCondition[0].relatedUsers.forEach((item) => {
+        if (!item.finished) {
+          has_no_finished = true
+        }
+      })
+      if (!has_no_finished) {
+        state.done.follow = true
+        state.done.follow_red = false
+      }
+      break
+  }
+  if (req.task_done) {
+    addFinishEvent({
+      params: {
+        eventData: follow_name,
+        eventType: event_type,
+        luckdropId: state.detail.taskLuckdropId
+      }
+    })
+  }
+}
+
 onMounted(() => {
   state.process_mode = process.env.NODE_ENV
-  console.log('state.process_mode',state.process_mode)
   state.postId = getQueryString('postId')
   state.tweetId = getQueryString('tweetId')
   init()
@@ -780,6 +925,7 @@ onMounted(() => {
   // state.close_status = '没有领到钱'
 })
 
+
 // 点击领取
 function clickOpenRedPacket() {
   chrome.runtime.sendMessage({
@@ -791,11 +937,13 @@ function clickOpenRedPacket() {
 }
 
 function handleRedPacket() {
+  state.loading_show = true
   getRedPacket({
     params: {
       postId: state.postId
     }
   }).then((res) => {
+    state.loading_show = false
     if (res.code == 0) {
       showOpenedPage()
       init()
@@ -1114,6 +1262,12 @@ function onRuntimeMsg() {
       case 'BACK_DISCORD_LOGIN_SUCCESS':
         discordLoginSuccess();
         break;
+      case 'DO_TASK':
+        if (!req.task_type || state.tweetId != req.tweet_Id) {
+          return
+        }
+        state.loading_show = false
+        doTaskReport(req, sender)
     }
   })
 }
@@ -1182,7 +1336,7 @@ async function joinDiscord() {
           state.done.join_discord = true;
         } else {
           state.done.join_discord = false;
-          if(discordAuthorizeRequired) {
+          if (discordAuthorizeRequired) {
             discordAuth('authAndJoinIng');
           } else {
             openInviteUrl();
@@ -1259,7 +1413,7 @@ function discordLoginSuccess() {
   if (joinDiscordActionState == 'authAndJoinIng') {
     openInviteUrl();
   }
-  if(discordAuthorizeRequired) {
+  if (discordAuthorizeRequired) {
     discordAuthorizeRequired = false;
   }
 }
@@ -1292,10 +1446,9 @@ function openInviteUrl() {
   }
 }
 
-
 </script>
  
-<style  lang="scss">
+<style lang="scss" scoped>
 html,
 body {
   margin: 0;
@@ -1306,6 +1459,7 @@ body {
 }
 
 .content {
+  position: relative;
   width: 375px;
   height: 500px;
   background: #fafafa;
@@ -1436,6 +1590,7 @@ body {
         }
 
         p {
+          width: 100%;
           margin: 0;
           padding: 0;
           color: #fff;
@@ -1542,6 +1697,10 @@ body {
       div:last-child {
         text-align: right;
       }
+
+      .text {
+        cursor: pointer;
+      }
     }
 
     .luck-list {
@@ -1946,7 +2105,7 @@ body {
         }
 
         span {
-          margin-left: 15px;
+          margin-left: 12px;
           font-weight: 800;
           font-size: 60px;
           line-height: 76px;

+ 47 - 18
src/view/popup/popup.vue

@@ -1,4 +1,5 @@
 <template>
+    <global-tip :type="'3'"></global-tip>
     <div class="page-wrapper" ref="pageWrapperDom" @scroll="pageScroll">
         <template v-if="isLogin && homeVisibility">
             <v-head :show_more="true" :show_state="'home'" :user_info="userInfo"></v-head>
@@ -13,7 +14,11 @@
                         <img :src="require('@/assets/svg/icon-home-bill.svg')" />
                     </div>
                 </div>
-                <div class="amount">${{ canWithdrawBalance }}</div>
+                <div class="amount">
+                    <a-tooltip :title="'$'+canWithdrawBalance">
+                        ${{ getBit(canWithdrawBalance) }}
+                    </a-tooltip>
+                </div>
                 <div class="area-btn">
                     <div class="withdraw-btn" @click="clickWithdraw">Withdraw</div>
                     <div class="top-up-btn" @click="clickTopUp">Deposit</div>
@@ -40,7 +45,7 @@
                             @click="clickListItem(item, index)">
 
                             <red-dot class="red-dots"
-                                v-if="item.unReadMsgCount > 0"></red-dot>
+                                v-if="item.unReadMsgCount > 0 && isReadMsg"></red-dot>
 
                             <div class="img-wrapper">
                                 <!-- 收到红包 -->
@@ -88,7 +93,10 @@
                                                 </template>
                                                 <!-- 已完成 -->
                                                 <template v-else-if="item.status == 1">
-                                                    <span class="blance">{{ item.amount }}</span>
+                                                    <span class="blance">
+                                                        <a-tooltip :title="item.amount">
+                                                            {{ getBit(item.amount) }}</a-tooltip>
+                                                    </span>
                                                     <span class="coin-type">{{ item.currencySymbol || '' }}</span>
                                                     <img :src="item.currencyIconPath" alt="">
                                                 </template>
@@ -99,7 +107,11 @@
                                             </template>
                                             <!-- 发出去的 -->
                                             <template v-else-if="item.type == 2">
-                                                <span class="blance">-{{ item.amount }}</span>
+                                                <span class="blance">
+                                                    <a-tooltip :title="'-' + item.amount">
+                                                        -{{ getBit(item.amount) }}
+                                                    </a-tooltip>
+                                                </span>
                                                 <span class="coin-type">{{ item.currencySymbol || '' }}</span>
                                                 <img :src="item.currencyIconPath" alt="">
                                             </template>
@@ -195,7 +207,7 @@
         </template>
         <modal :visible="modalVisible"   
             title="Early termination of Giveaway?"
-            content="This operation will close the red envelope and refund the remaining amount within 2 days"
+            content="The remaining amount will be returned to your wallet within 1 day."
             cancelText="Termination"
             confirmText="Cancel"
             @cancel="modalCancel"
@@ -204,7 +216,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, inject, onBeforeUnmount } from "vue";
+import { ref, onMounted, inject } from "vue";
 
 import popupLogin from "@/view/popup/components/login.vue";
 import popupTransactions from "@/view/components/popup-transactions";
@@ -221,7 +233,11 @@ import { terminatedLuckdrop } from "@/http/redPacket";
 import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
 import Report from "@/log-center/log";
 import router from "@/router/popup.js";
-import VHead from '@/view/popup/components/head.vue'
+import { getBit } from "@/uilts/help";
+import  GlobalTip  from '@/view/components/global-tip.vue'
+
+import VHead from '@/view/popup/components/head.vue';
+
 
 let withdraw_info = inject('withdraw_info')
 withdraw_info.paypal = {}
@@ -251,6 +267,7 @@ let giveList = ref([]);
 
 // 钱包未读数
 let unReadCountWallet = ref(0);
+let isReadMsg = ref(true);
 
 let giveReqParams = {
     params: {
@@ -271,12 +288,17 @@ withdraw_info.paypal.wallet_withdraw_config = walletWithdrawConfig
 
 
 let moreTabList = ref([
+    {
+        icon: require("@/assets/svg/icon-website.svg"),
+        label: "Website",
+        href: 'https://denet.me'
+    },
     {
         icon: require("@/assets/svg/icon-twitter.svg"),
         label: "Twitter",
         href: 'https://twitter.com/denet2022'
-    }
-    , {
+    },
+    {
         icon: require("@/assets/svg/icon-discord.svg"),
         label: "Discord",
         href: 'https://discord.gg/wZSz9p8ddG'
@@ -311,6 +333,13 @@ onMounted(() => {
             },{
                 type: window.location.href.indexOf('home.html') > -1 ? 'web' : 'extensions'
             });
+            setMessageCount();
+            setTimeout(() => {
+                isReadMsg.value = false;
+                readAllMsg({msgType: 1}, () => {
+                    setMessageCount();
+                });
+            }, 2000);
         } else {
             Report.reportLog({
                 pageSource: Report.pageSource.denetLogin,
@@ -318,21 +347,17 @@ onMounted(() => {
             });
         }
     });
-    setMessageCount();
-    setTimeout(() => {
-        setMessageCount();
-    }, 1600)
 });
 
-onBeforeUnmount(() => {
+const readAllMsg = ({msgType}, cb) => {
     readAllMsgByType({
         params: {
-            msgType: 1
+            msgType
         }
     }).then(res => {
-        setMessageCount();
+        cb && cb();
     })
-});
+};
 
 const setMessageCount = () => {
     getAllMessageInfo({params: {
@@ -488,6 +513,8 @@ const withdrawBack = () => {
 const showTransactions = () => {
 //     // homeVisibility.value = false;
 //     // transactionsVisibility.value = true;
+
+    readAllMsg({msgType: 1});
     router.push('/transactions')
 };
 
@@ -816,6 +843,8 @@ body {
                             font-weight: 500;
                             font-size: 14px;
                             margin-bottom: 5px;
+                            max-width: 132px;
+                            word-break: break-all;
                         }
 
                         .time {
@@ -841,7 +870,7 @@ body {
                                 .blance {
                                     margin-left: 3px;
                                     display: inline-block;
-                                    max-width: 68px;
+                                    max-width: 80px;
                                     word-break: break-all;
                                     line-height: 18px;
                                     color: #E29A2E;

+ 1 - 1
src/view/popup/top-up/home.vue

@@ -1,7 +1,7 @@
 <template>
     <!-- 公共组件 -->
     <div class="info">
-        <v-head :title="'TopUp'" :show_more="true" :show_help="false" :back_url="'/'"></v-head>
+        <v-head :title="'Deposit'" :show_more="true" :show_help="false" :back_url="'/'"></v-head>
         <currency-list style="height: calc(100% - 48px);" @selectCurrency="selectCurrency" :page="'top-up'"></currency-list>
     </div>
 

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

@@ -59,7 +59,7 @@
       <div class="left">
         <div class="txt">Receive Amount</div>
         <div class="money">{{ state.amount || 0 }} {{ state.currency_code }}</div>
-        <div class="txt"> Network Fee: <a-tooltip :title="state.fee_amount">{{ numToFixed(state.fee_amount) }}</a-tooltip> {{ withdraw_info.token_symbol }} </div>
+        <div class="txt"> Network Fee: <a-tooltip :title="state.fee_amount">{{ getBit(state.fee_amount) }}</a-tooltip> {{ withdraw_info.token_symbol }} </div>
       </div>
       <div class="right">
         <div class="btn" @click="clickBtn" :class="{ enter: state.is_enter_state }">Confirm</div>
@@ -76,6 +76,7 @@ import { reactive, onMounted, inject } from 'vue'
 import { getWithdrawConfig } from "@/http/account";
 import { withdrawCalcFee } from "@/http/pay";
 import Report from "@/log-center/log";
+import { getBit } from "@/uilts/help";
 
 let withdraw_info = inject('withdraw_info')
 

+ 5 - 1
vue.config.js

@@ -99,7 +99,11 @@ module.exports = {
           {
             from: path.resolve(`src/manifest.json`),
             to: `${path.resolve('dist')}/manifest.json`
-          }
+          },
+          // {
+          //   from: path.resolve(`src/rules`),
+          //   to: `${path.resolve('dist')}/rules`
+          // }
         ]
       })
     ],

Vissa filer visades inte eftersom för många filer har ändrats