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

152 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>
</head>
<body>
<!--top-->
<header class="header-PC header-Product">
<div id="header" class="theme-black">
{include file="include/top" /}
{include file="include/top-header" /}
</div>
</header>
<!--top End-->
<!-- 登录 -->
<div class="login login_bg login_height">
<div class="swt-Container">
<div class="login_content">
<div class="title f-black text-c"><span class="cursor_p">Welcome Back</span></div>
<div class="content content_01">
<li class="margin-b-5">
<input type="text" id="email" onfocus="hide_err('email')" onblur="check_format('email')" placeholder="Email Address">
<div id="err_email" style="color: red"></div>
</li>
<li class="margin-b-5">
<input type="password" onfocus="hide_err('password')" id="password" placeholder="Password">
<div id="err_password" style="color: red"></div>
</li>
<div id="err_block" style="color: red"></div>
<div class="tjdl">
<a class="tjbtn" id="submit-btn" onclick="login()">Login</a>
</div>
</div>
<div class="Register">
<a href="__ORICOROOT__<?php echo url('/register'); ?>" class="left">Registry</a>
<a href="__ORICOROOT__<?php echo url('/customer/retrieve_password'); ?>" class="right"> Forget password</a>
</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>-->
</div>
</div>
</div>
<!-- 登录 -->
<!-- bottom s -->
{include file="include/footer" /}
<!-- bottom e -->
</body>
</html>
<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: '/us/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 = '/us/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>