| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- @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>
- <script src="https://captcha.253.com/TCaptcha.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.login.mobile')}}'">手机动态码登录<div class="b-line"></div></div>
- <div class="clear"></div>
- </div>
- <div class="split-block"></div>
- <form method="post" id="form_account" action="{{route($sub_site.'mobile.login')}}">
- <input type="hidden" name="ticket" id="ticket">
- <input type="hidden" name="bizState" id="bizState">
- <input type="hidden" name="randstr" id="randstr">
- {{ csrf_field() }}
- <div class="loging-input-group">
- <div class="group-list">
- <div class="g-close"></div>
- <input id="account" name="account" type="text" class="l-input j-l-input font14" placeholder="请输入用户名/手机/邮箱" autocomplete="off">
- </div>
- <div class="group-list pwd">
- <div class="g-close"></div>
- <input id="password" name="password" type="text" onfocus="this.type='password'" class="l-input j-l-input font14" placeholder="请输入密码" autocomplete="off">
- </div>
- </div>
- <div class="l-tool-bar list_height">
- <div class="auto-loging">
- <div class="for-checkbox active" id="for-checkbox">下次自动登录</div>
- </div>
- <div class="for-pwd link_gray6"><a href="{{route($sub_site.'mobile.password.request')}}">忘记密码</a></div>
- <div class="clear"></div>
- </div>
- <div id="pop" style="display:none"></div>
- <input type="hidden" name="autoLogin" id="autoLogin" value="1" >
- </form>
- <div class="btn-spacing login-account"><a id="loginBtn" href="javascript:;" class="qs-btn qs-btn-blue font18">登录</a></div>
- <div class="qs-center login-btn-group">
- <div class="login-btn-group-box">
- <a url="{{route($sub_site.'mobile.register.index')}}" class="qs-btn qs-btn-medium qs-btn-border-orange font14 register_user" url="{{route($sub_site.'register.index')}}" href="javascript:;" style="width: 2.45rem;">立即注册</a>
- <a href="{{route($sub_site.'mobile.login.company')}}" class="qs-btn qs-btn-medium qs-btn-border-blue font14" style="width: 2.45rem;margin-left: .5rem">企业用户登录</a>
- <div class="clear"></div>
- </div>
- </div>
- <div class="qs-center coop-title">使用合作账号登录/注册</div>
- <div class="coop-group qs-center" >
- <div class="coop-cell" id="other-thirdlogin">
- </div>
- <div class="clear"></div>
- </div>
- @endsection
- @section('script')
- @include('mobile.module.widgets.thirdlogin')
- <script>
- $(function () {
- $(".register_user").click(function(){
- var url=$(this).attr("url")
- $.getJSON("{{route($sub_site.'register.status')}}", function (result) {
- if (result.status == 0) {
- qsToast({type:2,context: result.msg});
- } else{
- location.href=url;
- }
- });
- })
- //gt_init(gt_call_back);//初始化极验
- var captcha_callback = function(res){
- if(res.hasOwnProperty('errorMessage')){
- alert(res.errorMessage)
- }
- if(res.ret == 0){
- console.log('行为验证通过');
- $("#ticket").val(res.ticket);
- $("#bizState").val(res.bizState);
- $("#randstr").val(res.randstr);
- ajax_login();
- }else{
- console.log('用户主动关闭验证码')
- }
- console.log('callback:', res);
- };
- var captcha = new TencentCaptcha('196587903', captcha_callback, {});
- $('.login-account').on('click', function () {
- var usernameValue = $.trim($('input[name=account]').val());
- var passwordValue = $.trim($('input[name=password]').val());
- if (usernameValue == '') {
- qsToast({type:2,context: '请输入用户名/手机号'});
- return false;
- }
- if (passwordValue == '') {
- qsToast({type:2,context: '请输入密码'});
- return false;
- }
- //ajax_login(1);
- captcha.show();
- });
- // 自动登录
- $('#for-checkbox').on('click', function() {
- $(this).toggleClass('active');
- if ($(this).hasClass('active')) {
- $('#autoLogin').val('1');
- } else {
- $('#autoLogin').val('0');
- }
- })
- function ajax_login() {
- $.ajax({
- type: 'post',
- url: $("#form_account").attr('action'),
- data: $("#form_account").serialize(),
- beforeSend:function () {
- //console.log('请求开始');
- },
- complete:function() {
- //console.log('请求结束');
- },
- success: function (data) {
- //console.log(data);
- qsToast({type:2,context: "登录成功, 正在跳转..."});
- location.href=data.data.redirect_url+'?token='+data.data.token;
- },
- 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});
- }
- }
- });
- };
- });
- $('.gohome').on('click', function () {
- location.href="{{route($sub_site.'home')}}";
- });
- </script>
- @endsection
|