Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/workspace.xml
wushaodong 3 years ago
parent
commit
b405624c7a
4 changed files with 26 additions and 21 deletions
  1. 3 5
      h_exam/exam_detail.html
  2. 1 0
      js/components.js
  3. 13 11
      js/exam_detail_img.js
  4. 9 5
      js/exam_list.js

+ 3 - 5
h_exam/exam_detail.html

@@ -61,7 +61,7 @@
           </div>
           <p class="alert-msg"><i class="glyphicon glyphicon-volume-up"></i>
 
-            </p>
+          </p>
           <div class="list">
             <div class="list-flex">
               <!--添加 data-href 跳转  -->
@@ -170,9 +170,7 @@
             <div class="comment">
               <!-- 功能 用户图片 昵称 言论  回复功能 点赞功能 -->
               <!-- <div class="nocomment">说说你对套卷的看法吧!</div> -->
-              <div id="detail">
-
-              </div>
+              <div id="detail"></div>
               <div class="loading">正在加载中....</div>
               <div class="nodata">到底了</div>
             </div>
@@ -219,4 +217,4 @@
   </div>
 </body>
 
-</html>
+</html>

File diff suppressed because it is too large
+ 1 - 0
js/components.js


+ 13 - 11
js/exam_detail_img.js

@@ -35,22 +35,24 @@ $(function () {
   $("[data-click='open']").click(function () {
     let bool = $(this).data("open");
     if (!bool) {
-      $(this).data("open", true).children("span").text("收起阅读全部").parent().children("i").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up").parent().parent().parent().addClass("edi-body-height");
+      $("#toast").show();
+      // $(this).data("open", true).children("span").text("收起阅读全部").parent().children("i").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up").parent().parent().parent().addClass("edi-body-height");
     } else {
       $(this).data("open", false).children("span").text("展开阅读全部").parent().children("i").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down").parent().parent().parent().removeClass("edi-body-height");
     }
   })
 
-  // 不能实现的事件
-  function warm () {
-    alert("请在大联考App内登录后操作")
-  }
-  // $(".edi-open>span[data-click='open']").click(warm)
-  $(".edi-user").click(warm)
-  $(".choose").click(warm)
+  // // 不能实现的事件
+  // function warm () {
+  //   alert("请在大联考App内登录后操作")
+  // }
+  // // $(".edi-open>span[data-click='open']").click(warm)
+  // $(".edi-user").click(warm)
+  // $(".choose").click(warm)
 
   // 默认 时间
-  $(".pull-right>span").click(function () {
-    $(this).addClass('active').siblings("span").removeClass("active");
-  })
+  // $(".pull-right>span").click(function () {
+  //   $(this).addClass('active').siblings("span").removeClass("active");
+  // })
+
 })

+ 9 - 5
js/exam_list.js

@@ -1,20 +1,23 @@
 $(function () {
   $("img").lazyload();
   const globaldata = {
-    active: 0,
+    active: null,
   }
   let params = lxd.parseUrl(window.location.href).query,
     my_nav = $(".my-nav"), my_nav_lis = my_nav.find("li"), id = params["id"] || 0;
-  my_nav_lis.removeClass("active");
-  $(my_nav_lis[id]).addClass("active");
-  let grade = $(my_nav_lis[id]).data("id"), lock = false, currentPage = 3, totalPage = 3, type = $(my_nav_lis[id]);
+  if (id < my_nav_lis.length) {
+    my_nav_lis.removeClass("active");
+    $(my_nav_lis[id]).addClass("active");
+  }
+  let grade = $(my_nav_lis[id]).data("id"), lock = false, currentPage = 3, totalPage = 3, type = $(my_nav_lis[id]), zlock = "数据加载中...";
   my_nav.click(function (e) {
     if (e.target.className == "my-nav") return false;
     let active = Array.prototype.slice.call($(this).find("li")).indexOf(e.target);
     if (active == globaldata.active) return false;
-    $(".my-loading").html("数据加载中...").hide();
     globaldata.active = active;
     type = $(e.target);
+    z_lock = type.data("zlock") || zlock;
+    $(".my-loading").html(z_lock).hide();
     currentPage = type.data("currentPage") || 3;
     totalPage = type.data("totalPage") || 3;
     grade = type.data("id");
@@ -43,6 +46,7 @@ $(function () {
       data({ currentPage, area, grade }).then(res => { totalPage = res.totalPage; currentPage++; type.data("totalPage", res.totalPage); type.data("currentPage", currentPage); lock = res.lock; $(".my-loading").hide(); })
     }
     if (c == 0 && currentPage > totalPage) {
+      type.data("zlock", "已经没有可以加载的数据了")
       type.data("lock", true)
       $(".my-loading").html("已经没有可以加载的数据了").show();
     }

Some files were not shown because too many files changed in this diff