Browse Source

高亮控制

wangxy 17 hours ago
parent
commit
047041fccd
2 changed files with 19 additions and 2 deletions
  1. 1 1
      pages/chaojidanci/newEnglish/components/beiPage.vue
  2. 18 1
      utils/cacheManager.js

+ 1 - 1
pages/chaojidanci/newEnglish/components/beiPage.vue

@@ -182,7 +182,7 @@
 			} = res.data;
 			if (wanchengFlag == 1) {
 				// 更新当前岛小节完成状态
-				cacheManager.updateUnitStatus('zhangInfo', props.pageData.danyuanId)
+				cacheManager.updateDanciWanchengStatus(props.pageData.danyuanId)
 			}
 		})
 	}

+ 18 - 1
utils/cacheManager.js

@@ -149,6 +149,22 @@ const cacheManager = (function() {
 	    set('contentInfo', obj);
 	}
 
+	function updateDanciWanchengStatus(curDanyuanId) {
+		let obj = get('contentInfo') || {};
+		if (obj && obj.danyuanList) {
+			obj.danyuanList.forEach(danyuan => {
+				if (danyuan.danyuanList) {
+					const item = danyuan.danyuanList.find(j => j.danyuanId == curDanyuanId);
+					if (item) {
+						item.wanchengFlag = 1;
+					}
+				}
+			});
+		}
+		set('contentInfo', obj);
+	}
+
+
 	return {
 		set,
 		get,
@@ -160,7 +176,8 @@ const cacheManager = (function() {
 		findArrayInObject,
 		clearAll,
 		updateJisuanWanchengStatus,
-		updatePinduWanchengStatus
+		updatePinduWanchengStatus,
+		updateDanciWanchengStatus
 	};
 })();