新媒体-合同签约,CA签约

examine.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. var qs = parseQueryString(window.location.href),type,user_id,reason;
  2. var request = '';
  3. $().ready(function(){
  4. if(qs.user_id){user_id = qs.user_id}
  5. if(qs.reason){reason = decodeURI(qs.reason)}
  6. if(qs.type){
  7. type = qs.type;
  8. }
  9. if(type == 2){
  10. //审核回执--失败
  11. $('.examineIng').hide();
  12. $(".receipt").show();
  13. if(reason == ''){
  14. reason = '审核未通过'
  15. }
  16. $(".receipt .hint").html(reason);
  17. }
  18. if(!getCookie('user_id') || getCookie('user_id') != user_id){
  19. window.location.href="index.html"
  20. }
  21. })
  22. function goPergectInfo(){
  23. //回填写信息页面
  24. window.location.href = 'perfectInfo.html?user_id=' + user_id
  25. }
  26. //获取地址栏参数
  27. function parseQueryString(url) {
  28. var urlObj = {};
  29. var reg = /([^?=&]+)=([^?=&]+)/g;
  30. url.replace(reg, function($0, $1, $2) {
  31. urlObj[$1] = decodeURIComponent($2);
  32. })
  33. return urlObj;
  34. }
  35. // 展示错误提示信息
  36. function showMsg(msg) {
  37. var msgBox = document.getElementsByClassName('alert-info')[0];
  38. msgBox.getElementsByTagName("p")[0].innerHTML=msg;
  39. msgBox.style.display="block";
  40. setTimeout(function() {
  41. msgBox.style.display="none";
  42. }, 2000);
  43. }
  44. //取Cookie的值
  45. function getCookie(name) {
  46. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  47. if (arr = document.cookie.match(reg)){
  48. return arr[2];
  49. }else{
  50. return false
  51. }
  52. }
  53. //写入到Cookie
  54. //name:cookie名称 value:cookie值
  55. function setCookie(name,value){
  56. var exp = new Date();
  57. exp.setTime(exp.getTime() + 12 * 60 * 60000);//过期时间 12小时
  58. // exp.setTime(exp.getTime() + 60 * 10000);//过期时间 10分钟
  59. document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
  60. }