Bläddra i källkod

20210821 16-00

邪性 3 år sedan
förälder
incheckning
79f50a9c6a
4 ändrade filer med 39 tillägg och 15 borttagningar
  1. 14 6
      .idea/workspace.xml
  2. 2 2
      h_exam/exam_list.html
  3. 1 1
      js/components.js
  4. 22 6
      js/exam_list.js

+ 14 - 6
.idea/workspace.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="82570a17-8430-4238-ae79-81bbbd2de81f" name="Default Changelist" comment="20210821 8-37 修改">
+    <list default="true" id="82570a17-8430-4238-ae79-81bbbd2de81f" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/js/exam_detail.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/exam_detail.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/h_exam/exam_list.html" beforeDir="false" afterPath="$PROJECT_DIR$/h_exam/exam_list.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/js/components.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/components.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/js/exam_list.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/exam_list.js" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -244,8 +245,8 @@
     <sorting>DEFINITION_ORDER</sorting>
   </component>
   <component name="ProjectFrameBounds">
-    <option name="x" value="-120" />
-    <option name="y" value="34" />
+    <option name="x" value="-182" />
+    <option name="y" value="178" />
     <option name="width" value="1933" />
     <option name="height" value="899" />
   </component>
@@ -716,11 +717,18 @@
       <option name="project" value="LOCAL" />
       <updated>1629691379090</updated>
     </task>
-    <option name="localTasksCounter" value="42" />
+    <task id="LOCAL-00042" summary="20210821 8-37 修改">
+      <created>1629701924179</created>
+      <option name="number" value="00042" />
+      <option name="presentableId" value="LOCAL-00042" />
+      <option name="project" value="LOCAL" />
+      <updated>1629701924179</updated>
+    </task>
+    <option name="localTasksCounter" value="43" />
     <servers />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-120" y="34" width="1933" height="899" extended-state="0" />
+    <frame x="-182" y="178" width="1933" height="899" extended-state="0" />
     <editor active="true" />
     <layout>
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16711159" />

+ 2 - 2
h_exam/exam_list.html

@@ -64,7 +64,7 @@
   <!-- @小屏幕 下拉菜单 -->
   <div id="nav-sm" class="nav-sm-noheight">
     <div class="my-province">
-      <span>全国</span><i class="glyphicon glyphicon-chevron-down"></i>
+      <span>省份</span><i class="glyphicon glyphicon-chevron-down"></i>
       <div data-province="true">
         <i class="glyphicon glyphicon-play icon-play"></i>
       </div>
@@ -158,4 +158,4 @@
   </div>
 </body>
 
-</html>
+</html>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
js/components.js


+ 22 - 6
js/exam_list.js

@@ -9,7 +9,17 @@ $(function () {
     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 = "数据加载中...";
+  let grade = $(my_nav_lis[id]).data("id"), lock = false, type = $(my_nav_lis[id]), zlock = "数据加载中...",
+    // 加载的数据
+    area = params["area"] || '';
+  if (!area) {
+    var currentPage = 3, totalPage = 3;
+  } else {
+    $(".my-list").empty();
+    var currentPage = 1, totalPage = 1;
+    $(".my-loading").show();
+    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(); })
+  }
   my_nav.click(function (e) {
     $(".my-loading").hide();
     if (e.target.className == "my-nav") return false;
@@ -21,21 +31,27 @@ $(function () {
     i ? $(".my-loading").show() : '';
     z_lock = i || zlock;
     $(".my-loading").html(z_lock).hide();
-    currentPage = type.data("currentPage") || 3;
-    totalPage = type.data("totalPage") || 3;
     grade = type.data("id");
     lock = type.data("lock") || false;
+    if (!area) {
+      currentPage = type.data("currentPage") || 3;
+      totalPage = type.data("totalPage") || 3;
+    } else {
+      currentPage = type.data("currentPage") || 1;
+      totalPage = type.data("totalPage") || 1;
+      $(".my-loading").show();
+      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(); })
+    }
     $(this).find(".active").removeClass("active");
     type.addClass("active");
     $(".ke>.active").removeClass("active");
     $($(".ke>.my-list")[active]).addClass("active");
+
   })
 
   // 加载数据
   // 显示区高度
-  let ch = document.documentElement.clientHeight || document.body.clientHeight,
-    // 加载的数据
-    area = params["area"] || '';
+  let ch = document.documentElement.clientHeight || document.body.clientHeight;
   $(window).scroll(function () {
     if (lock) return false;
     // 滑动区高度

Vissa filer visades inte eftersom för många filer har ändrats