123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- @extends('mobile.module.layouts.content')
- @push('meta')
- <meta name="csrf-token" content="{{ csrf_token() }}">
- @endpush
- @push('css')
- <link href="{{ theme_asset('mobile/css/company.css') }}" rel="stylesheet">
- @endpush
- @section('content')
- <div class="mui-content">
- @if(auth('web-member')->user()->mobile_audit)
- <div class="split-block-title font_blue">当前手机已认证,修改手机后您的登录手机号将同步修改</div>
- @else
- <div class="split-block-title">手机认证后,您可以用手机号登录和找回密码!</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="请输入手机号码" maxlength="11" autocomplete="off" @if(!auth('web-member')->user()->mobile_audit) value="{{ auth('web-member')->user()->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>
- </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<=1){
- 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);
- }
- };
- $('#getVerfyCode').on('click',function(){
- if(ountdownVal<180) return false;
- var mobile = $.trim($('#mobile').val());
- if(mobile==''|| mobile==null){
- qsToast({type:2,context: '请输入手机号'});
- return false;
- }else{
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- type: "POST",
- url: "{{ route($sub_site.'mobile.person.mobileAudit') }}",
- data: {
- mobile:mobile,
- id:"{{ auth('web-member')->user()->id }}",
- },
- dataType: "json",
- success: function(result){
- qsToast({type:1,context: '验证码发送成功'});
- timer=setInterval(ountdown,1000);
- },
- error: function (errorData) {
- if (errorData.status==422) {//验证错误
- $.each(JSON.parse(errorData.response).errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- return false;
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: JSON.parse(errorData.response).message});
- return false;
- }
- },
- });
- }
- });
- /**
- * 提交验证
- */
- $('#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({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- type: "POST",
- url: "{{ route($sub_site.'mobile.person.mobileAuditCode') }}",
- data: {
- mobile:mobile,
- verifycode:verifycode,
- id:"{{ auth('web-member')->user()->id }}",
- },
- dataType: "json",
- success: function(result){
- if(result.data){
- qsToast({type:1,context: '验证手机号增加'+result.data+'积分'});
- }else{
- qsToast({type:1,context: '手机认证成功'});
- }
- window.location.href="{{ route($sub_site.'mobile.person.memberSafe') }}";
- },
- error: function (errorData) {
- if (errorData.status==422) {//验证错误
- $.each(JSON.parse(errorData.response).errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- return false;
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: JSON.parse(errorData.response).message});
- return false;
- }
- }
- });
- });
- </script>
- @endsection
|