|
@@ -189,9 +189,15 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
$(`.${contentWrapClassName} .infos .infos-box`).html('');
|
|
|
$(`.${contentWrapClassName} .anchors ul`).html('');
|
|
|
var pushInfo = []
|
|
|
+ var textType = []
|
|
|
+ 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 += parseFloat(item.constant)
|
|
|
+ }
|
|
|
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 +
|
|
@@ -294,7 +300,7 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
adjustHeight();
|
|
|
adjustWidth()
|
|
|
getcheck()
|
|
|
- getResult(pushInfo)
|
|
|
+ getResult(pushInfo, textType, constant)
|
|
|
copy(name)
|
|
|
getprinting()
|
|
|
|
|
@@ -408,7 +414,7 @@ function getchecks() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-function getResult(pushInfo) {
|
|
|
+function getResult(pushInfo, textType, constant) {
|
|
|
$(".but").click(function () {
|
|
|
let arr = [];
|
|
|
let multarr = []
|
|
@@ -420,7 +426,13 @@ function getResult(pushInfo) {
|
|
|
let proposals = []
|
|
|
let scrollTop = []
|
|
|
let v
|
|
|
+ let numType = false
|
|
|
isclick = true
|
|
|
+ for (var i = 0; i < textType.length; i++) {
|
|
|
+ if (textType[i] == 13) {
|
|
|
+ numType = true
|
|
|
+ }
|
|
|
+ }
|
|
|
$(".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');
|
|
@@ -434,15 +446,15 @@ function getResult(pushInfo) {
|
|
|
}
|
|
|
scrollTop.push($(this).eq(0).find(".chColor").offset())
|
|
|
});
|
|
|
+
|
|
|
for (var i = 0; i < scrollTop.length; i++) {
|
|
|
if (scrollTop[i] != undefined) {
|
|
|
v = scrollTop[i]
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- console.log(v)
|
|
|
if (v) {
|
|
|
- $(`.scale .infos`).scrollTop(v.top)
|
|
|
+ $(`.scale .infos`).scrollTop(v.top + 346)
|
|
|
}
|
|
|
if (!$(".contentList").find(".item-title").hasClass('chColor') && !$(".contentList").find(".item-titles").hasClass('chColor')) {
|
|
|
$('input[type="radio"]:checked').each(function () {
|
|
@@ -489,25 +501,28 @@ function getResult(pushInfo) {
|
|
|
result = tmp
|
|
|
proposal = proposals.join(";");
|
|
|
}
|
|
|
- if (result == undefined) {
|
|
|
- if (num > 0) {
|
|
|
- $(".score").html('总分:' + num + '分');
|
|
|
- }
|
|
|
- $(".score").css('display', 'block')
|
|
|
- $(".copy").css('display', 'none')
|
|
|
- $(".foot").css('display', 'block')
|
|
|
- } else {
|
|
|
+ console.log(constant)
|
|
|
+ // num = num+constant
|
|
|
+ console.log(num)
|
|
|
+ if (result) {
|
|
|
$(".hel").attr({
|
|
|
"title": proposal
|
|
|
});
|
|
|
$(".result_title").html('结果:' + result);
|
|
|
- if (num > 0) {
|
|
|
+ if (num >= 0 && numType) {
|
|
|
$(".score").html('总分:' + num + '分');
|
|
|
}
|
|
|
$(".result").css('display', 'block')
|
|
|
$(".score").css('display', 'block')
|
|
|
$(".copy").css('display', 'block')
|
|
|
$(".foot").css('display', 'block')
|
|
|
+ } else {
|
|
|
+ if (num >= 0 && numType) {
|
|
|
+ $(".score").html('总分:' + num + '分');
|
|
|
+ }
|
|
|
+ $(".score").css('display', 'block')
|
|
|
+ $(".copy").css('display', 'none')
|
|
|
+ $(".foot").css('display', 'block')
|
|
|
}
|
|
|
} else {
|
|
|
Toast('温馨提示:必填选项不能为空~', 500, 'warn')
|
|
@@ -597,7 +612,7 @@ function bindTabClick() {
|
|
|
})
|
|
|
}
|
|
|
function adjustHeight() {
|
|
|
- const extHt = window.opener ? 60 : 0;
|
|
|
+ const extHt = window.opener?60:0; //网页查看时隐藏页脚
|
|
|
var ht = window.innerHeight || document.documentElement.clientHeight;
|
|
|
$(".content").height(ht - 160 + "px");
|
|
|
$(".content .infos").height(ht - 170 + "px");
|