init
This commit is contained in:
293
app/mobile/view/customer/forgetpwd.phtml
Executable file
293
app/mobile/view/customer/forgetpwd.phtml
Executable file
@@ -0,0 +1,293 @@
|
||||
<!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">
|
||||
<style></style>
|
||||
</head>
|
||||
|
||||
<body style="background: #fff;">
|
||||
<div id="content">
|
||||
{include file="include/top" /}
|
||||
<div class="img-responsive margin-top-90"><img src="__PUBLIC__/m_web/images/user/login_banner.jpg" alt=""/>
|
||||
</div>
|
||||
|
||||
<!-- 代码部分begin -->
|
||||
<div class="regist-tab">
|
||||
<!--<div class="tab">
|
||||
<a href="javascript:;" class="on">邮箱注册</a> <a href="javascript:;" class="on">手机注册</a> </div>-->
|
||||
<div class="content">
|
||||
<div class="margin-top-30">
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/phone.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="telephone" name="telephone" type="" placeholder="请输入您手机号码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您手机号码'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-code">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/login-code.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="captcha" name="captcha" type="text" placeholder="请输入验证码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入验证码'">
|
||||
</div>
|
||||
<div class="input-code"> <a href="javascript:void(0);" class="nbtn" id="nbtn"><button>获取验证码</button></a></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/password.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="password" name="password" type="password" placeholder="请设置您的新密码" onfocus="this.placeholder=''" onblur="this.placeholder='请设置您的新密码'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/password.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="re_password" name="re_password" type="password" placeholder="确认新密码" onfocus="this.placeholder=''" onblur="this.placeholder='确认新密码'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="regist-form"><input type="checkbox"> 我已阅读并同意《网站服务条款》</div>-->
|
||||
<div class="margin-top-90 login-btn overflow-h">
|
||||
<button class="update_pwd">提交</button>
|
||||
</div>
|
||||
<div class="login-text margin-bottom-90 overflow-h"><span class="float_l"><a href="__ORICOROOT__/customer/register.html">立即注册</a></span> <span class="float_r"><a href="__ORICOROOT__/customer/login.html">立即登录</a></span></div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$( function () {
|
||||
$( ".regist-tab .tab a" ).mouseover( function () {
|
||||
$( this ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
var index = $( this ).index();
|
||||
number = index;
|
||||
$( '.regist-tab .content li' ).hide();
|
||||
$( '.regist-tab .content li:eq(' + index + ')' ).show();
|
||||
} );
|
||||
|
||||
var auto = 1; //等于1则自动切换,其他任意数字则不自动切换
|
||||
if ( auto == 1 ) {
|
||||
var number = 0;
|
||||
var maxNumber = $( '.regist-tab .tab a' ).length;
|
||||
|
||||
function autotab() {
|
||||
number++;
|
||||
number == maxNumber ? number = 0 : number;
|
||||
$( '.regist-tab .tab a:eq(' + number + ')' ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
$( '.regist-tab .content ul li:eq(' + number + ')' ).show().siblings().hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$( ".update_pwd" ).click( function () {
|
||||
var telephone = $( "input[name = 'telephone']" ).val();
|
||||
var captcha = $( "input[name = 'captcha']" ).val();
|
||||
var password = $( "input[name = 'password']" ).val();
|
||||
var re_password = $( "input[name = 're_password']" ).val();
|
||||
|
||||
var arg = /^1[3456789]\d{9}$/;
|
||||
if (!arg.test(telephone))
|
||||
{
|
||||
var msg = '请检查手机号格式';
|
||||
alert(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
arg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/;
|
||||
if (!arg.test(password))
|
||||
{
|
||||
var msg = '密码必须包含8-20个字符,且包含数字和字母';
|
||||
alert(msg);
|
||||
return;
|
||||
}
|
||||
if (password != re_password)
|
||||
{
|
||||
var msg = '两次密码不一致';
|
||||
alert(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax( {
|
||||
url: '__ORICOROOT__/customer/update_forget_pwd.html',
|
||||
type: 'post',
|
||||
data: {
|
||||
telephone: telephone,
|
||||
captcha: captcha,
|
||||
password: password,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function ( res ) {
|
||||
if ( res.code == 200 ) {
|
||||
alert('修改密码成功')
|
||||
window.location.href = "__ORICOROOT__/customer/personal.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(res.msg);
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var InterValObj; //timer变量,控制时间
|
||||
var curCount; //当前剩余秒数
|
||||
$(function() {
|
||||
$("a.yanzhengma").click(function(event) {
|
||||
event.preventDefault();
|
||||
//$img = $("#authcode");
|
||||
$("#yanzhengma").attr("src", "<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>" + "?" + Math.random());
|
||||
});
|
||||
$('#register-form').bind('submit', function(event) {
|
||||
var nameObj = document.getElementById('firstname');
|
||||
if (isNull(nameObj.value) || nameObj.value.length < 2 || nameObj.value.length > 20) {
|
||||
alert('用户名必须在2-20个字符之间');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
var passwordObj = document.getElementById('password');
|
||||
if (isNull(passwordObj.value) || passwordObj.value.length < 6) {
|
||||
alert('密码必须包含8-20个字符,且包含数字和字母');
|
||||
passwordObj.focus();
|
||||
return false;
|
||||
}
|
||||
var repasswordObj = document.getElementById('repassword');
|
||||
if (isNull(repasswordObj.value)) {
|
||||
alert('请确认您的密码');
|
||||
repasswordObj.focus();
|
||||
return false;
|
||||
}
|
||||
if (repasswordObj.value !== passwordObj.value) {
|
||||
repasswordObj.focus();
|
||||
alert('两次密码不一致');
|
||||
return false;
|
||||
}
|
||||
var emailObj = document.getElementById('email');
|
||||
if (!validEmail(emailObj.value)) {
|
||||
alert('电子邮箱格式不正确');
|
||||
emailObj.focus();
|
||||
return false;
|
||||
}
|
||||
var codeObj = document.getElementById('code');
|
||||
if (isNull(codeObj.value)) {
|
||||
alert('短信验证码不能为空');
|
||||
codeObj.focus();
|
||||
return false;
|
||||
}
|
||||
var options = {
|
||||
type: "post",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
if (data.code) {
|
||||
//alert(data.msg);
|
||||
location.href = data.url;
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("a.yanzhengma").click();
|
||||
}
|
||||
};
|
||||
$.ajax(options);
|
||||
return false;
|
||||
});
|
||||
$("a#submit-btn").click(function(event) {
|
||||
event.preventDefault();
|
||||
$('#register-form').submit();
|
||||
});
|
||||
$("a#nbtn").click(function(event) {
|
||||
event.preventDefault();
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
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) {
|
||||
//设置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>");
|
||||
}
|
||||
}
|
||||
function isNull(data) {
|
||||
return (data == "" || data == undefined || data == null) ? true : false;
|
||||
}
|
||||
function trim(str) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
function isTelephone(value) {
|
||||
var isMobile = /^1[345789]\d{9}$/;
|
||||
return isMobile.test(value);
|
||||
}
|
||||
function validEmail(email) {
|
||||
//对电子邮件的验证
|
||||
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
return reg.test(email);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
78
app/mobile/view/customer/login.phtml
Executable file
78
app/mobile/view/customer/login.phtml
Executable file
@@ -0,0 +1,78 @@
|
||||
<!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: #fff;" class="f_weight_100">
|
||||
<div id="content">
|
||||
{include file="include/top" /}
|
||||
<div class="img-responsive margin-top-90"><img src="__PUBLIC__/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="__PUBLIC__/m_web/images/user/login-use.png" alt=""/></div>
|
||||
<div class="input-a">
|
||||
<input name="telephone" type="text" placeholder="用户名/账号/手机号" onfocus="this.placeholder=''" onblur="this.placeholder='用户名/账号/手机号'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/password.png" alt=""/></div>
|
||||
<div class="input-a">
|
||||
<input name="password" type="password" placeholder="请输入您的密码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的密码'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-btn margin-top-70">
|
||||
<button class="login">登录</button>
|
||||
</div>
|
||||
<div class="login-text"><a href="__ORICOROOT__/customer/register.html">快速注册</a> <span class="floa_r"><a href="__ORICOROOT__/customer/forgetpwd.html">忘记密码?</a></span></div>
|
||||
|
||||
<!--其他登录方式-->
|
||||
<div class="m_Container other_login margin-top-90">
|
||||
<div class="title img-responsive"><img src="__PUBLIC__/m_web/images/user/other_login.png"></div>
|
||||
<div class="text_center margin-top-30 margin-bottom-60">
|
||||
<a href="__ORICOROOT__/customer/quick_login.html" class="img-responsive"><img src="__PUBLIC__/m_web/images/user/quick-phone.png"></a>
|
||||
</div>
|
||||
</div>
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(".login").click(function() {
|
||||
var telephone = $("input[name = 'telephone']").val();
|
||||
var password = $("input[name = 'password']").val();
|
||||
$.ajax({
|
||||
url: '/mobile/customer/new_login.html',
|
||||
type: 'post',
|
||||
data: {
|
||||
username: telephone,
|
||||
password: password
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res.code == 200)
|
||||
window.location.href = "/mobile/customer/personal.html";
|
||||
else
|
||||
alert(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
177
app/mobile/view/customer/my_collection.phtml
Executable file
177
app/mobile/view/customer/my_collection.phtml
Executable file
@@ -0,0 +1,177 @@
|
||||
<!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-collection" /}
|
||||
<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" src="__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-20 margin-bottom-10 overflow-h">
|
||||
<div class="m_Container">
|
||||
<!--导航-->
|
||||
<div class="collection_c margin-bottom-14 margin-top-10 text_black " id="collection_c">
|
||||
<div class="scroller">
|
||||
<ul class="clearfix text_28">
|
||||
|
||||
<li class="<?php if ($cid == 0): ?> collection_c_hover <?php endif; ?>"><a href="__ORICOROOT__/customer/my_collection.html" class=""><span>全部</span></a></li>
|
||||
<?php if (!empty($productCategory)): ?>
|
||||
|
||||
<?php foreach($productCategory as $key => $value): ?>
|
||||
<li class="<?php if ($cid == $value['id']): ?> collection_c_hover <?php endif; ?>"><a href="/mobile/customer/my_collection/cid/<?php echo $value['id']; ?>" class=""><span><?php echo $value['name']; ?></span></a></li>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--列表-->
|
||||
<div class="collection_l f_weight_100">
|
||||
<?php if (!empty($list)): ?>
|
||||
<ul>
|
||||
<?php foreach($list as $key => $value): ?>
|
||||
<li class="">
|
||||
<div class="Batch_select" style="display: none;">
|
||||
<input id="" name="check_box" type="checkbox" class="check_box" value="<?php echo $value['id']; ?>"><label></label>
|
||||
</div>
|
||||
<div class="left img-responsive"><img src="<?php echo $value['product_two_img']; ?>"></div>
|
||||
<div class="right">
|
||||
<p class="text_28 margin-top-14"><?php echo $value['name']?></p>
|
||||
<p class="text_24 text_gray margin-top-20"><?php echo $value['brand_id']; ?></p>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<!--无收藏-->
|
||||
<div class="margin-top-90 margin-bottom-90 text_32 text_center">您未收藏任何产品</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collection_b text_24" style="display: none;">
|
||||
<div class="m_container margin-bottom-20 margin-top-30 text_gray overflow-h">
|
||||
<div class="collection_b_left img-responsive"><input type="checkbox" class="check" name="check" value=""><label></label>全选</div>
|
||||
<div class="collection_b_right delete">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="all_del Popup img-responsive" style="display: none">
|
||||
<div class="all_delect content text_center">
|
||||
<p class="text_28 margin-bottom-30">确定删除?</p>
|
||||
<p class="all_del_left">
|
||||
<span class="bg_red u_button_blue text_24">确定</span>
|
||||
<span class="bg_gray u_button_gray text_24">取消</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script type="text/javascript" src="__PUBLIC__/m_web/js/scroll/iscroll.js"></script>
|
||||
<script type="text/javascript" src="__PUBLIC__/m_web/js/scroll/navbarscroll.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/*导航滚动*/
|
||||
$(function(){
|
||||
//demo示例一到四 通过lass调取,一句可以搞定,用于页面中可能有多个导航的情况
|
||||
$('.collection_c').navbarscroll();
|
||||
});
|
||||
/*批量删除*/
|
||||
$(function(){
|
||||
$(".Batch").click(function(){
|
||||
$(".Batch_select").toggle();
|
||||
$(".collection_b").toggle();
|
||||
//$(".u_admin01").hide();
|
||||
//$(".u_admin02").show();
|
||||
//$(".u_product .check_B").show();
|
||||
//$(".u_product .s_del").removeClass('u_del');
|
||||
});
|
||||
$(".u_admin02 .cancel").click(function(){
|
||||
//$(".u_admin02").hide();
|
||||
//$(".u_admin01").show();
|
||||
//$(".u_product .check_B").hide();
|
||||
//$(".u_product .s_del").addClass('u_del');
|
||||
});
|
||||
})
|
||||
|
||||
/*全选*/
|
||||
$(document).ready(function(){
|
||||
$(".collection_b_left input[name='check']").click(function(){
|
||||
if($(this).is(":checked")){
|
||||
$(".Batch_select input[type='checkbox']").prop("checked",true);
|
||||
}else{
|
||||
$(".Batch_select input[type='checkbox']").prop("checked",false);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/*批量管量*/
|
||||
var checked = [];
|
||||
$(document).ready(function(){
|
||||
$(".delete").click(function(){
|
||||
$('input[name="check_box"]:checked').each(function() {
|
||||
checked.push($(this).val());
|
||||
});
|
||||
$(".all_del").show();
|
||||
});
|
||||
$(".all_delect .bg_gray").click(function(){
|
||||
$(".all_del").hide();
|
||||
checked = [];
|
||||
});
|
||||
$(".all_delect .bg_red").click(function(){
|
||||
var product_ids = checked;
|
||||
cancel_collection(product_ids, 1);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function cancel_collection(product_id, type=0)
|
||||
{
|
||||
if (product_id == '')
|
||||
{
|
||||
alert('请先选择产品');
|
||||
$(".all_del").hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var data = {
|
||||
type: 1,
|
||||
coll_id: product_id
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/mobile/collection/cancel_collection.html',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
if (type == 1)
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
297
app/mobile/view/customer/personal.phtml
Executable file
297
app/mobile/view/customer/personal.phtml
Executable file
@@ -0,0 +1,297 @@
|
||||
<!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>
|
||||
346
app/mobile/view/customer/quick_login.phtml
Executable file
346
app/mobile/view/customer/quick_login.phtml
Executable file
@@ -0,0 +1,346 @@
|
||||
<!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">
|
||||
<style></style>
|
||||
</head>
|
||||
|
||||
<body style="background: #fff;">
|
||||
<div id="content">
|
||||
{include file="include/top" /}
|
||||
<div class="img-responsive margin-top-90"><img src="__PUBLIC__/m_web/images/user/login_banner.jpg" alt=""/>
|
||||
</div>
|
||||
|
||||
<!-- 代码部分begin -->
|
||||
<div class="regist-tab">
|
||||
<!--<div class="tab">
|
||||
<a href="javascript:;" class="on">邮箱注册</a> <a href="javascript:;" class="on">手机注册</a> </div>-->
|
||||
<div class="content">
|
||||
<ul>
|
||||
<!-- <li style="display: none;"> -->
|
||||
<li>
|
||||
<div class="margin-top-30">
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/phone.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="telephone" name="telephone" type="" placeholder="手机号码" onfocus="this.placeholder=''" onblur="this.placeholder='手机号码'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-m-a ">
|
||||
<div class="login-m-code">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/login-code.png" alt=""/>
|
||||
</div>
|
||||
<div class="input-a">
|
||||
<input id="captcha" name="captcha" type="text" placeholder="请输入验证码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入验证码'">
|
||||
</div>
|
||||
<div class="input-code"> <a href="javascript:void(0);" class="nbtn" id="nbtn"><button>获取验证码</button></a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="regist-form"><input type="checkbox"> 我已阅读并同意《网站服务条款》</div>-->
|
||||
<div class="margin-top-90 login-btn margin-bottom-90 overflow-h">
|
||||
<button class="login" onclick="login()">立即登录</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
$( function () {
|
||||
$( ".regist-tab .tab a" ).mouseover( function () {
|
||||
$( this ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
var index = $( this ).index();
|
||||
number = index;
|
||||
$( '.regist-tab .content li' ).hide();
|
||||
$( '.regist-tab .content li:eq(' + index + ')' ).show();
|
||||
} );
|
||||
|
||||
var auto = 1; //等于1则自动切换,其他任意数字则不自动切换
|
||||
if ( auto == 1 ) {
|
||||
var number = 0;
|
||||
var maxNumber = $( '.regist-tab .tab a' ).length;
|
||||
|
||||
function autotab() {
|
||||
number++;
|
||||
number == maxNumber ? number = 0 : number;
|
||||
$( '.regist-tab .tab a:eq(' + number + ')' ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
$( '.regist-tab .content ul li:eq(' + number + ')' ).show().siblings().hide();
|
||||
}
|
||||
}
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* var InterValObj; //timer变量,控制时间
|
||||
var curCount; //当前剩余秒数
|
||||
$(function() {
|
||||
$("a.yanzhengma").click(function(event) {
|
||||
event.preventDefault();
|
||||
//$img = $("#authcode");
|
||||
$("#yanzhengma").attr("src", "<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>" + "?" + Math.random());
|
||||
});
|
||||
$('#register-form').bind('submit', function(event) {
|
||||
var nameObj = document.getElementById('firstname');
|
||||
if (isNull(nameObj.value) || nameObj.value.length < 2 || nameObj.value.length > 20) {
|
||||
alert('用户名必须在2-20个字符之间');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var codeObj = document.getElementById('code');
|
||||
if (isNull(codeObj.value)) {
|
||||
alert('短信验证码不能为空');
|
||||
codeObj.focus();
|
||||
return false;
|
||||
}
|
||||
var options = {
|
||||
type: "post",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
if (data.code) {
|
||||
//alert(data.msg);
|
||||
location.href = data.url;
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("a.yanzhengma").click();
|
||||
}
|
||||
};
|
||||
$.ajax(options);
|
||||
return false;
|
||||
});
|
||||
$("#submit-btn").click(function(event) {
|
||||
event.preventDefault();
|
||||
$('#register-form').submit();
|
||||
});
|
||||
$("#nbtn").click(function(event) {
|
||||
event.preventDefault();
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
if (InterValObj) {
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo url('__ORICOROOT__/customer/sendsms'); ?>',
|
||||
//data: {telephone: telephoneObj.value, register: 1},
|
||||
data:data,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if (data.code > 0) {
|
||||
//设置button效果,开始计时
|
||||
curCount = 60;
|
||||
$("#nbtn").css("background-color", "transparent");
|
||||
$("#nbtn").attr("disabled", "true");
|
||||
$("#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;
|
||||
$("#nbtn").removeAttr("disabled"); //启用按钮
|
||||
$("#nbtn").css("background-color", "");
|
||||
$("#nbtn").html("<button>重新发送</button>");
|
||||
} else {
|
||||
curCount--;
|
||||
$("#nbtn").html("<button>重新发送" + curCount + "秒</button>");
|
||||
}
|
||||
}
|
||||
function isNull(data) {
|
||||
return (data == "" || data == undefined || data == null) ? true : false;
|
||||
}
|
||||
function trim(str) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
function isTelephone(value) {
|
||||
var isMobile = /^1[345789]\d{9}$/;
|
||||
return isMobile.test(value);
|
||||
}
|
||||
function validEmail(email) {
|
||||
//对电子邮件的验证
|
||||
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
return reg.test(email);
|
||||
}*/
|
||||
|
||||
var InterValObj; //timer变量,控制时间
|
||||
var curCount; //当前剩余秒数
|
||||
$(function() {
|
||||
$("a.yanzhengma").click(function(event) {
|
||||
event.preventDefault();
|
||||
//$img = $("#authcode");
|
||||
$("#yanzhengma").attr("src", "<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>" + "?" + Math.random());
|
||||
});
|
||||
$('#register-form').bind('submit', function(event) {
|
||||
var nameObj = document.getElementById('firstname');
|
||||
if (isNull(nameObj.value) || nameObj.value.length < 2 || nameObj.value.length > 20) {
|
||||
alert('用户名必须在2-20个字符之间');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var codeObj = document.getElementById('code');
|
||||
if (isNull(codeObj.value)) {
|
||||
alert('短信验证码不能为空');
|
||||
codeObj.focus();
|
||||
return false;
|
||||
}
|
||||
var options = {
|
||||
type: "post",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
if (data.code) {
|
||||
//alert(data.msg);
|
||||
location.href = data.url;
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("a.yanzhengma").click();
|
||||
}
|
||||
};
|
||||
$.ajax(options);
|
||||
return false;
|
||||
});
|
||||
$("a#submit-btn").click(function(event) {
|
||||
event.preventDefault();
|
||||
$('#register-form').submit();
|
||||
});
|
||||
$("a#nbtn").click(function(event) {
|
||||
event.preventDefault();
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
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>");
|
||||
}
|
||||
}
|
||||
function isNull(data) {
|
||||
return (data == "" || data == undefined || data == null) ? true : false;
|
||||
}
|
||||
function trim(str) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
function isTelephone(value) {
|
||||
var isMobile = /^1[345789]\d{9}$/;
|
||||
return isMobile.test(value);
|
||||
}
|
||||
function validEmail(email) {
|
||||
//对电子邮件的验证
|
||||
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
return reg.test(email);
|
||||
}
|
||||
</script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
function login()
|
||||
{
|
||||
var telephone = $("#telephone").val();
|
||||
var captcha = $("#captcha").val();
|
||||
|
||||
data = {
|
||||
telephone: telephone,
|
||||
captcha: captcha
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/mobile/customer/new_login.html',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if (res.code == 200)
|
||||
{
|
||||
location.href = '__ORICOROOT__/customer/personal.html';
|
||||
}
|
||||
if (res.code < 0)
|
||||
{
|
||||
alert(res.msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
</script>
|
||||
217
app/mobile/view/customer/register.phtml
Executable file
217
app/mobile/view/customer/register.phtml
Executable file
@@ -0,0 +1,217 @@
|
||||
<!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">
|
||||
<style></style>
|
||||
</head>
|
||||
|
||||
<body style="background: #fff;">
|
||||
<div id="content">
|
||||
{include file="include/top" /}
|
||||
<div class="img-responsive margin-top-90"><img src="__PUBLIC__/m_web/images/user/login_banner.jpg" alt=""/>
|
||||
</div>
|
||||
|
||||
<!-- 代码部分begin -->
|
||||
<div class="regist-tab">
|
||||
<!--<div class="tab">
|
||||
<a href="javascript:;" class="on">邮箱注册</a> <a href="javascript:;" class="on">手机注册</a> </div>-->
|
||||
<div class="content">
|
||||
<div class="margin-top-30">
|
||||
<div class="login-m-a">
|
||||
<div class="login-m-password">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/phone.png" alt=""/></div>
|
||||
<div class="input-a"><input id="telephone" name="telephone" type="" placeholder="手机号码" onfocus="this.placeholder=''" onblur="this.placeholder='手机号码'"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-m-a">
|
||||
<div class="login-m-code">
|
||||
<div class="login-m-img"><img src="__PUBLIC__/m_web/images/user/login-code.png" alt=""/></div>
|
||||
<div class="input-a"><input id="captcha" name="captcha" type="text" placeholder="请输入验证码" onfocus="this.placeholder=''" onblur="this.placeholder='手机号码'"></div>
|
||||
<div class="input-code"> <a href="javascript:void(0);" class="nbtn" id="nbtn"><button>获取验证码</button></a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="regist-form"><input type="checkbox"> 我已阅读并同意《网站服务条款》</div>-->
|
||||
<div class="margin-top-90 login-btn margin-bottom-20 overflow-h"><button class="register" onclick="register()">立即注册</button></div>
|
||||
<div class="login-text"><a href="__ORICOROOT__/customer/login.html" class="float_l margin-bottom-90">立即登录</a></div>
|
||||
</div>
|
||||
<script>
|
||||
$( function () {
|
||||
$( ".regist-tab .tab a" ).mouseover( function () {
|
||||
$( this ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
var index = $( this ).index();
|
||||
number = index;
|
||||
$( '.regist-tab .content li' ).hide();
|
||||
$( '.regist-tab .content li:eq(' + index + ')' ).show();
|
||||
} );
|
||||
|
||||
var auto = 1; //等于1则自动切换,其他任意数字则不自动切换
|
||||
if ( auto == 1 ) {
|
||||
var number = 0;
|
||||
var maxNumber = $( '.regist-tab .tab a' ).length;
|
||||
|
||||
function autotab() {
|
||||
number++;
|
||||
number == maxNumber ? number = 0 : number;
|
||||
$( '.regist-tab .tab a:eq(' + number + ')' ).addClass( 'on' ).siblings().removeClass( 'on' );
|
||||
$( '.regist-tab .content ul li:eq(' + number + ')' ).show().siblings().hide();
|
||||
}
|
||||
}
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var InterValObj; //timer变量,控制时间
|
||||
var curCount; //当前剩余秒数
|
||||
$(function() {
|
||||
$("a.yanzhengma").click(function(event) {
|
||||
event.preventDefault();
|
||||
//$img = $("#authcode");
|
||||
$("#yanzhengma").attr("src", "<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>" + "?" + Math.random());
|
||||
});
|
||||
$('#register-form').bind('submit', function(event) {
|
||||
var nameObj = document.getElementById('firstname');
|
||||
if (isNull(nameObj.value) || nameObj.value.length < 2 || nameObj.value.length > 20) {
|
||||
alert('用户名必须在2-20个字符之间');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var codeObj = document.getElementById('code');
|
||||
if (isNull(codeObj.value)) {
|
||||
alert('短信验证码不能为空');
|
||||
codeObj.focus();
|
||||
return false;
|
||||
}
|
||||
var options = {
|
||||
type: "post",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
if (data.code) {
|
||||
//alert(data.msg);
|
||||
location.href = data.url;
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("a.yanzhengma").click();
|
||||
}
|
||||
};
|
||||
$.ajax(options);
|
||||
return false;
|
||||
});
|
||||
$("a#submit-btn").click(function(event) {
|
||||
event.preventDefault();
|
||||
$('#register-form').submit();
|
||||
});
|
||||
$("a#nbtn").click(function(event) {
|
||||
event.preventDefault();
|
||||
var telephoneObj = document.getElementById('telephone');
|
||||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||||
alert('手机号码格式不正确');
|
||||
telephoneObj.focus();
|
||||
return false;
|
||||
}
|
||||
if (InterValObj) {
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo url('__ORICOROOT__/customer/sendsms'); ?>',
|
||||
data: {telephone: telephoneObj.value, register: 1},
|
||||
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>");
|
||||
}
|
||||
}
|
||||
function isNull(data) {
|
||||
return (data == "" || data == undefined || data == null) ? true : false;
|
||||
}
|
||||
function trim(str) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
function isTelephone(value) {
|
||||
var isMobile = /^1[345789]\d{9}$/;
|
||||
return isMobile.test(value);
|
||||
}
|
||||
function validEmail(email) {
|
||||
//对电子邮件的验证
|
||||
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||||
return reg.test(email);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
function register()
|
||||
{
|
||||
var telephone = $("#telephone").val();
|
||||
var captcha = $("#captcha").val();
|
||||
|
||||
data = {
|
||||
telephone: telephone,
|
||||
captcha: captcha
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/mobile/customer/new_register',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if (res.code == 200)
|
||||
{
|
||||
location.href = '/mobile/customer/personal.html';
|
||||
}
|
||||
if (res.code < 0)
|
||||
{
|
||||
alert(res.msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user