const {post,config} = require('./promise.js'); const $ = require("jquery"); function bindTipsEvent() { $(".conditTips").on('click',".radioChecks",function(e){ e.stopPropagation() $(this).attr("data-select","select").children("i").css({ "background":"url('../images/sex2.png') center center no-repeat" }) $(this).siblings().attr("data-select","").children("i").css("background","url('../images/sex1.png') center center no-repeat") }) $(".conditTips").on('click',".closeModal",function(e){ e.stopPropagation() $(this).parents(".popupModal").css("display","none") }) $(".conditTips").on('click',".popupModal",function(e){ e.stopPropagation() }) $(".conditTips").on('click',".mayResultSelect",function(){ console.log('clickpopup') $(".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{ var data = res.data if(data.code == 0){ var result = data.data; var tmpName = that.parent().find(".calculateName"); var deepDetailResultStr = ''; for(var v = 0;v < result.result.length;v++){ var name = result.result[v].name var text = result.result[v].text deepDetailResultStr+='

'+name+':'+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) that.parent().find(".calculateError").html(data.msg).css("display","block") that.parent().find(".calculateResult").html('') } }) }) } module.exports = { bindTipsEvent }