소스 검색

20210819 11-28

邪性 3 년 전
부모
커밋
87a976d44b
4개의 변경된 파일15개의 추가작업 그리고 81개의 파일을 삭제
  1. 0 67
      css/exam_detail.less
  2. 1 1
      h_exam/exam_detail.html
  3. 9 7
      js/components.js
  4. 5 6
      js/exam_detail.js

+ 0 - 67
css/exam_detail.less

@@ -1,67 +0,0 @@
-.new3 .body {
-  padding: 0 5px;
-  margin-top: 90px;
-}
-.new3 .body h4 {
-  font-weight: 500;
-}
-.new3 .body .title {
-  color: #777;
-  margin: 5px 0;
-}
-.new3 .body .list .list-flex {
-  margin: 10px  0;
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-}
-.new3 .body .list .list-flex .list-item {
-  border-radius: 5px;
-  flex: 1;
-  padding: 10px;
-  margin-right: 20px;
-  box-shadow: 0 0 5px #d6d6d6;
-}
-.new3 .body .list .list-flex .list-item:hover {
-  cursor: pointer;
-}
-@media screen and (max-width: 768px) {
-  .new3 .body .list .list-flex .list-item {
-    margin-right: 5px;
-  }
-}
-.new3 .body .list .list-flex .list-item h4 {
-  font-weight: 600;
-}
-.new3 .body .list .list-flex .list-item .p {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.new3 .body .list .list-flex .list-item .p .blue {
-  color: #2382ff;
-}
-.new3 .body .list .list-flex .list-item .p a:hover {
-  color: #777;
-}
-.new3 .body .list .list-flex > .list-item:last-child {
-  margin: 0 0 0 20px;
-}
-@media screen and (max-width: 768px) {
-  .new3 .body .list .list-flex > .list-item:last-child {
-    margin: 0 0 0 5px;
-  }
-}
-.alert-msg {
-  margin: 10px 0;
-  padding: 10px;
-  background-color: #eee;
-  border-radius: 5px;
-  vertical-align: middle;
-  text-align: center;
-}
-#toast .toast-content{
- img{
-   padding: 1px;
- }
-}

+ 1 - 1
h_exam/exam_detail.html

@@ -84,7 +84,7 @@
                 <h4>理科数学</h4>
                 <div class="p">
                   <div>投稿试题</div>
-                  <div>投稿答案</div>
+                  <div class="blue">查看答案</div>
                 </div>
               </div>
               <div data-href="http://www.gaokaoapp.net" class="list-item">

+ 9 - 7
js/components.js

@@ -242,13 +242,15 @@ $(function () {
 $(function () {
   let dom = $("#toast>.toast-content");
   let style = dom.data();
-  let h = style["height"] * 1 / 2;
-  let w = style["width"] * 1 / 2;
-  style["width"] += "px";
-  style["height"] += "px";
-  style["top"] = `calc(50vh - ${h}px )`;
-  style["left"] = `calc(50vw - ${w}px )`;
-  dom.css(style);
+  try {
+    let h = style["height"] * 1 / 2;
+    let w = style["width"] * 1 / 2;
+    style["width"] += "px";
+    style["height"] += "px";
+    style["top"] = `calc(50vh - ${h}px )`;
+    style["left"] = `calc(50vw - ${w}px )`;
+    dom.css(style);
+  } catch (err) { }
   dom.find("a").click(function () {
     window.location.href = $(this).attr("href")
   })

+ 5 - 6
js/exam_detail.js

@@ -2,13 +2,12 @@ $(function () {
   let list_flex = $(".list .list-flex");
   Array.from(list_flex).forEach(item => {
     let list_item = $(item).find(".list-item");
-    list_item.click(function () {
-      if (!$(this).data("href")) {
-        $(this).find(".p>div").click(function () {
-          $("#toast").addClass("show")
-        })
+    list_item.click(function (e) {
+      if (e.target.className != "blue" && $(e.target).parent()[0].className == "p") {
+        $("#toast").addClass("show")
         return false;
-      };
+      }
+      if (!$(this).data("href")) return false;
       window.location.href = $(this).data("href");
     })
     if (list_item.length == 1) {