123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>选择登录方式-{eyou:global name='web_name' /}</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
- <link href="{eyou:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
- {eyou:static file="users/skin/css/basic.css" /}
- {eyou:static file="users/skin/css/eyoucms.css" /}
- {eyou:include file="users/skin/css/diy_css.htm" /}
- {eyou:static file="/public/static/common/js/jquery.min.js"/}
- {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
- {eyou:static file="users/skin/js/global.js" /}
- {eyou:static file="/public/static/common/js/mobile_global.js" /}
- </head>
-
- <body class="login-reg">
- <div class="wrapper">
- <input type="hidden" id="wechat_url" value="{$eyou.field.wechat_url|default=''}">
- <div class="hend-box">
- <div class="title">登录</div>
- <div class="desc">还没有账号,<a href="{:url('user/Users/reg')}" style="color: #ff9600;">立即注册</a></div>
- </div>
-
- <div class="cont-box">
- <div id="con_sign_1">
- <form action="" name='theForm' id="theForm" method="post" class="">
- <div class="wx-form-group">
- <input type="text" name="username" required class="wx-form-control" placeholder="请输入账号" autocomplete="off" />
- </div>
- <div class="wx-form-group">
- <input type="password" name="password" required class="wx-form-control" placeholder="请输入密码" autocomplete="off" />
- <span class="password-icon pass-showhide pass-hide" data-name="password"></span>
- </div>
- {eyou:eq name="$is_vertify" value="1"}
- <div class="wx-form-group">
- <div class="field">
- <input type="text" name="vertify" autocomplete="off" class="wx-form-control" placeholder="请输入验证码" />
- <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_login' /}" class="chicuele" id="imgVerifys" onclick="handleVerifyRefresh('imgVerifys');" title="看不清?点击更换验证码" align="absmiddle">
- </div>
- </div>
- {/eyou:eq}
- <input type="hidden" name="referurl" value="{$referurl}" />
- <input type="hidden" name="website" value="website" />
- <input style="margin-top: 44px;" type="button" name="submit" class="btn btn-lg btn-primary btn-block" value="登录" />
- <div class="login-link">
- <a style="color: #ff9600;" id="click_sign_1" href="javascript:void(0);" onclick="showPhoneSignIn1();">使用手机号登录</a>
- </div>
- </form>
- </div>
-
- <div id="con_sign_2" style="display:none;">
- <form action="" name='theMobileForm' id="theMobileForm" method="post" class="">
- <div class="wx-form-group">
- <input type="text" name="mobile" value="" required class="wx-form-control" placeholder="请输入手机号" autocomplete="off" />
- </div>
- <div class="wx-form-group" id="vertify_div">
- <div class="field">
- <input type="text" name="mobile_vertify" autocomplete="off" class="wx-form-control" placeholder="图片验证码" />
- <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_mobile_login' /}" class="chicuele" id="mobile_imgVerifys" onclick="mobile_fleshVerify();" title="看不清?点击更换验证码" align="absmiddle">
- </div>
- </div>
- <div class="wx-form-group">
- <div class="field">
- <input id="mobile_code" type="text" class="wx-form-control" name="mobile_code" placeholder="请输入动态码">
- <input type="button" id="mobile_code_button" onclick="send_mobile_code();" class="sento" value="获取动态码">
- </div>
- </div>
- <input type="hidden" name="referurl" value="{$referurl}" />
- <input type="hidden" name="website" value="website" />
- <input type="hidden" name="__mobile_1_token__" value="{$Request.token.__mobile_1_token__}" />
- <input style="margin-top: 44px;" type="button" onclick="checkMobileUserLogin1649732103()" class="btn btn-lg btn-primary btn-block" value="登录" />
- <div class="login-link">
- <a class="fr" style="color: #ff9600;" id="click_sign_2" href="javascript:void(0);" onclick="showPhoneSignIn2();">使用账号登录</a>
- </div>
- <script>
- $("input[name=mobile]").keyup(function(event){
- var mobile = $(this).val();
- if (11 == mobile.length && 32 <= event.keyCode) {
- $('#vertify_div').css('display','block');
- }
- });
-
- /*$("input[name=mobile_vertify]").keyup(function(event){
- var mobile_vertify = $(this).val();
- if (4 <= mobile_vertify.length && 32 <= event.keyCode) {
- send_mobile_code();
- }
- });*/
-
- function send_mobile_code() {
- var mobile = $("input[name=mobile]").val();
- // 手机号是否为空
- if (!mobile) {
- $("input[name=mobile]").focus();
- layer.msg('请输入手机号码!', {time: 1500});
- return false;
- }
-
- // 手机格式不正确
- var reg = /^1[0-9]{10}$/i;
- if (!reg.test(mobile)) {
- $("input[name=mobile]").focus();
- layer.msg('请输入正确的请输入手机号码!', {time: 1500});
- return false;
- }
- $('#vertify_div').css('display','block');
- var mobile_vertify = $("input[name=mobile_vertify]").val();
- if (!mobile_vertify) {
- return false;
- }
-
- // 设置为不可点击
- $("#mobile_code_button").val('获取中…').attr('disabled', 'disabled');
- var __mobile_1_token__ = $('input[name=__mobile_1_token__]').val();
-
- $.ajax({
- url: "{eyou:url link='api/Ajax/SendMobileCode' /}",
- // source:2 登录
- data: {type:'users_mobile_login', mobile:mobile, is_mobile:true, title:'登录', source:2,IsVertify:1, vertify:mobile_vertify, __mobile_1_token__:__mobile_1_token__},
- type:'post',
- dataType:'json',
- success:function(res){
- if (res.code == 1) {
- code_countdown();
- layer.msg(res.msg, {time: 1500});
- } else {
- $("#mobile_code_button").val('获取验证码').removeAttr("disabled");
- layer.alert(res.msg, {icon: 2, title: false, closeBtn: 0});
- }
- },
- error : function() {
- $("#mobile_code_button").val('获取验证码').removeAttr("disabled");
- layer.alert('发送失败,请尝试重新发送!', {icon: 5, title: false, closeBtn: 0});
- }
- });
- }
-
- function mobile_fleshVerify() {
- // 更新验证码
- handleVerifyRefresh('mobile_imgVerifys', 'users_mobile_login');
- // 更新token
- $.ajax({
- async:false,
- url: "__ROOT_DIR__/index.php?m=api&c=Ajax&a=get_token&name=__mobile_1_token__",
- data: {_ajax:1},
- type:'GET',
- dataType:'html',
- success:function(res1){
- $('input[name=__mobile_1_token__]').val(res1);
- },
- error : function(e) {
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5, title:false});
- }
- });
- }
-
- function code_countdown(){
- // 倒计时
- var setTime;
- var time = 120;
- setTime = setInterval(function() {
- if(0 >= time) {
- clearInterval(setTime);
- return false;
- }
-
- time--;
- $("#mobile_code_button").val(time + '秒').attr('disabled', 'disabled');
- if(time == 0) $("#mobile_code_button").val('获取验证码').removeAttr("disabled");
- }, 1000);
- }
- function checkMobileUserLogin1649732103() {
- var mobile = $('#theMobileForm input[name=mobile]');
- var mobile_code = $('#theMobileForm input[name=mobile_code]');
-
- if (mobile.val() == '') {
- layer.msg('手机号不能为空!', {
- time: 1500
- });
- mobile.focus();
- return false;
- }
-
- if (mobile_code.val() == '') {
- layer.msg('验证码不能为空!', {
- time: 1500
- });
- mobile_code.focus();
- return false;
- }
-
- layer_loading('正在处理');
- $.ajax({
- url: "{eyou:url link='user/Users/mobile_login' /}",
- data: $('#theMobileForm').serialize(),
- type: 'post',
- dataType: 'json',
- success: function(res) {
- if (1 == res.code) {
- if (5 == res.data.status) {
- layer.alert(res.msg, {
- icon: 5,
- title: false,
- closeBtn: false
- }, function() {
- window.location.href = res.url;
- });
- } else {
- window.location.href = res.url;
-
- }
- } else {
- layer.closeAll();
- if ('vertify' == res.data.status) {
- mobile_fleshVerify();
- }
-
- if (2 == res.data.status) {
- showErrorAlert(res.msg, 4);
- } else {
- layer.msg(res.msg, {
- icon: 5,
- time: 1500
- });
- }
- }
- },
- error: function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
- </script>
- </form>
- </div>
-
- <!-- 第三方账号登录 -->
- {eyou:if condition="!empty($weapp_wxlogin) || !empty($weapp_qqlogin) || !empty($weapp_wblogin)"}
- <div class="account-login">
- {eyou:notempty name="$weapp_qqlogin"}
- <a data-href="{eyou:url link='plugins/QqLogin/login' seo_pseudo='1' seo_inlet='0' /}" class="qq-login"></a>
- {/eyou:notempty}
- {eyou:notempty name="$weapp_wxlogin"}
- <a data-href="{eyou:url link='plugins/WxLogin/login' seo_pseudo='1' seo_inlet='0' /}" class="wechat-login"></a>
- {/eyou:notempty}
- {eyou:notempty name="$weapp_wblogin"}
- <a data-href="{eyou:url link='plugins/Wblogin/login' seo_pseudo='1' seo_inlet='0' /}" class="weibo-login"></a>
- {/eyou:notempty}
- </div>
- {/eyou:if}
- <!-- 第三方账号登录 -->
- </div>
- </div>
- {eyou:static file="users/skin/js/users_login.js" /}
-
- <script type="text/javascript">
- // 使用微信登录
- function wechat_login() {
- var wechat_url = $('#wechat_url').val();
- if (!wechat_url) {
- showErrorAlert('网络失败,请刷新页面后重试');
- }
- layer_loading('正在处理');
- $.ajax({
- url: wechat_url,
- data: {data:0},
- type: 'post',
- dataType:'json',
- success:function(res){
- layer.closeAll();
- if (res.code == 1) {
- window.location.href = res.url;
- } else {
- layer.msg(res.msg, {time: 2000, icon: 5});
- }
- },
- error : function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- };
-
- $(function() {
- $('input[name=submit]').on('click', function() {
- // 账号判断
- var username = $('input[name=username]');
- if (username.val() == '') {
- username.focus();
- showLayerMsg('用户名不能为空');
- return false;
- }
- // 密码判断
- var password = $('input[name=password]');
- if (password.val() == '') {
- password.focus();
- showLayerMsg('密码不能为空');
- return false;
- }
- var formData = $('#theForm').serialize();
- // 等保插件密码复杂判断,需在(formData)变量后面
- {$pwdJsCode|default=''}
-
- // 提交登录
- showLayerLoad();
- $.ajax({
- url : eyou_basefile + "?m=user&c=Users&a=login",
- data: formData,
- type: 'post',
- dataType: 'json',
- success: function(res) {
- if (1 == res.code) {
- if (5 == res.data.status) {
- showLayerMsg(res.msg, 2, function() {
- window.location.href = res.url;
- });
- } else {
- window.location.href = res.url;
- }
- } else {
- layer.closeAll();
- if (2 == res.data.status) {
- showLayerAlert(res.msg, 4);
- } else {
- showLayerMsg(res.msg);
- }
- if ('vertify' == res.data.status) handleVerifyRefresh();
- }
- },
- error: function(e) {
- layer.closeAll();
- showLayerAlert(e.responseText);
- }
- });
- });
- });
- </script>
- </body>
- </html>
|