|
|
@@ -22,6 +22,9 @@ const WuBianConstKey = {
|
|
|
TenantId: 'WubianTenantId',
|
|
|
MarketAlbumListData: 'WubianMarketAlbumListData',
|
|
|
AllMarketGroupListData: 'WubianAllMarketGroupListData',
|
|
|
+ MyAllArtModifyCountData: 'WubianMyAllArtModifyCountData',
|
|
|
+ MyArtCountCaptureEnabled: 'WubianMyArtCountCaptureEnabled',
|
|
|
+ MyArtCountModifyMode: 'WubianMyArtCountModifyMode',
|
|
|
|
|
|
AllUserSimpleInfo: 'WubianAllUserSimpleInfo',
|
|
|
ScoreRankDaily: 'WubianScoreRankDaily',
|
|
|
@@ -384,9 +387,56 @@ function handleUserCollectList() {
|
|
|
return;
|
|
|
}
|
|
|
handleHeaders();
|
|
|
- // rspData.data.list = [];
|
|
|
- // rspData.data.next = 0;
|
|
|
- // gRetBody = rspData;
|
|
|
+ let cntDict = getAllArtModifyCountDict();
|
|
|
+ let list = rspData.data.list;
|
|
|
+ if (isMyArtCountCaptureEnabled()) {
|
|
|
+ for (let i = list.length - 1; i >= 0; i--) {
|
|
|
+ const artInfo = list[i];
|
|
|
+ cntDict[artInfo.title] = artInfo.total;
|
|
|
+ }
|
|
|
+ setAllArtModifyCountDict(cntDict);
|
|
|
+ } else {
|
|
|
+ if (isMyArtCountModifyMode()) {
|
|
|
+ for (let i = list.length - 1; i >= 0; i--) {
|
|
|
+ const artInfo = list[i];
|
|
|
+ checkArticleModify(artInfo, cntDict);
|
|
|
+ if (artInfo.total == 0) {
|
|
|
+ list.splice(i, 1);
|
|
|
+ cntDict[artInfo.title] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gRetBody = rspData;
|
|
|
+ setAllArtModifyCountDict(cntDict);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function getAllArtModifyCountDict() {
|
|
|
+ let dict = {};
|
|
|
+ let str = magicJS.data.read(WuBianConstKey.MyAllArtModifyCountData, '');
|
|
|
+ let lineArr = str.split('\n');
|
|
|
+ for (let i = 0; i < lineArr.length; i++) {
|
|
|
+ let kvArr = lineArr[i].trim().split('=');
|
|
|
+ let name = kvArr[0].trim();
|
|
|
+ let count = parseInt(kvArr[1].trim());
|
|
|
+ dict[name] = count;
|
|
|
+ }
|
|
|
+ return dict;
|
|
|
+}
|
|
|
+
|
|
|
+function setAllArtModifyCountDict(dict) {
|
|
|
+ let str = '';
|
|
|
+ for (let name in dict) {
|
|
|
+ str += `${name}=${dict[name]}\n`;
|
|
|
+ }
|
|
|
+ magicJS.data.write(WuBianConstKey.MyAllArtModifyCountData, str);
|
|
|
+}
|
|
|
+
|
|
|
+function checkArticleModify(artInfo, modifyCntDict) {
|
|
|
+ let title = artInfo.title;
|
|
|
+ if (modifyCntDict[title] != void 0) {
|
|
|
+ artInfo.total = modifyCntDict[title];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function handleInitData() {
|
|
|
@@ -657,6 +707,15 @@ function setActivityDisabled(activityId, bDisabled = true) {
|
|
|
magicJS.data.write(key, bDisabled);
|
|
|
}
|
|
|
|
|
|
+function isMyArtCountCaptureEnabled() {
|
|
|
+ let isEnabled = magicJS.data.read(WuBianConstKey.MyArtCountCaptureEnabled, true);
|
|
|
+ return isEnabled;
|
|
|
+}
|
|
|
+function isMyArtCountModifyMode() {
|
|
|
+ let isEnabled = magicJS.data.read(WuBianConstKey.MyArtCountModifyMode, false);
|
|
|
+ return isEnabled;
|
|
|
+}
|
|
|
+
|
|
|
function handleCvtGoodsList() {
|
|
|
let rspData = getResponsePlainData();
|
|
|
if (!rspData) {
|