Authored by lore-w

注册页bug修改、商品列表样式修改 code review by liuyue

<div class="register-page">
<!--<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">-->
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled="">
</li>
{{# loginUrl}}
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{.}}">完善信息</a>
</li>
{{/loginUrl}}
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled="">
</li>
{{# loginUrl}}
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{.}}">快速登录</a>
</li>
{{/loginUrl}}
{{# skipUrl}}
<li class="skip-user-info">
<a href="{{.}}">跳过此步</a>
</li>
{{/skipUrl}}
{{# skipUrl}}
<li class="skip-user-info">
<a href="{{.}}">跳过此步</a>
</li>
{{/skipUrl}}
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
<!--</form>-->
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -39,12 +39,12 @@
<div class="good-detail-text">
<a href="{{url}}">{{name}}</a>
<p class="price">
<span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">
¥{{salePrice}}
</span>
{{# marketPrice}}
<span class="market-price">¥{{.}}</span>
{{/ marketPrice}}
<span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">
¥{{salePrice}}
</span>
</p>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -29,7 +29,9 @@ var $pwdIntensity = $('.pwd-intensity'),
//signup验证
var $region = $('#country-code'),
$regionSelect = $('#region');
$regionSelect = $('#region'),
isPwd = false,
pwdVal;
setTimeout(function() {
$pn.val('');
... ... @@ -43,10 +45,13 @@ setTimeout(function() {
$ca.attr('maxlength', caCount);
//密码规则提示
$pwd.focus(function() {
$pwd.focus(function(event) {
$pwdTips.removeClass('hide');
isPwd = true;
pwdVal = $(this).val();
}).blur(function() {
$pwdTips.addClass('hide');
isPwd = false;
});
... ... @@ -509,6 +514,23 @@ exports.init = function(page) {
});
});
// 防止粘贴密码
/*$('#pwd, #repwd').keydown(function (event) {
console.log(event.ctrlKey);
console.log(isPwd);
console.log(event.keyCode);
if (event.ctrlKey && isPwd && event.keyCode === 86) {
$(this).val(pwdVal);
}
});*/
$pwd[0].onpaste = function() {
return false;
};
//ajax表单提交
$registerBtn.click(function() {
... ...
... ... @@ -27,7 +27,7 @@
outline: none;
}
input {
input.input {
height: 43px;
line-height: 43px;
font-size: 16px;
... ... @@ -53,28 +53,26 @@
float: left;
}
&.send-captcha {
top: 0;
background: #ff1901;
position: absolute;
width: 100px;
right: 0;
font-size: 12px;
text-indent: 0;
letter-spacing: 0;
&.disable {
background: #555;
}
}
&.agree-terms {
width: initial;
height: initial;
vertical-align: middle;
}
}
input.send-captcha {
top: 0;
background: #ff1901;
position: absolute;
width: 100px;
right: 0;
font-size: 12px;
text-indent: 0;
letter-spacing: 0;
&.disable {
background: #555;
}
}
.link {
text-decoration: underline;
color: #ff1901;
... ...
... ... @@ -52,6 +52,11 @@
> .price {
margin-top: 10px;
}
.market-price {
text-decoration: line-through;
color: #999;
}
}
.col-btn {
... ...
... ... @@ -2,7 +2,7 @@
use Action\AbstractAction;
class RegisterController extends AbstractAction
class Register1Controller extends AbstractAction
{
/**
* 登录页
... ... @@ -49,7 +49,7 @@ class RegisterController extends AbstractAction
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190'
)
);
$this->_view->display('index', $data);
$this->_view->display('../register/index', $data);
}
public function checkmobileAction()
... ...