邪性 3 gadi atpakaļ
vecāks
revīzija
d97d5f587c
3 mainītis faili ar 65 papildinājumiem un 11 dzēšanām
  1. 21 10
      .idea/workspace.xml
  2. 41 0
      js/exam_detail.js
  3. 3 1
      js/new_detail.js

+ 21 - 10
.idea/workspace.xml

@@ -1,12 +1,8 @@
 <?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="20210820 17-44">
+    <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$/h_news/news_detail.html" beforeDir="false" afterPath="$PROJECT_DIR$/h_news/news_detail.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" />
-      <change beforePath="$PROJECT_DIR$/js/new_detail.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/new_detail.js" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -100,12 +96,12 @@
     <session id="-1918643531">
       <usages-collector id="statistics.file.extensions.edit">
         <counts>
-          <entry key="txt" value="22" />
+          <entry key="txt" value="27" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.file.types.edit">
         <counts>
-          <entry key="PLAIN_TEXT" value="22" />
+          <entry key="PLAIN_TEXT" value="27" />
         </counts>
       </usages-collector>
     </session>
@@ -1330,11 +1326,25 @@
       <option name="project" value="LOCAL" />
       <updated>1629452683994</updated>
     </task>
-    <option name="localTasksCounter" value="28" />
+    <task id="LOCAL-00028" summary="20210820 18-20">
+      <created>1629454856679</created>
+      <option name="number" value="00028" />
+      <option name="presentableId" value="LOCAL-00028" />
+      <option name="project" value="LOCAL" />
+      <updated>1629454856679</updated>
+    </task>
+    <task id="LOCAL-00029" summary="20210820 18-20">
+      <created>1629455063581</created>
+      <option name="number" value="00029" />
+      <option name="presentableId" value="LOCAL-00029" />
+      <option name="project" value="LOCAL" />
+      <updated>1629455063581</updated>
+    </task>
+    <option name="localTasksCounter" value="30" />
     <servers />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-17" y="57" width="1933" height="899" extended-state="0" />
+    <frame x="-17" y="57" width="1933" height="899" extended-state="1" />
     <editor active="true" />
     <layout>
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16390817" />
@@ -1441,7 +1451,8 @@
     <MESSAGE value="试卷图片页" />
     <MESSAGE value="20210820 14-52" />
     <MESSAGE value="20210820 17-44" />
-    <option name="LAST_COMMIT_MESSAGE" value="20210820 17-44" />
+    <MESSAGE value="20210820 18-20" />
+    <option name="LAST_COMMIT_MESSAGE" value="20210820 18-20" />
   </component>
   <component name="editorHistoryManager">
     <entry file="file://$PROJECT_DIR$/h_news/new_detail.html" />

+ 41 - 0
js/exam_detail.js

@@ -14,4 +14,45 @@ $(function () {
       $(item).append(`<div style="visibility:hidden" class="list-item"></div>`);
     }
   })
+})
+$(function () {
+  let path = lxd.parseUrl(window.location.href).pathname;
+  let reg = /(?<=\/h_exam\/).*?(?=.html)/;
+  $.ajax({
+    url: `http://api.gaokaoapp.net/exampaper/h/${path.match(reg)}/`,
+    data: {
+    },
+    type: "get",
+    error: function (error) {
+      $(".loading").html("获取更多的评论,请下载大联考app").show();
+    },
+    success: function (res) {
+      let { comments, like_count = 1, read_count = 1 } = res.data;
+      $(".good>span").html(like_count);
+      $(".see").html(`阅读数:${read_count}`);
+      let father = document.createDocumentFragment();
+      Array.from(comments).forEach(
+        item => {
+          let str = `<div class="user" data-good="false" data-userid="1" >
+    <div class="u-img"><img src="${item.user_face}" alt="" class="img"></div>
+    <div class="u-content">
+      <div class="u-flex">
+        <div class="u-name">${item.user_name}</div>
+        <div class="u-fabulous" data-gods="1"><span>${item.like_count}</span><i data-gods="1" style="margin-left:5px" class="glyphicon glyphicon-thumbs-up"></i></div>
+      </div>
+      <div class="u-detail">
+       ${item.content}
+      </div>
+      <div class="u-flex">
+        <div class="u-date">${item.delay_time}</div>
+      </div>
+    </div>
+  </div>`;
+          $(father).append(str);
+        }
+      )
+      $("#detail").append(father);
+      $(".loading").html("获取更多的评论,请下载大联考app").show()
+    }
+  })
 })

+ 3 - 1
js/new_detail.js

@@ -10,7 +10,9 @@ $(function () {
       $(".loading").html("获取更多的评论,请下载大联考app").show();
     },
     success: function (res) {
-      let { comments } = res.data;
+      let { comments, like_count = 1, read_count = 1 } = res.data;
+      $(".good>span").html(like_count);
+      $(".see").html(`阅读数:${read_count}`);
       let father = document.createDocumentFragment();
       Array.from(comments).forEach(
         item => {