123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- @extends('mobile.module.layouts.content')
- @push('meta')
- @endpush
- @push('css')
- <link href="{{ theme_asset('mobile/css/members.css') }}" rel="stylesheet">
- @endpush
- @push('js')
- <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
- <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
- @endpush
- @section('content')
- <div class="qs-top-nav x2 list_height">
- <div class="n-cell active">已验证手机找回<div class="b-line"></div></div>
- <div class="n-cell" onclick="javascript:location.href='{{route($sub_site.'mobile.password.request.email', ['utype'=>$utype])}}'">已绑定邮箱找回<div class="b-line"></div></div>
- <div class="clear"></div>
- </div>
- <div class="split-block"></div>
- <form id="getPassByMobileForm" action="{{route($sub_site."mobile.password.request")}}" method="post">
- {{csrf_field()}}
- <div class="loging-input-group">
- <div class="group-list mobile">
- <input id="mobile" name="mobile" type="text" class="l-input font14" placeholder="请输入手机号码" autocomplete="off">
- <a href="javascript:;" id="getVerfyCode" class="qs-btn qs-btn-inline qs-btn-medium qs-btn-border-gray font14">获取验证码</a>
- </div>
- <div class="group-list verfy">
- <input id="mobile_vcode" name="mobile_vcode" type="text" class="l-input font14" placeholder="请输入手机验证码" autocomplete="off">
- </div>
- </div>
- <div class="l-tool-bar list_height">
- <div class="for-pwd link_gray6"><a href="{{route("mobile.appeal")}}">账号申诉</a></div>
- <div class="clear"></div>
- </div>
- <input type="hidden" name="utype" value="{{$utype}}" />
- <input type="hidden" name="type" value="mobile" />
- <div id="pop" style="display:none"></div>
- </form>
- <div class="btn-spacing"><a id="nextBtn" href="javascript:;" class="qs-btn qs-btn-blue font18">下一步</a></div>
- @endsection
- @section('script')
- <script type="text/javascript" src="{{ theme_asset('app/js/regular.js') }}"></script>
- <script>
- //发送短信
- var handler = function(captchaObj) {
- captchaObj.appendTo("#popup-captcha");
- captchaObj.onSuccess(function() {
- var result = captchaObj.getValidate();
- toSetSms(result);
- });
- captchaObj.onError(function() {
- });
- $('#getVerfyCode').on('click', function () {
- if ($('#getVerfyCode').hasClass('qs-btn-border-disabled')) {
- return false;
- }
- var mobileValue = $.trim($('input[name=mobile]').val());
- if (mobileValue == '') {
- qsToast({type:2,context: '请输入手机号码'});
- return false;
- }
- if (mobileValue != "" && !regularMobile.test(mobileValue)) {
- qsToast({type:2,context: '手机号码格式不正确'});
- return false;
- }
- if (remoteValid('mobile',mobileValue)) {
- qsToast({type:2,context: '该手机号没有注册账号'});
- return false;
- }
- captchaObj.verify();
- });
- };
- gt_init(handler);
- // 发送手机验证码
- function toSetSms(geet_result) {
- var mobileValue = $.trim($('input[name=mobile]').val());
- function settime(countdown) {
- if (countdown == 0) {
- $('#getVerfyCode').removeClass('qs-btn-border-disabled');
- $('#getVerfyCode').text('获取验证码');
- countdown = 180;
- return;
- } else {
- $('#getVerfyCode').addClass('qs-btn-border-disabled');
- $('#getVerfyCode').text('重新发送' + countdown + '秒');
- countdown--;
- }
- setTimeout(function() {
- settime(countdown)
- },1000)
- }
- $('#getVerfyCode').prop("disabled", !0);
- $('#getVerfyCode').addClass('qs-btn-border-disabled');
- $('#getVerfyCode').text('发送中...');
- geet_result.mobile= mobileValue;
- geet_result.type= "check";
- $.ajax({
- url: "{{route('sms.send')}}",
- type: 'POST',
- dataType: 'json',
- data: geet_result,
- success: function (data) {
- // console.log(data);
- setTimeout(function() {
- qsToast({type:2,context: '验证码已发送,请注意查收'});
- // 开始倒计时
- var countdowns = 180;
- settime(countdowns);
- },1000)
- },
- error: function (errorData) {
- // console.log(errorData);
- var response=$.parseJSON(errorData.response);
- if (errorData.status==422) {//验证错误
- $.each(response.errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- return false;
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: response.message});
- }
- setTimeout(function() {
- $('#getVerfyCode').prop("disabled", 0);
- $('#getVerfyCode').removeClass('qs-btn-border-disabled');
- $('#getVerfyCode').text('获取验证码');
- },1500)
- }
- });
- }
- /**
- * 验证用户名等是否重复
- * @param validType 验证类型
- * @param validValue 值
- * @returns {boolean|*}
- */
- function remoteValid(validType, validValue){
- var result = false;
- $.ajax({
- url: "{{route('register.check', ['utype'=>$utype])}}",
- cache: false,
- async: false,
- type: 'post',
- dataType: 'json',
- data: { type: validType, param: validValue },
- success: function(json) {
- result= true;
- }
- });
- return result;
- }
- /**
- * 下一步
- */
- $('#nextBtn').on('click', function() {
- var mobileValue = $.trim($('input[name=mobile]').val());
- var mobile_vcodeValue = $.trim($('input[name=mobile_vcode]').val());
- if (mobileValue == '') {
- qsToast({type:2,context: '请输入手机号码'});
- return false;
- }
- if (mobileValue != "" && !regularMobile.test(mobileValue)) {
- qsToast({type:2,context: '手机号码格式不正确'});
- return false;
- }
- if (mobile_vcodeValue == '') {
- qsToast({type:2,context: '请输入手机验证码'});
- return false;
- }
- var url = "{{route($sub_site.'mobile.password.request')}}";
- $.ajax({
- url: url,
- type: 'POST',
- dataType: 'json',
- data: $('#getPassByMobileForm').serialize(),
- success: function (data) {
- //qsToast({type:2,context: "注册成功,正在为你跳转.."});
- setTimeout(function () {
- window.location.href = data.data.url;
- },1000)
- },
- error:function(errorData) {
- //$('#btnRegPersonal').text('注册个人会员').removeClass('btn_disabled').prop('disabled', 0);
- var response=$.parseJSON(errorData.response);
- if (errorData.status==422) {//验证错误
- $.each(response.errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- return false;
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: response.message});
- }
- }
- });
- })
- </script>
- @endsection
|