|
@@ -1,6 +1,7 @@
|
|
|
const {post,config} = require('./promise.js');
|
|
|
|
|
|
-$(document).on('click',".radioChecks",function(){
|
|
|
+$(".conditionHintTips").on('click',".radioChecks",function(e){
|
|
|
+ e.stopPropagation()
|
|
|
$(this).attr("data-select","select").children("i").css({
|
|
|
"background":"url('../images/sex2.png') center center no-repeat"
|
|
|
})
|
|
@@ -10,23 +11,69 @@ $(".conditionHintTips").on('click',".closeModal",function(e){
|
|
|
e.stopPropagation()
|
|
|
$(this).parents(".popupModal").css("display","none")
|
|
|
})
|
|
|
+$(".conditionHintTips").on('click',".popupModal",function(e){
|
|
|
+ e.stopPropagation()
|
|
|
+})
|
|
|
$(".conditionHintTips").on('click',".mayResultSelect",function(){
|
|
|
$(".popupModal").css('display',"none")
|
|
|
$(this).children(".popupModal").css('display',"block")
|
|
|
+ var that = $(this);
|
|
|
+ var numFlg = $(this).attr("data-num")
|
|
|
+ var tmpMoadlData = window.pushMessage[numFlg]
|
|
|
+ for(var i = 0;i<tmpMoadlData.details.length;i++){
|
|
|
+ var tmpPushMsgDetail = tmpMoadlData.details[i]
|
|
|
+ if(tmpPushMsgDetail.type == 2){
|
|
|
+ for(var m = 0;m < tmpPushMsgDetail.content.details.length;m++){
|
|
|
+ var tmpPushMsgDetailContentVal = tmpPushMsgDetail.content.details[m]
|
|
|
+ if(tmpPushMsgDetailContentVal.controlType == 0){
|
|
|
+ var domList = that.find(".caculateLis").children("li")
|
|
|
+ for(var n =0;n < tmpPushMsgDetailContentVal.details.length;n++){
|
|
|
+ if(tmpPushMsgDetailContentVal.details[n].state == 1){
|
|
|
+ domList.eq(n).attr("data-select","select").children("i").css({
|
|
|
+ "background":"url('../images/sex2.png') center center no-repeat"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ domList.eq(n).attr("data-select","").children("i").css({
|
|
|
+ "background":"url('../images/sex1.png') center center no-repeat"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(tmpPushMsgDetailContentVal.controlType == 2){
|
|
|
+ var domLis = that.find("input[type=text]").eq(m)
|
|
|
+ $(domLis).val(tmpPushMsgDetailContentVal.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(tmpPushMsgDetail.type == 3){
|
|
|
+ for(var a = 0;a < tmpPushMsgDetail.content.details.length;a++){
|
|
|
+ var tmpPushMsgDetailContentValS = tmpPushMsgDetail.content.details[a]
|
|
|
+ var domList = that.find(".radioChecks")
|
|
|
+ for(var b = 0;b <domList.length;b++){
|
|
|
+ if(that.find(".makesureResult").html() == tmpPushMsgDetailContentValS.detailName){
|
|
|
+ domList.eq(a).attr("data-select","select").children("i").css({
|
|
|
+ "background":"url('../images/sex2.png') center center no-repeat"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ domList.eq(a).attr("data-select","").children("i").css({
|
|
|
+ "background":"url('../images/sex1.png') center center no-repeat"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
$(".conditionHintTips").on('click',".sureScore",function(e){
|
|
|
e.stopPropagation()
|
|
|
- if($(this).attr("data-type") == 2){
|
|
|
- var tmpVal = $(this).parents(".mayResultSelect").find(".calculateResult:last").html()
|
|
|
- tmpVal && $(this).parents(".mayResultSelect").find(".makesureResult").html(tmpVal)
|
|
|
- }
|
|
|
if($(this).attr("data-type") == 3){
|
|
|
var tempVal = $(this).parents(".mayResultSelect").find(".radioChecks[data-select='select'] span").html()
|
|
|
tempVal && $(this).parents(".mayResultSelect").find(".makesureResult").html(tempVal)
|
|
|
}
|
|
|
$(this).parents(".popupModal").css('display',"none")
|
|
|
})
|
|
|
-$(".conditionHintTips").on('click','.calculate',function(){
|
|
|
+$(".conditionHintTips").on('click','.calculate',function(e){
|
|
|
+ e.stopPropagation()
|
|
|
var that = $(this)
|
|
|
var numFlg = that.attr("data-num")
|
|
|
var tmpMoadlData = window.pushMessage[numFlg]
|
|
@@ -39,7 +86,7 @@ $(".conditionHintTips").on('click','.calculate',function(){
|
|
|
paramsJson = tmpPushMsgDetail;
|
|
|
for(var m = 0;m < tmpPushMsgDetail.content.details.length;m++){
|
|
|
var tmpPushMsgDetailContentVal = tmpPushMsgDetail.content.details[m]
|
|
|
- if(tmpPushMsgDetailContentVal.controlType == 1){
|
|
|
+ if(tmpPushMsgDetailContentVal.controlType == 0){
|
|
|
var domList = that.parent(".modalMainTwo").find(".caculateLis").children("li")
|
|
|
for(var n =0;n < domList.length;n++){
|
|
|
if($(domList[n]).attr("data-select")){
|
|
@@ -61,9 +108,9 @@ $(".conditionHintTips").on('click','.calculate',function(){
|
|
|
}
|
|
|
for(var s = 0;s < paramsJson.content.details.length;s++){
|
|
|
if(paramsJson.content.details[s].controlType == 2 && paramsJson.content.details[s].value == ''){
|
|
|
- that.parent().find(".calculateError").css("display","block")
|
|
|
- that.parent().find(".calculateResult").html('')
|
|
|
- return
|
|
|
+ that.parent().find(".calculateError").css("display","block");
|
|
|
+ that.parent().find(".calculateResult").html('');
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
post(config.calculate,resultParams).then((res)=>{
|
|
@@ -76,14 +123,12 @@ $(".conditionHintTips").on('click','.calculate',function(){
|
|
|
var name = result.result[v].name
|
|
|
var text = result.result[v].text
|
|
|
deepDetailResultStr+='<p class="result"><span class="calculateName">'+name+':</span><span class="calculateResult">'+text+'</span></p>'
|
|
|
- // for(var s = 0;s < tmpName.length;s++){
|
|
|
- // console.log(tmpName.eq(s).html().split(":")[0])
|
|
|
- // if(tmpName.eq(s).html().split(":")[0] == name){
|
|
|
- // tmpName.eq(s).next().html(result.result[v].text)
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
$('.resultLis').html(deepDetailResultStr)
|
|
|
+ if($(".sureScore").attr("data-type") == 2){
|
|
|
+ var tmpVal = that.parents(".mayResultSelect").find(".calculateResult:last").html()
|
|
|
+ tmpVal && that.parents(".mayResultSelect").find(".makesureResult").html(tmpVal)
|
|
|
+ }
|
|
|
that.parent().find(".calculateError").css("display","none")
|
|
|
}else{
|
|
|
console.log(res)
|