Commit 4128839e by 梁建民

注册

parent c7bc33b6
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<div class="person"> <div class="person">
<div class="wrap"> <div class="wrap">
<div class="register layui-form"> <div class="register layui-form">
<input type="hidden" name="code_type" value="1">
<p class="tit"> <p class="tit">
<em class="va-m lineBlock"></em> <em class="va-m lineBlock"></em>
<span class="va-m">注册账户</span> <span class="va-m">注册账户</span>
...@@ -27,8 +28,10 @@ ...@@ -27,8 +28,10 @@
</div> </div>
<div class="input-wrap"> <div class="input-wrap">
<i class="iconfont iconpassword va-m"></i> <i class="iconfont iconpassword va-m"></i>
<input type="text" class="w w1 va-m" placeholder="请输入密码" name="password"> <div class="pwd lineBlock">
<i class="iconfont iconjuxing27 va-m lineBlock"></i> <input type="password" class="w w1 va-m" placeholder="请输入密码" name="password">
</div>
<i class="iconfont iconjuxing27 va-m lineBlock eyes"></i>
</div> </div>
<!--验证码--> <!--验证码-->
<div class="input-wrap" id="verifiCode" style="display: none"> <div class="input-wrap" id="verifiCode" style="display: none">
...@@ -42,7 +45,11 @@ ...@@ -42,7 +45,11 @@
<input type="text" name="code" class="w w1 va-m" placeholder="请输入手机验证码"> <input type="text" name="code" class="w w1 va-m" placeholder="请输入手机验证码">
<input type="button" name="codetext" class="lineBlock text va-m" value="发送验证码"/> <input type="button" name="codetext" class="lineBlock text va-m" value="发送验证码"/>
</div> </div>
<input type="hidden" name="code_type" value="1"> <!--错误提示-->
<div class="error-text" style="display: none">
<i class="iconfont iconjuxing20 va-m"></i>
<span class="va-m"></span>
</div>
<div class="btn-wrap"> <div class="btn-wrap">
<a href="javascript:;" class="btn" lay-submit lay-filter="register">注册</a> <a href="javascript:;" class="btn" lay-submit lay-filter="register">注册</a>
</div> </div>
...@@ -63,6 +70,15 @@ ...@@ -63,6 +70,15 @@
<include file="public/foot"/> <include file="public/foot"/>
<script src="__PUBLIC__/js/person/register.js"></script> <script src="__PUBLIC__/js/person/register.js"></script>
<script type="text/html" id="pwdHtml">
{{# if (d.flag== 1) { }}
<input type="text" class="w w1 va-m" placeholder="请输入密码" name="password" value="{{d.value}}">
{{# } else { }}
<input type="password" class="w w1 va-m" placeholder="请输入密码" name="password" value="{{d.value}}">
{{# } }}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -11,12 +11,17 @@ ...@@ -11,12 +11,17 @@
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
<script> <script>
var auth_url = 'authapi', var auth_url = 'authapi',
so_url = 'soapi', so_url = 'soapi',
user_url = 'userapi', user_url = 'userapi',
goods_url = 'goodsapi', goods_url = 'goodsapi',
inquiry_url = 'inquiryapi', inquiry_url = 'inquiryapi',
dist = '__PUBLIC__'; index_url = 'indexicsales',
passport_url = 'passporticsales',
search_url = 'searchicsales',
home_url = 'homeicsales',
item_url = 'itemicsales',
dist = '__PUBLIC__';
</script> </script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
\ No newline at end of file
...@@ -331,7 +331,8 @@ body { ...@@ -331,7 +331,8 @@ body {
color: #2e3033; color: #2e3033;
margin-left: 5px; margin-left: 5px;
} }
.person .wrap .register .iconjuxing27 { .person .wrap .register .iconjuxing27,
.person .wrap .register .iconiconxiantiaoshouji {
font-size: 20px; font-size: 20px;
color: #adb6bf; color: #adb6bf;
width: 112px; width: 112px;
......
...@@ -395,7 +395,7 @@ body { ...@@ -395,7 +395,7 @@ body {
} }
} }
.iconjuxing27 { .iconjuxing27,.iconiconxiantiaoshouji{
font-size: 20px; font-size: 20px;
color: #adb6bf; color: #adb6bf;
width: 112px; width: 112px;
......
No preview for this file type
...@@ -116,6 +116,9 @@ Created by iconfont ...@@ -116,6 +116,9 @@ Created by iconfont
<glyph glyph-name="password" unicode="&#58912;" d="M283.830857 501.430857V596.662857a238.153143 238.153143 0 0 0 237.860572 237.897143 238.153143 238.153143 0 0 0 237.897142-237.897143v-95.232a194.889143 194.889143 0 0 0 160.914286-191.634286v-164.352a194.779429 194.779429 0 0 0-194.56-194.56H317.44a194.779429 194.779429 0 0 0-194.56 194.56V309.76a194.889143 194.889143 0 0 0 160.950857 191.634286z m61.44 2.925714h352.877714V596.662857a176.64 176.64 0 0 1-176.457142 176.457143 176.64 176.64 0 0 1-176.420572-176.457143v-92.306286z m-27.830857-61.44a133.266286 133.266286 0 0 1-133.12-133.12v-164.352a133.266286 133.266286 0 0 1 133.12-133.12h408.502857a133.266286 133.266286 0 0 1 133.12 133.12V309.76a133.266286 133.266286 0 0 1-133.12 133.12H317.44z m204.251429-144.091428a71.314286 71.314286 0 0 1-71.241143-71.241143 71.314286 71.314286 0 0 1 71.241143-71.204571 71.314286 71.314286 0 0 1 71.241142 71.204571 71.314286 71.314286 0 0 1-71.241142 71.241143z m0-203.885714c-73.142857 0-132.681143 59.501714-132.681143 132.644571 0 73.179429 59.538286 132.681143 132.681143 132.681143s132.681143-59.501714 132.681142-132.681143c0-73.142857-59.501714-132.644571-132.681142-132.644571z" horiz-adv-x="1024" /> <glyph glyph-name="password" unicode="&#58912;" d="M283.830857 501.430857V596.662857a238.153143 238.153143 0 0 0 237.860572 237.897143 238.153143 238.153143 0 0 0 237.897142-237.897143v-95.232a194.889143 194.889143 0 0 0 160.914286-191.634286v-164.352a194.779429 194.779429 0 0 0-194.56-194.56H317.44a194.779429 194.779429 0 0 0-194.56 194.56V309.76a194.889143 194.889143 0 0 0 160.950857 191.634286z m61.44 2.925714h352.877714V596.662857a176.64 176.64 0 0 1-176.457142 176.457143 176.64 176.64 0 0 1-176.420572-176.457143v-92.306286z m-27.830857-61.44a133.266286 133.266286 0 0 1-133.12-133.12v-164.352a133.266286 133.266286 0 0 1 133.12-133.12h408.502857a133.266286 133.266286 0 0 1 133.12 133.12V309.76a133.266286 133.266286 0 0 1-133.12 133.12H317.44z m204.251429-144.091428a71.314286 71.314286 0 0 1-71.241143-71.241143 71.314286 71.314286 0 0 1 71.241143-71.204571 71.314286 71.314286 0 0 1 71.241142 71.204571 71.314286 71.314286 0 0 1-71.241142 71.241143z m0-203.885714c-73.142857 0-132.681143 59.501714-132.681143 132.644571 0 73.179429 59.538286 132.681143 132.681143 132.681143s132.681143-59.501714 132.681142-132.681143c0-73.142857-59.501714-132.644571-132.681142-132.644571z" horiz-adv-x="1024" />
<glyph glyph-name="iconxiantiaoshouji" unicode="&#58913;" d="M800.9472 324.8128c-58.88-34.56-122.112-56.32-186.624-64.128l6.912-148.2752a30.6944 30.6944 0 1 0-61.3632-2.816l-6.8864 147.9424a442.5984 442.5984 0 0 0-153.2928 30.4128l-62.8736-134.1184a30.72 30.72 0 0 0-55.6032 26.112l62.976 134.3488c-56.6528 31.8208-106.752 76.1088-147.968 130.5344l-79.7184-103.68a30.592 30.592 0 0 0-43.0592-5.632 30.72 30.72 0 0 0-5.632 43.0336l92.416 120.2688a609.3312 609.3312 0 0 0-57.216 132.352 30.72 30.72 0 1 0 58.8288 17.7152c51.712-171.9552 173.2864-292.608 325.12-322.7136 151.8848-30.1568 310.1952 34.9696 423.68 174.1312a30.72 30.72 0 1 0 47.5904-38.8352 609.0752 609.0752 0 0 0-103.424-100.5056l39.5008-146.3808a30.72 30.72 0 0 0-59.3152-16.0256l-34.048 126.2592z" horiz-adv-x="1024" />
</font> </font>
......
No preview for this file type
No preview for this file type
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
var index = layer.load(1, { var index = layer.load(1, {
offset: ['50%', "50%"], offset: ['50%', "50%"],
shade: false shade: false
}) });
var platform = { var platform = {
source: 2, source: 2,
token: '' token: Util.getCookie('token') || ''
} };
var params = $.extend({}, platform, param); var params = $.extend({}, platform, param);
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
type: type, type: type,
url: url, url: url,
data: params, data: params,
dataType: dataTypeXpx, dataType: 'json',
xhrFields: { xhrFields: {
withCredentials: true withCredentials: true
}, },
......
...@@ -23,13 +23,18 @@ ...@@ -23,13 +23,18 @@
//商品数量获取 //商品数量获取
IcController.getData(apis.goodsCount, 'POST', null, function (res) { IcController.getData(apis.goodsCount, 'POST', null, function (res) {
var getTpl = countHtml.innerHTML; if (res.errcode == 0) {
layui.laytpl(getTpl).render(res.count, function (html) {
$(".good_total").empty().html(html); var getTpl = countHtml.innerHTML;
}); layui.laytpl(getTpl).render(res.count, function (html) {
$(".good_total").empty().html(html);
});
}
}); });
......
...@@ -45,8 +45,11 @@ ...@@ -45,8 +45,11 @@
if (res.err_code == 0) { if (res.err_code == 0) {
$verifiCode.hide();
$code.focus(); $code.focus();
//开始倒计时 //开始倒计时
var second = 60, timer = null; var second = 60, timer = null;
...@@ -97,12 +100,25 @@ ...@@ -97,12 +100,25 @@
if (!$password.val()) { if (!$password.val()) {
$password.parent('.input-wrap').addClass('error'); $password.parent().parent('.input-wrap').addClass('error');
return false; return false;
} }
//密码长度要大于6位,由数字和字母组成
var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,}$/;
if (!reg.test($password.val())) {
$password.parent().parent('.input-wrap').addClass('error');
$(".error-text").show().find("span").text('密码长度要大于6位,由数字和字母组成');
return false;
}
if (!$code.val()) { if (!$code.val()) {
$code.parent('.input-wrap').addClass('error'); $code.parent('.input-wrap').addClass('error');
...@@ -141,6 +157,7 @@ ...@@ -141,6 +157,7 @@
mobile: mobile, mobile: mobile,
code_type: 1 code_type: 1
} }
opt.getCode(opt, 'mobile', params); opt.getCode(opt, 'mobile', params);
} }
...@@ -155,6 +172,79 @@ ...@@ -155,6 +172,79 @@
}); });
//手机号
$('input[name="mobile"]').on('input propertychange', function () {
var val = $(this).val();
if (val) {
$(this).parent('.input-wrap').removeClass('error');
}
});
//密码
$('input[name="password"]').on('input propertychange', function () {
var val = $(this).val();
if (val) {
$(this).parent().parent('.input-wrap').removeClass('error');
//符合密码长度要大于6位,由数字和字母组成
var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,}$/;
if (reg.test(val)) {
$(".error-text").hide();
}
}
});
//手机验证码
$('input[name="code"]').on('input propertychange', function () {
var val = $(this).val();
if (val) {
$(this).parent('.input-wrap').removeClass('error');
}
});
//查看密码
$(".eyes").on('click', function () {
//兼容ie
var flag;
$(this).toggleClass('iconiconxiantiaoshouji');
flag = $(this).hasClass('iconiconxiantiaoshouji') ? '1' : '2';
var data = {
value: $("input[name='password']").val(),
flag: flag
};
var getTpl = pwdHtml.innerHTML;
layui.laytpl(getTpl).render(data, function (html) {
$(".pwd").empty().html(html);
});
});
//注册提交 //注册提交
layui.form.on('submit(register)', function (data) { layui.form.on('submit(register)', function (data) {
...@@ -169,7 +259,10 @@ ...@@ -169,7 +259,10 @@
if (res.err_msg == 0) { if (res.err_msg == 0) {
console.log(res) //注入token
Util.setCookie('token', res.access_token);
window.location.href = homeicsales_url + '/homes';
} else { } else {
...@@ -179,6 +272,13 @@ ...@@ -179,6 +272,13 @@
$(data.elem).removeClass("layui-btn-disabled"); $(data.elem).removeClass("layui-btn-disabled");
//处理验证码不正确的时候
if (res.err_code == 501) {
$("#verifiCode").show();
}
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment