var qs = parseQueryString(window.location.href),type,user_id,reason; var request = ''; $().ready(function(){ if(qs.user_id){user_id = qs.user_id} if(qs.reason){reason = decodeURI(qs.reason)} if(qs.type){ type = qs.type; } if(type == 2){ //审核回执--失败 $('.examineIng').hide(); $(".receipt").show(); if(reason == ''){ reason = '审核未通过' } $(".receipt .hint").html(reason); } if(!getCookie('user_id') || getCookie('user_id') != user_id){ window.location.href="index.html" } }) function goPergectInfo(){ //回填写信息页面 window.location.href = 'perfectInfo.html?user_id=' + user_id } //获取地址栏参数 function parseQueryString(url) { var urlObj = {}; var reg = /([^?=&]+)=([^?=&]+)/g; url.replace(reg, function($0, $1, $2) { urlObj[$1] = decodeURIComponent($2); }) return urlObj; } // 展示错误提示信息 function showMsg(msg) { var msgBox = document.getElementsByClassName('alert-info')[0]; msgBox.getElementsByTagName("p")[0].innerHTML=msg; msgBox.style.display="block"; setTimeout(function() { msgBox.style.display="none"; }, 2000); } //取Cookie的值 function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)){ return arr[2]; }else{ return false } } //写入到Cookie //name:cookie名称 value:cookie值 function setCookie(name,value){ var exp = new Date(); exp.setTime(exp.getTime() + 12 * 60 * 60000);//过期时间 12小时 // exp.setTime(exp.getTime() + 60 * 10000);//过期时间 10分钟 document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); }