countdownlong.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. $(function () {
  2. settime();
  3. });
  4. //验证码类型
  5. var sms_type;
  6. var smstype;
  7. var countdown=100;
  8. $("#countdown").css("backgroundColor","#fff");
  9. var indexRoute = $("#indexRoute").val();
  10. function settime() {
  11. if (countdown == 0) {
  12. $("#btn").hide();
  13. window.location.href=indexRoute;
  14. } else {
  15. countdown--;
  16. if(document.getElementById('countdown')){
  17. document.getElementById('countdown').innerHTML = countdown;
  18. }
  19. }
  20. setTimeout(function() {
  21. settime();
  22. },1000)
  23. }
  24. //注册获取验证码
  25. $("#getverificode").click(function () {
  26. var is_reg = $("#is_reg").val();
  27. var is_status = $("#is_status").val();
  28. var mobileValue = $.trim($('#mobile').val());
  29. if (mobileValue == '') {
  30. dialogDiv('请输入手机号码','确定','Display');
  31. $('#mobile').focus();
  32. return false;
  33. };
  34. if (mobileValue != "" && !regularMobile.test(mobileValue)) {
  35. dialogDiv('请输入正确的手机号码','确定','Display');
  36. $('#mobile').focus();
  37. return false;
  38. }
  39. if(is_status==1){
  40. if(is_reg==0)
  41. {
  42. $.ajax({
  43. headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
  44. url: $("#form3").attr('action'),
  45. type: 'POST',
  46. dataType: 'json',
  47. data: {
  48. mobile:mobileValue,
  49. type:2,
  50. },
  51. success: function (result) {
  52. // 开始倒计时
  53. var countdownZZ = 60;
  54. function settime() {
  55. if (countdownZZ == 0) {
  56. $('#getverificode').prop("disabled", 0);
  57. $('#getverificode').removeClass('btn_disabled');
  58. $('#getverificode').html('获取验证码');
  59. $("#is_status").val(1);
  60. countdownZZ = 100;
  61. return;
  62. } else {
  63. $("#is_status").val(0);
  64. $('#getverificode').prop("disabled", !0);
  65. $('#getverificode').addClass('btn_disabled');
  66. $("#getverificode").css('font-size','18px')
  67. $('#getverificode').html('重新发送' + countdownZZ + '秒');
  68. countdownZZ--;
  69. }
  70. setTimeout(function() {
  71. settime()
  72. },1000)
  73. }
  74. settime();
  75. },
  76. error: function (errorData) {
  77. if (errorData.status==422) {//验证错误
  78. $.each(JSON.parse(errorData.responseText).errors,function (key,val) {
  79. dialogDiv(val[0],'确定','Display');
  80. return false;
  81. });
  82. }
  83. else if(errorData.status==400) {//业务错误
  84. dialogDiv(JSON.parse(errorData.responseText).message,'确定','Display');
  85. }
  86. }
  87. })
  88. }
  89. }
  90. });
  91. $('#btnsubmit').click(function() {
  92. var reg_mobile = $.trim($("#mobile").val());
  93. var reg_verifiy = $.trim($("#verifiy").val());
  94. var id_card = $.trim($("#id_card").val());
  95. var name = $.trim($("#name").val());
  96. var nation = $.trim($("#nation").val());
  97. var sex = $.trim($("#sex").val());
  98. if(reg_mobile=="")
  99. {
  100. dialogDiv('手机号不能空','确定','Display');
  101. $("#mobile").focus();
  102. return false;
  103. }
  104. if(reg_verifiy == "")
  105. {
  106. dialogDiv('验证码不能空','确定','Display');
  107. $("#verifiy").focus();
  108. return false;
  109. }
  110. $.ajax({
  111. headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
  112. url: $("#form3").attr('action_to'),
  113. type: 'POST',
  114. dataType: 'json',
  115. data: {
  116. mobile:reg_mobile,
  117. mobile_code:reg_verifiy,
  118. id_card:id_card,
  119. name:name,
  120. nation:nation,
  121. sex:sex,
  122. },
  123. success: function (result) {
  124. location.href=result.data.redirect_url;
  125. },
  126. error: function (errorData) {
  127. if (errorData.status==422) {//验证错误
  128. $.each(JSON.parse(errorData.responseText).errors,function (key,val) {
  129. dialogDiv(val[0],'确定','Display');
  130. return false;
  131. });
  132. }
  133. else if(errorData.status==400) {//业务错误
  134. dialogDiv(JSON.parse(errorData.responseText).message,'确定','Display');
  135. }
  136. }
  137. })
  138. });
  139. function reg() {
  140. window.location.href= root + "?m=Aio&c=Members&a=createresume";
  141. return false;
  142. }
  143. function Display() {
  144. $("#MyDiv").remove();
  145. $("#fade").remove();
  146. }
  147. function savelocation() {
  148. window.location.href = qscms.root +"?m=Aio&c=Job&a=joblist&flag=1"
  149. }
  150. function toback() {
  151. window.history.go(-1);
  152. }
  153. function refresh() {
  154. window.location.reload();
  155. }
  156. /*底部导航选中事件 by zmy 2018 02 06*/
  157. window.onload=function(){
  158. urlinfo=window.location.href; //获取当前页面的url
  159. len=urlinfo.length;//获取url的长度
  160. offset=urlinfo.indexOf("?");//设置参数字符串开始的位置
  161. newsidinfo_first=urlinfo.substr(offset,len)//取出参数字符串
  162. newsidinfo = newsidinfo_first.replace('?','')
  163. newsidinfoarray = newsidinfo.split("&");//以&分隔形成参数数组
  164. var newsid;
  165. for(var i=0; i<newsidinfoarray.length; i++){
  166. if(newsidinfoarray[i].substring(0,2)=='c='){
  167. newsids=newsidinfoarray[i].split("=");//对获得的参数字符串按照“=”进行分割
  168. newsid=newsids[1];//得到参数值
  169. }
  170. }
  171. if((newsid=="Job")||(newsid=="job")){
  172. if(newsidinfo.indexOf("flag")!=-1){
  173. $(".foot-child").css('background','none');
  174. $('#zyjs').css('background','url(/Application/Aio/View/default/public/images/footer/footer-zyjs-hover.png) no-repeat');
  175. }else if(newsidinfo.indexOf("advice")!=-1){
  176. $(".foot-child").css('background','none');
  177. } else{
  178. $(".foot-child").css('background','none');
  179. $('#zxzw').css('background','url(/Application/Aio/View/default/public/images/footer/footer-zxzw-hover.png) no-repeat');
  180. }
  181. }else if((newsid=="Company")||(newsid=="company")){
  182. $(".foot-child").css('background','none');
  183. $('#mqzp').css('background','url(/Application/Aio/View/default/public/images/footer/footer-mqzp-hover.png) no-repeat');
  184. }else if((newsid=="News")||(newsid=="news")){
  185. $(".foot-child").css('background','none');
  186. $('#gkxx').css('background','url(/Application/Aio/View/default/public/images/footer/footer-gkxx-hover.png) no-repeat');
  187. }else if((newsid=="Qianren")||(newsid=="qianren")){
  188. $(".foot-child").css('background','none');
  189. $('#sbcx').css('background','url(/Application/Aio/View/default/public/images/footer/footer-sbcx-hover.png) no-repeat');
  190. }else if(newsid=="members"){
  191. if(newsidinfo.indexOf("index")!=-1){
  192. $(".foot-child").css('background','none');
  193. }else if(newsidinfo.indexOf("login")!=-1){
  194. $(".foot-child").css('background','none');
  195. }else if(newsidinfo.indexOf("personal")!=-1){
  196. $(".foot-child").css('background','none');
  197. }else if(newsidinfo.indexOf("register")!=-1){
  198. $(".foot-child").css('background','none');
  199. }else{
  200. $(".foot-child").css('background','none');
  201. $('#jldy').css('background','url(/Application/Aio/View/default/public/images/footer/footer-jldy-hover.png) no-repeat');
  202. }
  203. }
  204. }