$(document).ready(function(){ $("#Main_Form").fromsAuth({type:'NONE'}); $("#Main_Form2").fromsAuth({type:'NONE'}); //============================ // 發送簡訊驗證碼 start //============================ $("#send_sms_bt, .form-cellphone-verifyText").click(function(){ if($(this).closest(".form-cellphone-verifyText").length > 0 && $(this).data("sended") != "0"){ alert("test"); return false; } if($("#Country").val() == ''){ alert(_jsLang.請選擇國別); return false; }; if($("#Cellphone").val() == ''){ alert(_jsLang.請輸入行動電話); return false; }; if($("#send_sms_bt").attr('count') !='0'){ return false; } $.post('/member/ajax/ajax_send_sms_code-p.php', {Country: $("#Country").val(), Cellphone: $("#Cellphone").val()}, function(h){ //console.log(h) if(h == 'OK'){ $("#Country").attr('disabled', true); $("#Cellphone").attr('readonly', true); alert(_jsLang.簡訊已經發送至您的手機了); $("#send_sms_bt").attr('count','600'); timeout(); $("#send_sms_bt").addClass("form-hide") $(".form-cellphone-verify").removeClass("form-hide") } else if(h == 'RET_REPLY'){ alert(_jsLang.請勿重覆發送簡訊請等侯5分鐘); } else if(h == 'RET_OVER'){ alert(_jsLang.手機簡訊發送已上限); } else if(h == 'RET_CELLPHONE_REPLY'){ alert(_jsLang.此手機已經被認證綁定了); } else if(h == 'RET_ERROR_DATABASE'){ alert(_jsLang.資料庫忙線中); } else if(h == 'WRONG_CELLPHONE_FORMAT'){ alert(_jsLang.手機格式錯誤); } }, 'html'); }); function timeout(){ var sec = $("#send_sms_bt").attr('count'), verifyText = $(".form-cellphone-verifyText") var t sec = sec - 1 ; var count_min = 0; var count_sec = 0; count_min = Math.floor(sec/60); count_sec = (Array(2).join('0')+(sec%60)).slice(-2); if( sec != '0'){ verifyText.text(_jsLang.重新發送簡訊+' ('+count_min+':'+count_sec+')'); $("#send_sms_bt").attr('count',sec); t=setTimeout(timeout,1000); }else{ verifyText.text(_jsLang.再傳送一次); verifyText.data("sended", "0") $("#send_sms_bt").attr('count','0'); clearTimeout(t); } } //============================ // 發送簡訊驗證碼 end //============================ //數字驗證碼刷新 $(document).on("click", ".Change_Pic", function(){ $(this).parent(".form-verify-picbox").find(".Checkspan").load('/ajax/ajax_get_check_pic.php',{change:1}) }) //手機版切換登入/註冊 $(document).on("click", ".login-tabs-item, .member-already", function(){ let _this = $(this) target = $("#" + _this.data("target")) if(!_this.hasClass("in-active")){ $(".login-tabs-item.in-active, .login-group").removeClass("in-active") if(_this.hasClass("member-already")){ //將對應頁簽加class $(".login-tabs-item[data-target="+_this.data("target")+"]").addClass("in-active") }else{ _this.addClass("in-active") } target.addClass("in-active") target.find(".Checkspan").load('/ajax/ajax_get_check_pic.php',{change:1}) } }) //============================== // 註冊會員條款顯示 start //============================== let checkOpen = false function checkInfoReverse(){ let rightRange = $(window).width() - $(".signup-check-icon").get(0).getBoundingClientRect().right if(rightRange < 330){ $(".signup-check-info").addClass("reverse") }else{ $(".signup-check-info").removeClass("reverse") } } function outerCloseCheck(){ $(".signup-check-info").removeClass("show") checkOpen = false } $(document).on("mouseenter", ".signup-check-icon", function(){ checkInfoReverse() if($(window).width() > 1024){ $(".signup-check-info").addClass("show") checkOpen = true $(document).one("click", outerCloseCheck) } }).on("mouseleave", ".signup-check-icon", function(){ if($(window).width() > 1024){ $(".signup-check-info").removeClass("show") checkOpen = false } }).on("click", ".signup-check-icon", function(){ if(checkOpen){ checkInfoReverse() $(".signup-check-info").removeClass("show") checkOpen = false }else{ $(".signup-check-info").addClass("show") $(document).one("click", outerCloseCheck) checkOpen = true } }) //手機關閉 $(document).on("click", ".signup-check-close", function(){ $(".signup-check-info").removeClass("show") checkOpen = false }) //============================== // 註冊會員條款顯示 end //============================== });