var __SINA_SURVEY_DATA={"survey":{"id":"3241","creator":"zhangmei","title":"\u4e00\u6c7d\u8981\u6536\u8d2d\u534e\u6668\u4e2d\u56fd?\u534e\u6668\u56de\u5e94\uff1a\u6ca1\u6536\u5230\u6d88\u606f","description":"\u6709\u6d88\u606f\u4eba\u58eb\u900f\u9732\uff0c\u4e00\u6c7d\u96c6\u56e2\u8ba1\u5212\u4f5c\u4ef7\u7ea672\u4ebf\u7f8e\u5143\u6536\u8d2d\u534e\u6668\u4e2d\u56fd\u80a1\u4efd\u3002\u5bf9\u6b64\uff0c\u534e\u6668\u96c6\u56e2\u76f8\u5173\u8d1f\u8d23\u4eba\u8868\u793a\uff1a\u201c\u6211\u4eec\u6682\u65f6\u4e5f\u6ca1\u6709\u5f97\u5230\u786e\u5207\u6d88\u606f\uff0c\u4f46\u5df2\u7ecf\u5173\u6ce8\u5230\u5a92\u4f53\u7684\u62a5\u9053\uff0c\u5e76\u4e14\u5df2\u7ecf\u4e0a\u62a5\uff08\u534e\u6668\u96c6\u56e2\uff09\u7ba1\u7406\u4eba\u3002\u201d","keyword":"\u534e\u6668\u4e2d\u56fd,\u4e00\u6c7d\u96c6\u56e2","start_time":"1612337555","end_time":"2022564720","type":"1","channel":"8","status":"1","anti_cheat_strategy":"0","qr_code":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKIAAACiAQMAAAD4PIRYAAAABlBMVEX\/\/\/8AAABVwtN+AAABAElEQVRIic2WwQ3FIAxDLTFAR2J1RuoAkfITh5Zf9W5a0UMelwgbB+ADX\/P8gB7L0LM45TR+9NjDMfzsKKKmPYraM27votFWHdBGyuLdr4xSIR7QSzcVpVNJcz38q6LzhvJoVq2lzYelR2GHl1qmp2fUg07N\/pZuQlr3JM4lWsQREQbfQJ3NedC2dJPSdOoMDkZ5Zqia4jZo6uT0iprSGblqnlV8iGkp5GmRYezPoKZhjpInPTqnu5pOZ0ZYHM47439+FdE7wdOpc5bIKSdZZUdjZzM9pbTXEGVwXGNsBy2tGF59F13mfLy5ZBR82I30CtMTkNPLqfWmMTz9K6Ef+H74QSZy+nY9LQAAAABJRU5ErkJggg==","others":{"result_show":"1","user_result_show":"0","result_save":"1","result_order":"0","result_order_q":"0","true_result":"1","vote_show":"1","vote_submit":1,"vote_login":"1","voter_source":"0","share_img":"\/\/n.sinaimg.cn\/vote\/600\/w300h300\/20210108\/c79e-khmyntz5681515.jpg","comment":"1","survey_summary":"\u6295\u7968\u6210\u529f\uff0c\u611f\u8c22\u60a8\u7684\u53c2\u4e0e\uff01","redirect_url":"","display_type":"3","text_detail":"","text_detail_url":"","repetition_attr":"0","count_per_type":"1","repetition_user_cookie_device":"1","repetition_interval":"60m","repetition_freq":"","repetition_interval_did":"60m","repetition_freq_did":"","repetition_end_msg":"\u5df2\u7ecf\u6295\u8fc7\u7968\uff0c\u611f\u8c22\u60a8\u7684\u53c2\u4e0e","repetition_end_msg_did":"\u5df2\u7ecf\u6295\u8fc7\u7968\uff0c\u611f\u8c22\u60a8\u7684\u53c2\u4e0e","repetition_end_msg_cid":"\u5df2\u7ecf\u6295\u8fc7\u7968\uff0c\u611f\u8c22\u60a8\u7684\u53c2\u4e0e","button_status_uid":"0","button_status_did":"0","button_status_did_online":"0","button_status_cid":0,"result_interval_show":0,"result_address":"1","group":"2","vote_list_order":"1","vote_end_msg":"","survey_comment_type":"1","max_votes_per_cast":"1","ranking_list":"0","sub_channel_id":"","max_voter":0,"resize_pic":0,"final_result_show":1},"created_time":"1612337573","modified_time":"1612337573"},"content":{"question":[{"id":"63448","survey_id":"3241","type":"1","parent_id":"3241","sort_id":"1","status":"1","description":"\u4f60\u89c9\u5f97\u4e00\u6c7d\u6536\u8d2d\u534e\u6668\u4e2d\u56fd\u7684\u6d88\u606f\u662f\u771f\u7684\u5417\uff1f","others":{"question_selection":"1","question_type":"1","group_id":"","answer_order":"0","button_des":"","button_status_des":"","question_img":"","question_img_url":"","checkbox_num_least":0,"checkbox_num_most":0,"score_display_type":0,"score_num_least":0,"score_num_most":0,"standard_point":0},"created_time":"1612337695","modified_time":"1612689281","r_aids":[],"answers":[63449,63450,63451]},{"id":"63452","survey_id":"3241","type":"1","parent_id":"3241","sort_id":"2","status":"1","description":"\u4f60\u89c9\u5f97\u7834\u4ea7\u91cd\u6574\u540e\u7684\u534e\u6668\u96c6\u56e2\u672a\u6765\u53ef\u671f\u5417\uff1f","others":{"question_selection":"1","question_type":"1","group_id":"","answer_order":"0","button_des":"","button_status_des":"","question_img":"","question_img_url":"","checkbox_num_least":0,"checkbox_num_most":0,"score_display_type":0,"score_num_least":0,"score_num_most":0,"standard_point":0},"created_time":"1612337788","modified_time":"1612689281","r_aids":[],"answers":[63453,63454,63455]}],"answer":{"63448":[{"id":"63449","survey_id":"3241","type":"2","parent_id":"63448","sort_id":"1","status":"1","description":"\u65e0\u98ce\u4e0d\u8d77\u6d6a\uff0c\u662f\u771f\u7684","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"","answer_img_height":"","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":63452},"created_time":"1612337695","modified_time":"1612689281"},{"id":"63450","survey_id":"3241","type":"2","parent_id":"63448","sort_id":"2","status":"1","description":"\u7eaf\u5c5e\u8c23\u8a00","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":63452},"created_time":"1612337695","modified_time":"1612689281"},{"id":"63451","survey_id":"3241","type":"2","parent_id":"63448","sort_id":"3","status":"1","description":"\u4e0d\u597d\u8bf4","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":63452},"created_time":"1612337695","modified_time":"1612689281"}],"63452":[{"id":"63453","survey_id":"3241","type":"2","parent_id":"63452","sort_id":"1","status":"1","description":"\u4e0d\u770b\u597d\uff0c\u5f88\u96be\u5d1b\u8d77","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"","answer_img_height":"","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":null},"created_time":"1612337788","modified_time":"1612689281"},{"id":"63454","survey_id":"3241","type":"2","parent_id":"63452","sort_id":"2","status":"1","description":"\u770b\u597d\uff0c\u7edd\u5730\u53cd\u51fb","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":null},"created_time":"1612337788","modified_time":"1612689281"},{"id":"63455","survey_id":"3241","type":"2","parent_id":"63452","sort_id":"3","status":"1","description":"\u4e0d\u4e88\u7f6e\u8bc4","others":{"next_question":0,"answer_img":"","answer_img_url":"","answer_img_width":"undefined","answer_img_height":"undefined","answer_type_blank":0,"standard_point":0,"video_id":"","route_id":"","answer_note":"","right_answer":"0","next_question_id":null},"created_time":"1612337788","modified_time":"1612689281"}]},"point":[],"group":[],"a_q":{"63449":63448,"63450":63448,"63451":63448,"63453":63452,"63454":63452,"63455":63452}},"total":{"true":{"survey":"158","modified_time":"1659807510","question":{"63448":"158","63452":"158"},"answer":{"63449":{"number":"100","score":0,"percent":63.29},"63450":{"number":"24","score":0,"percent":15.19},"63451":{"number":"34","score":0,"percent":21.52},"63453":{"number":"87","score":0,"percent":55.06},"63454":{"number":"41","score":0,"percent":25.95},"63455":{"number":"30","score":0,"percent":18.99}}},"fake":{"survey":"158","modified_time":"1659807510","question":{"63448":"158","63452":"158"},"answer":{"63449":{"number":"100","score":0,"percent":63.29},"63450":{"number":"24","score":0,"percent":15.19},"63451":{"number":"34","score":0,"percent":21.52},"63453":{"number":"87","score":0,"percent":55.06},"63454":{"number":"41","score":0,"percent":25.95},"63455":{"number":"30","score":0,"percent":18.99}}}},"records":null};
!function(){var t=window.__SINA_SURVEY_DATA||null,e=t&&t.survey.id,s={},n=window.location.href,a=".com";-1!=n.indexOf("sina.cn")&&(a="");var i="";window.sina_survey_config&&(i=window.sina_survey_config.host||"");var o="//"+i+"vote.sina"+a+".cn/api/survey/cast_vote",r="//"+i+"vote.sina"+a+".cn/api/survey/get_captcha/",c="//"+i+"vote.sina"+a+".cn/result/component/",u="//"+i+"vote.sina"+a+".cn/api/survey/vote_status/",d="//"+i+"vote.sina"+a+".cn/api/survey/info/",l={},_=null,h=document.getElementById("sina_survey_js_"+e),v={},p={},y={},g=null;e&&(s[e]=t,window.sina_survey_config&&window.sina_survey_config.callback&&(y[e]=window.sina_survey_config.callback));var m={addClass:function(t,e){new RegExp("\\b"+e+"\\b").test(t.className)||(t.className=(t.className+" "+e).match(/\S+/g).join(" "))},removeClass:function(t,e){var s=new RegExp("\\b"+e+"\\b","g");t.className=t.className.replace(s,"").replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},getByClass:function(t,e){for(var s=t.getElementsByTagName("*"),n=new RegExp("\\b"+e+"\\b","i"),a=[],i=0;i320&&d<=480?Math.round(.3*(d-25)):Math.round(.23*(d-25)),o=Math.round(a/n*i);else if("sina"==r){h?u=h.parentNode:p[s]&&(u=p[s]);d=Math.round(m.getWidth(u));var l=m.getStyle(document.getElementsByTagName("html")[0],"fontSize").split("px")[0];i=Math.round((d-.8*l-.6*l-.1*l)/2),o=Math.round(a/n*i)}return{width:i,height:o}},addEvent:function(t,e,s){t.attachEvent?t.attachEvent("on"+e,s):t.addEventListener(e,s,!1)},removeEvent:function(t,e,s){t.detachEvent?t.detachEvent("on"+e,s):t.removeEventListener(e,s,!1)},browserRedirect:function(){var t=navigator.userAgent.toLowerCase(),e=window.location.href,s=window.location.host,n=t.match(/(sinanews|sinafinance)/i),a=t.match(/MicroMessenger/i);return n?-1!=e.indexOf("file://")?"client":"client_m":a?"wechat":-1!=s.indexOf("sina.cn")?"m":"pc"},getUrlKey:function(t){return t.substring(t.indexOf("code=")).split("&")[0].split("=")[1]},getCookie:function(t){var e=document.cookie.split("; "),s=0;for(s=0;s"),e.push(s+"="+n)}return e.join("&")},ajax:function(t,e){if((e=e||{}).data=e.data||{},e.data.t=e.data.t||(new Date).getTime(),e.method=e.method||"get","wechat"==f&&(e.data.code=m.getUrlKey(window.location.href)),"client"==f)g&&g.fetch({url:t,type:e.method,data:e.data},function(t){e.success&&e.success(t)});else{var s=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if("post"==e.method){s.open("POST",t,!0),s.withCredentials=!0,s.setRequestHeader("Content-Type","application/x-www-form-urlencoded");try{s.send(e.data?this.json2url(e.data):null)}catch(t){}}else{t+="?"+this.json2url(e.data),s.open("GET",t,!0);try{s.send()}catch(t){}}s.onreadystatechange=function(){4==s.readyState&&(200==s.status?e.success&&e.success(s.responseText):e.error&&e.error(s.status))}}}},f=m.browserRedirect(),w="";n=n.replace(/([?|&])code=[^&]*/gi,"$1");var b="https://vote.sina.cn/weixin/router?final_redirect_url="+encodeURIComponent(n);if("wechat"==f&&t.survey.others.vote_login>0&&!window.sessionStorage.getItem("vote_wxCode")){window.sessionStorage.setItem("vote_wxCode",1);var x=encodeURIComponent(b);window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7ae02ffb0ec715d6&redirect_uri="+x+"&response_type=code&scope=snsapi_base#wechat_redirect"}"client"==f&&(w="https:"),window.sinaSurveyEvent={init:function(n){window.sina_survey_config=n,p[n.id]=m.getDom(n.parent),v[n.id]=n.parent,y[n.id]=n.callback,g=n.class,m.jsonp({url:w+d+n.id,success:function(n){0==n.result.status.code&&(t=n.result.data,e=t.survey.id,s[e]=t,T(e))}})},imgError:function(t){var e=t.parentNode,s=w+"//n.sinaimg.cn/survey/images/sina_logo.png";e.style.background="url("+s+") center center no-repeat #eee",e.style.backgroundSize="102px 44px",e.onclick=function(){var s=t.getAttribute("data-src");t.src=s+"?"+(new Date).getTime(),e.onclick=null}}};var T=function(t){t&&m.ajax(w+u+t,{method:"post",success:function(e){var n=null;if(n="string"==typeof e?JSON.parse(e):e,window["sina_survey_status_"+t]=n.result.status.code,l[t]=n.result.status.code,window.sina_survey_config&&"_blank"==window.sina_survey_config.resultType)k.init(t);else if(0==n.result.status.code||102==n.result.status.code)k.init(t);else{var a=C.getStatus(t);1==s[t].survey.type&&1==s[t].survey.others.result_show&&a?C.init(t):k.init(t)}}})},k={init:function(t){if(h||p[t]){var e=this;this.addCss(t),setTimeout(function(){e.cHtml(t),setTimeout(function(){e.setImgInfo()},100)},100)}},addCss:function(t){var e=document.getElementsByTagName("head")[0],s=document.getElementById("sina_survey_css"),n=document.createElement("link"),a=null,i="";window.sina_survey_config&&(a=window.sina_survey_config.surveyCss),a&&!s&&(i=-1!=a.toString().indexOf("http")?a:"pc"!=f?w+"//n.sinaimg.cn/survey/css/sina_survey_m_js.css":w+"//n.sinaimg.cn/survey/css/sina_survey_js.css",n.id="sina_survey_css",n.rel="stylesheet",n.type="text/css",n.href=i,e.appendChild(n))},setImgInfo:function(){var t="";window.sina_survey_config&&(window.sina_survey_config.source,t=window.sina_survey_config.imgWidth);for(var e=m.getByClass(document,"survey_img_box"),s=0;s'+d+""):(d="已结束",c.innerHTML=''+d+""),1==a&&2!=i&&(c.innerHTML+=''+_.survey+"人参与"),u.className="survey_content_item_wrap survey_content_item_wrap_"+e.id,r.innerHTML=e.title;for(var h=0;h提交';else switch(l[t]){case 0:case 102:p='提交';break;case 101:p='已结束';break;default:p='已提交'}var y="",g=C.getStatus(t);return 1==e.others.result_show&&2!=e.type&&g&&window.sina_survey_config&&"_blank"==window.sina_survey_config.resultType&&(y="查看结果'),2==e.status&&(p='已结束'),o.innerHTML+='",o},cItem:function(t,e,n){var a=s[n].content.answer[t];switch(e.others.question_type){case"1":return this.radio(e,a,n);case"2":return this.checkBox(e,a,n);case"3":return this.text(e,a,n);case"4":return this.score(e,a,n);case"5":return this.radio(e,a,n);case"6":return this.checkBox(e,a,n)}},radio:function(t,e,s){var n="",a="";1==t.others.question_selection&&(n='*');for(var i=0;i',l=""):i%2==1&&(d="",l="")):this.parentWidth>320&&this.parentWidth<=480?(c="survey_img_box_min",i%3==0?(d='',l=""):i%3==2&&(d="",l="
")):i%4==0?(d='',l=""):i%4==3&&(d="",l="
"):i%2==0?(d='',l=""):i%2==1&&(d="",l="
"),i==e.length-1&&(l=""),-1==g.indexOf("http")&&(g=w+g),o='',r="survey_img_box",c&&"pc"==f&&(u=c)}a+=d+''+l}return''+t.sort_id+'、'+t.description+""+n+'
"},checkBox:function(t,e,s){var n="",a="";1==t.others.question_selection&&(n='*('+(t.others.checkbox_num_least>0?" 最少"+t.others.checkbox_num_least+"项 ":"")+(t.others.checkbox_num_most>0?" 最多"+t.others.checkbox_num_most+"项":"")+')');for(var i=0;i',l=""):i%2==1&&(d="",l="")):this.parentWidth>320&&this.parentWidth<=480?(c="survey_img_box_min",i%3==0?(d='',l=""):i%3==2&&(d="",l="
")):i%4==0?(d='',l=""):i%4==3&&(d="",l="
"):i%2==0?(d='',l=""):i%2==1&&(d="",l="
"),i==e.length-1&&(l=""),-1==g.indexOf("http")&&(g=w+g),o='',r="survey_img_box",c&&"pc"==f&&(u=c)}a+=d+'"+e[i].description+'
'+l}return''+t.sort_id+'、'+t.description+""+n+'
"},text:function(t,e){var s="",n="";return 1==t.others.question_selection&&(s='*'),n+='',''+t.sort_id+'、'+t.description+""+s+'
"},score:function(t,e){var s="",n="";1==t.others.question_selection&&(s='*');for(var a=0;a"+o+""}return n='',''+t.sort_id+'、'+t.description+""+s+'
"},show:function(t){m.getByClass(document,"survey_content_body_"+t)[0].style.display="block"},hide:function(t){m.getByClass(document,"survey_content_body_"+t)[0].style.display="none"},getData:function(t){var e="true";return 0==s[t].survey.others.true_result&&(e="fake"),s[t].total[e]}},E={init:function(t){this.addDomEvent(t),this.scoreBoxEvent(t)},addDomEvent:function(t){var e=s[t].survey,n=m.getByClass(document.body,"survey_content_body_"+e.id)[0],a=(m.getByClass(n,"survey_score_box"),this);m.addEvent(n,"click",function(s){var n=s.target;if("I"===n.tagName){2==e.others.vote_show?a.nextEvent(n,t):a.scoreEvent(n);var i=m.getParentTagName(n,"UL");m.addClass(i,"active"),m.removeClass(i,"tip"),i.style.background=""}}),m.addEvent(n,"change",function(s){var n=s.target;if(2!=e.others.vote_show||"TEXTAREA"!==n.tagName&&"INPUT"!==n.tagName)switch(n.tagName){case"INPUT":a.inputEvent(n);break;case"I":a.scoreEvent(n)}else a.nextEvent(n,t);var i=m.getParentTagName(n,"UL");m.removeClass(i,"tip"),i.style.background=""}),m.addEvent(n,"mouseover",function(t){var e=t.target;if("I"===e.tagName)for(var s=e.parentNode.getElementsByTagName("i"),n=s.length,a=0;a=s?m.removeClass(n[a],"active"):m.addClass(n[a],"active")}},inputEvent:function(t){var e=m.getParent(t,"survey_content_item"),s=e.getElementsByTagName("input");if("radio"==t.type&&e.setAttribute("data-answer",t.value),"checkbox"==t.type){e.getAttribute("data-min");for(var n=e.getAttribute("data-max"),a=[],i=0,o=0;on)return t.checked=!1,void B.show("最多选择"+n+"项");e.setAttribute("data-answer",a.join("-"))}},scoreEvent:function(t){for(var e=t.parentNode.getElementsByTagName("i"),s=!0,n=0;n0){for(var r=0,c=0;c0){var i=null;if("wechat"!=f){if("client"==f)return void(g&&g.login({},function(t){1==s[n].survey.anti_cheat_strategy?S.init(n):e.postForm(n)}));if(!(window.userInfo||e.getCookie()))return void(window.WapLogin?(i="function"==typeof WapLogin?new WapLogin:this).login(!1,function(t){S.init(n)}):(i=window.SINA_OUTLOGIN_LAYER)&&i.set("plugin",{parentNode:document.body,position:"center"}).register("login_success",function(){S.init(n)}).show())}}1==s[n].survey.anti_cheat_strategy?S.init(n):e.postForm(n)}else"scoreNoPass"!=a.code?B.show("请完善各必填项!",function(){B.highLight()}):B.show("多选题"+a.index+"最少选择"+a.min+"项!",function(){B.highLight()})})},getPostData:function(t){for(var e={survey_id:t,user_info:{user_id:"",user_type:1},vote:[],captcha:{captcha_token:S.captchaToken||"",value:S.value||""}},s=m.getByClass(document.body,"survey_content_item_wrap_"+t)[0],n=m.getByClass(s,"survey_content_item"),a=0;a0){var i=null;"wechat"!=f&&"client"!=f&&(i=window.userInfo||this.getCookie(),a.user_info.user_id=i.uid)}m.ajax(w+o,{method:"post",data:a,success:function(s){if(s){var n=null;switch((n="string"==typeof s?JSON.parse(s):s).result.status.code){case 0:N.changeBtn(t),S.showStatus=!1,S.captchaHide();var a="";return window.sina_survey_config&&"toast"==window.sina_survey_config.tipType&&(a="toast"),void B.show(n.result.status.msg,function(){window.sina_survey_records={},window.sina_survey_records[n.result.data.survey.id]=n.result.data.records,window.sina_survey_config?("_blank"==window.sina_survey_config.resultType?function(e){if(!C.getStatus(t))return;if("wechat"==f||"m"==f||"client_m"==f)window.location.href=w+e.result.data.url+"?time="+(new Date).getTime();else{var s=window.open("about:blank");s.location.href=w+e.result.data.url+"?time="+(new Date).getTime()}}(n):C.show(t,function(){k.hide(t)}),y[e]&&y[e](n)):C.show(t,function(){k.hide(t)})},a);case 106:case 107:S.showStatus=!1,C.show(t,function(){k.hide(t)});break;case 108:case 109:case 110:S.showStatus=!1;break;case 113:return S.status=!0,void B.show(n.result.status.msg,function(){S.getData(t)});case 112:case 114:S.showStatus=!0;break;default:S.showStatus=!1}S.captchaHide(),B.show(n.result.status.msg)}},error:function(t){}})}},C={getStatus:function(t){for(var e=!1,n=s[t].content.question,a=0;a已提交':1==s[t].survey.others.result_show&&n&&(this.init(t),e&&e())},init:function(t){if(!document.querySelector("#sina_survey_result_js_"+t)){var e=document.getElementById("sina_survey_result_css"),s=document.createElement("script"),n=null;t&&(window.sina_survey_config&&(n=window.sina_survey_config.resultCss),n&&!e&&s.setAttribute("data-css",n.toString()),s.setAttribute("data-parent",v[t]),s.id="sina_survey_result_js_"+t,s.type="text/javascript",s.src=w+c+t+".js?v="+(new Date).getTime(),p[t]?p[t].appendChild(s):h.parentNode.insertBefore(s,h),s.onload=s.onreadystatechange=function(){this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||window.sina_survey_config&&window.sina_survey_config.setPercent&&window.sina_survey_config.setPercent(t)})}}},S={init:function(t){this.surveyId=t,this.captchaToken="",this.captchaImg="",this.value="",this.height=this.height||"",this.status=!0,this.showStatus=!1,this.timer=null,this.getData(t)},getData:function(t){var e=this;m.jsonp({url:w+r+t,success:function(s){0==s.result.status.code&&(e.captchaImg=s.result.data.img,e.captchaToken=s.result.data.captcha_token,e.captchaTokenValue=s.result.data.value,e.cBody(t))}})},captchaShow:function(){var t=this;if(this.box){function e(){window.sina_survey_box_mask.style.display="block",t.box.style.display="block"}"pc"!=f?this.setStyle("",function(){e()}):e()}},captchaHide:function(){this.box&&(window.sina_survey_box_mask.style.display="none",this.box.style.display="none")},cBody:function(t){var e=document.createElement("div");e.className="survey_captcha_box clearfix",e.style.display="block",e.innerHTML='验证码
取消确定
',this.box?this.box.innerHTML=e.innerHTML:(this.box=e,document.body.appendChild(e)),this.addEvent(e,t),this.captchaShow()},addEvent:function(t,e){var s=this;if("pc"!=f){var n=this.box.getElementsByTagName("input")[0];n.onfocus=function(){s.setStyle("focus")},n.onblur=function(){s.setStyle("blur")}}this.box.ontouchmove=function(t){t.preventDefault()},t.onclick=function(t){if("survey_captcha_cancel"==t.target.className&&s.captchaHide(),"survey_captcha_ok"==t.target.className){if(!s.status)return;s.status=!1;var n=setTimeout(function(){s.status=!0,clearTimeout(n)},1500),a=m.getByClass(document,"survey_captcha_code_"+s.surveyId)[0].value;""!=m.removeSpace(a)?(s.value=a,N.postForm(s.surveyId)):(B.show("请输入验证码!"),s.status=!0)}"survey_captcha_img"==t.target.className&&s.getData(e)}},setStyle:function(t,e){if("m"==f||"pc"==f){var s=this.height||this.box.clientHeight;return s&&(this.height=s),this.box.style.position="fixed",this.box.style.top="50%",this.box.style.marginTop="-"+s/2+"px",void(e&&e())}var n=this,a=navigator.userAgent.toLowerCase(),i="ios";t&&"blur"==t?(clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(e),clearTimeout(n.timer)},500)):(-1!=a.indexOf("android")&&(i="android"),"ios"==i?n.setTop(e):"android"==i&&(clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(e),clearTimeout(n.timer)},500)))},setTop:function(t){if(window.sina_survey_config&&window.sina_survey_config.setTop)window.sina_survey_config.setTop(this.box,e);else{var s=this.height||this.box.clientHeight;s&&(this.height=s),I(this.box,s)}t&&t()}},B={init:function(){this.height=this.height||"",this.timer=null,this.cBody()},cBody:function(){if(!document.getElementById("survey_tip_box")){var t=document.createElement("div"),e=document.createElement("div");t.id="survey_captcha_box_mask",t.className="survey_captcha_box_mask",e.id="survey_tip_box",e.className="survey_tip_box",e.innerHTML='提示
确定
',window.sina_survey_box_mask=t,document.body.appendChild(t),document.body.appendChild(e),m.addEvent(e,"touchmove",function(t){t.preventDefault()}),m.addEvent(t,"touchmove",function(t){t.preventDefault()}),m.addEvent(t,"click",function(t){t.preventDefault()})}},show:function(t,e,s){if(s&&"toast"==s){var n=document.querySelector(".survey_toast_box");return n||((n=document.createElement("div")).className="survey_toast_box",n.innerHTML=t,document.body.appendChild(n)),n.style.display="block",window.sina_survey_config.setTop&&window.sina_survey_config.setTop(n),void setTimeout(function(){n.style.opacity=0,setTimeout(function(){n.style.display="none",n.style.opacity=1},1e3)},1e3)}var a=document.getElementById("survey_captcha_box_mask"),i=document.getElementById("survey_tip_box");i.getElementsByTagName("p")[0].innerHTML=t,a.style.display="block","pc"!=f?this.height?this.setStyle(function(){i.style.display="block"}):(i.style.display="block",this.setStyle()):i.style.display="block",m.getByClass(i,"survey_tip_btn")[0].onclick=function(){S.showStatus&&S.captchaShow(),S.box&&"block"==S.box.style.display||S.showStatus||(a.style.display="none"),i.style.display="none",e&&e()}},highLight:function(){if(3==_.getAttribute("data-type")?_.getElementsByTagName("textarea")[0].focus():m.addClass(_.getElementsByTagName("ul")[0],"tip"),"m"==f){var t=m.getPos(_).top;window.scrollTo(0,t)}},setStyle:function(t){if("m"==f||"pc"==f){var e=document.getElementById("survey_tip_box"),s=this.height||e.clientHeight;return s&&(this.height=s),e.style.position="fixed",e.style.top="50%",e.style.marginTop="-"+s/2+"px",void(t&&t())}var n=this,a="ios",i=0;-1!=navigator.userAgent.toLowerCase().indexOf("android")&&(a="android"),"ios"==a?i=300:"android"==a&&(i=500),clearTimeout(this.timer),this.timer=setTimeout(function(){n.setTop(t),clearTimeout(n.timer)},i)},setTop:function(t){var s=document.getElementById("survey_tip_box");if(window.sina_survey_config&&window.sina_survey_config.setTop)window.sina_survey_config.setTop(s,e);else{var n=this.height||s.clientHeight;n&&(this.height=n),I(s,n)}t&&t()}},I=function(t,e){var s=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientHeight||document.body.clientHeight,a=Math.floor((n-e)/2)+s;t.style.position="absolute",t.style.marginTop=0,t.style.top=a+"px"};T(e)}();