瀏覽代碼

静态信息为空时判断

wyq 3 年之前
父節點
當前提交
a6fbdf4377
共有 3 個文件被更改,包括 15 次插入16 次删除
  1. 9 10
      src/css/staticInfo.less
  2. 3 1
      src/js/informationOut.js
  3. 3 5
      src/js/staticInfo.js

+ 9 - 10
src/css/staticInfo.less

@@ -92,8 +92,7 @@
   .infos {
     height: 100%;
     overflow-y: auto;
-    /*padding: 0 60px 0 0;*/
-    // width: calc(100% - 250px);
+    border-top: 1px solid #E6E6E6;
   }
 
   .infos>div {
@@ -368,15 +367,13 @@
     }
     .item-content{
       margin: 10px 0;
-      display: flex;
-      flex-flow: wrap;
+      display: inline-block;
       .radio {
         display: flex;
         margin: 5px;
         margin-right: 25px;
+        float: left;
         label{
-          display: flex;
-          align-items: center;
           font-weight: 400;
           color: #666666;
           line-height: 20px;
@@ -433,10 +430,12 @@
   .result_box{
     padding:25px 56px;
     overflow: hidden;
-    position: relative;
+    max-width: 100%;
+    min-width: 100px;
+    display: inline-block;
     .result_left{
       display: inline-block;
-      position: absolute;
+      float: left;
       .hel{
         background: #2C96E5;
         border-radius: 50%;
@@ -449,7 +448,7 @@
     .result_title{
       max-width: 85%;
       display: inline-block;
-      margin-left: 65px;
+      float: left;
     }
   }
   
@@ -511,7 +510,7 @@
 }
 .scale{
   .infos-box{
-    border: 1px solid #E6E6E6;
+    
     margin: 0 71px 20px 38px;
     .infoWrapper {
       padding: 0 75px;

+ 3 - 1
src/js/informationOut.js

@@ -536,10 +536,12 @@ function renderTab(detailList, scale) {
     //$(".tabBox .title").html(noticeName);
   }
   let defaultModuleName
-  if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || getUrlArgObject('scale') == 'scale') {
+  if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || (getUrlArgObject('scale') == 'scale' && detailList['静态知识'])) {
+    console.log(123)
     $(".tabList .tab").eq(1).addClass("activeTab")
     defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
   } else {
+    console.log(2)
     $(".tabList .tab").eq(0).addClass("activeTab")
     defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
   }

+ 3 - 5
src/js/staticInfo.js

@@ -126,6 +126,7 @@ function renderContentscale(list, contentWrapClassName, name) {
   var textType = []
   for (var i = 0; i < list[0].detailList.length; i++) {
     var item = list[0].detailList[i];
+    textType.push(item.textType)
     if (item.textType == 11) {
       item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
       str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
@@ -384,14 +385,11 @@ function getResult(pushInfo, textType) {
         if ($(this).attr("resultType") == 1) {
           num += parseFloat($(this).val())
         } else {
-          console.log($(this).attr("data_obj"))
           arr.push($(this).attr("data_obj"))
           proposals.push($(this).attr("proposal"))
         } 
       });
-      console.log(arr)
       tmp = arr.join(";");
-      
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
@@ -419,8 +417,8 @@ function getResult(pushInfo, textType) {
         result = tmp
         proposal = proposals.join(";");
       }
-
       if (result == undefined) {
+        
         if ($.inArray(13, textType) > 0) {
           $(".score").html('总分:' + num + '分');
         }
@@ -431,7 +429,7 @@ function getResult(pushInfo, textType) {
         $(".hel").attr({
           "title": proposal
         });
-
+        console.log(textType)
         $(".result_title").html(result);
         if ($.inArray(13, textType) > 0) {
           $(".score").html('总分:' + num + '分');