Browse Source

Merge branch 'master' of http://192.168.3.18:3000/CallPro/EBook.git

lujianhong 4 years ago
parent
commit
567b05940b
1 changed files with 18 additions and 0 deletions
  1. 18 0
      EBook.Web/Common/tasklib_book.js

+ 18 - 0
EBook.Web/Common/tasklib_book.js

@@ -248,11 +248,16 @@ function bindEventYS() {
     $(".yaoshi").on("click", function () {
         var ParentAnid = $(this).attr("parent-anid");
         if ($(this).attr("data-status") == "0") {
+            // 显示处理
             if (ParentAnid != undefined) {
                 $.each($(this).parents().find(".yaoshi[parent-anid='" + ParentAnid + "']"), function (index, FItem) {
                     $(FItem).attr("data-status", "1");
                     $(FItem).attr("src", PicInfo.yaoshiShowImgUrl);
                     $.each($(FItem).parent().find(".underlineContent"), function (index, item) {
+                        var ULCText = $(this).text();  // 获取文本内容
+                        if (ULCText.indexOf("√") > -1) {
+                            $(this).parent().find(".checkbox").find("input").prop('checked', true);
+                        }
                         if (!$(item).hasClass("no-answer")) {
                             $(item).css("color", "#92D050");
                         }
@@ -269,6 +274,10 @@ function bindEventYS() {
                 $(this).attr("src", PicInfo.yaoshiShowImgUrl);
                 //$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#92D050");
                 $.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
+                    var ULCText = $(this).text();  // 获取文本内容
+                    if (ULCText.indexOf("√") > -1) {
+                        $(this).parent().find(".checkbox").find("input").prop('checked', true);
+                    }
                     if (!$(item).hasClass("no-answer")) {
                         $(item).css("color", "#92D050");
                     }
@@ -286,11 +295,16 @@ function bindEventYS() {
             }
         }
         else {
+            // 隐藏处理
             if (ParentAnid != undefined) {
                 $.each($(this).parents().find(".yaoshi[parent-anid='" + ParentAnid + "']"), function (index, FItem) {
                     $(FItem).attr("data-status", "0");
                     $(FItem).attr("src", PicInfo.yaoshiHideImgUrl);
                     $.each($(FItem).parent().find(".underlineContent"), function (index, item) {
+                        var ULCText = $(this).text();  // 获取文本内容
+                        if (ULCText.indexOf("√") > -1) {
+                            $(this).parent().find(".checkbox").find("input").prop('checked', false);
+                        }
                         $(item).css("color", "#ffffff");
                         $(item).find(".wordStyle").css("color", "#ffffff");
                         $(item).find(".phraseStyle").css("background-color", "#ffffff");
@@ -302,6 +316,10 @@ function bindEventYS() {
                 $(this).attr("src", PicInfo.yaoshiHideImgUrl);
                 //$(this).nextUntil(".yaoshi").filter(".underlineContent").css("color", "#ffffff");
                 $.each($(this).nextUntil(".yaoshi").filter(".underlineContent"), function (index, item) {
+                    var ULCText = $(this).text();  // 获取文本内容
+                    if (ULCText.indexOf("√") > -1) {
+                        $(this).parent().find(".checkbox").find("input").prop('checked', false);
+                    }
                     $(item).css("color", "#ffffff");
                     $(item).find(".wordStyle").css("color", "#ffffff");
                     $(item).find(".phraseStyle").css("background-color", "#ffffff");