Browse Source

Merge branch 'dev_1.1.0' of https://git.yishihui.com/DeNet/de-net into dev_1.1.0

nieyuge 2 years ago
parent
commit
7c96409dc5

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

@@ -112,6 +112,8 @@ export function twitterPublishHandler(res) {
 }
 
 export function showPinTips() {
+    hidePopupPage();
+    hideNoticeBindTweet();
     getChromeStorage('pinData', (res) => {
         if (!res || res.show) {
             let domPop = document.getElementById('de-pin-pop');
@@ -121,8 +123,6 @@ export function showPinTips() {
 }
 
 export function hidePinTips() {
-    hidePopupPage();
-    hideNoticeBindTweet();
     let pop = document.querySelector('#de-pin-pop');
     if (pop) {
         pop.style.display = 'none';
@@ -375,6 +375,8 @@ function addPublishTipsIframe(params = {}) {
 }
 
 export function noticeBindTweet(params) {
+    hidePinTips();
+    hidePopupPage();
     let iframe = document.createElement('iframe');
     iframe.id = 'de-notice-bind-tweet';
     iframe.src = chrome.runtime.getURL('/iframe/bind-tweet.html') + `?params=${JSON.stringify(params)}`;
@@ -386,8 +388,6 @@ export function noticeBindTweet(params) {
 }
 
 export function hideNoticeBindTweet() {
-    hidePinTips();
-    hidePopupPage();
     let iframeContent = document.getElementById('de-notice-bind-tweet');
     if (iframeContent) {
         document.querySelector('body').removeChild(iframeContent)
@@ -1304,12 +1304,12 @@ export const appendPopupPage = (params) => {
 
 export const showPopupPage = (params) => {
     let { path = '' } = params;
+    hidePinTips();
+    hideNoticeBindTweet();
     appendPopupPage({ path });
 }
 
 export const hidePopupPage = () => {
-    hidePinTips();
-    hideNoticeBindTweet();
     let iframe = document.getElementById('de-popup-page');
     if (iframe) {
         document.querySelector('body').removeChild(iframe);

+ 18 - 3
src/view/iframe/publish/give-dialog.vue

@@ -1435,7 +1435,18 @@ const getDiscordInviteInfo = ({inviteUrl, getDuildId}, cb) => {
         }, {
             err: err
         });
-        getGuildInfoByOpenApi({inviteCode}, cb);
+
+        let errMsg = err;
+        if(typeof errMsg == 'object') {
+            errMsg = JSON.stringify(err);
+        }
+        if(errMsg.indexOf('code 404') > -1) {
+            discordInviteInfo.value = {};
+            iptErrMsgTxt.value = discordIptErrTxt;
+        } else {
+            getGuildInfoByOpenApi({inviteCode}, cb);
+
+        }
     });
 }
 
@@ -1494,8 +1505,12 @@ const inviteGuildResHandler = (res, params) => {
             icon,
         }
     }
-    discordInviteInfo.value = resData.data;
-
+    if(res.code == inviteCode) {
+         discordInviteInfo.value = resData.data;
+    } else {
+        discordInviteInfo.value = {};
+        iptErrMsgTxt.value = discordIptErrTxt;
+    }
     return resData;
 };
 

+ 2 - 1
src/view/popup/components/tabbar.vue

@@ -106,9 +106,9 @@ let NFTReqParams = {
 const emits = defineEmits(["tabbarClick"]);
 
 const tabbarHandler = (params, index) => {
+    setMessageCount();
     currentTab.value.index = index;
     currentTab.value.path = params.path;
-
     router.push(params.path);
     emits("tabbarClick", params);
 };
@@ -160,6 +160,7 @@ const setMessageCount = () => {
 
 onMounted(() => {
     setActiveTab();
+    setMessageCount();
 });
 </script>
 

+ 18 - 3
src/view/popup/currency-detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="currency-detail-page">
-    <v-head :title="currencyInfo.currencyName" 
+    <v-head :title="currencyInfo.tokenSymbol" 
             :show_more="false"
             :show_refresh="true"
             :show_list="true"
@@ -13,9 +13,12 @@
         class="icon-currency"
         :src="currencyInfo.iconPath"/>
       <div class="amount">
-        <a-tooltip :title="'$'+currencyInfo.totalBalance">
+        <div class="balance">
+          <a-tooltip :title="'$'+currencyInfo.totalBalance">
               ${{ getBit(currencyInfo.totalBalance) }}
-          </a-tooltip> {{currencyInfo.currencyName}}
+          </a-tooltip> 
+          {{currencyInfo.tokenSymbol}}
+        </div>
         <div class="final">
           <a-tooltip :title="'$'+currencyInfo.totalUsdEstimateBalance">
               ${{ getBit(currencyInfo.totalUsdEstimateBalance) }}
@@ -179,6 +182,7 @@ onMounted(() => {
         totalBalance,
         totalUsdEstimateBalance
       };
+      console.log(currencyInfo.value )
     }
 })
 </script>
@@ -206,6 +210,17 @@ onMounted(() => {
       font-weight: 700;
       font-size: 28px;
       text-align: center;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+      width: 100%;
+      .balance {
+        padding: 0 18px;
+        box-sizing: border-box;
+        width: 100%;
+        word-break: break-word;
+      }
 
       .final {
         margin-top: 9px;

+ 16 - 0
src/view/popup/tabbar-page/message/index.vue

@@ -204,10 +204,12 @@ import { getMineLuckdropRecords } from "@/http/account";
 import { terminatedLuckdrop } from "@/http/redPacket";
 import { readAllMsgByType, getAllMessageInfo } from "@/http/messageApi"
 import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
+import { getChromeStorage } from "@/uilts/chromeExtension";
 
 var moment = require("moment");
 
 let currentTabIndex = ref(0);
+let userInfo = ref({});
 
 let tabList = ref([
   {
@@ -388,7 +390,21 @@ const setMessageCount = () => {
     });
 }
 
+
+const getUserInfo = (cb) => {
+  getChromeStorage("userInfo", (res) => {
+    if (res && res.accessToken) {
+      userInfo.value = res;
+    } else {
+      userInfo.value = {};
+    }
+    cb && cb(res);
+  });
+};
+
+
 onMounted(() => {
+  getUserInfo();
   getLuckdropRecordsList();
 
   setMessageCount();