portal html css js resource

cmp-setAuth.js 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //企业认证
  2. $(function() {
  3. var orgid = $.cookie('orgId');
  4. var auth = GetQueryString("auth");
  5. var temp = [];
  6. /*查询企业认证状态*/
  7. authStatus();
  8. $("#authsubmet").on("click", function() {
  9. var fileoneVal = $("#fileone1").attr("data-id");
  10. var filetwoVal = $("#fileone2").attr("data-id");
  11. if(fileoneVal == "") {
  12. $.MsgBox.Alert('提示', '请上传《企业法人营业执照》');
  13. } else if(filetwoVal == "") {
  14. $.MsgBox.Alert('提示', '请上传加盖公章的《入驻科袖授权证明》');
  15. } else {
  16. temp.push(fileoneVal);
  17. temp.push(filetwoVal);
  18. authsubmetFun(temp);
  19. }
  20. })
  21. function authStatus() {
  22. $.ajax("/ajax/org/authStatus", {
  23. data: {
  24. "id": orgid
  25. },
  26. type: "GET",
  27. dataType: 'json',
  28. async: false,
  29. success: function($data) {
  30. console.log($data)
  31. if($data.success) {
  32. if($data.data == -1) { //认证失败
  33. $(".authsb").removeClass("displayNone");
  34. $("#authsb").on("click", function() {
  35. $(this).parents(".authsb").addClass("displayNone");
  36. $(".authup").removeClass("displayNone");
  37. })
  38. } else if($data.data == 0) { //未认证
  39. if(auth==1){
  40. $(".authup").removeClass("displayNone");
  41. }else{
  42. $(".authks").removeClass("displayNone");
  43. $("#authks").on("click", function() {
  44. $(this).parents(".authks").addClass("displayNone");
  45. $(".authup").removeClass("displayNone");
  46. })
  47. }
  48. } else if($data.data == 1) { //待认证
  49. $(".authtj").removeClass("displayNone");
  50. } else if($data.data == 2) { //认证中
  51. $(".authz").removeClass("displayNone");
  52. } else if($data.data == 3) { //已认证
  53. $(".authok").removeClass("displayNone");
  54. } else {
  55. $.MsgBox.Alert('提示', '不存在该企业或该企业认证状态为空');
  56. }
  57. }
  58. },
  59. error: function() {
  60. $.MsgBox.Alert('提示', '服务器请求失败');
  61. },
  62. });
  63. }
  64. function authsubmetFun(temp) {
  65. console.log(temp)
  66. console.log(orgid)
  67. $.ajax("/ajax/authApply/org", {
  68. data: {
  69. "professorId": orgid,
  70. "fns": temp
  71. },
  72. type: "POST",
  73. dataType: 'json',
  74. async: false,
  75. traditional: true, //传数组必须加这个
  76. success: function($data) {
  77. console.log($data)
  78. if($data.success) {
  79. //location.reload(true);
  80. location.href = "cmp-setAuth.html";
  81. }
  82. },
  83. error: function() {
  84. $.MsgBox.Alert('提示', '服务器请求失败');
  85. },
  86. });
  87. }
  88. })