Files
orico-official-website-old/app/usmobile/view/customer/index.phtml
2024-10-29 14:04:59 +08:00

157 lines
4.3 KiB
PHTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/m_weben/css/login.css">
</head>
<body>
<!--top-->
<div id="content">
{include file="include/top" /}
<!--top End-->
<!--banner-->
<div class="img-responsive margin-top-90"><img src="/frontend/m_web/images/user/login_banner.jpg" alt=""></div>
<!-- 登录 -->
<div class="margin-top-30">
<div class="login-m-a">
<div class="login-m-user">
<div class="login-m-img"><img src="/frontend/m_web/images/user/login-use.png" alt=""></div>
<div class="input-a">
<input type="text" id="email" onfocus="hide_err('email')" onblur="check_format('email')" placeholder="Email Address">
</div>
</div>
</div>
<div class="login-m-a ">
<div class="login-m-password">
<div class="login-m-img"><img src="/frontend/m_web/images/user/password.png" alt=""></div>
<div class="input-a">
<input type="password" onfocus="hide_err('password')" id="password" placeholder="Password">
</div>
</div>
</div>
</div>
<!--登录按钮-->
<div class="login-btn margin-top-70">
<button class="login" onclick="login()">Login</button>
</div>
<!--快速注册-->
<div class="login-text">
<a href="__ORICOROOT__<?php echo url('/customer/register'); ?>">Registry</a>
<span class="floa_r"><a href="__ORICOROOT__<?php echo url('/customer/retrieve_password'); ?>">Forget password</a></span>
</div>
<!-- <div class="short">
<div class="Quick"><span>其它登录方式</span></div>
<a onclick='toLogin()'><img src="__PUBLIC__/web/images/customer/QQ.png" height="33"></a>
<a onclick='toLogin()'><img src="__PUBLIC__/web/images/customer/weixin.png" height="33"></a>
</div>-->
<!-- 登录 -->
<!-- bottom s -->
{include file="include/bottom" /}
<!-- bottom e -->
</div>
<script type="text/javascript">
function show_err(id, html)
{
var err_id = '#err_' + id;
var input_id = '#' + id;
$(err_id).html(html);
$(input_id).css('border', '1px solid red');
}
function hide_err(id)
{
var err_id = '#err_' + id;
var input_id = '#' + id;
$(err_id).html('');
$('err_block').html('');
$(input_id).css('border', '1px solid #dedfe0');
}
function check_format(id)
{
if (id == 'email')
{
var email = $("#email").val();
var arg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/;
if (!arg.test(email))
{
var html = 'Please check the E-mail';
show_err(id, html);
return false;
}
else
{
hide_err(id);
return true;
}
}
}
function login()
{
var email = $("#email").val();
var password = $("#password").val();
var data = {
email: email,
password: password
};
if (!check_format('email'))
{
return;
}
$.ajax({
url: '/usmobile/customer/new_login',
type: 'post',
dataType: 'json',
data: data,
success: function (res) {
if (res.code == 200)
{
var redirect_uri = '<?php echo $url; ?>';
if (redirect_uri != '')
{
location.href = redirect_uri;
}
else
{
location.href = '/usmobile/customer/personal';
}
}
else if (res.code < 0)
{
var html = res.msg;
$('#err_block').html(html);
}
}
});
}
$(document).keyup(function(e) {
var code = e.keyCode;
if (code == 13)
{
login();
}
});
</script>
</body>
</html>