123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <div class="modify_user_dialog">
- <div class="tip">
- 短信到达需要1~2分钟,若长时间未收到请点击重新发送!
- </div>
- <div id="J_mobileWrap" class="content">
- <div class="err J_errbox"></div>
- <div class="td1"><span class="asterisk"></span> 手机号码:</div>
- <div class="td2">
- <input type="text" id="mobile" data-original="{{ $mobile }}" @if(!auth('web-company')->user()->mobile_audit) value="{{ $mobile }}" @endif class="input_245_34" name="mobile" placeholder="请输入手机号码">
- <input type="hidden" name="audit" id="audit" value="{{ $mobile_audit }}">
- </div>
- <div class="clear"></div>
- <div class="td1"><span class="asterisk"></span> 验证码:</div>
- <div class="td2">
- <div class="code">
- <input type="text" class="" name="verifycode">
- </div>
- <div class="codebtn"><input type="button" id="J_mobileVerifyCode" class="btn_verficode J_hoverbut" value="获取验证码"></div>
- <div class="clear"></div>
- </div>
- <div class="clear"></div>
- </div>
- </div>
- <div id="popup-captcha"></div>
- <input type="hidden" id="btnCheck" />
- <script>
- $(function () {
- var timer,ountdownVal = 60;
- $("#J_mobileVerifyCode").click(function () {
- var mobile = $("#mobile").val();
- if(mobile==''|| mobile==null){
- disapperTooltip("remind", '手机号码不能为空!');
- }else{
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- type: "POST",
- url: "{{ route('verifyCode') }}",
- data: {
- mobile:mobile,
- id:"{{ auth('web-company')->user()->id }}"
- },
- dataType: "json",
- success: function(result){
- if(result.status) {
- disapperTooltip('success','验证码发送成功!');
- timer=setInterval(ountdown,1000);
- } else {
- disapperTooltip('remind',result.msg);
- }
- },
- error: function (errorData) {
- if(errorData.status==400) {//业务错误
- disapperTooltip("remind", errorData.responseJSON.message);
- }else if (errorData.status==422) {//验证错误
- $.each(errorData.responseJSON.errors,function (key,val) {
- disapperTooltip("remind", val[0]);
- });
- }
- }
- });
- }
- })
- ountdown = function(){
- ountdownVal--;
- if(ountdownVal<=0){
- clearInterval(timer);
- $('#J_mobileVerifyCode').val('获取验证码').removeClass('disabled').prop('disabled', 0);
- }else{
- $('#J_mobileVerifyCode').val('重新发送'+ ountdownVal +'秒').addClass('disabled').prop('disabled', !0);
- }
- };
- })
- </script>
|