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

297 lines
9.7 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>
<head>
<meta charset="utf-8"> {include file="include/head" /}
<title>个人中心</title>
<link href="__PUBLIC__/m_web/css/login.css" rel="stylesheet" type="text/css">
</head>
<body style="background: #f4f5f5;">
<div id="content">
{include file="include/top" /}
<div class="img-responsive personal-all margin-top-90">
<img src="__PUBLIC__/m_web/images/user/personal-bg.jpg" alt=""/>
<div class="personal_header">
<div class="m_Container">
<div class="left"><img class="headimg" style="border-radius: 50%;" src="<?php echo $customer_info['picture'] != '' ? $customer_info['picture'] : '__PUBLIC__/m_web/images/user/user-img_03.png'; ?>" alt=""/></div>
<div class="right text_28">
<p>用户:<?php echo $customer_info['firstname']; ?></p>
<p class="margin-top-14">状态:已登录</p>
</div>
</div>
</div>
</div>
<div class="personal-bg margin-top-14">
<div class="m_Container f_weight_100">
<div class="personal-m-a text_28 text_gray ">
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/collection.png" alt=""/></div>
<a href="__ORICOROOT__/customer/my_collection.html"><div class="personal-lable">我的收藏</div></a>
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
</div>
<div class="personal-m-a text_28 text_gray">
<div class="modify">
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/password.png" alt=""/></div>
<div class="personal-lable">修改密码</div>
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
</div>
<div class="Popup">
<div class="content password">
<?php if ($customer_info['have_pwd']): ?>
<div class="margin-bottom-20"><label>旧密码</label><input class="form-control input_class" id="old_pwd" type="password"></div>
<?php endif; ?>
<div class="margin-bottom-20"><label>新密码</label><input id="password" class="form-control input_class" type="password"></div>
<div class="margin-bottom-20"><label>确认密码</label><input id="re_password" class="form-control input_class" type="password"></div>
<div class="text_right"><a href="__ORICOROOT__/customer/forgetpwd.html" class="text_blue">忘记密码?</a></div>
<div class="u_button text_22 text_center margin-top-50"><a class="u_button_blue" onclick="update_pwd()">确认</a><a class="u_button_gray">取消</a><!--<a href="http://www.orico.com.cn/forgetpwd"><span class="forget_button f_blue">忘记密码</span></a>--></div>
</div>
</div>
</div>
<div class="personal-m-a text_28 text_gray">
<div class="modify">
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/email.png" alt=""/></div>
<div class="personal-lable">修改邮箱</div>
<div class="personal-c margin-top-40"><?php echo $customer_info['email']; ?></div>
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
</div>
<div class="Popup">
<div class="content email">
<div class="margin-bottom-20"><label>新邮箱</label><input class="form-control input_class" id="email" type="text"></div>
<div class="u_button text_22 text_center margin-top-50"><a class="u_button_blue" onclick="bind_email()">确认</a><a class="u_button_gray">取消</a>
</div>
</div>
</div>
</div>
<div class="personal-m-a text_28 text_gray">
<div class="modify">
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/phone.png" alt=""/></div>
<div class="personal-lable">手机号码</div>
<div class="personal-c margin-top-40"><?php echo $customer_info['telephone']; ?></div>
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
</div>
<div class="Popup">
<div class="content phone img-responsive">
<div class="margin-bottom-20"><label>旧手机</label><input class="form-control input_class" id="old_telephone" type="text"></div>
<div class="margin-bottom-30"><label>新手机</label><input class="form-control input_class" id="telephone" type="text"></div>
<div class="position_r margin-bottom-20">
<div class="input-code">
<input id="captcha" name="captcha" type="text" placeholder="请输入验证码" class="input_phone text_24">
<a href="javascript:void(0);" class="nbtn" id="nbtn"><button>获取验证码</button></a>
</div>
</div>
<div class="u_button text_22 text_center margin-top-50"><a onclick="update_tel()" class="u_button_blue">确认</a><a class="u_button_gray">取消</a><!--<a href="http://www.orico.com.cn/forgetpwd"><span class="forget_button f_blue">忘记密码</span></a>--></div>
</div>
</div>
</div>
</div>
</div>
<div class=" login-btn" style="margin-bottom: 1.3rem;">
<button class="update margin-top-50" onclick="logout()">退出</button>
</div>
<!--底部-->
{include file="include/bottom" /}
</body>
</html>
<script type="text/javascript">
/*修改密码*/
$(function(){
$(".modify").click(function(){
$(this).next(".Popup").show();
});
$(".u_button_gray").click(function(){
$(this).parents(".Popup").hide();
})
});
var InterValObj; //timer变量控制时间
$("a#nbtn").click(function(event) {
event.preventDefault();
var telephoneObj = document.getElementById('telephone');
var arg = /^1[3456789]\d{9}$/;
if (!arg.test(telephoneObj.value))
{
var msg = '请检查手机号格式';
alert(msg);
return;
}
if (InterValObj) {
return false;
}
$.ajax({
type: 'POST',
url: '<?php echo url('__ORICOROOT__/customer/sendsms'); ?>',
data: {telephone: telephoneObj.value},
dataType: 'json',
success: function(data) {
if (data.code == 200) {
//设置button效果开始计时
curCount = 60;
$("a#nbtn").css("background-color", "transparent");
$("a#nbtn").attr("disabled", "true");
$("a#nbtn").html("<button>重新发送" + curCount + "秒</button>");
//alert("验证码发送成功,请查收!");
InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器1秒执行一次
//alert(data.msg);
} else {
alert(data.msg);
}
}
});
});
function SetRemainTime() {
if (curCount < 1) {
window.clearInterval(InterValObj); //停止计时器
InterValObj = null;
$("a#nbtn").removeAttr("disabled"); //启用按钮
$("a#nbtn").css("background-color", "");
$("a#nbtn").html("<button>重新发送</button>");
} else {
curCount--;
$("a#nbtn").html("<button>重新发送" + curCount + "秒</button>");
}
}
</script>
<script type="text/javascript">
function logout()
{
$.ajax({
'url': '/mobile/customer/new_logout.html',
'type': 'post',
'success': function(res) {
location.href = '__ORICOROOT__';
}
})
}
function update_pwd()
{
var old_pwd = $("#old_pwd").val();
var password = $("#password").val();
var re_password = $("#re_password").val();
var arg = /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*-.]+$)[a-zA-Z\d!@#$%^&*-.]{8,20}$/;
if (!arg.test(password))
{
var msg = '密码必须包含8-20个字符,且至少包含两种类型字符';
alert(msg);
return;
}
if (password != re_password)
{
var msg = '两次密码不一致';
alert(msg);
return;
}
var data = {
old_password: old_pwd,
password: password,
};
$.ajax({
url: '/mobile/customer/update_pwd.html',
type: 'post',
dataType: 'json',
data: data,
success: function (res) {
if (res.code == 200)
{
alert(res.msg);
location.reload();
}
else
{
alert(res.msg);
}
}
});
}
function bind_email()
{
var email = $("#email").val();
var data = {
email: email
};
var arg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/;
if (!arg.test(email))
{
var msg = '请检查邮箱格式';
alert(msg);
return;
}
$.ajax({
url: '/mobile/customer/bind_email.html',
type: 'post',
dataType: 'json',
data: data,
success: function (res) {
if (res.code == 200)
{
alert(res.msg);
location.reload();
}
else
{
alert(res.msg);
}
}
});
}
function update_tel()
{
var old_tel = $("#old_telephone").val();
var new_tel = $("#telephone").val();
var captcha = $("#captcha").val();
var data = {
old_telephone: old_tel,
new_telephone: new_tel,
captcha: captcha
};
var arg = /^1[3456789]\d{9}$/;
if (!arg.test(old_tel) || !arg.test(new_tel))
{
var msg = '请检查手机号格式';
alert(msg);
return;
}
$.ajax({
url: '/mobile/customer/update_tel.html',
type: 'post',
dataType: 'json',
data: data,
success: function (res) {
if (res.code == 200)
{
alert(res.msg);
location.reload();
}
else
{
alert(res.msg);
}
}
});
}
</script>