123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- @extends('mobile.module.layouts.content')
- @push('meta')
- @endpush
- @push('css')
- <link rel="stylesheet" href="{{theme_asset('mobile/css/company.css')}}">
- @endpush
- @push('js')
- @endpush
- @section('content')
- <div class="mui-content">
- @if($mobile_audit == 0)
- <div class="split-block-title">手机认证后,您可以用手机号登录和找回密码!</div>
- @else
- <div class="split-block-title font_blue">当前手机已认证,修改手机后您的登录手机号将同步修改</div>
- @endif
- <form action="post" id="logingForm">
- <div class="loging-input-group">
- <div class="group-list mobile">
- <input id="mobile" name="mobile" type="text" class="l-input font14" placeholder="请输入手机号码" autocomplete="off" @if(!$mobile_audit) value="{{ $mobile or '' }}" @endif @if($mobile_audit ==1) mobile="{{ $mobile }}" @endif>
- <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="verifycode" name="verifycode" type="text" class="l-input font14" placeholder="请输入手机验证码" autocomplete="off">
- </div>
- </div>
- <div id="pop" style="display:none"></div>
- <input type="hidden" id="mobileVerify" value="0">
- </form>
- <div class="split-block"></div>
- <div class="btn-spacing">
- <a id="loginBtn" href="javascript:;" class="qs-btn qs-btn-blue font18">提交</a>
- </div>
- </div>
- @endsection
- @section('script')
- <script type="text/javascript">
- var timer,ountdownVal = 180,
- ountdown = function(){
- ountdownVal--;
- if(ountdownVal<=0){
- clearInterval(timer);
- ountdownVal = 180;
- $('#getVerfyCode').html('获取验证码').removeClass('qs-btn-border-disabled').prop('disabled', 0);
- }else{
- $('#getVerfyCode').html('重新发送'+ ountdownVal +'秒').addClass('qs-btn-border-disabled').prop('disabled', !0);
- }
- };
- /**
- * ajax 登录
- */
- function doAjax() {
- $('#pop').hide();
- var mobile = $.trim($('#mobile').val());
- $.ajax({
- url:"{{ route($sub_site.'mobile.firm.com.verify.code') }}",
- type:"POST",
- data:{mobile:mobile,id:"{{ $user->id }}",_token:"{{ csrf_token() }}"},
- success:function(result){
- if(result.status == 1){
- qsToast({type:1,context: result.msg});
- timer=setInterval(ountdown,1000);
- }else{
- qsToast({type:2,context: result.msg});
- }
- },
- error: function (errorData) {
- var response=$.parseJSON(errorData.response);
- if (errorData.status==422) {//验证错误
- // console.log(errorData);return ;
- $.each(response.errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: response.message});
- }
- },
- });
- }
- /**
- * 配置极验
- */
- // $.ajax({
- // url: qscms.root+'?m=Mobile&c=captcha&type=mobile&t=' + (new Date()).getTime(),
- // type: 'get',
- // dataType: 'json',
- // success: function(config) {
- // initGeetest({
- // gt: config.gt,
- // challenge: config.challenge,
- // offline: !config.success
- // }, function(captchaObj) {
- // captchaObj.appendTo("#pop");
- // captchaObj.onSuccess(function() {
- // doAjax();
- // });
- // window.captchaObj = captchaObj
- // });
- // }
- // });
- $('#getVerfyCode').on('click',function(){
- if(ountdownVal<180) return false;
- var mobile = $.trim($('#mobile').val());
- if (mobile == '') {
- qsToast({type:2,context: '请输入手机号'});
- return false;
- }
- if($('#mobile').attr('mobile') == mobile){
- qsToast({type:2,context: '你的手机号已经通过认证!'});
- return false;
- }
- if (eval($('#mobileVerify').val())) {
- window.captchaObj.refresh();
- $('#pop').show();
- } else {
- doAjax();
- }
- });
- /**
- * 登录验证
- */
- $('#loginBtn').on('click', function(e) {
- var mobile = $.trim($('#mobile').val());
- var verifycode = $.trim($('#verifycode').val());
- if (mobile == '') {
- qsToast({type:2,context: '请输入手机号'});
- return false;
- }
- if (verifycode == '') {
- qsToast({type:2,context: '请输入验证码'});
- return false;
- }
- $.ajax({
- url:"{{ route($sub_site.'mobile.firm.com.mobile.auth') }}",
- type:"POST",
- data:{verifycode:verifycode,mobile:mobile,_token:"{{ csrf_token() }}"},
- success:function(result){
- if(result.status == 1){
- qsToast({type:1,context: result.msg});
- setTimeout(function(){
- window.location.href="{{ route($sub_site.'mobile.firm.com.security') }}";
- },2000);
- }else{
- qsToast({type:2,context: result.msg});
- }
- },
- error: function (errorData) {
- var response=$.parseJSON(errorData.response);
- if (errorData.status==422) {//验证错误
- // console.log(errorData);return ;
- $.each(response.errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: response.message});
- }
- },
- });
- });
- </script>
- @endsection
|