瀏覽代碼

20210826 15-26

邪性 3 年之前
父節點
當前提交
870a641fb0
共有 13 個文件被更改,包括 443 次插入18 次删除
  1. 3 3
      .idea/workspace.xml
  2. 1 1
      404.html
  3. 60 1
      css/components.css
  4. 70 0
      css/search.css
  5. 1 1
      h_exam/exam_detail_d_img.html
  6. 4 0
      index.html
  7. 18 0
      js/components.js
  8. 4 1
      js/exam_detail.js
  9. 16 10
      js/exam_detail_img.js
  10. 3 1
      js/exam_list.js
  11. 7 0
      js/index.js
  12. 143 0
      js/search.js
  13. 113 0
      search.html

+ 3 - 3
.idea/workspace.xml

@@ -258,10 +258,10 @@
     <sorting>DEFINITION_ORDER</sorting>
   </component>
   <component name="ProjectFrameBounds" extendedState="6">
-    <option name="x" value="-122" />
-    <option name="y" value="53" />
+    <option name="x" value="-68" />
+    <option name="y" value="69" />
     <option name="width" value="1933" />
-    <option name="height" value="884" />
+    <option name="height" value="877" />
   </component>
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
   <component name="ProjectView">

+ 1 - 1
404.html

@@ -7,7 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="keywords" content="大联考,大联考网页版,新高考,高考动态,志愿填报,招生报考,历年真题,模拟考试,高考">
   <meta name="description" id="sharedsc" content="大联考提供新高考动态、志愿填报、招生报考、历年真题、模拟考试等海量的高考资讯与模考资料。旗下有大联考APP、大联考APP小程序。">
