");e.onload=function(a){URL.revokeObjectURL(e.src)},$("#smCode").val(""),e.attr("src",baseUrl+"/api/code/imgCode?imgCodeKey="+randomAuthorization),$(".imgCode_img").html("").append(e)}function login(){$(".checkbox-receded").on("click",(function(){buryingPonit("勾选【服务协议】选框","page_click",".checkbox"),$(this).toggleClass("checked"),isChecked=!isChecked,""==$("#sqrName").val().replace(/\s*/g,"")||""==$("#phoneNumber").val().replace(/\s*/g,"")||!phonereg.test($("#phoneNumber").val())||$("#smCode").val().length<6||!e||!$(".checkbox-receded").hasClass("checked")||o()?("01"==shareAwardPageValue?$(".form-warp").addClass("golden-disable").removeClass("disable").removeClass("golden-form"):$(".form-warp").addClass("disable").removeClass("golden-disable").removeClass("golden-form"),$(".form-warp").removeClass("form"+idx).addClass("form"+idx+"-hui")):($(".form-warp").removeClass("disable").removeClass("golden-disable"),"01"==shareAwardPageValue?$(".form-warp").addClass("golden-form"):$(".form-warp").removeClass("golden-form"),$(".form-warp").removeClass("form"+idx+"-hui").addClass("form"+idx))})),$("#phoneNumber").on("input",(function(){var e=$(this).val();""==e?(this.placeholder="请输入手机号码",$(".getMSGCode").addClass("disable")):phonereg.test(e)&&!isSending?$(".getMSGCode").removeClass("disable"):(console.log(e),$(".getMSGCode").addClass("disable"))})),$(".form-item input").on("input",(function(){""==$("#sqrName").val().replace(/\s*/g,"")||""==$("#phoneNumber").val().replace(/\s*/g,"")||!phonereg.test($("#phoneNumber").val())||$("#smCode").val().length<6||!e||!$(".checkbox-receded").hasClass("checked")||o()?"01"==shareAwardPageValue?$(".form-warp").addClass("golden-disable").removeClass("disable").removeClass("golden-form"):$(".form-warp").addClass("disable").removeClass("golden-disable").removeClass("golden-form"):($(".form-warp").removeClass("disable").removeClass("golden-disable"),"01"==shareAwardPageValue?$(".form-warp").addClass("golden-form"):$(".form-warp").removeClass("golden-form"))})),getImgCode(),$(".imgCode_img").on("click",(function(){buryingPonit("点击【图形验证码】图片","page_click",".imgCode_img"),getImgCode(),e=!1,$(".input_imgCode").val(""),$("#imgCode").val(""),$(".getMSGCode").addClass("disable")}));var e=!1,a=!0,s=0;function o(){if("3"!=isOpenHyerlink&&"2"!=isOpenHyerlink)return!1;for(var e=0;e<$(".beHyerlinkVoList").children("div").find(".checkboxList").length;e++)return"checkboxList checked"!=$(".beHyerlinkVoList").children("div").find(".checkboxList")[e].className||($(".form-warp").addClass("form"+idx).removeClass("form"+idx+"-hui"),!1)}function t(){""==$("#sqrName").val().replace(/\s*/g,"")||""==$("#phoneNumber").val().replace(/\s*/g,"")||!phonereg.test($("#phoneNumber").val())||$("#smCode").val().length<6||!e||!$(".checkbox-receded").hasClass("checked")||o()?$(".form-warp").addClass("form"+idx+"-hui").removeClass("form"+idx):$(".form-warp").removeClass("form"+idx+"-hui").addClass("form"+idx)}$(".getMSGCode").on("click",(function(){if(a){var s=sm2.doEncrypt($("#phoneNumber").val(),cipherKey);if($(this).hasClass("disable"))return!1;""!=$("#sqrName").val().replace(/\s*/g,"")?""!=$("#phoneNumber").val().replace(/\s*/g,"")?phonereg.test($("#phoneNumber").val())?isSending||(sessionStorage.getItem("configValue")?$.ajax({url:baseUrl+"/api/code/smCode",type:"get",dataType:"json",timeout:3e3,headers:headersObj({mobile:s,userName:$("#sqrName").val(),outCode:cookieFG,shortLink:sessionStorage.getItem("activityNo"),custRecom:"01"}),data:{mobile:s,userName:$("#sqrName").val(),outCode:cookieFG,shortLink:sessionStorage.getItem("activityNo"),custRecom:"01"},beforeSend:function(){$(".getMSGCode").addClass("disable"),a=!1},success:function(s){$(".getMSGCode").removeClass("disable"),a=!0,"0000"===s.code?("risk"===s.data.flag?($("#verifcode_pop1").show(),$(".shadow").show()):"true"===s.data.flag?(e=!0,isSending=!0,$.leftTime(config.sendMessageTime,(function(e){e.status?($(".getMSGCode").text(60*parseInt(e.m)+parseInt(e.s)+"s"),$(".getMSGCode").addClass("disable")):(isSending=!1,$(".getMSGCode").text("重新发送"),$(".getMSGCode").removeClass("disable"))}))):"false"===s.data.flag?showToast("验证码发送失败,请稍再试"):"refuse"===s.data.flag?(showToast("0000对不起,您不在活动对象内,感谢关注"),$(".shadow").hide(),isDisable=!0):showToast(s.data.message),sessionStorage.setItem("transId",s.data.transId||"")):showToast(s.data.message)},error:function(){$("#verifcode_pop1").show(),$shadow.show()}}):($("#verifcode_pop1").show(),$shadow.show())):showToast("请先输入正确的手机号码!"):showToast("请先输入手机号码!"):showToast("请先输入申请人姓名!")}})),$("#imgCode").off().on("input",(function(){if(""!=$(this).val()?$(this).siblings(".clear-close").css({visibility:"visible"}):$(this).siblings(".clear-close").css({visibility:"hidden"}),$(this).val().length<4)return!1;if(1==s)return $("#msgCode").val(""),$("#verifcode_pop1").hide(),$(".shadow").hide(),!1;var a=sm2.doEncrypt($("#phoneNumber").val(),cipherKey);$.ajax({url:baseUrl+"/api/code/verifyImgCodes",type:"POST",dataType:"json",headers:headersObj({imgCode:$("#imgCode").val().replace(/\s*/g,""),mobile:a,shortLink:sessionStorage.getItem("activityNo"),custRecom:"01",imgCodeKey:randomAuthorization,transId:sessionStorage.getItem("transId")?sessionStorage.getItem("transId"):""},{Accept:"application/json","Content-Type":"application/json"}),data:JSON.stringify({imgCode:$("#imgCode").val().replace(/\s*/g,""),mobile:a,shortLink:sessionStorage.getItem("activityNo"),custRecom:"01",imgCodeKey:randomAuthorization,transId:sessionStorage.getItem("transId")?sessionStorage.getItem("transId"):""}),success:function(s){"0000"==s.code?"true"===s.data?(e=!0,isSending=!0,$.leftTime(config.sendMessageTime,(function(e){e.status?($(".getMSGCode").text(60*parseInt(e.m)+parseInt(e.s)+"s"),$(".getMSGCode").addClass("disable")):(isSending=!1,$(".getMSGCode").text("重新发送"),$(".getMSGCode").removeClass("disable"))})),$("#verifcode_pop1").hide(),$(".shadow").hide(),getImgCode(),sessionStorage.getItem("configValue")||$.ajax({url:baseUrl+"/api/code/smCode",type:"get",dataType:"json",headers:headersObj({mobile:a,userName:$("#sqrName").val(),shortLink:sessionStorage.getItem("activityNo"),custRecom:"01"}),data:{mobile:a,userName:$("#sqrName").val(),shortLink:sessionStorage.getItem("activityNo"),custRecom:"01"},success:function(e){e.data||showToast(e.data.message)}}),$(".verifcode-state").css("background","url(../image/pop/right.png) no-repeat").hide(),$(".verifcode-state")[0].style.backgroundSize="100%"):($(".verifcode-state").css("background","url(../image/pop/wrong.png) no-repeat").show(),$(".verifcode-state")[0].style.backgroundSize="100%"):showToast(s.message||"验证码无效");""==$("#sqrName").val().replace(/\s*/g,"")||""==$("#phoneNumber").val().replace(/\s*/g,"")||!phonereg.test($("#phoneNumber").val())||$("#smCode").val().length<6||!e||!$(".checkbox-receded").hasClass("checked")||o()?"01"==shareAwardPageValue?$(".form-warp").addClass("golden-disable").removeClass("disable").removeClass("golden-form"):$(".form-warp").addClass("disable").removeClass("golden-disable").removeClass("golden-form"):($(".form-warp").removeClass("disable").removeClass("golden-disable"),"01"==shareAwardPageValue?$(".form-warp").addClass("golden-form"):$(".form-warp").removeClass("golden-form"))}})})),$("#sqrName,#phoneNumber,#smCode").on("input",(function(){t()})),$(".checkbox-receded").on("click",(function(){t()}));var i=!0;$(".ljsq").on("click",(function(){if(buryingPonit("点击【立即申请】按钮","page_click",".ljsq"),i&&""!=$("#sqrName").val()&&""!=$("#phoneNumber").val()&&phonereg.test($("#phoneNumber").val())){if(!e)return showToast("请先验证图片验证码"),!1;if(!(!$("#smCode").val().length>=6))if(console.log($(".checkbox-receded").hasClass("checked")),$(".checkbox-receded").hasClass("checked")){if("3"==isOpenHyerlink||"2"==isOpenHyerlink)for(var a=0;a<$(".beHyerlinkVoList").children("div").find(".checkboxList").length;a++)if("checkboxList checked"!=$(".beHyerlinkVoList").children("div").find(".checkboxList")[a].className)return showToast("请同意遵守活动细则及协议后才能分享哦!"),!1;var o={mobile:sm2.doEncrypt($("#phoneNumber").val(),cipherKey),smCode:$("#smCode").val(),custRecom:"01"};1==s&&(o.imgCode=$("#imgCode").val().replace(/\s*/g,""),o.imgCodeKey=randomAuthorization),$.ajax({url:baseUrl+"/api/code/verifyCodes",type:"POST",dataType:"json",headers:headersObj(o,{Accept:"application/json","Content-Type":"application/json"}),data:JSON.stringify(o),beforeSend:function(){i=!1},success:function(e){i=!0,console.log(e.code),"0000"===e.code?$.ajax({url:baseUrl+"/api/cust/saveInfo",type:"POST",dataType:"json",headers:headersObj({shortUrl:GetRequest().shortUrl,activityType:sessionStorage.getItem("activityType"),channelId:sessionStorage.getItem("channelId"),activityNo:sessionStorage.getItem("activityNo"),name:$("#sqrName").val(),phone:$("#phoneNumber").val(),contentType:GetRequest().contentType?GetRequest().contentType:""},{Accept:"application/json","Content-Type":"application/json"}),data:JSON.stringify({shortUrl:GetRequest().shortUrl,activityType:sessionStorage.getItem("activityType"),channelId:sessionStorage.getItem("channelId"),activityNo:sessionStorage.getItem("activityNo"),name:$("#sqrName").val(),phone:$("#phoneNumber").val(),contentType:GetRequest().contentType?GetRequest().contentType:""}),success:function(e){"0000"===e.code?locationHref("./recommended_success.html"):showToast(e.message)}}):"4006"==e.code||"5102"==e.code?($(".verifcode-state").hide().removeClass("error-state"),getImgCode($(".imgCode_img"),randomAuthorization),$("#imgCode").val(""),$("#verifcode_pop1").show(),$(".shadow").show(),$("#sendMsgCode").addClass("gray-btn"),s=1):showToast(e.message||"短信验证码错误,请重试")}})}else showToast("请同意遵守活动细则及协议后才能分享哦!")}}))}sessionStorage.removeItem("type"),sessionStorage.removeItem("configValue"),GetRequest().activityNo?sessionStorage.setItem("activityNo",GetRequest().activityNo):sessionStorage.setItem("activityNo","CR2019042810001"),$.ajax({type:"GET",dataType:"json",headers:headersObj({},{Accept:"application/json","Content-Type":"application/json"}),url:baseUrl+"/api/systemConfig/sys.verify.status",success:function(e){"on"==(e.data||{configValue:"on"}).configValue&&(getFinger(),sessionStorage.setItem("configValue","on"))}}),$.ajax({type:"GET",dataType:"json",headers:headersObj({"G-COMT-Authorization":sessionStorage.getItem("token")}),url:baseUrl+"/api/systemConfig/h5.basePoint.url",success:function(e){var a=e.data;sessionStorage.setItem("pointValue",a.configValue)}}),$("#verifcode_close1").on("click",(function(){getImgCode(),$("#verifcode_pop1").hide(),$shadow.hide(),getImgCode()})),$("#hdxz").on("click",(function(){buryingPonit("点击【活动细则】按钮","page_click","#hdxz"),$("#hdxz_pop").show(),$shadow.show()})),$(".hdxz").on("click",(function(){buryingPonit("点击【活动细则】按钮","page_click","#hdxz"),$("#hdxz_pop").show(),$shadow.show()})),$("#hdxz_close").on("click",(function(){$("#hdxz_pop").hide(),$shadow.hide()})),$(".clear-close").off().on("click",(function(){$(".verifcode-state").hide().removeClass("error-state"),$(this).siblings(".opcity-input").val(""),$(this).css({visibility:"hidden"})})),$((function(){var e=window.innerHeight;$("input,select").on("blur",(function(){var a=window.innerHeight;if(e!=a){var s=document.documentElement.scrollTop||document.body.scrollTop;s-=1,window.scrollTo(0,s),s+=1,window.scrollTo(0,s)}})),sessionStorage.setItem("shortUrl",GetRequest().shortUrl),$.ajax({url:baseUrl+"/api/cust/recomActivity",type:"post",dataType:"json",headers:headersObj({shortUrl:GetRequest().shortUrl,requestType:"1",activityType:"1",activityNo:sessionStorage.getItem("activityNo"),contentType:GetRequest().contentType?GetRequest().contentType:""},{Accept:"application/json","Content-Type":"application/json"}),data:JSON.stringify({shortUrl:GetRequest().shortUrl,requestType:"1",activityType:"1",activityNo:sessionStorage.getItem("activityNo"),contentType:GetRequest().contentType?GetRequest().contentType:""}),success:function(e){if(localStorage.setItem("locationUrl",window.location.href),setTitle(e.data.data.activityName),sa.quick("autoTrackWithoutProfile",{channel:"协同营销",activity_type:"客户推荐客户",children_page:"信息填写",out_code:""==sessionStorage.getItem("deviceId")?getCookieFG():sessionStorage.getItem("deviceId"),activity_no:e.data.data.activityNo}),"0000"===e.code){var a=e.data.data.invitationTips.replace("name",e.data.userInfo.realName);if($("#bgImg").prop("src",imgBaseUrl+e.data.data.backgroundImg),$("body").css("background",e.data.data.backgroundColur),$("#dhgz_pop .rc-i").html(e.data.data.exchangeRules),$("#hdxz_pop .rc-i").html(e.data.data.activityRules),$("#hdms").html(a),$(".vip").prop("src",imgBaseUrl+e.data.data.vipServiceImg),sessionStorage.setItem("activityNo",e.data.data.activityNo),sessionStorage.setItem("activityType",e.data.data.activityType),sessionStorage.setItem("channelId",e.data.data.channelId),sessionStorage.setItem("activityNo",e.data.data.activityNo),sessionStorage.setItem("idNo",e.data.userInfo.idNo),shareAwardPageValue=e.data.data.shareAwardPage,"1"===e.data.data.isFirstAccount&&$(".oneUser").show(),e.data.data.firstAccountPic&&$(".oneUser").css({background:"url("+imgBaseUrl+e.data.data.firstAccountPic+") center top no-repeat",backgroundSize:"100%"}),isOpenHyerlink=e.data.data.isOpenHyerlink,"3"==e.data.data.isOpenHyerlink||"2"==e.data.data.isOpenHyerlink){for(var s=[],o=0;o";idx=s.length+1,$(".form-warp").addClass("form"+idx+"-hui"),console.log(s,"nbList"),s.length>0?$(".form-warp").css("height","530px"):$(".form-warp").css("height","400px"),$(".form-warp").css({height:430+20*idx+"px"}),$(".ljsq").css({top:20*idx+"px"}),$(".beHyerlinkVoList").append(t),$(".beHyerlinkVoList").show(),$(".checkboxList").on("click",(function(){buryingPonit("勾选【服务协议】选框","page_click",".checkbox"),$(this).toggleClass("checked"),""==$("#sqrName").val().replace(/\s*/g,"")||""==$("#phoneNumber").val().replace(/\s*/g,"")||!phonereg.test($("#phoneNumber").val())||$("#smCode").val().length<6||!$(".checkbox-receded").hasClass("checked")||function(){if("3"!=isOpenHyerlink&&"2"!=isOpenHyerlink)return!1;for(var e=0;e<$(".beHyerlinkVoList").children("div").find(".checkboxList").length;e++)return"checkboxList checked"==$(".beHyerlinkVoList").children("div").find(".checkboxList")[e].className?($(".form-warp").addClass("form"+idx).removeClass("form"+idx+"-hui"),!1):($(".form-warp").addClass("form"+idx+"-hui").removeClass("form"+idx),!0)}()?$(".form-warp").addClass("form"+idx+"-hui").removeClass("form"+idx):$(".form-warp").removeClass("form"+idx+"-hui").addClass("form"+idx)}))}else $(".form-warp").css("height","450px"),$(".form-warp").addClass("form1-hui"),idx=1;$(".towUser").on("click",(function(){locationHref(e.data.data.secondAccountUrl)})),$(".oneUser").on("click",(function(){locationHref(e.data.data.firstAccountUrl)})),"0"!=e.data.data.isFloatSign&&($(".floatImg").css({background:"url("+imgBaseUrl+e.data.data.floatImgSign+") center top no-repeat",backgroundSize:"100%"}),$(".floatImg").attr("href",e.data.data.floatUrlSign||"javascript:void(0)").show(),$(".floatImgClose").show())}else"1010"===e.code?(showToast(e.message),$shadow.show(),$shadow.css("background","rgba(0,0,0,.4)")):($("body").html("").css({background:"url(../image/error.png) no-repeat","background-size":"100%"}),showToast(e.message))}}),$(".floatImgClose").on("click",(function(){$(".floatImg").hide(),$(".floatImgClose").hide()}))})),login()