portal html css js resource

cmp-settled-reback.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //找回企业账号
  2. $(function() {
  3. var companyNameVal, companyEmailVal, companyPaswVal;
  4. var setname = false;
  5. var setpass = false;
  6. var setemail = false;
  7. var ifxuanze = true;
  8. var temp = [];
  9. /*校验提交按钮显示状态*/
  10. $('#containerCon').on('keyup', "#companyName,.companyEmail,#companyPasw", function() {
  11. if($("#companyName").val() == "" || $("#companyEmail").val() == "" || $("#companyPasw").val() == "") {
  12. $("#znameSubmit").attr("disabled", true);
  13. } else {
  14. $("#znameSubmit").attr("disabled", false);
  15. }
  16. });
  17. /*校验企业名称*/
  18. $('#companyName').on('blur', function() {
  19. checkName();
  20. });
  21. /*校验企业邮箱*/
  22. $('.companyEmail').on('blur', function() {
  23. checkEmail();
  24. });
  25. /*校验登录密码*/
  26. $('#companyPasw').on('blur', function() {
  27. checkPasw();
  28. });
  29. /*校验单选框*/
  30. $(".cmpAgree").on("click", function() {
  31. if($(this).hasClass("ifxuanze")) {
  32. $(this).removeClass("ifxuanze");
  33. $(this).attr("src", "images/business_button_xuanze_nor.png")
  34. ifxuanze = false;
  35. } else {
  36. $(this).addClass("ifxuanze");
  37. $(this).attr("src", "images/business_button_xuanze_hig.png");
  38. ifxuanze = true;
  39. }
  40. })
  41. /*找回企业账号提交*/
  42. $('#znameSubmit').on('click', function() {
  43. var fileoneVal = $("#fileone1").attr("data-id");
  44. var filetwoVal = $("#fileone2").attr("data-id");
  45. if(ifxuanze == false) {
  46. $.MsgBox.Alert('提示', '请确认后勾选此选项')
  47. } else if(fileoneVal == "") {
  48. $.MsgBox.Alert('提示', '请上传《企业法人营业执照》');
  49. } else if(filetwoVal == "") {
  50. $.MsgBox.Alert('提示', '请上传加盖公章的《入驻科袖授权证明》');
  51. } else {
  52. temp.push(fileoneVal);
  53. temp.push(filetwoVal);
  54. mailRegistration(temp);
  55. }
  56. });
  57. function checkName() {
  58. companyNameVal = $("#companyName").val();
  59. if(companyNameVal.length == "") {
  60. $(".msgReg1 span").text("请输入您的企业名称");
  61. } else {
  62. $.ajax("/ajax/isOrgUser", {
  63. data: {
  64. "orgName": companyNameVal
  65. },
  66. type: "GET",
  67. dataType: 'json',
  68. async: false,
  69. success: function($data) {
  70. console.log($data)
  71. if($data.success && $data.data == true) {
  72. $(".msgReg1 span").html('该企业名称还未注册企业账号,<a class="cmpColor" href="cmp-settled-reg.html">请先注册</a>');
  73. } else if(!$data.success && !$data.data) {
  74. if($data.code == 2) {
  75. $(".msgReg1 span").text("");
  76. setname = true;
  77. } else if($data.code == 3) {
  78. $(".msgReg1 span").text("该企业已成为【科袖认证企业】,若有问题请联系客服 010-62343359");
  79. } else if($data.code == 4) {
  80. $(".msgReg1 span").html('该企业正在进行认证审核,暂时无法找回账户');
  81. }
  82. }
  83. },
  84. error: function() {
  85. $.MsgBox.Alert('提示', '服务器请求失败')
  86. },
  87. });
  88. }
  89. }
  90. function checkEmail() {
  91. companyEmailVal = $(".companyEmail").val();
  92. var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
  93. if(gunf.test(companyEmailVal.trim())) {
  94. $.ajax("/ajax/isRegOrg", {
  95. data: {
  96. "email": companyEmailVal
  97. },
  98. type: "GET",
  99. dataType: 'json',
  100. async: false,
  101. success: function($data) {
  102. console.log($data)
  103. if($data.data == false) {
  104. $(".msgReg2 span").text("该邮箱已注册企业账户,请使用其他邮箱");
  105. } else {
  106. $(".msgReg2 span").text("");
  107. setemail = true;
  108. }
  109. },
  110. error: function() {
  111. $.MsgBox.Alert('提示', '服务器请求失败')
  112. },
  113. });
  114. } else {
  115. $(".msgReg2 span").text("请输入正确是邮箱地址");
  116. }
  117. }
  118. function checkPasw() {
  119. companyPaswVal = $("#companyPasw").val();
  120. if(companyPaswVal.length < 6) {
  121. $(".msgReg3 span").text("密码由6-24个字符组成,区分大小写");
  122. } else {
  123. $(".msgReg3 span").text("");
  124. setpass = true;
  125. }
  126. }
  127. function mailRegistration(temp) {
  128. if(setname && setpass && setemail) {
  129. $.ajax("/ajax/orgRetrieve", {
  130. data: {
  131. "Name": companyNameVal,
  132. "Email": companyEmailVal,
  133. "passwd": companyPaswVal,
  134. "fns": temp,
  135. },
  136. type: "POST",
  137. dataType: 'json',
  138. async: false,
  139. traditional: true, //传数组必须加这个
  140. success: function($data) {
  141. console.log($data)
  142. if($data.success) {
  143. location.href = "cmp-settled-rebackOk.html";
  144. }
  145. },
  146. error: function() {
  147. $.MsgBox.Alert('提示', '服务器请求失败');
  148. }
  149. });
  150. } else {
  151. checkName();
  152. checkEmail();
  153. checkPasw();
  154. }
  155. }
  156. })