-  <title>页面找不到</title>
+  <title>404</title>
   <script>
     var _hmt = _hmt || [];
     (function () {

+ 60 - 1
css/components.css

@@ -50,6 +50,45 @@
   background-color: #f6f6f6;
   border: 5px;
 }
+.my-search {
+  margin: 32px 30px 0 0;
+}
+.my-search div {
+  display: flex;
+  align-items: center;
+  border: 1px solid #aaa;
+  border-radius: 5px;
+  padding: 0 0 0 5px;
+  overflow: hidden;
+  max-width: 300px;
+}
+.my-search div select {
+  border: 0;
+  outline: none;
+  border-right: 1px solid #e6e6e6 !important;
+  height: 34px;
+  box-sizing: border-box;
+  border-right: 0;
+}
+.my-search div input {
+  border: 0;
+  outline: none;
+  padding: 5px;
+  height: 34px;
+  box-sizing: border-box;
+  border-left: 0;
+  width: 100%;
+}
+.my-search div label {
+  display: block;
+  margin: 0;
+  height: 34px;
+  box-sizing: border-box;
+  color: #0099CC !important;
+  line-height: 34px;
+  padding: 0 10px;
+  color: #fff;
+}
 textarea {
   resize: none;
 }
@@ -194,6 +233,11 @@ body::-webkit-scrollbar-track {
   font-size: 20px;
   border-radius: 5px;
 }
+@media screen and (max-width: 768px) {
+  .header .ha-item .my-search {
+    display: none;
+  }
+}
 .header .ha-item .app {
   height: 100%;
   text-align: center;
@@ -215,7 +259,12 @@ body::-webkit-scrollbar-track {
   position: absolute;
   right: 0px;
 }
+.header .hb-item {
+  box-sizing: border-box;
+}
 .header .hb-item .nav {
+  box-sizing: border-box;
+  width: 100%;
   display: flex;
   justify-content: flex-start;
   align-content: center;
@@ -281,7 +330,7 @@ body::-webkit-scrollbar-track {
   box-sizing: border-box;
   background-color: #fff;
   margin-top: 80px;
-  padding: 0 20px;
+  padding: 0 0 0 22px;
 }
 #nav-sm .my-province {
   padding: 20px 0;
@@ -289,6 +338,13 @@ body::-webkit-scrollbar-track {
 #nav-sm .my-province div {
   top: 50px;
 }
+#nav-sm .search {
+  padding: 20px 0;
+  border-bottom: 1px solid #e6e6e6;
+}
+#nav-sm .search .my-search {
+  margin: 0;
+}
 @media screen and (max-width: 768px) {
   #nav-sm {
     border-top: 1px solid #eee;
@@ -371,6 +427,9 @@ body::-webkit-scrollbar-track {
   padding: 5px 30px;
   margin-bottom: 10px;
 }
+.body .my-search {
+  margin: 10px 0;
+}
 .body .my-articles ul {
   width: 100%;
   border-top: 1px solid #e6e6e6;

+ 70 - 0
css/search.css

@@ -0,0 +1,70 @@
+.body {
+  margin-top: 90px;
+}
+.body .search {
+  display: flex;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.body .search .button {
+  margin-left: 5px;
+  width: 60px;
+  background-color: #03c762;
+  text-align: center;
+  letter-spacing: 5px;
+  line-height: 34px;
+  color: #fff;
+  border-radius: 5px;
+}
+.body .content p {
+  color: #777;
+}
+.body .content ul {
+  list-style: none;
+  padding: 0;
+}
+.body .content ul li {
+  padding: 10px 0;
+}
+.body .content ul li a:hover {
+  color: #777;
+}
+.body .content ul li a h5 {
+  font-size: 18px;
+  line-height: 22px;
+  color: #2440b3;
+  font-weight: 500;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+  margin: 5px 0;
+}
+@media screen and (max-width: 768px) {
+  .body .content ul li a h5 {
+    font-size: 15px;
+  }
+}
+.body .content ul li a .flex {
+  display: flex;
+  justify-content: flex-start;
+  align-items: flex-start;
+}
+.body .content ul li a img {
+  max-width: 140px;
+  border-radius: 5px;
+}
+.body .content ul li a img.flex-item {
+  margin-right: 10px;
+}
+.body .content ul li a .flex-item > p:nth-child(2) {
+  color: #777;
+}
+.body .content ul li a .flex-item p {
+  color: black;
+  margin-bottom: 5px;
+}
+.body .pagination .active > a {
+  background-color: #03c762;
+  border: 1px solid #03c762;
+}

+ 1 - 1
h_exam/exam_detail_d_img.html

@@ -64,7 +64,7 @@
           <div class="edi-body" data-spy="scroll" data-target="" data-offset="0">
             <div class="my-nav">
               <ul>
-                <li>试题</li>
+                <li data-open="false">试题</li>
                 <li class="active">答案</li>
               </ul>
             </div>

+ 4 - 0
index.html

@@ -46,6 +46,7 @@
             <img src="./imgs/app_dowload.png" alt="大联考App下载">
           </div>
         </div>
+        <div class="my-search pull-right"></div>
         <div class="button pull-right">
           <div id="listbutton" class="glyphicon glyphicon-th-list button"></div>
         </div>
@@ -78,6 +79,9 @@
   <!-- components 共用菜单 -->
   <!-- @小屏幕 下拉菜单 -->
   <div id="nav-sm" class="nav-sm-noheight">
+    <div class="search">
+      <div class="my-search"></div>
+    </div>
     <ul>
       <!-- active 表明当前页面属于那个动作分类 -->
       <li><a class="nav-sm-title active" href="javascript:;" draggable="false">首页</a>

+ 18 - 0
js/components.js

@@ -377,6 +377,23 @@ $(function () {
     $(window).scrollTop(top)
   })
 })
+
+// 页面搜索功能
+$(function () {
+  var Fragment = document.createDocumentFragment();
+  var div = document.createElement("div");
+  div.innerHTML = `
+  <select >
+    <option value="1">试题</option>
+    <option value="2">咨询</option> 
+   </select>
+  <input placeholder="请输入关键字..." type="text" />
+  <label class="glyphicon glyphicon-search"></label>
+  `;
+  Fragment.appendChild(div)
+  $(".my-search").append(Fragment);
+})
+
 // 图片观看轮播
 // $(function () {
 //   // 获取图片
@@ -451,3 +468,4 @@ $(function () {
 //     })
 //   } catch (err) { }
 // })
+// 

+ 4 - 1
js/exam_detail.js

@@ -3,7 +3,10 @@ $(function () {
   function href (e) {
     e.stopPropagation();
     let url = $(this).data("href");
-    if (!url) return false;
+    if (!url) {
+      $("#toast").show();
+      return false
+    };
     window.location.href = url;
   }
   Array.from(list_flex).forEach(item => {

+ 16 - 10
js/exam_detail_img.js

@@ -4,6 +4,12 @@ $(function () {
     active: null,
     maxlength: null,
   };
+  // 判断试题是否存在;
+  let bool = $(".my-nav>ul>li:first-child"), slock = true;
+  if (!bool.data("open")) {
+    bool.css({ "cursor": "not-allowed" });
+    slock = false;
+  }
   // 实现跳转
   let my_nav = $(".my-nav"), top = my_nav.offset().top;
   $(".my-nav").click(function (e) {
@@ -13,9 +19,9 @@ $(function () {
     // globaldata.active = active;
     // 模板之间跳转逻辑
     if (e.target == $(this).find("li.active")[0]) return false;
-    console.log(active)
     switch (active) {
       case 0:
+        if (!slock) break;
         id = lxd.parseUrl(window.location.href).pathname.match(/(?<=\/h_exam\/d_).*?(?=.html)/);
         window.open(`/h_exam/s_${id}.html`);
         break;
@@ -48,15 +54,15 @@ $(function () {
     }
   )
   // 查看更多
-  $("[data-click='open']").click(function () {
-    let bool = $(this).data("open");
-    if (!bool) {
-      $("#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");
-    }
-  })
+  // $("[data-click='open']").click(function () {
+  //   let bool = $(this).data("open");
+  //   if (!bool) {
+  //     $("#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 () {

+ 3 - 1
js/exam_list.js

@@ -85,6 +85,8 @@ $(function () {
         },
         success: function (res) {
           let { dataList, totalPage } = res.data;
+          console.log(dataList)
+          console.log(data.area)
           let father = document.createDocumentFragment();
           Array.from(dataList).forEach(
             item => {
@@ -97,7 +99,7 @@ $(function () {
               <div class="item-detail">
               <div class="title">${item.title}</div>
               <div class="province">${item.areas}</div>
-              <div class="time">高考动态<span>${item.delay_time}</span></div>
+              <div class="time">${item.status_text}<span>${item.delay_time}</span></div>
               </div>
             </a>`;
               $(father).append(str);

+ 7 - 0
js/index.js

@@ -4,5 +4,12 @@ $(function () {
   $("#myCarousel").carousel(
     { interval: 5000 }
   )
+  $(".my-search")
+    .find("label").click(function () {
+      let valdoms = $(this).siblings(),
+        selectval = $(valdoms[0]).val(),
+        inputval = $(valdoms[1]).val();
+      window.open(`/search.html?selectval=${selectval}&inputval=${inputval}`);
+    })
 })
 

+ 143 - 0
js/search.js

@@ -0,0 +1,143 @@
+$(function () {
+  let params = lxd.parseUrl(window.location.href).query,
+    my_search = $(".my-search>div"), start = 0, end = 0, currentPage = 1, pageSize = 20, totalPage = 1;
+  my_search.find("select").val(params.selectval);
+  my_search.find("input").val(params.inputval);
+  // 数据渲染
+  function work (data, parameter) {
+    $(".content>ul>li").remove();
+    data = data.map(item => {
+      let reg = new RegExp(`(${parameter})`, "g"), newstr = item.title.replace(reg, `<font color=red>$1</font>`);
+      let li = document.createElement("li");
+      li.innerHTML = `<a target="_blank" href="${item.url}">
+        <h5>${newstr}</h5>
+        <div class="flex">
+          <img data-original="${item.thumbnail}"
+          src="./imgs/app.png" alt=""
+            class="flex-item">
+          <div class="flex-item">
+            <p>${item.status} ${item.area}</p>
+            <p>${item.time}</p>
+          </div>
+        </div>
+      </a>`;
+      return li;
+    })
+    $(".content>ul").append(data);
+    $("img").lazyload();
+  }
+  // 分页请求
+  function request (data) {
+    return new Promise(resolve => {
+      $.ajax({
+        method: "get",
+        data: {
+          type: data.selectval,
+          parameter: data.inputval,
+          currentPage,
+          pageSize
+        },
+        url: "http://admin.gaokaoapp.net/find/search/",
+        success: function (res) {
+          let { dataList: datas, totalPage: total, totalResult } = res.data;
+          totalPage = total;
+          $(".content>p").html(`为您找到相关结果约${totalResult}个`);
+          work(datas, data.inputval)
+          resolve(total);
+        }
+      })
+    })
+  }
+  request(params).then(res => problem(res));
+  // 页面搜索逻辑
+  function axios () {
+    let div = $(".my-search>div"), data = { selectval: div.find("select").val(), inputval: div.find("input").val() };
+    params = { ...data };
+    request(params).then(res => problem(res));
+  }
+  $(".button").click(axios);
+  // 分页问题 小于5
+  function problem (res) {
+    let ul = $(".pagination>li");
+    if (res <= 5) {
+      Array.from(ul).forEach((item, index) => {
+        if (index > res) $(item).addClass("disabled")
+      })
+    } else {
+      Array.from(ul).forEach((item, index) => {
+        if (index != 0) $(item).removeClass("disabled")
+      })
+    }
+  }
+  my_search.keydown(function (event) {
+    if (event.keyCode == 13) axios();
+  }).find("label").click(axios);
+  // let lis = $(".pagination>li");
+  // 分页逻辑
+  $(".pagination").click(function (e) {
+    let li = $(e.target).parent();
+    if (li.hasClass("active") || li.hasClass("disabled")) return false;
+    $(this).find(".active").removeClass("active");
+    let val = $(e.target).html(), arr = [];
+    function operation (num, arr) {
+      let brr = [];
+      Array.from(arr).forEach(item => brr.push($(item).html()))
+      brr = brr.slice(1, -1);
+      if (num > 0 && Number(brr[4]) < totalPage) {
+        Array.from(arr).forEach((item, index) => {
+          $(item).parent().removeClass("disabled");
+          if (index != 0 && index != 6) {
+            let html = Number(brr[index - 1]) + num;
+            if (html > totalPage) {
+              $(item).html(html).parent().addClass("disabled");
+            } else {
+              if (index == 1) {
+                $(item).html(html).parent().addClass("active");
+                req(html)
+              } else {
+                $(item).html(html);
+              }
+            }
+          }
+          if (index == 6 && Number(brr[4]) + num > totalPage) {
+            $(item).parent().addClass("disabled");
+          }
+        })
+      }
+      if (num < 0 && Number(brr[0]) != 1) {
+        Array.from(arr).forEach((item, index) => {
+          $(item).parent().removeClass("disabled");
+          let html = Number(brr[index - 1]) + num;
+          if (index != 0 && index != 6) {
+            if (index == 1) {
+              $(item).html(html).parent().addClass("active");
+              req(html)
+            } else {
+              $(item).html(html)
+            }
+          }
+          if (index == 0 && Number(brr[0]) + num == 1) {
+            $(item).parent().addClass("disabled");
+          }
+        })
+      }
+    }
+    function req (val) {
+      currentPage = Number(val);
+      request(params)
+    }
+    switch (val) {
+      case "»":
+        arr = li.parent().find("a");
+        operation(5, arr)
+        break;
+      case "«":
+        arr = li.parent().find("a");
+        operation(-5, arr)
+        break;
+      default:
+        li.addClass("active");
+        req(val)
+    }
+  })
+})

+ 113 - 0
search.html

@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta name="keywords" content="大联考,大联考网页版,新高考,高考动态,志愿填报,招生报考,历年真题,模拟考试,高考">
+  <meta name="description" id="sharedsc" content="大联考提供新高考动态、志愿填报、招生报考、历年真题、模拟考试等海量的高考资讯与模考资料。旗下有大联考APP、大联考APP小程序。">
+  <title>搜索</title>
+  <script>
+    var _hmt = _hmt || [];
+    (function () {
+      var hm = document.createElement("script");
+      hm.src = "https://hm.baidu.com/hm.js?c422004622ec075298aaf0a1a7bd21fe";
+      var s = document.getElementsByTagName("script")[0];
+      s.parentNode.insertBefore(hm, s);
+    })();
+  </script>
+  <link rel="shortcut icon" type="image/x-icon" href="./imgs/favicon.ico">
+  <script src="./js/jquery.js"></script>
+  <script type="text/javascript" src="../js/jquery.lazyload.min.js"></script>
+  <script src="./bootstrap/bootstrap.min.js"></script>
+  <link rel="stylesheet" href="./bootstrap/bootstrap.min.css">
+  <link rel="stylesheet" href="./css/components.css">
+  <link rel="stylesheet" href="./css/search.css">
+  <script src="./js/qrcode.min.js"></script>
+  <script src="./js/components.js"></script>
+  <script src="./js/search.js"></script>
+</head>
+
+<body>
+  <!-- 通用头部 -->
+  <div class="header">
+    <div class="container">
+      <div id="face" class="ha-item">
+        <div class="img pull-left">
+          <!-- 网站图标 -->
+          <a href="../index.html">
+            <img src="../imgs/app.png" alt=""></a>
+          <!-- <span>大联考</span> -->
+        </div>
+        <div data-app="download" class="app pull-right">
+          <a href="http://app.gaokaoapp.net" draggable="false">
+            <img src="../imgs/app_dowload.png" alt="" draggable="false"><br>
+            <span>大联考App下载</span>
+          </a>
+          <div style="display: none;">
+            <img src="../imgs/app_dowload.png" alt="大联考App下载">
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+  <div id="body" class="container">
+    <div class="row">
+      <div class="col">
+        <div class="body">
+          <div class="search">
+            <div class="my-search"></div>
+            <div class="button">搜索</div>
+          </div>
+          <div class="content">
+            <p>为您找到相关结果约0个</p>
+            <ul>
+            </ul>
+          </div>
+          <ul class="pagination">
+            <li class="disabled"><a href="#">&laquo;</a></li>
+            <li class="active"><a href="#">1</a></li>
+            <li><a href="#">2</a></li>
+            <li><a href="#">3</a></li>
+            <li><a href="#">4</a></li>
+            <li><a href="#">5</a></li>
+            <li><a href="#">&raquo;</a></li>
+          </ul>
+        </div>
+      </div>
+    </div>
+  </div>
+  <!-- 以下为通用html -->
+  <div class="footer">
+    <p>Copyright © 2021 <a href="http://app.gaokaoapp.net" target="_blank">大联考</a> All Rights Reserved. </p>
+    <p><a href="https://beian.miit.gov.cn/#/Integrated/index">豫ICP备15004940号</a></p>
+  </div>
+  <!-- 返回顶部 -->
+  <div id="top" class="noshow">
+    <i class="glyphicon glyphicon-chevron-up"></i>
+  </div>
+  <!-- 分享功能 -->
+  <div id="share">
+    <div>分享</div>
+    <ul>
+      <li>分享到</li>
+      <li><img src="./imgs/qq.png" alt="QQ">QQ</li>
+      <li><img src="./imgs/weixin.png" alt="微信">微信</li>
+      <li><img src="./imgs/weibo.png" alt="微博">微博</li>
+    </ul>
+  </div>
+  <!-- 下载app -->
+  <div id="download">
+    <div class="left">
+      <img src="./imgs/app.png" alt="大联考">
+      <div class="row1">大联考</div>
+      <div class="row2">全国中学生都在用</div>
+    </div>
+    <div class="right">
+      <button class="btn btn-info">下载</button>
+    </div>
+  </div>
+</body>
+
+</html>