Ei kuvausta

status.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var params=parseQueryString(window.location.href)
  2. $().ready(function(){
  3. clickRecord("openLink","链接打开")//链接打开
  4. // 审核中
  5. if(params.status==1) {
  6. $(".form").hide();
  7. $(".auditng").show();
  8. // 审核成功
  9. }else if(params.status==2) {
  10. $(".form").hide();
  11. $(".success").show();
  12. }else {
  13. $(".form").hide();
  14. $(".error").show();
  15. }
  16. })
  17. $(".button1").on("click",function(){
  18. clickRecord("applyAgainClick","再次申请点击")//再次申请
  19. if(params.typeId) {
  20. window.location.href="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+1+"&typeId="+params.typeId
  21. }else {
  22. window.location.href="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+1
  23. }
  24. })
  25. $(".button2").on("click",function(){
  26. clickRecord("applyAgainClick","再次申请点击")//再次申请
  27. if(params.typeId) {
  28. window.location.href="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+1+"&hasCode=1"+"&typeId="+params.typeId
  29. }else {
  30. window.location.href="index.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+1+"&hasCode=1"
  31. }
  32. })
  33. $(".top img").on("click",function(){
  34. // hasCode标识点击下一步不提交信息
  35. if(params.typeId) {
  36. window.location.href="identity.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+params.hasError+"&code="+params.code+"&hasCode=1"+"&typeId="+params.typeId
  37. }else {
  38. window.location.href="identity.html?source="+params.source+"&phone="+params.phone+"&uid="+params.uid+"&token="+params.token+"&hasError="+params.hasError+"&code="+params.code+"&hasCode=1"
  39. }
  40. })
  41. //获取地址栏参数
  42. function parseQueryString(url) {
  43. var urlObj = {};
  44. var reg = /([^?=&]+)=([^?=&]+)/g;
  45. url.replace(reg, function($0, $1, $2) {
  46. urlObj[$1] = decodeURIComponent($2);
  47. })
  48. return urlObj;
  49. }
  50. // 展示错误提示信息
  51. function showMsg(msg) {
  52. $(".alert-info").show();
  53. $(".alert-info p").text(msg);
  54. setTimeout(function() {
  55. $(".alert-info").hide();
  56. }, 1000);
  57. }
  58. // 埋点
  59. function clickRecord(eventId,eventName){
  60. $.ajax({
  61. url:"/user/clickRecord",
  62. type:"post",
  63. dataType:"json",
  64. data:{
  65. event_id:eventId,
  66. event_name:eventName,
  67. channel_id:params.source
  68. },
  69. success:function(res) {
  70. }
  71. })
  72. }