shawenguan 1 年之前
父節點
當前提交
8139ccd19d
共有 1 個文件被更改,包括 25 次插入22 次删除
  1. 25 22
      Scripts/wubian/wubianHelper.js

+ 25 - 22
Scripts/wubian/wubianHelper.js

@@ -388,34 +388,37 @@ function handleUserCollectList() {
         return;
     }
     handleHeaders();
-    let artIdNameMapData = magicJS.data.read(WuBianConstKey.ArtIdNameMapData, {});
-    let realCntDict = getMyAllArtRealCountData();
-    let modCntDict = getAllArtModifyCountDict();
-    let list = rspData.data.list;
-    for (let i = list.length - 1; i >= 0; i--) {
-        const artInfo = list[i];
-        artIdNameMapData[artInfo.artId] = artInfo.title;
-        realCntDict[artInfo.title] = artInfo.total;
-    }
-    magicJS.data.write(WuBianConstKey.ArtIdNameMapData, artIdNameMapData);
-    if (isMyArtCountCaptureEnabled()) {
+    let reqData = getRequestPlainData();
+    if (reqData.state == 1) {//1=收藏中 2=转让中 3=已转让
+        let artIdNameMapData = magicJS.data.read(WuBianConstKey.ArtIdNameMapData, {});
+        let realCntDict = getMyAllArtRealCountData();
+        let modCntDict = getAllArtModifyCountDict();
+        let list = rspData.data.list;
         for (let i = list.length - 1; i >= 0; i--) {
             const artInfo = list[i];
+            artIdNameMapData[artInfo.artId] = artInfo.title;
             realCntDict[artInfo.title] = artInfo.total;
         }
-        setAllArtRealCountDict(realCntDict);
-    }
-    if (isMyArtCountModifyMode()) {
-        for (let i = list.length - 1; i >= 0; i--) {
-            const artInfo = list[i];
-            checkArticleModify(artInfo, modCntDict);
-            if (artInfo.total == 0) {
-                list.splice(i, 1);
-                modCntDict[artInfo.title] = 0;
+        magicJS.data.write(WuBianConstKey.ArtIdNameMapData, artIdNameMapData);
+        if (isMyArtCountCaptureEnabled()) {
+            for (let i = list.length - 1; i >= 0; i--) {
+                const artInfo = list[i];
+                realCntDict[artInfo.title] = artInfo.total;
             }
+            setAllArtRealCountDict(realCntDict);
+        }
+        if (isMyArtCountModifyMode()) {
+            for (let i = list.length - 1; i >= 0; i--) {
+                const artInfo = list[i];
+                checkArticleModify(artInfo, modCntDict);
+                if (artInfo.total == 0) {
+                    list.splice(i, 1);
+                    modCntDict[artInfo.title] = 0;
+                }
+            }
+            gRetBody = rspData;
+            setAllArtModifyCountDict(modCntDict);
         }
-        gRetBody = rspData;
-        setAllArtModifyCountDict(modCntDict);
     }
 }