Authored by xuqi

Merge branch 'feature/passport' of http://git.dev.yoho.cn/web/yohobuy into feature/passport

... ... @@ -5,43 +5,43 @@
<div class="content">
<div class="back-header clearfix">
<h2 class="title">找回密码</h2>
<span class="country-code">
<em>中国 +86</em>
<span id="country-code" class="country-code">
<em>{{countryName}} +{{countryCode}}</em>
<i class="iconfont">&#xe61d;</i>
</span>
<ul id="country-code-list" class="country-code-list">
<li data-cc="+61">澳大利亚 +61</li>
<li data-cc="+82">韩国 +82</li>
<li data-cc="+1">加拿大 +1</li>
<li data-cc="+60">马来西亚 +60</li>
<li data-cc="+1">美国 +1</li>
<li data-cc="+81">日本 +81</li>
<li data-cc="+65">新加坡 +65</li>
<li data-cc="+44">英国 +44</li>
<li data-cc="+86">中国 +86</li>
<li data-cc="+853">中国澳门 +853</li>
<li data-cc="+886">中国台湾 +886</li>
<li data-cc="+852">中国香港 +852</li>
{{# countryList}}
<li data-cc="+{{code}}">{{name}} +{{code}}</li>
{{/ countryList}}
</ul>
</div>
<form id="back-form" class="back-form" action="">
<input id="country-code-hide" type="hidden" name="country-code" value="+44">
<input id="country-code-hide" type="hidden" name="country-code" value="+86">
<ul>
<li class="input-container-li clearfix">
<input id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="邮箱/手机号码" autocomplete="off">
<ul id="tip-panel" class="tip-panel"></ul>
<span id="account-err" class="err-tip hide">
<i></i>
<em>账户名不能为空</em>
</span>
</li>
<li class="input-container-li clearfix">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="http://www.yohobuy.com/passport/images" alt="" onclick="imgcode()">
<a class="link change-captcha" onclick="imgcode()">换一张</a>
<img id="captcha-img" class="captcha-img" src="http://www.yohobuy.com/passport/images" alt="">
<a id="change-captcha" class="link change-captcha">换一张</a>
<span id="captcha-err" class="err-tip captcha-err hide">
<i></i>
<em>验证码不能为空</em>
</span>
</li>
<li class="input-container-li clearfix">
<input name="refer" id="refer" type="hidden" value="http%3A%2F%2Fwww.yohobuy.com%2F">
<input id="find-btn" class="btn find-btn disable" type="submit" value="下一步" disabled="">
<input id="find-btn" class="btn find-btn disable" type="submit" value="下一步" disabled="">
</li>
</ul>
</ul>
</form>
</div>
{{/ back}}
{{/ back}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="reset-pwd-page back-page passport-page yoho-page clearfix">
{{# resetPwd}}
{{> passport/cover}}
<div class="content">
<h2 class="title2">重置密码</h2>
<form id="reset-pwd-form" class="reset-pwd-form" method="POST" action="/passport/back/update">
<ul>
<li class="input-container-li po-re">
<input id="pwd" class="input va pwd" type="password" name="pwd" placeholder="新密码" maxlength="20">
<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="pwd-tips hide">
<div class="default" id="pwd-tip1">密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2">建议由字母、 数字、 符号两种以上组合</div>
</div>
<span id="pwd-err" class="err-tip hide">
<i></i>
<em>请输入密码</em>
</span>
</li>
<li class="input-container-li clearfix po-re">
<input id="re-input" class="input va re-input repwd" type="password" name="re-input" placeholder="再次输入" maxlength="20">
<span id="repwd-err" class="err-tip hide">
<i></i>
<em>请输入密码确认</em>
</span>
</li>
<li class="input-container-li clearfix">
<input type="hidden" name="code" value="159bI6arxsuaPBxG2iV9OE9BrgDnAPiTecUqYh2iUC3ntt6S0eOtxXpVu+jWIlveXx9NRuwS9zdrXzcUyOd+d3ikzYBAo0k">
<input id="reset-pwd-btn" class="btn reset-pwd-btn" type="submit" value="提交" disabled="">
</li>
</ul>
</form>
</div>
{{/ resetPwd}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="reset-success-page back-page passport-page yoho-page clearfix">
{{# resetSuccess}}
{{> passport/cover}}
<div class="content">
<div class="success-text">
<i class="iconfont">&#xe620;</i><span>恭喜!</span>密码修改成功,&nbsp;<span id="count-down">5</span>&nbsp;&nbsp;秒后将跳转至首页
</div>
<a class="success-btn" href="/">随便逛逛</a>
</div>
{{/ resetSuccess}}
</div>
{{> layout/footer}}
... ...
{{> layout/simple-header}}
<div class="send-email-page passport-page yoho-page clearfix">
{{# sendEmail}}
{{> passport/cover}}
<div class="content">
<div class="send-tips"><i class="iconfont">&#xe61e;</i>我们已经把验证邮件发送至您的邮箱,请在24小时内通过邮件内的<br>链接继续设置新的密码。</div>
<div class="no-find">没有收到?到您邮箱的垃圾邮件里找找。</div>
<div class="to-my-email">
<a href="http://mail.qq.com" target="_blank" class="btn_b_ar_r">去我的邮箱&gt;</a>
</div>
</div>
{{/ sendEmail}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/simple-header}}
<div class="verification-page back-page passport-page yoho-page clearfix">
{{# verification}}
{{> passport/cover}}
<div class="content">
<form id="verification-form" class="verification-form" method="POST" action="/passport/back/backmobile">
<ul>
<li class="head-title">验证身份</li>
<li class="po-re">
<label class="pn-label">手机号码</label>
<span class="country-code">+86</span>
<span class="phone-num">18115624066</span>
</li>
<li class="po-re">
<input id="captcha" class="input va captcha" type="text" name="captcha">
<input id="send-captcha" class="btn send-captcha" type="button" value="发送验证码" disabled="">
<div id="captcha-tip" class="captcha-tips"><i class="iconfont">&#xe61f;</i>验证码已发送至您的手机,请查收</div>
<span id="err-tip" class="err-tip hide">
<i></i>
<em>请输入验证码</em>
</span>
</li>
<li>
<input name="area" id="area" type="hidden" value="86">
<input name="mobile" id="mobile" type="hidden" value="18115624066">
<input name="captchaPic" id="captchaPic" type="hidden" value="g7ce">
<input name="refer" id="refer" type="hidden" value="">
<input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled="">
</li>
</ul>
</form>
</div>
{{/ verification}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -31,4 +31,25 @@
<script>
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 找回密码--}}
{{#if backPage}}
<script>
seajs.use('js/passport/back');
</script>
{{/if}}
{{!-- 重置密码--}}
{{#if resetPage}}
<script>
seajs.use('js/passport/reset');
</script>
{{/if}}
{{!-- 验证手机 --}}
{{#if vertificationPage}}
<script>
seajs.use('js/passport/vertification');
</script>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Mon Dec 14 09:37:47 2015
Created by FontForge 20120731 at Mon Dec 14 13:45:36 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Mon Dec 14 09:37:47 2015
bbox="0 -214 1172.1 864"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E61D"
unicode-range="U+0078-E620"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -105,5 +105,15 @@ M982 137z" />
<glyph glyph-name="uniE61D" unicode="&#xe61d;"
d="M888 620q8 8 18.5 10.5t20.5 0t18 -10.5q4 -4 6.5 -8.5t4 -9.5t1.5 -10.5t-1.5 -10t-4 -9.5t-6.5 -9l-406 -405q-12 -12 -28.5 -12t-27.5 12q-6 5 -9 12.5t-3 15.5t3 15t9 13zM539 214q3 -3 5 -6t3.5 -7t2 -7.5t0.5 -7.5t-0.5 -8t-2 -7.5t-3.5 -6.5t-5 -6
q-12 -12 -28.5 -12t-28.5 12l-406 405q-7 8 -10 18.5t0 20.5t10 18q6 6 13.5 9t15 3t15 -3t13.5 -9zM539 214z" />
<glyph glyph-name="uniE61E" unicode="&#xe61e;"
d="M127 769v-770h770v770h-770zM555 170h-86v86h86v-86zM555 298h-86v257h86v-257z" />
<glyph glyph-name="uniE61F" unicode="&#xe61f;"
d="M511.5 747q-72.5 0 -141 -22.5t-123.5 -64t-96 -96.5t-63.5 -123t-22.5 -141q0 -91 35 -173.5t95 -142.5t143 -95.5t173.5 -35.5t173.5 35.5t143 95.5t95 142.5t35 173.5q1 73 -22 141t-64 123t-96 96.5t-123.5 64t-141 22.5zM452 100h-1v0l-38 38l-179 180l38 37
l179 -179l318 318l38 -38zM512 -147q-91 0 -175 35q-80 34 -142 96t-96 142q-8 21 -15 42t-11 43t-6.5 44t-2.5 45q0 91 35 174q34 81 96 142.5t142 95.5q84 36 175 36q45 0 88.5 -9t85.5 -27q40 -16 75.5 -40.5t66.5 -54.5q20 -21 38 -44t32.5 -47.5t25.5 -51.5
q35 -83 35 -174t-35 -174q-34 -80 -96 -142t-142 -96q-14 -6 -28 -11t-28.5 -9t-29 -6.5t-29 -4.5t-29.5 -3t-30 -1zM511.5 747q-90.5 0 -173 -35.5t-142.5 -95.5t-95.5 -142.5t-35.5 -173.5t35.5 -173.5t95.5 -142.5t142.5 -95t173 -35t173.5 35t142.5 95t95 142.5
t35.5 173.5t-35.5 173.5t-95 142.5t-142.5 95.5t-173.5 35.5zM451 99l-38 39l-180 180l39 38l179 -180l318 318l39 -38zM414 138l37 -37l355 355l-37 37l-318 -318l-179 180l-38 -37z" />
<glyph glyph-name="uniE620" unicode="&#xe620;"
d="M958 662q0 30 -21 51.5t-51 21.5h-749q-30 0 -51 -21.5t-21 -51.5v-748q0 -30 21 -51t51 -21h749q30 0 51 21t21 51v748zM778 358l-267 -267q-14 -14 -34 -14q-9 0 -18 3.5t-16 10.5l-168 168q-14 14 -14 34t14 34q9 10 21.5 13t25 0t21.5 -13l134 -133l233 232
q9 10 21.5 13t25 0t21.5 -13q14 -14 14 -34t-14 -34z" />
</font>
</defs></svg>
... ...
/**
* 找回密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery'),
phoneRegx = require('./mail-phone-regx').phoneRegx;
var $cr = $('#country-code-hide'),
$phoneNum = $('#phone-num'),
$ca = $('#captcha'),
$tipPanel = $('#tip-panel'),
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
acAccount = [
['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序
['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序
],
$ccList = $('#country-code-list'),
$cc = $('#country-code'),
$btn = $('#find-btn'),
$accErr = $('#account-err'),
$caErr = $('#captcha-err'),
time, //timeout-id
caCount = 4, //验证码位数
hasPh = false,
hasCa = false;
require('../../plugin/jquery.placeholder');
/*function getSource(column, postition, event) {
try {
dataLayer.push({
louceng: column,
weizhi: postition,
event: event
});
} catch (e) {}
}*/
function imgcode() {
$('#captcha-img').attr('src', 'http://www.yohobuy.com/passport/images?t=' + Math.random());
//getSource('yoho_family_web', '换一张', 'homepage_man');
}
function enableBtn() {
if (hasPh && hasCa) {
$btn.removeClass('disable').prop('disabled', false);
} else {
$btn.addClass('disable').prop('disabled', true);
}
}
function vaPn(v) {
var pass = true,
errTxt = '';
v = $.trim(v);
if (v !== '') {
if (/^[0-9]+$/.test(v)) {
if (phoneRegx[$cr.val()].test(v)) {
pass = true;
} else {
errTxt = '手机号码格式不正确, 请重新输入';
pass = false;
}
} else {
if (emailReg.test(v)) {
pass = true;
} else {
errTxt = '邮箱格式不正确, 请重新输入';
pass = false;
}
}
} else {
errTxt = '账户名不能为空';
pass = false;
}
hasPh = pass;
return {
pass: pass,
errTxt: errTxt
};
}
function vaCa() {
var v = $.trim($ca.val());
if (v === '' || v.length < caCount) {
hasCa = false;
enableBtn();
return;
} else {
$.ajax({
type: 'POST',
url: '/passport/back/authcode',
data: {
code: v,
mobile: $('#phone-num').val(),
area: $('#country-code-hide').val()
}
}).then(function(data) {
if (data.code === 200) {
hasCa = true;
} else {
hasCa = false;
imgcode();
}
enableBtn();
});
}
}
$ca.attr('maxlength', caCount);
//IE8 placeholder
$('input').placeholder();
$('#change-captcha, #captcha-img').on('click', function() {
imgcode();
});
$cc.on('click', function(e) {
e.stopPropagation();
if ($ccList.css('style') === 'block') {
$ccList.slideUp('fast');
} else {
$ccList.slideDown('fast');
}
});
$ccList.delegate('li', 'click', function(e) {
var $cur = $(this),
code = $cur.data('cc'),
pnVa;
e.stopPropagation();
$cr.val(code);
$cc.find('em').html($cur.text());
//切换后验证手机号码
if ($.trim($phoneNum.val()) !== '') {
pnVa = vaPn($phoneNum.val());
enableBtn();
if (hasPh) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').text(pnVa.errTxt);
$phoneNum.addClass('error');
}
}
$ccList.slideUp('fast');
});
$(document).click(function() {
if ($tipPanel.css('display') === 'block') {
$tipPanel.slideUp();
}
if ($ccList.css('display') === 'block') {
$ccList.slideUp();
}
});
$phoneNum.keyup(function() {
var account = $.trim($(this).val()),
html = '',
acs,
i;
//输入@时显示自动补全列表
if (account.indexOf('@') !== -1 && account.lastIndexOf('@') === account.indexOf('@')) {
if (/^[0-9]*@$/.test(account)) {
//数字顺序
acs = acAccount[0];
} else {
acs = acAccount[1];
}
for (i = 0; i < acs.length; i++) {
html += '<li>' + account.slice(0, account.indexOf('@')) + '@' + acs[i] + '</li>';
}
$tipPanel.html(html).slideDown();
} else {
$tipPanel.slideUp();
}
vaPn(account);
enableBtn();
}).blur(function() {
time = setTimeout(function() {
var pnVa = vaPn($phoneNum.val());
if (pnVa.pass) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').find('em').text(pnVa.errTxt);
$phoneNum.addClass('error');
}
}, 170);
}).focus(function() {
$(this).removeClass('error');
//focus隐藏错误提示
$accErr.addClass('hide');
});
//验证码在鼠标移开后验证, keyup时不再验证
$ca.blur(function() {
var errTxt = $.trim($ca.val()) === '' ? '验证码不能为空' : '验证码不正确';
if (hasCa) {
$caErr.addClass('hide');
$ca.removeClass('error');
} else {
$caErr.removeClass('hide').find('em').text(errTxt);
$ca.addClass('error');
//验证码错误则刷新验证码
imgcode();
}
}).focus(function() {
$(this).removeClass('error');
//focus隐藏错误提示
$caErr.addClass('hide');
}).keyup(function() {
vaCa();
});
$tipPanel.delegate('li', 'click', function(e) {
var account = $(this).text(),
pnVa;
e.stopPropagation();
$phoneNum.val(account);
if (time) {
clearTimeout(time);
pnVa = vaPn(account);
enableBtn();
if (pnVa.pass) {
$accErr.addClass('hide');
$phoneNum.removeClass('error');
} else {
$accErr.removeClass('hide').find('em').text(pnVa.errTx);
$phoneNum.addClass('error');
}
time = null;
}
$tipPanel.slideUp();
});
$('#find-btn').click(function(e) {
//getSource('yoho_family_web', '下一步按钮', 'homepage_man');
if (/^[0-9]+$/.test($.trim($phoneNum.val()))) {
$('#find-form').attr('action', '/passport/back/mobile');
}
if ($(this).hasClass('disable')) {
return;
}
if (!hasCa || !hasPh) {
e.preventDefault();
return true;
}
});
\ No newline at end of file
... ...
/**
* 找回密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery');
var $pwd = $('#pwd'),
$repwd = $('#re-input'),
$next = $('#reset-pwd-btn'),
$pwdErr = $('#pwd-err'),
$repwdErr = $('#repwd-err'),
$pwdTips = $('#pwd-tips');
var hasNoErrPw = false;
var $pwdIntensity = $('.pwd-intensity'),
$pwdParent = $pwdIntensity.closest('.pwd-intensity-container'),
$pwdTip1 = $('#pwd-tip1');
require('../../plugin/jquery.placeholder');
/*
* 计算密码复杂度
*/
function gettype(str, i) {
if (str.charCodeAt(i) >= 48 && str.charCodeAt(i) <= 57) {
return 1;
} else if (str.charCodeAt(i) >= 97 && str.charCodeAt(i) <= 122) {
return 2;
} else if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
return 3;
}
return 4;
}
function isregular(cur, pre, type) {
var curCode = cur.charCodeAt(0);
var preCode = pre.charCodeAt(0);
if (curCode - preCode === 0) {
return true;
}
if (type !== 4 && (curCode - preCode === 1 || curCode - preCode === -1)) {
return true;
}
return false;
}
function getcomplex(curType, preType) {
if (preType === 0 || curType === preType) {
return 0;
} else if (curType === 4 || preType === 4) {
return 2;
} else {
return 1;
}
}
function computeComplex(password) {
var complex = 0,
length = password.length,
pre = '',
preType = 0,
i = 0,
cur,
curType;
for (i = 0; i < length; i++) {
cur = password.charAt(i);
curType = gettype(password, i);
if (preType !== curType || !isregular(cur, pre, curType)) {
complex += curType + getcomplex(curType, preType);
}
pre = cur;
preType = curType;
}
return complex;
}
function pwdKeyupEvt() {
var pwd = $pwd.val(),
pwdStrength = computeComplex(pwd),
level = 0;
//TODO:自定义密码强度规则,需要修正
if (pwdStrength === 0) {
level = 0;
} else if (pwdStrength <= 10) {
level = 1;
} else if (pwdStrength <= 20) {
level = 2;
} else {
level = 3;
}
switch (level) {
case 0:
$pwdParent.removeClass('red yellow green');
$pwdIntensity.removeClass('color');
break;
case 1:
$pwdParent.addClass('red').removeClass('yellow green');
$pwdIntensity.filter('.low').addClass('color');
$pwdIntensity.filter('.mid,.high').removeClass('color');
break;
case 2:
$pwdParent.addClass('yellow').removeClass('red green');
$pwdIntensity.filter('.low,.mid').addClass('color');
$pwdIntensity.filter('.high').removeClass('color');
break;
case 3:
$pwdParent.addClass('green').removeClass('yellow red');
$pwdIntensity.addClass('color');
break;
}
//
if (pwd === '') {
hasNoErrPw = false;
$pwdTip1.removeClass('red yes no').addClass('default');
} else {
if (pwd.length < 6 || pwd.length > 20) {
hasNoErrPw = false;
$pwdTip1.removeClass('default yes').addClass('no red');
} else {
hasNoErrPw = true;
$pwdTip1.removeClass('default no red').addClass('yes');
}
//提示2不做验证
}
}
//IE8 placeholder
$('input').placeholder();
$('.va').keyup(function() {
var pass = true;
if ($(this).hasClass('pwd')) {
pwdKeyupEvt();
} else {
if ($(this).val() === '') {
pass = false;
}
}
if (pass && hasNoErrPw && $pwd.val() === $repwd.val()) {
pass = true;
} else {
pass = false;
}
if (pass) {
$next.removeClass('disable').prop('disabled', false);
} else {
$next.addClass('disable').prop('disabled', true);
}
}).blur(function() {
var v = $(this).val();
if ($(this).hasClass('pwd')) {
if (v === '') {
$(this).addClass('error');
$pwdErr.removeClass('hide').find('em').text('请输入密码');
} else if (v.length < 6 || v.length > 20) {
$(this).addClass('error');
$pwdErr.removeClass('hide').find('em').text('密码只支持6-20位');
} else {
$pwdErr.addClass('hide');
if ($repwd.val() !== '') {
if (v !== $repwd.val()) {
$repwd.addClass('error');
$repwdErr.removeClass('hide').find('em').text('两次密码输入不一致,请重新输入');
} else {
$repwd.removeClass('error');
$repwdErr.addClass('hide');
}
}
}
} else {
if (v === '') {
$(this).addClass('error');
$repwdErr.removeClass('hide').find('em').text('请输入密码确认');
} else {
if ($pwd.val() !== '' && v !== $pwd.val()) {
$(this).addClass('error');
$repwdErr.removeClass('hide').find('em').text('两次密码输入不一致,请重新输入');
} else {
$(this).removeClass('error');
$repwdErr.addClass('hide');
}
}
}
}).focus(function() {
$(this).removeClass('error');
//focus后错误提示隐藏
if ($(this).hasClass('pwd')) {
$pwdErr.addClass('hide');
} else {
$repwdErr.addClass('hide');
}
});
$pwd.focus(function() {
$pwdErr.addClass('hide');
$pwdTips.removeClass('hide');
}).blur(function() {
$pwdTips.addClass('hide');
});
$('#pwd, #repwd').keydown(function(e) {
var code = e.keyCode || e.which;
//空格输入过滤
if (code === 32) {
e.preventDefault();
return;
}
});
... ...
/**
* 验证手机
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('yoho.jquery');
var $sc = $('#send-captcha'),
$msgTip = $('#captcha-tip'),
$errTip = $('#err-tip'),
$next = $('#next-step'),
seconds,
itime;
$sc.click(function() {
$.post('/passport/register/authcode', {
mobile: $('#mobile').val(),
area: $('#area').val(),
captcha: $('#captchaPic').val(),
project: 'repassword'
}, function(jsonData) {
if (jsonData.code === 200) {
$errTip.hide();
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
} else {
$(this).addClass('error');
$errTip.removeClass('hide').text('发送失败');
}
});
});
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
$('#captcha').keyup(function() {
var v = $.trim($(this).val());
if (v !== '') {
//添加验证码正确验证
//$next.removeClass('disable').prop('disabled', false);
$next.removeClass('disable').removeAttr('disabled');
} else {
//$next.addClass('disable').prop('disabled', true);
$next.addClass('disable').attr('disabled', true);
}
}).blur(function() {
var v = $.trim($(this).val());
if (v === '') {
//添加验证码正确验证
$(this).addClass('error');
$errTip.removeClass('hide');
} else {
$(this).removeClass('error');
$errTip.addClass('hide');
}
}).focus(function() {
$(this).removeClass('error');
});
\ No newline at end of file
... ...
... ... @@ -16,7 +16,8 @@
"yoho.lazyload": "1.0.0",
"yoho.handlebars": "3.0.3",
"yoho.jquery": "1.8.3",
"json2": "1.0.0"
"json2": "1.0.0",
"placeholders.js": "3.0.3"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
/*!
* HTML5 Placeholder jQuery Plugin v1.8.3
* @link http://mths.be/placeholder
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
var jQuery = require('yoho.jquery');
(function(f){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this};f.fn.placeholder.input=f.fn.placeholder.textarea=true}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()};f.fn.placeholder.input=e;f.fn.placeholder.textarea=a;f(function(){f('form').bind('submit.placeholder',function(){var g=f('.placeholder',this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.placeholder',function(){f('.placeholder').val('')})}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr('placeholder')&&g.hasClass('placeholder')){if(g.data('placeholder-password')){g.hide().next().attr('id',g.removeAttr('id').data('placeholder-id')).show().focus()}else{g.val('').removeClass('placeholder')}}}function d(h){var l,k=f(this),g=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=f('<input>').attr(f.extend(c(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',b);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}}(jQuery));
\ No newline at end of file
... ...
... ... @@ -1083,6 +1083,7 @@
span, a {
font-size: 12px;
vertical-align: middle;
}
.tell-icon {
... ...
... ... @@ -10,20 +10,37 @@
width: 268px;
line-height: 40px;
margin-bottom: 5px;
.country-code {
float: right;
cursor: pointer;
color: #b9b9b9;
.iconfont {
font-size: 14px;
vertical-align: middle;
}
}
}
.title {
float: left;
margin: 0px;
font-size: 22px;
line-height: 40px;
color: #000;
font-weight: normal;
}
.title2 {
margin: 0 0 5px;
font-size: 22px;
line-height: 40px;
color: #000;
font-weight: normal;
}
.country-code {
float: right;
cursor: pointer;
color: #b9b9b9;
.err-tip.captcha-err {
top: 10px;
left: 326px;
}
.country-code-list {
... ... @@ -42,12 +59,187 @@
li {
height: 20px;
line-height: 20px;
line-height: 20px;
}
}
input {
padding: 0;
outline: none;
font-family: Regular, 'SimHei';
font-family: Regular, arial, 'Microsoft YaHei';
}
.input-container-li {
position: relative;
margin-bottom: 22px;
.btn {
width: 270px;
height: 45px;
line-height: 45px;
cursor: pointer;
font-size: 20px;
border: none;
letter-spacing: 0;
}
.captcha {
width: 160px;
}
.captcha-img {
height: 37px;
width: 90px;
border: 0;
margin-left: 10px;
vertical-align: middle;
outline: none;
cursor: pointer;
}
.change-captcha {
color: #ff1901;
font-size: 12px;
text-decoration: underline;
margin-left: 10px;
cursor: pointer;
}
}
}
.send-email-page {
font-size: 14px;
.content {
margin: 216px 0 0 !important;
}
.send-tips {
line-height: 28px;
color: #4c4c4c;
text-align: center;
font-size: 15px;
.iconfont {
margin: 0 8px 0 0;
}
}
.no-find {
margin: 10px 0 0 0;
line-height: 20px;
color: #a5a4a4;
text-align: center;
}
.to-my-email {
a {
display: block;
margin: 53px auto 0;
width: 270px;
height: 45px;
line-height: 45px;
background: #ff1901;
text-align: center;
color: #fff;
letter-spacing: 2px;
}
}
}
.verification-page .content{
li {
position: relative;
margin-bottom: 43px;
}
.btn {
@include inline-block;
border: none;
}
.head-title {
font-size: 24px;
color: #000;
}
.pn-label {
color: #828282;
font-size: 16px;
}
.country-code {
margin: 0 10px;
}
.country-code, .phone-num {
color: #000;
font-size: 16px;
}
.captcha {
width: 160px !important;
}
.send-captcha {
width: 133px;
font-size: 12px;
position: relative;
top: -1px;
letter-spacing: 0;
}
.err-tip {
left: 310px;
}
.captcha-tips {
position: absolute;
top: 50px;
color: #a5a4a4;
.iconfont {
color: #0F9ACD;
font-size: 14px;
margin: 0 8px 0 0;
vertical-align: 12%;
}
}
}
.reset-success-page {
.content {
margin: 255px 0 0 !important;
}
.success-text {
line-height: 35px;
.iconfont {
font-size: 30px;
color: #ee3f14;
}
span {
font-size: 24px;
margin: 0 18px;
}
#count-down {
color: #ee3f14;
}
}
.success-btn {
display: block;
margin: 43px auto 0;
width: 269px;
line-height: 269px;
height: 45px;
line-height: 45px;
font-size: 14px;
color: #fff;
text-align: center;
background-color: #ff1901;
}
}
\ No newline at end of file
... ...
@import "login", "register", "back";
$tip: sprite-map("passport/tip/*.png", $spacing: 10px);
/**/
.passport-page {
width: 1150px;
... ... @@ -17,6 +18,7 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px);
height: 43px;
font-size: 16px;
line-height: 1.2;
line-height: 43px\9;
width: 268px;
border: 1px solid #dbdbdb;
text-indent: 10px;
... ... @@ -39,8 +41,75 @@ $tip: sprite-map("passport/tip/*.png", $spacing: 10px);
letter-spacing: 10px;
font-size: 20px;
cursor: pointer;
&.disable {
background-color: #555;
cursor: default;
}
}
.pwd-intensity-container {
width: 270px;
text-align: right;
padding-top: 5px;
&.red {
.pwd-intensity {
color: #ee0011;
}
.color {
background: #ee0011;
color: #fff;
}
}
&.yellow {
.pwd-intensity {
color: #ff0;
}
.color {
background: #ff0;
color: #fff;
}
}
&.green {
.pwd-intensity {
color: #0f0;
}
.color {
background: #0f0;
color: #fff;
}
}
.pwd-intensity {
height: 15px;
font-size: 12px;
background-color: #e8e8e8;
padding: 0px 10px;
text-align: center;
color: #b9b9b9;
}
}
.tip-panel {
position: absolute;
display: none;
width: 248px;
padding: 0 10px;
z-index: 100;
background-color: #161616;
border: 1px solid rgba(255, 255, 255, 0.7);
margin-top: 5px;
cursor: pointer;
@include border-radius(5px);
li {
height: 20px;
line-height: 20px;
color: #b9b9b9;
}
}
.err-tip {
position: absolute;
font-size: 14px;
... ...
... ... @@ -50,13 +50,241 @@ class BackController extends AbstractAction
);
$data = array(
'simpleHeader' => $simpleHeader,
'loginPage' => true,
'backPage' => true,
'back' => array(
'coverHref' => '/passport',
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
'countrys' => array()
'countryCode' => '86',
'countryName' => '中国',
'countryList' => array(
array(
'code' => '61',
'name' => '澳大利亚'
),
array(
'code' => '82',
'name' => '韩国'
),
array(
'code' => '1',
'name' => '加拿大'
),
array(
'code' => '86',
'name' => '中国'
)
)
)
);
$this->_view->display('index', $data);
}
/**
* 发送邮件
*/
public function sendemailAction() {
$simpleHeader = array(
'logo' => array(
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => 'http://www.yohobuy.com'
),
'tool' => array(
array(
'title' => 'Hi~',
'loginUrl' => 'www.yoho.com',
'regUrl' => ''
),
array(
'title' => 'MY有货',
'options' => array(
array(
'textCn' => '我的收藏',
'url' => ''
),
array(
'textCn' => '优惠券',
'url' => ''
),
)
),
array(
'title' => '订单中心',
'url' => 'http://www.yohobuy.com/home/orders?t=1449801433.5294'
),
array(
'title' => '帮助中心',
'url' => 'http://www.yohobuy.com/help'
),
array(
'title' => '400-9889-9646',
'tell' => true
)
)
);
$data = array(
'simpleHeader' => $simpleHeader,
'sendEmail' => array(
'coverHref' => '/passport',
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
'countrys' => array()
)
);
$this->_view->display('send-email', $data);
}
/**
* 重置密码
*/
public function resetPwdAction() {
$simpleHeader = array(
'logo' => array(
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => 'http://www.yohobuy.com'
),
'tool' => array(
array(
'title' => 'Hi~',
'loginUrl' => 'www.yoho.com',
'regUrl' => ''
),
array(
'title' => 'MY有货',
'options' => array(
array(
'textCn' => '我的收藏',
'url' => ''
),
array(
'textCn' => '优惠券',
'url' => ''
),
)
),
array(
'title' => '订单中心',
'url' => 'http://www.yohobuy.com/home/orders?t=1449801433.5294'
),
array(
'title' => '帮助中心',
'url' => 'http://www.yohobuy.com/help'
),
array(
'title' => '400-9889-9646',
'tell' => true
)
)
);
$data = array(
'simpleHeader' => $simpleHeader,
'resetPage' => true,
'resetPwd' => array(
'coverHref' => '/passport',
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
'countrys' => array()
)
);
$this->_view->display('reset-pwd', $data);
}
public function resetSuccessAction() {
$simpleHeader = array(
'logo' => array(
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => 'http://www.yohobuy.com'
),
'tool' => array(
array(
'title' => 'Hi~',
'loginUrl' => 'www.yoho.com',
'regUrl' => ''
),
array(
'title' => 'MY有货',
'options' => array(
array(
'textCn' => '我的收藏',
'url' => ''
),
array(
'textCn' => '优惠券',
'url' => ''
),
)
),
array(
'title' => '订单中心',
'url' => 'http://www.yohobuy.com/home/orders?t=1449801433.5294'
),
array(
'title' => '帮助中心',
'url' => 'http://www.yohobuy.com/help'
),
array(
'title' => '400-9889-9646',
'tell' => true
)
)
);
$data = array(
'simpleHeader' => $simpleHeader,
'resetSuccess' => array(
'coverHref' => '/passport',
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
'countrys' => array()
)
);
$this->_view->display('reset-success', $data);
}
public function verificationAction() {
$simpleHeader = array(
'logo' => array(
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => 'http://www.yohobuy.com'
),
'tool' => array(
array(
'title' => 'Hi~',
'loginUrl' => 'www.yoho.com',
'regUrl' => ''
),
array(
'title' => 'MY有货',
'url' => 'http://www.yohobuy.com/home?t=1450070066.9024',
'options' => array(
array(
'textCn' => '我的收藏',
'url' => ''
),
array(
'textCn' => '优惠券',
'url' => ''
),
)
),
array(
'title' => '订单中心',
'url' => 'http://www.yohobuy.com/home/orders?t=1449801433.5294'
),
array(
'title' => '帮助中心',
'url' => 'http://www.yohobuy.com/help'
),
array(
'title' => '400-9889-9646',
'tell' => true
)
)
);
$data = array(
'simpleHeader' => $simpleHeader,
'vertificationPage' => true,
'verification' => array(
'coverHref' => '/passport',
'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
'countrys' => array()
)
);
$this->_view->display('verification', $data);
}
}
\ No newline at end of file
... ...