|
@@ -114,6 +114,7 @@ function renderContent(list, contentWrapClassName) {
|
|
|
|
|
|
function renderContentscale(list, contentWrapClassName, name) {
|
|
|
var pushInfo = []
|
|
|
+ var textType = []
|
|
|
// anchors = '<li><i></i><a href="#' + contentWrapClassName +
|
|
|
// '">' + name + '</a></li><li class="anchor-line"></li>';
|
|
|
str = '<p class="scaletitle">' + name + '</p>'
|
|
@@ -121,7 +122,8 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
// $(`.${contentWrapClassName} .anchors ul`).append(anchors);
|
|
|
for (var i = 0; i < list[0].detailList.length; i++) {
|
|
|
var item = list[0].detailList[i];
|
|
|
-
|
|
|
+ console.log(item.resultType)
|
|
|
+ textType.push(item.textType)
|
|
|
if (item.textType == 11) {
|
|
|
anchors = '<li><i></i><a href="#' + contentWrapClassName + i +
|
|
|
'">' + item.content + '</a></li><li class="anchor-line"></li>';
|
|
@@ -140,12 +142,11 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
var it = items.detailList[k];
|
|
|
it.content = it.content && it.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
|
|
|
str = '<div class="contentList" data-id="' + it.parentId + '"><div class="item-list">';
|
|
|
- if (it.selectType == 2) {
|
|
|
+ if (it.selectType == 21) {
|
|
|
str += '<p class="item-title">' + it.content + '</p>'
|
|
|
- } else if (it.selectType == 1) {
|
|
|
+ } else if (it.selectType == 22) {
|
|
|
str += '<p class="item-titles">' + it.content + '</p>'
|
|
|
}
|
|
|
-
|
|
|
str += '<div class="item-content" data-id="' + it.id + '">'
|
|
|
str += '</div></div></div>'
|
|
|
$(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "]").append(str);
|
|
@@ -155,11 +156,11 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
str = '<div class="radio" name="scale' + its.parentId + '" value="' + its.score + '">';
|
|
|
if (it.selectType == 1 && item.resultType == 1) {
|
|
|
str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + its.score + '"/>'
|
|
|
- } else if (it.selectType == 2 && item.resultType == 1) {
|
|
|
+ } 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 == 1 && item.resultType == 2) {
|
|
|
+ } 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="' + its.result + '"/>'
|
|
|
- } else if (it.selectType == 2 && item.resultType == 2) {
|
|
|
+ } 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="' + its.result + '"/>'
|
|
|
}
|
|
|
str += its.content
|
|
@@ -211,7 +212,7 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
adjustHeight();
|
|
|
adjustWidth()
|
|
|
getcheck()
|
|
|
- getResult(pushInfo)
|
|
|
+ getResult(pushInfo, textType)
|
|
|
copy(name)
|
|
|
getprinting()
|
|
|
}
|
|
@@ -276,7 +277,7 @@ function copy(name) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function getResult(pushInfo) {
|
|
|
+function getResult(pushInfo, textType) {
|
|
|
$(".but").click(function () {
|
|
|
let arr = [];
|
|
|
let num = 0
|
|
@@ -284,16 +285,17 @@ function getResult(pushInfo) {
|
|
|
let key = false
|
|
|
$(".contentList").each(function (i) {
|
|
|
if ($(this).find('input[type="radio"]:checked').val() == undefined) {
|
|
|
- $(this).find(".item-titles").addClass('chColor');
|
|
|
+ $(this).find(".item-title").addClass('chColor');
|
|
|
} else {
|
|
|
- $(this).find(".item-titles").removeClass('chColor');
|
|
|
+ $(this).find(".item-title").removeClass('chColor');
|
|
|
}
|
|
|
if ($(this).find('input[type="checkbox"]:checked').val() == undefined) {
|
|
|
- $(this).find(".item-title").addClass('chColor');
|
|
|
+ $(this).find(".item-titles").addClass('chColor');
|
|
|
} else {
|
|
|
- $(this).find(".item-title").removeClass('chColor');
|
|
|
+ $(this).find(".item-titles").removeClass('chColor');
|
|
|
}
|
|
|
});
|
|
|
+ console.log(!$(".contentList").find(".item-title").hasClass('chColor'))
|
|
|
if (!$(".contentList").find(".item-title").hasClass('chColor')) {
|
|
|
$('input[type="radio"]:checked').each(function () {
|
|
|
if (Number($(this).val())) {
|
|
@@ -331,12 +333,14 @@ function getResult(pushInfo) {
|
|
|
"title": result
|
|
|
});
|
|
|
$(".result_title").html(result);
|
|
|
- $(".score").html('总分:' + num + '分');
|
|
|
+ if ($.inArray(13, textType)>0){
|
|
|
+ $(".score").html('总分:' + num + '分');
|
|
|
+ }
|
|
|
$(".score").css('display', 'block')
|
|
|
$(".result").css('display', 'block')
|
|
|
$(".foot").css('display', 'block')
|
|
|
} else {
|
|
|
- Toast('温馨提示:必填选项不能为空~', 500000)
|
|
|
+ Toast('温馨提示:必填选项不能为空~', 500)
|
|
|
}
|
|
|
})
|
|
|
|