Browse Source

多个标题情况下计分结果

wyq 3 năm trước cách đây
mục cha
commit
f84787c595
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      src/js/staticInfo.js

+ 5 - 4
src/js/staticInfo.js

@@ -124,13 +124,13 @@ function renderContent(list, contentWrapClassName) {
 function renderContentscale(list, contentWrapClassName, name) {
   var pushInfo = []
   var textType = []
-  var constant
+  var constant = 0
   $('.scaletitle').html(name);
   for (var i = 0; i < list[0].detailList.length; i++) {
     var item = list[0].detailList[i];
     textType.push(item.textType)
     if (item.resultType == 1) {
-      constant = item.constant
+      constant += parseFloat(item.constant)
     }
     if (item.textType == 11) { 
       item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
@@ -397,7 +397,6 @@ function getResult(pushInfo, textType, constant) {
         break
       }
     }
-    // var v = scrollTop.indexOf(undefined)
     if (v) {
       $(`.scale .infos`).scrollTop(v.top + 346)
     }
@@ -446,7 +445,9 @@ function getResult(pushInfo, textType, constant) {
         result = tmp
         proposal = proposals.join(";");
       }
-      num = num+constant
+      console.log(constant)
+      // num = num+constant
+      console.log(num)
       if (result) {
         $(".hel").attr({
           "title": proposal