Parcourir la source

Merge branch 'dynamicScale0609' into testNew

wyq il y a 4 ans
Parent
commit
2654c29200
2 fichiers modifiés avec 23 ajouts et 19 suppressions
  1. 1 0
      src/css/staticInfo.less
  2. 22 19
      src/js/staticInfo.js

+ 1 - 0
src/css/staticInfo.less

@@ -416,6 +416,7 @@
   color: #333333;
   display: none;
   margin: 0 6.5%;
+  text-align: center;
   .result_box{
     display: flex;
     justify-content: center;

+ 22 - 19
src/js/staticInfo.js

@@ -159,7 +159,7 @@ function renderContentscale(list, contentWrapClassName, name) {
             } else if (it.selectType == 22 && item.resultType == 1) {
               str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.score + '" />'
             } else if (it.selectType == 21 && item.resultType == 2) {
-              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content+'问题' + its.result + '"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '问题' + its.result + '"/>'
             } else if (it.selectType == 22 && item.resultType == 2) {
               str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '问题' + its.result + '"/>'
             }
@@ -220,12 +220,12 @@ function renderContentscale(list, contentWrapClassName, name) {
 function getprinting() {
   $('.printing').click(function () {
     $('.foot').hide()
-    $('.hel').hide()
+    // $('.hel').hide()
     $('#Print').css({
       'height': 'auto', //高度自动
     }).jqprint();
     $('.foot').show()
-    $('.hel').show()
+    // $('.hel').show()
   })
 }
 
@@ -238,10 +238,9 @@ function getcheck() {
       $radio.prop('checked', false);
       $("input:radio[name='" + domName + "']").data('waschecked', false);
       $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
-      if (isclick){
+      if (isclick) {
         getchecks()
       }
-      
     } else {
       $radio.prop('checked', true);
       $("input:radio[name='" + domName + "']").data('waschecked', false);
@@ -290,7 +289,7 @@ function copy(name) {
   })
 
 }
-function getchecks(){
+function getchecks() {
   $(".contentList").each(function (i) {
     if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
       $(this).find(".item-title").addClass('chColor');
@@ -338,34 +337,38 @@ function getResult(pushInfo, textType) {
           arr.push($(this).attr("data_obj"))
         }
       });
-      tmp = arr.join(";");
+      tmp = arr.join("");
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
-          console.log(parseFloat(pushInfo[i].content.max))
-          console.log(pushInfo[i].content.max)
-          console.log(num)
-          
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min) {
-            console.log(pushInfo[i])
             if (tmp) {
-              if (num == 0){
-                result = pushInfo[i].result + ';' + tmp
-              }else{
+              if (num == 0) {
+                result = pushInfo[i].result + ';' + tmp
+              } else {
                 result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
               }
             } else {
               if (num == 0) {
                 result = pushInfo[i].result
               } else {
-                result = pushInfo[i].result + '(' + num + '分' +')'
+                result = pushInfo[i].result + '(' + num + '分' + ')'
               }
             }
+            $(".result").css('display', 'block')
+            $(".copy").css('display', 'block')
+          } else {
+            if (tmp) {
+              result = tmp
+              $(".result").css('display', 'block')
+              $(".copy").css('display', 'block')
+            } else {
+              $(".result").css('display', 'none')
+              $(".copy").css('display', 'none')
+            }
+
           }
         }
-      } else {
-        result = tmp
       }
-
       $(".result_title").attr({
         "title": result
       });