Bläddra i källkod

恢复知识点处理

namejr 4 år sedan
förälder
incheckning
229e16a99b
1 ändrade filer med 21 tillägg och 13 borttagningar
  1. 21 13
      EBook.Web/Common/tasklib_book.js

+ 21 - 13
EBook.Web/Common/tasklib_book.js

@@ -263,8 +263,8 @@ var dealGLShowFunc = function (NodeHandle) {
             $(element).css("color", "#db5d00");
         }
         else if (showFlagS == "1") {
-            var shcode = $(element).attr("shcode");
-            if (shcode == "1") {
+            var uLFlag = $(element).attr("uLFlag");
+            if (uLFlag == "1") {
                 $(element).css("color", "#92D050");
             }
             else {
@@ -292,18 +292,26 @@ var dealGLShowFunc = function (NodeHandle) {
     });
 };
 
-// 处理显示或隐藏答案(shcode判断是否存在横线内,showFlag是否显示)
+// 处理显示或隐藏答案(shcode是否可点击,uLFlag判断是否存在横线内,showFlag是否显示)
 var dealAnswerFunc = function (NodeHandle, OCFlag) {
     if (OCFlag) {
-        $(NodeHandle).css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("showFlag","1");
-        $(NodeHandle).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("showFlag", "1");
+        $(NodeHandle).css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("shcode", 0).attr("showFlag", "1");
+        $(NodeHandle).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").css("color", "#92D050").css("border-bottom", "1px solid #979797").css("background-color", "transparent").attr("shcode", 0).attr("showFlag", "1");
         // 处理高亮
         dealGLShowFunc(NodeHandle);
     }
     else {
-
-        $(NodeHandle).css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("showFlag", "0");
-        $(NodeHandle).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("showFlag", "0");
+        $.each($(NodeHandle).find(".wordStyle,.phraseStyle,.phraseStyle,u,span"),function(index,element){
+            var uLFlag = $(element).attr("uLFlag");
+            if (uLFlag == "1") {
+                $(element).css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("shcode", 1).attr("showFlag", "0");
+                $(element).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("shcode", 1).attr("showFlag", "0");
+            }
+            else {
+                $(element).css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("shcode", 0).attr("showFlag", "0");
+                $(element).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").css("color", "#ffffff").css("border-bottom", "1px solid #979797").css("background-color", "#ffffff").attr("shcode", 0).attr("showFlag", "0");
+            }
+        });
     }
     var underlineContentText = $(NodeHandle).text();  // 获取文本内容
     if (underlineContentText.indexOf("√") > -1) {
@@ -492,8 +500,8 @@ function bindEventTeaOrignalYS() {
         playVisiableAudioCallBack(2, $(this).attr("alt"));
     });
     // 绑定横线内处理
-    $(document).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", "0").attr("showFlag", "1");
-    $(document).find(".underlineContent").find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", "1").attr("showFlag", "1");
+    $(document).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("uLFlag", "0").attr("shcode", 0).attr("showFlag", "1");
+    $(document).find(".underlineContent").find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", 0).attr("uLFlag", "1").attr("showFlag", "1");
 }
 
 //页面加载完,课件 绑定事件
@@ -629,8 +637,8 @@ function bindEventYS() {
         playVisiableAudioCallBack(2, $(this).attr("alt"));
     });
     // 绑定横线内处理
-    $(document).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", "0").attr("showFlag", "1");
-    $(document).find(".underlineContent").find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", "1").attr("showFlag", "1");
+    $(document).find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("uLFlag", "0").attr("shcode", 0).attr("showFlag", "1");
+    $(document).find(".underlineContent").find(".wordStyle,.phraseStyle,.phraseStyle,u,span").attr("shcode", 0).attr("uLFlag", "1").attr("showFlag", "1");
 }
 
 // 移动端使用,true:表示点击表格且正在移动,需阻止模块切换
@@ -1464,7 +1472,7 @@ function randomNum(minNum, maxNum) {
     }
 }
 
-// 传递显示单词wordFlag/句子phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
+// 传递显示单词wordFlag/短语phraseFlag/句型sentenceFlag,true表示高亮,false表示不高亮
 function showGLWorld(wordFlag, phraseFlag, sentenceFlag) {
     styleWPSContrl.wordFlag = wordFlag;
     styleWPSContrl.phraseFlag = phraseFlag;