wenliming 2 rokov pred
rodič
commit
a75c240d1a

+ 24 - 1
src/logic/content/twitter.js

@@ -15,6 +15,10 @@ let tweetAccountBindGroupInfo = {
     isInit: false
 }
 
+let systemInfo = {
+    theme: 'light'
+}
+
 function twitterPinLogin() {
     if (window.location.href == 'https://api.twitter.com/oauth/authorize') {
         let code = document.querySelector('code')
@@ -839,6 +843,7 @@ export function init() {
     checkTwitterTaskState();
     initBuyNFT();
     addJoinedGroupList();
+    getSysTheme();
 
     // getTweetAccountGroupInfo( () => {
     addGroupTab()
@@ -1771,8 +1776,9 @@ export const selectGroupTab = () => {
 const addGroupTabEventListener = (params) => {
     let { groupTab } = params;
     groupTab.addEventListener('click', function () {
+        let groupColor = systemInfo.theme == 'light' ? 'rgb(15, 20, 25)' : '#fff';
         setGroupTabSelfStyle({
-            groupColor: 'rgb(15, 20, 25)',
+            groupColor: groupColor,
             groupFontWeight: '700',
             lineDisplay: 'block'
         });
@@ -2049,4 +2055,21 @@ const getTweetAccountGroupInfo = (cb) => {
             cb && cb()
         })
     }
+}
+
+const getSysTheme = () => {
+    const themeMedia = window.matchMedia("(prefers-color-scheme: light)");
+    if (themeMedia.matches) {
+        systemInfo.theme = 'light'
+    } else {
+        systemInfo.theme = 'dark'
+    }
+    themeMedia.addListener(e => {
+        addGroupTab()
+        if (e.matches) {
+            systemInfo.theme = 'light'
+        } else {
+            systemInfo.theme = 'dark'
+        }
+    });
 }

+ 7 - 0
src/view/iframe/tab-group/tab-group.vue

@@ -176,6 +176,13 @@ const getListData = () => {
         if (res.code == 0) {
             let resData = res.data;
             if (resData.length) {
+                for (let i = 0; i < resData.length; i++) {
+                    let matedata = resData[i]["nftItem"]['metadata'];
+                    if(matedata) {
+                        resData[i]["nftItem"]['metadata'] = JSON.parse(matedata);
+                    }
+                }
+
                 if (!listReqParams.params.preTimestamp) {
                     listData.value = resData;
                 } else {