|
@@ -102,6 +102,7 @@ function renderContent(list, contentWrapClassName) {
|
|
var divHeight = 0;
|
|
var divHeight = 0;
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
divHeight = divHeight + parseInt($('#' + contentWrapClassName + i).css('height')) + parseInt($('#' + contentWrapClassName + i).parent().next().css('height')) + 20
|
|
divHeight = divHeight + parseInt($('#' + contentWrapClassName + i).css('height')) + parseInt($('#' + contentWrapClassName + i).parent().next().css('height')) + 20
|
|
|
|
+
|
|
if (divHeight > scrollTop) {
|
|
if (divHeight > scrollTop) {
|
|
var anchor = 2 * i;
|
|
var anchor = 2 * i;
|
|
$(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
|
|
$(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
|
|
@@ -163,7 +164,7 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
}
|
|
}
|
|
str += its.content
|
|
str += its.content
|
|
if (item.resultType == 1) {
|
|
if (item.resultType == 1) {
|
|
- str += '<span class="num">' + '(' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + ')' + '</span>'
|
|
|
|
|
|
+ str += '<span class="num">' + its.score + '</span>'
|
|
}
|
|
}
|
|
str += '</label>'
|
|
str += '</label>'
|
|
str += `${its.match == 1 ? `<img class="recommend" src=${recommend} />` : ``}</div>`
|
|
str += `${its.match == 1 ? `<img class="recommend" src=${recommend} />` : ``}</div>`
|
|
@@ -188,7 +189,7 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
str = '<div class="scalebot">'
|
|
str = '<div class="scalebot">'
|
|
str += '<button class="but">结果</button><p class="score"></p>'
|
|
str += '<button class="but">结果</button><p class="score"></p>'
|
|
str += '</div>'
|
|
str += '</div>'
|
|
- str += `<div class="result"><div class="result_box"><img src=${hel} class="hel"/><span>结果:</span><p id="result_title" class="result_title"></p><textarea id="inputs"></textarea></div></div>`
|
|
|
|
|
|
+ str += `<div class="result"><div class="result_box"><div class="result_left"><img src=${hel} class="hel"/><span>结果:</span></div><p id="result_title" class="result_title"></p><textarea id="inputs"></textarea></div></div>`
|
|
str += `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
str += `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
$(`.${contentWrapClassName} .infos .infos-box`).append(str);
|
|
$(`.${contentWrapClassName} .infos .infos-box`).append(str);
|
|
// str = `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
// str = `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
@@ -213,6 +214,7 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
getResult(pushInfo, textType)
|
|
getResult(pushInfo, textType)
|
|
copy(name)
|
|
copy(name)
|
|
getprinting()
|
|
getprinting()
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function getprinting() {
|
|
function getprinting() {
|
|
@@ -289,15 +291,15 @@ function copy(name) {
|
|
$(".copy").click(function () {
|
|
$(".copy").click(function () {
|
|
var texts = document.getElementById("result_title").innerText;
|
|
var texts = document.getElementById("result_title").innerText;
|
|
if (texts == '') {
|
|
if (texts == '') {
|
|
- Toast('结果为空,无法复制', 500000000000, 'warn')
|
|
|
|
|
|
+ Toast('结果为空,无法复制', 500, 'warn')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
var inputs = document.getElementById("inputs");
|
|
var inputs = document.getElementById("inputs");
|
|
- inputs.value = name + '结果为;' + texts; // 修改文本框的内容(赋值内容)
|
|
|
|
|
|
+ inputs.value = name + '结果为:' + texts; // 修改文本框的内容(赋值内容)
|
|
console.log(inputs.value)
|
|
console.log(inputs.value)
|
|
inputs.select(); // 选中文本
|
|
inputs.select(); // 选中文本
|
|
document.execCommand("copy"); // 执行浏览器复制命令
|
|
document.execCommand("copy"); // 执行浏览器复制命令
|
|
- Toast('复制成功', 50000000000, 'success')
|
|
|
|
|
|
+ Toast('复制成功', 500, 'success')
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
window.close()
|
|
window.close()
|
|
}, 500)
|
|
}, 500)
|
|
@@ -392,6 +394,7 @@ function getResult(pushInfo, textType) {
|
|
$(".hel").attr({
|
|
$(".hel").attr({
|
|
"title": proposal
|
|
"title": proposal
|
|
});
|
|
});
|
|
|
|
+
|
|
$(".result_title").html(result);
|
|
$(".result_title").html(result);
|
|
if ($.inArray(13, textType) > 0) {
|
|
if ($.inArray(13, textType) > 0) {
|
|
$(".score").html('总分:' + num + '分');
|
|
$(".score").html('总分:' + num + '分');
|
|
@@ -402,7 +405,7 @@ function getResult(pushInfo, textType) {
|
|
$(".foot").css('display', 'block')
|
|
$(".foot").css('display', 'block')
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- Toast('温馨提示:必填选项不能为空~', 500000000000000, 'warn')
|
|
|
|
|
|
+ Toast('温馨提示:必填选项不能为空~', 500, 'warn')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
$(".printing").hover(
|
|
$(".printing").hover(
|