Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

Showing 57 changed files with 1766 additions and 31 deletions
@@ -510,4 +510,95 @@ @@ -510,4 +510,95 @@
510 ... 510 ...
511 ] 511 ]
512 } 512 }
  513 + }
  514 +
  515 +
  516 +## 登录、注册、找回密码
  517 +
  518 +### TIP:登录注册找回密码页面body有特有样式,因为数据中需要传一个isPassportPage为body添加一个class
  519 +
  520 +### 通用头部(包含在每个页面中)
  521 +
  522 + {
  523 + showGoBack: true/false, //是否显示GO-BACK链接
  524 + backUrl: '',
  525 + showHeaderImg: true/false, //显示头部图片
  526 + showHeaderText: true/false, //显示头部文字
  527 + headerText: ''
  528 + }
  529 +
  530 +### 区域列表
  531 +
  532 + [
  533 + {
  534 + areaCode: '+86', //区号
  535 + selected: true/false,
  536 + name: '中国'
  537 + },
  538 + ...
  539 + ]
  540 +
  541 +### 登录
  542 +
  543 + //登录页
  544 + {
  545 + account: '', //默认填入的用户名
  546 + registerUrl: '', //免费注册地址
  547 + aliLoginUrl: '',
  548 + weiboLoginUrl: '',
  549 + qqLoginUrl: '',
  550 + interationalUrl: '',
  551 + phoneRetriveUrl: '',
  552 + emailRetriveUrl: ''
  553 + }
  554 +
  555 + //国际账号登录页
  556 + {
  557 + countrys: [...], //区域列表
  558 + countryCode: '',
  559 + phoneNum: ''
  560 + }
  561 +
  562 +### 注册
  563 +
  564 + //注册页
  565 + {
  566 + countrys: [...], //区域列表
  567 + countryCode: '' //默认区号
  568 + }
  569 +
  570 + //验证码
  571 + {
  572 + areaCode: '',
  573 + phoneNum: ''
  574 + }
  575 +
  576 + //密码页
  577 + {
  578 + ... //仅头部
  579 + }
  580 +
  581 +### 找回密码
  582 +
  583 + //邮箱找回&重置密码
  584 + {
  585 + ... //仅头部
  586 + }
  587 +
  588 + //邮箱找回成功
  589 + {
  590 + goEmail: '',
  591 + resendUrl: ''
  592 + }
  593 +
  594 + //手机找回
  595 + {
  596 + countrys: [...],
  597 + countryCode: ''
  598 + }
  599 +
  600 + //手机找回验证码
  601 + {
  602 + areaCode: '',
  603 + phoneNum: ''
513 } 604 }
1 var yohobuy; 1 var yohobuy;
2 2
3 -require('./js/index'); 3 +require('./js/passport/index');
4 4
5 module.exports = yohobuy; 5 module.exports = yohobuy;
1 -alert('I am test');  
  1 +/**
  2 + * 登录注册公用API
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var trim = $.trim;
  9 +
  10 +//邮箱验证规则
  11 +var emailRegx = /^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
  12 +
  13 +//手机号码验证规则
  14 +var phoneRegx = {
  15 + '+86': /^1[35847]{1}[0-9]{9}$/,
  16 + '+852': /^[965]{1}[0-9]{7}$/,
  17 + '+853': /^[0-9]{8}$/,
  18 + '+886': /^[0-9]{10}$/,
  19 + '+65': /^[98]{1}[0-9]{7}$/,
  20 + '+60': /^1[1234679]{1}[0-9]{8}$/,
  21 + '+1': /^[0-9]{10}$/,
  22 + '+82': /^01[0-9]{9}$/,
  23 + '+44': /^7[789][0-9]{8}$/,
  24 + '+81': /^0[9|8|7][0-9]{9}$/,
  25 + '+61': /^[0-9]{11}$/
  26 +};
  27 +
  28 +//错误验证
  29 +var $errTip,
  30 + tipTime;
  31 +
  32 +/**
  33 + * 初始化错误提示
  34 + */
  35 +function initErrTip() {
  36 + var errTipHtml = '<div id="err-tip" class="err-tip"></div>';
  37 +
  38 + //插入错误提示HTML
  39 + $('.passport-page').append(errTipHtml);
  40 +
  41 + $errTip = $('#err-tip');
  42 + $errTip.on('touchstart', function() {
  43 + $errTip.fadeOut();
  44 +
  45 + //清除Timeout
  46 + clearTimeout(tipTime);
  47 + });
  48 +}
  49 +
  50 +/**
  51 + * 显示错误提示
  52 + */
  53 +function showErrTip(content) {
  54 + if (typeof $errTip === 'undefined') {
  55 + return;
  56 + }
  57 +
  58 + $errTip.text(content).show();
  59 +
  60 + //若2秒内未点击则自动消失
  61 + tipTime = setTimeout(function() {
  62 + if ($errTip.css('display') === 'block') {
  63 + $errTip.fadeOut();
  64 + }
  65 + }, 2000);
  66 +}
  67 +
  68 +//密码显示隐藏
  69 +function bindEyesEvt() {
  70 + var $hasEye = $('.has-eye'),
  71 + $eye;
  72 +
  73 + $hasEye.append('<div class="eye close"></div>');
  74 + $eye = $hasEye.children('.eye');
  75 +
  76 + $eye.on('touchstart', function(e) {
  77 + var $this = $(this),
  78 + $pwd = $this.siblings('.pwd');
  79 +
  80 + e.preventDefault();
  81 + $this.toggleClass('close');
  82 +
  83 + //切换密码显示和文本显示
  84 + if ($this.hasClass('close')) {
  85 + $pwd.attr('type', 'password');
  86 + } else {
  87 + $pwd.attr('type', 'text');
  88 + }
  89 + $pwd.focus();
  90 + });
  91 +}
  92 +
  93 +// 清空账号显示
  94 +function bindClearEvt() {
  95 + var $hasClear = $('.has-clear'),
  96 + $clear;
  97 +
  98 + $hasClear.append('<div class="clear-input"></div>');
  99 + $clear = $hasClear.children('.clear-input');
  100 +
  101 + $clear.on('touchstart', function(e) {
  102 + var $input = $clear.siblings('.input');
  103 +
  104 + $input.val('').trigger('input').focus();
  105 + e.preventDefault();
  106 + });
  107 +
  108 + //反向逻辑
  109 + $hasClear.children('.input').bind('input', function() {
  110 + var $this = $(this),
  111 + $thisClear = $this.siblings('.clear-input'),
  112 + val = trim($this.val());
  113 +
  114 + if (val === '') {
  115 + $thisClear.hide();
  116 + } else {
  117 + $thisClear.show();
  118 + }
  119 + });
  120 +}
  121 +
  122 +// 密码长度验证
  123 +function pwdValidate(pwd) {
  124 + if (pwd.length >= 6 && pwd.length <= 20) {
  125 + return true;
  126 + }
  127 + return false;
  128 +}
  129 +
  130 +// hack for resolving direction:rtl didn't work in android uc
  131 +function selectCssHack($countrySelect) {
  132 + var u = navigator.userAgent;
  133 +
  134 + function autoSelectWidth() {
  135 + var wordCount = $countrySelect.find('option:selected').text().length;
  136 +
  137 + switch (wordCount) {
  138 +
  139 + //分别有2,3,4个汉字的情况
  140 + case 2:
  141 + $countrySelect.outerWidth(90);
  142 + break;
  143 + case 3:
  144 + $countrySelect.outerWidth(110);
  145 + break;
  146 + default:
  147 + $countrySelect.outerWidth(130);
  148 + }
  149 + }
  150 +
  151 + if (u.match(/uc/i) && u.match(/android/i)) {
  152 + $countrySelect.change(function() {
  153 + autoSelectWidth();
  154 + });
  155 + } else {
  156 + $countrySelect.removeClass('in-android-uc');
  157 + }
  158 +}
  159 +
  160 +//Exports APIs
  161 +module.exports = {
  162 + emailRegx: emailRegx,
  163 + phoneRegx: phoneRegx,
  164 + initErrTip: initErrTip,
  165 + showErrTip: showErrTip,
  166 + bindEyesEvt: bindEyesEvt,
  167 + bindClearEvt: bindClearEvt,
  168 + pwdValidate: pwdValidate,
  169 + selectCssHack: selectCssHack
  170 +};
  1 +/**
  2 + * 找回密码-验证码
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +
  7 +require('../code')(false);
  1 +/**
  2 + * 找回密码-邮箱找回成功
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +
  7 +var $ = require('yoho.zepto');
  8 +
  9 +var $resend = $('#resend');
  10 +
  11 +var api = require('../api'),
  12 + showErrTip = api.showErrTip;
  13 +
  14 +api.initErrTip();
  15 +
  16 +$resend.on('touchstart', function(e) {
  17 + e.preventDefault();
  18 +
  19 + $.ajax({
  20 + url: $resend.data('url'),
  21 + type: 'GET'
  22 + }).then(function(data) {
  23 + if (data.code === 200) {
  24 + showErrTip(data.message);
  25 + } else {
  26 + showErrTip(data.message);
  27 + }
  28 + });
  29 +});
  1 +/**
  2 + * 找回密码-邮箱找回
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $email = $('#email'),
  9 + $btnSure = $('#btn-sure');
  10 +
  11 +var api = require('../api');
  12 +
  13 +var trim = $.trim;
  14 +var showErrTip = api.showErrTip;
  15 +
  16 +api.initErrTip();
  17 +
  18 +api.bindClearEvt();
  19 +
  20 +$email.bind('input', function() {
  21 + if (trim($email.val()) === '') {
  22 + $btnSure.addClass('disable');
  23 + } else {
  24 + $btnSure.removeClass('disable');
  25 + }
  26 +});
  27 +
  28 +$btnSure.on('touchstart', function() {
  29 + var email = trim($email.val());
  30 +
  31 + if ($btnSure.hasClass('disable')) {
  32 + return;
  33 + }
  34 +
  35 + if (api.emailRegx.test(email)) {
  36 + $.ajax({
  37 + url: '/passport/back/sendemail',
  38 + type: 'POST',
  39 + data: {
  40 + email: email
  41 + }
  42 + }).then(function(data) {
  43 + if (data.code === 200) {
  44 + location.href = data.data;
  45 + } else {
  46 + showErrTip(data.message);
  47 + }
  48 + });
  49 + } else {
  50 + showErrTip('邮箱格式不正确,请重新输入');
  51 + }
  52 +});
  1 +/**
  2 + * 找回密码-手机
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $phoneNum = $('#phone-num'),
  9 + $countrySelector = $('#country-selector'),
  10 + $countryCode = $('#country-code'),
  11 + $btnNext = $('#btn-next');
  12 +
  13 +var api = require('../api');
  14 +
  15 +var trim = $.trim;
  16 +var showErrTip = api.showErrTip;
  17 +
  18 +api.initErrTip();
  19 +
  20 +api.bindClearEvt();
  21 +
  22 +$phoneNum.bind('input', function() {
  23 + if (trim($phoneNum.val()) === '') {
  24 + $btnNext.addClass('disable');
  25 + } else {
  26 + $btnNext.removeClass('disable');
  27 + }
  28 +});
  29 +
  30 +$countrySelector.change(function() {
  31 + $countryCode.text($countrySelector.val());
  32 +});
  33 +
  34 +$btnNext.on('touchstart', function() {
  35 + var pn = trim($phoneNum.val()),
  36 + country = $countrySelector.val();
  37 +
  38 + if ($btnNext.hasClass('disable')) {
  39 + return;
  40 + }
  41 +
  42 + if (api.phoneRegx.test(pn)) {
  43 + $.ajax({
  44 + url: '/passport/back/sendcode',
  45 + type: 'POST',
  46 + data: {
  47 + area: country.split('+')[1],
  48 + mobile: pn
  49 + }
  50 + }).then(function(data) {
  51 + if (data.code === 200) {
  52 + location.href = '/passport/back/code';
  53 + } else {
  54 + showErrTip(data.message);
  55 + }
  56 + });
  57 + } else {
  58 + showErrTip('手机号格式不正确,请重新输入');
  59 + }
  60 +});
  1 +/**
  2 + * 密码找回-新密码
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $pwd = $('#pwd'),
  9 + $btnOk = $('#btn-ok');
  10 +
  11 +var api = require('../api');
  12 +
  13 +var trim = $.trim;
  14 +var showErrTip = api.showErrTip;
  15 +
  16 +api.initErrTip();
  17 +
  18 +api.bindEyesEvt();
  19 +
  20 +$pwd.bind('input', function() {
  21 + if (trim($pwd.val()) === '') {
  22 + $btnOk.addClass('disable');
  23 + } else {
  24 + $btnOk.removeClass('disable');
  25 + }
  26 +});
  27 +
  28 +$btnOk.on('touchstart', function() {
  29 + var pwd = trim($pwd.val());
  30 +
  31 + if ($btnOk.hasClass('disable')) {
  32 + return;
  33 + }
  34 +
  35 + if (api.pwdValidate(pwd)) {
  36 + $.ajax({
  37 + type: 'POST',
  38 + url: '/passport/back/update',
  39 + data: {
  40 + password: pwd
  41 + }
  42 + }).then(function(data) {
  43 + if (data.code === 200) {
  44 + showErrTip('密码修改成功');
  45 +
  46 + //1000ms后跳转页面
  47 + setTimeout(function() {
  48 + location.href = '/';
  49 + }, 1000);
  50 + } else {
  51 + showErrTip(data.message);
  52 + }
  53 + });
  54 + } else {
  55 + showErrTip('密码6-20位,请重新输入');
  56 + }
  57 +});
  1 +/**
  2 + * 注册/找回密码-验证码
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +module.exports = function(useInRegister) {
  9 + var $captcha = $('#captcha'),
  10 + $btnNext = $('#btn-next'),
  11 + $captchaTip = $('#captcha-tip');
  12 +
  13 + var api = require('./api');
  14 +
  15 + var trim = $.trim;
  16 + var showErrTip = api.showErrTip;
  17 +
  18 + var urlMid = useInRegister ? 'register' : 'back';
  19 +
  20 + function countDown() {
  21 + var count = 59,
  22 + itime;
  23 +
  24 + itime = setInterval(function() {
  25 + if (count === 0) {
  26 + $captchaTip.text('重发验证码').removeClass('disable');
  27 + clearInterval(itime);
  28 + } else {
  29 + $captchaTip.text('重发验证码 (' + count-- + '秒)');
  30 + }
  31 + }, 1000);
  32 + }
  33 +
  34 + api.initErrTip();
  35 +
  36 + api.bindClearEvt();
  37 +
  38 + $captcha.bind('input', function() {
  39 + if (trim($captcha.val()) !== '') {
  40 + $btnNext.removeClass('disable');
  41 + } else {
  42 + $btnNext.addClass('disable');
  43 + }
  44 + });
  45 +
  46 + //重新发送验证码
  47 + $captchaTip.on('touchstart', function() {
  48 + if ($captchaTip.hasClass('disable')) {
  49 + return;
  50 + }
  51 +
  52 + $.ajax({
  53 + type: 'POST',
  54 + url: '/passport/' + urlMid + '/sendPhone'
  55 + }).then(function (data) {
  56 + if (data.code === 200) {
  57 + $captchaTip.text('重发验证码 (60秒)').addClass('disable');
  58 + countDown();
  59 + } else {
  60 +
  61 + //验证码不正确,显示提示
  62 + showErrTip(data.message);
  63 + }
  64 + });
  65 + });
  66 +
  67 + $btnNext.on('touchstart', function() {
  68 + if ($btnNext.hasClass('disable')) {
  69 + return;
  70 + }
  71 +
  72 + $.ajax({
  73 + type: 'POST',
  74 + url: '/passport/' + urlMid + '/verifycode',
  75 + data: {
  76 + verifyCode: trim($captcha.val())
  77 + }
  78 + }).then(function (data) {
  79 + if (data.code === 200) {
  80 + location.href = data.data;
  81 + } else {
  82 +
  83 + //验证码不正确,显示提示
  84 + showErrTip(data.message);
  85 + }
  86 + });
  87 + });
  88 +
  89 + countDown();
  90 +};
  1 +/**
  2 + * 注册、登录、密码找回打包入口
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +
  7 +//注册
  8 +require('./register/register');
  9 +require('./register/code');
  10 +require('./register/password');
  11 +
  12 +//登录
  13 +require('./login/login');
  14 +require('./login/interational');
  15 +
  16 +//密码找回
  17 +require('./back/mobile');
  18 +require('./back/code');
  19 +require('./back/email');
  20 +require('./back/email-success');
  21 +require('./back/new-password');
  1 +/**
  2 + * 国际账号登录
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $phoneNum = $('#phone-num'),
  9 + $countrySelect = $('#country-select'),
  10 + $countryCode = $('#country-code'),
  11 + $pwd = $('#pwd'),
  12 + $loginBtn = $('#btn-login'),
  13 +
  14 + pnPass = false,
  15 + pwdPass = false;
  16 +
  17 +var api = require('../api');
  18 +
  19 +var trim = $.trim;
  20 +var showErrTip = api.showErrTip;
  21 +
  22 +//登录按钮状态切换
  23 +function switchLoginBtnStatus() {
  24 + if (pnPass && pwdPass) {
  25 + $loginBtn.removeClass('disable');
  26 + } else {
  27 + $loginBtn.addClass('disable');
  28 + }
  29 +}
  30 +
  31 +//Android-UC下显示select的direction:rtl无效的临时解决办法
  32 +api.selectCssHack($countrySelect);
  33 +
  34 +//初始化ErrTip
  35 +api.initErrTip();
  36 +
  37 +//显示隐藏密码
  38 +api.bindEyesEvt();
  39 +
  40 +//清空手机号码
  41 +api.bindClearEvt();
  42 +
  43 +$phoneNum.bind('input', function() {
  44 + if (trim($phoneNum.val()) === '') {
  45 + pnPass = false;
  46 + } else {
  47 + pnPass = true;
  48 + }
  49 +
  50 + switchLoginBtnStatus();
  51 +});
  52 +
  53 +$pwd.bind('input', function() {
  54 + var pwd = trim($pwd.val());
  55 +
  56 + if (pwd === '') {
  57 + pwdPass = false;
  58 + } else {
  59 + pwdPass = true;
  60 + }
  61 +
  62 + switchLoginBtnStatus();
  63 +});
  64 +
  65 +$countrySelect.change(function() {
  66 + $countryCode.text($countrySelect.val());
  67 +});
  68 +
  69 +$loginBtn.on('touchstart', function() {
  70 + var pn = trim($phoneNum.val()),
  71 + country = $countrySelect.val(),
  72 + pwd = trim($pwd.val());
  73 +
  74 + if ($loginBtn.hasClass('disable')) {
  75 + return;
  76 + }
  77 +
  78 + if (api.phoneRegx[country].test(pn) && api.pwdValidate(pwd)) {
  79 + $.ajax({
  80 + type: 'POST',
  81 + url: '/passport/signin/auth',
  82 + data: {
  83 + area: country.split('+')[1],
  84 + account: pn,
  85 + pwd: pwd
  86 + }
  87 + }).then(function(data) {
  88 + if (data.code === 200) {
  89 + showErrTip('登录成功');
  90 +
  91 + //1000ms后跳转页面
  92 + setTimeout(function() {
  93 + location.href = data.data;
  94 + }, 1000);
  95 + } else {
  96 + showErrTip(data.message);
  97 + }
  98 + }, function() {
  99 + showErrTip('网络断开连接啦~');
  100 + });
  101 + } else {
  102 + showErrTip('账号或密码有错误,请重新输入');
  103 + }
  104 +});
  105 +
  106 +//对初始有默认值的情况去初始化登录按钮状态
  107 +$phoneNum.trigger('input');
  108 +$pwd.trigger('input');
  1 +/**
  2 + * 登录
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/9/30
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $account = $('#account'),
  9 + $pwd = $('#pwd'),
  10 + $loginBtn = $('#btn-login'),
  11 +
  12 + $mask = $('#retrive-pwd-mask'),
  13 + $ways = $('#retrive-pwd-ways'),
  14 +
  15 + accPass = false,
  16 + pwdPass = false;
  17 +
  18 +var api = require('../api');
  19 +
  20 +var trim = $.trim;
  21 +var showErrTip = api.showErrTip;
  22 +
  23 +//登录按钮状态切换
  24 +function switchLoginBtnStatus() {
  25 + if (accPass && pwdPass) {
  26 + $loginBtn.removeClass('disable');
  27 + } else {
  28 + $loginBtn.addClass('disable');
  29 + }
  30 +}
  31 +
  32 +//显示找回密码面板
  33 +function showRetrivePanel() {
  34 + $mask.show();
  35 + $ways.slideDown();
  36 +}
  37 +
  38 +//隐藏找回密码面板
  39 +function hideRetrivePanel() {
  40 + $mask.hide();
  41 + $ways.slideUp();
  42 +}
  43 +
  44 +//初始化ErrTip
  45 +api.initErrTip();
  46 +
  47 +//密码显示与隐藏
  48 +api.bindEyesEvt();
  49 +
  50 +//清空账号输入框
  51 +api.bindClearEvt();
  52 +
  53 +$account.bind('input', function() {
  54 + if (trim($account.val()) !== '') {
  55 + accPass = true;
  56 + } else {
  57 + accPass = false;
  58 + }
  59 + switchLoginBtnStatus();
  60 +});
  61 +
  62 +$pwd.bind('input', function() {
  63 + if (trim($pwd.val()) === '') {
  64 + pwdPass = false;
  65 + } else {
  66 + pwdPass = true;
  67 + }
  68 + switchLoginBtnStatus();
  69 +});
  70 +
  71 +
  72 +// Login
  73 +$loginBtn.on('touchstart', function() {
  74 + var acc = trim($account.val()),
  75 + pwd = trim($pwd.val());
  76 +
  77 + if ($loginBtn.hasClass('disable')) {
  78 + return;
  79 + }
  80 +
  81 + //验证账号(数字或者邮箱)和密码合理性
  82 + if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) {
  83 + $.ajax({
  84 + type: 'POST',
  85 + url: '/passport/signin/auth',
  86 + data: {
  87 + account: acc,
  88 + pwd: pwd
  89 + }
  90 + }).then(function(data) {
  91 + if (data.code === 200) {
  92 + showErrTip('登录成功');
  93 +
  94 + //1s后跳转页面
  95 + setTimeout(function() {
  96 + location.href = data.data;
  97 + }, 1000);
  98 + } else {
  99 + showErrTip(data.message);
  100 + }
  101 + }, function() {
  102 + showErrTip('网络断开连接啦~');
  103 + });
  104 + } else {
  105 + showErrTip('账号或密码有错误,请重新输入');
  106 + }
  107 +});
  108 +
  109 +
  110 +$('#forget-pwd').on('touchstart', function() {
  111 + showRetrivePanel();
  112 +});
  113 +
  114 +$mask.on('touchstart', function() {
  115 + hideRetrivePanel();
  116 +});
  117 +
  118 +$('#cancel-retrive').on('touchstart', function(e) {
  119 + e.preventDefault();
  120 + hideRetrivePanel();
  121 +});
  122 +
  123 +//对初始有默认值的情况去初始化登录按钮状态
  124 +$account.trigger('input');
  125 +$pwd.trigger('input');
  1 +/**
  2 + * 注册-验证码
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +
  7 +require('../code')(true);
  1 +/**
  2 + * 注册-密码
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $pwd = $('#pwd'),
  9 + $btnSure = $('#btn-sure');
  10 +
  11 +var api = require('../api');
  12 +
  13 +var trim = $.trim;
  14 +var showErrTip = api.showErrTip;
  15 +
  16 +api.initErrTip();
  17 +
  18 +api.bindEyesEvt();
  19 +
  20 +$pwd.bind('input', function() {
  21 + if (trim($pwd.val()) === '') {
  22 + $btnSure.addClass('disable');
  23 + } else {
  24 + $btnSure.removeClass('disable');
  25 + }
  26 +});
  27 +
  28 +$btnSure.on('touchstart', function() {
  29 + var pwd = trim($pwd.val());
  30 +
  31 + if ($btnSure.hasClass('disable')) {
  32 + return;
  33 + }
  34 +
  35 + if (api.pwdValidate(pwd) === false) {
  36 + showErrTip('密码6-20位,请重新输入');
  37 + } else {
  38 + $.ajax({
  39 + type: 'POST',
  40 + url: '/passport/register/regmobile',
  41 + data: {
  42 + password: pwd
  43 + }
  44 + }).then(function(data) {
  45 + if (data.code === 200) {
  46 + showErrTip('注册成功');
  47 +
  48 + //1000ms后跳转页面
  49 + setTimeout(function() {
  50 + location.href = data.data;
  51 + }, 1000);
  52 + } else {
  53 + if (data.code === 401 || data.code === 404 || data.code === 505) {
  54 + showErrTip(data.message);
  55 + } else {
  56 + showErrTip(data.message);
  57 + setTimeout(function() {
  58 + location.href = data.data;
  59 + }, 1000);
  60 + }
  61 + }
  62 + });
  63 + }
  64 +});
  1 +/**
  2 + * 注册
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/8
  5 + */
  6 +var $ = require('yoho.zepto');
  7 +
  8 +var $phoneNum = $('#phone-num'),
  9 + $countrySelect = $('#country-select'),
  10 + $countryCode = $('#country-code'),
  11 + $btnNext = $('#btn-next');
  12 +
  13 +var api = require('../api');
  14 +
  15 +var trim = $.trim;
  16 +var showErrTip = api.showErrTip;
  17 +
  18 +api.initErrTip();
  19 +
  20 +api.bindClearEvt();
  21 +
  22 +$phoneNum.bind('input', function() {
  23 + if (trim($phoneNum.val()) === '') {
  24 + $btnNext.addClass('disable');
  25 + } else {
  26 + $btnNext.removeClass('disable');
  27 + }
  28 +});
  29 +
  30 +$countrySelect.change(function() {
  31 + $countryCode.text($countrySelect.val());
  32 +});
  33 +
  34 +$btnNext.on('touchstart', function() {
  35 + var pn = trim($phoneNum.val()),
  36 + country = $countrySelect.val();
  37 +
  38 + if ($btnNext.hasClass('disable')) {
  39 + return;
  40 + }
  41 +
  42 + if (api.phoneRegx[country].test(pn)) {
  43 + $.ajax({
  44 + url: '/passport/register/sendphone',
  45 + type: 'POST',
  46 + data: {
  47 + area: country.split('+')[1],
  48 + profile: pn
  49 + }
  50 + }).then(function(data) {
  51 + if (data.code === 200) {
  52 + location.href = '/passport/register/code';
  53 + } else {
  54 + showErrTip(data.message);
  55 + }
  56 + });
  57 + } else {
  58 + showErrTip('手机号格式不正确,请重新输入');
  59 + }
  60 +});
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
16 "spm": { 16 "spm": {
17 "main": "index.js", 17 "main": "index.js",
18 "dependencies": { 18 "dependencies": {
  19 + "yoho.zepto": "1.1.60",
  20 + "yoho.jquery": "1.8.3"
19 }, 21 },
20 "devDependencies": { 22 "devDependencies": {
21 "expect.js": "0.3.1" 23 "expect.js": "0.3.1"
@@ -30,4 +32,4 @@ @@ -30,4 +32,4 @@
30 "test": "spm test", 32 "test": "spm test",
31 "build": "spm build" 33 "build": "spm build"
32 } 34 }
33 -} 35 +}
1 -body {  
2 - background-color: #ff0;  
3 -}  
  1 +@import "compass", "compass/reset";
  2 +$pxConvertRem: 40;
  3 +
  4 +* {
  5 + -webkit-tap-highlight-color: rgba(0,0,0,0);
  6 +}
  7 +
  8 +html, body {
  9 + font-family: helvetica,Arial,"黑体";
  10 + width: 100%;
  11 + font-size: 12px;
  12 + line-height: 1.4;
  13 +}
  14 +
  15 +.clearfix:before,
  16 +.clearfix:after {
  17 + content: "";
  18 + display: table;
  19 +}
  20 +
  21 +.clearfix:after {
  22 + clear: both;
  23 +}
  24 +
  25 +.clearfix {
  26 + *zoom: 1;
  27 +}
  28 +
  29 +button, input, select, textarea {
  30 + font-family: inherit;
  31 + font-size: 100%;
  32 + margin: 0;
  33 +}
  34 +
  35 +img {
  36 + max-width: 100%;
  37 + display: block;
  38 + border: 0;
  39 + margin: 0 auto;
  40 +}
  41 +
  42 +a {
  43 + text-decoration: none;
  44 + outline: none;
  45 + color: #000;
  46 +}
  47 +
  48 +@import "passport/index";
  1 +.back-email-success-page {
  2 + .tip {
  3 + font-size: 20px;
  4 + color: #fff;
  5 + margin-top: 30px;
  6 + }
  7 +
  8 + .sub-tip, .resend {
  9 + color: #939393;
  10 + font-size: 16px;
  11 + }
  12 +
  13 + .go-email {
  14 + margin: 20px 0 10px;
  15 + }
  16 +
  17 + .resend {
  18 + float: right;
  19 + }
  20 +}
  1 +.reg-code-page, .back-code-page {
  2 + .captcha-tip {
  3 + position: absolute;
  4 + width: 148px;
  5 + text-align: center;
  6 + right: 15px;
  7 + top: 8px;
  8 + color: #36a74c;
  9 + padding: 5px 0;
  10 + border: 1px solid #36a74c;
  11 + border-radius: 20px;
  12 + font-size: 16px;
  13 +
  14 + &.disable {
  15 + color: #8f8f8f;
  16 + border-color: #8f8f8f;
  17 +
  18 + }
  19 + }
  20 +
  21 + .input-container {
  22 + padding-right: 190px;
  23 + }
  24 +
  25 + .text-container {
  26 + color: #fff;
  27 + font-size: 16px;
  28 + margin-bottom: 20px;
  29 + }
  30 +
  31 + .phone {
  32 + color: #4ecae8;
  33 + }
  34 +
  35 + .clear {
  36 + right: 170px;
  37 + }
  38 +}
  1 +body.passport-body {
  2 + background-color: #444;
  3 + font-family: "MicroSoft YaHei",SimSun,sans-serif;
  4 +
  5 + * {
  6 + box-sizing: border-box;
  7 + }
  8 +}
  9 +
  10 +.passport-page {
  11 + text-align: center;
  12 + padding: 0 6%;
  13 +
  14 + .header {
  15 + position: relative;
  16 + height: 40px;
  17 + margin: 20px 0 30px;
  18 +
  19 + .go-back {
  20 + position: absolute;
  21 + height: 30px;
  22 + width: 30px;
  23 + top: 5px;
  24 + left: 0;
  25 + }
  26 +
  27 + .title {
  28 + font-size: 20px;
  29 + line-height: 40px;
  30 + color: #fff;
  31 + }
  32 +
  33 + .img-header {
  34 + width: 68px;
  35 + height: 40px;
  36 + }
  37 + }
  38 +
  39 + .input-container, .select-container {
  40 + position: relative;
  41 + width: 100%;
  42 + height: 52px;
  43 + font-size: 20px;
  44 + background-color: #575757;
  45 + border: 1px solid #606060;
  46 + border-radius: 5px;
  47 + text-align: left;
  48 + color: #fff;
  49 + }
  50 +
  51 + .select-container {
  52 + .select {
  53 + position: absolute;
  54 + height: 50px;
  55 + padding-right: 40px;
  56 + right: 0;
  57 + color: #fff;
  58 + background-color: transparent;
  59 + border: 0;
  60 + @include border-radius(5px);
  61 + @include appearance(none);
  62 + direction: rtl;
  63 +
  64 + &:focus {
  65 + outline: 0;
  66 + border: none;
  67 + }
  68 +
  69 + &:-moz-focusring {
  70 + color: transparent;
  71 + text-shadow: 0 0 0 #fff;
  72 + }
  73 + }
  74 +
  75 + .select-title {
  76 + line-height: 2.5;
  77 + margin-left: 15px;
  78 + }
  79 +
  80 + .arrow-right {
  81 + position: absolute;
  82 + width: 13px;
  83 + height: 20px;
  84 + right: 15px;
  85 + top: 16px;
  86 + background-image: url('http://static.dev.yohobuy.com/img/passport/arrow-right.png');
  87 + background-size: 100% 100%;
  88 + }
  89 + }
  90 +
  91 + .has-eye, .has-clear {
  92 + padding-right: 30px;
  93 + }
  94 +
  95 + .country-code {
  96 + position: absolute;
  97 + left: 15px;
  98 + line-height: 2.5;
  99 + }
  100 +
  101 + .phone-container {
  102 + padding-left: 55px;
  103 + }
  104 +
  105 + .input {
  106 + width: 100%;
  107 + line-height: 26px;
  108 + padding: 12px 0;
  109 + padding-left: 15px;
  110 + border-radius: 5px;
  111 + color: #fff;
  112 + background-color: transparent;
  113 + border: none;
  114 + }
  115 +
  116 + .btn {
  117 + display: block;
  118 + width: 100%;
  119 + font-size: 20px;
  120 + line-height: 2.5;
  121 + background-color: #36a74c;
  122 + @include border-radius(5px);
  123 + color: #fff;
  124 +
  125 + &.disable {
  126 + background-color: #a2a2a2;
  127 + }
  128 + }
  129 +
  130 + .country-select.in-android-uc {
  131 + width: 90px;
  132 + }
  133 +
  134 + .clear-input {
  135 + position: absolute;
  136 + display: none;
  137 + top: 18px;
  138 + right: 10px;
  139 + width: 16px;
  140 + height: 16px;
  141 + background-image: url('http://static.dev.yohobuy.com/img/passport/clear-input.png');
  142 + background-size: 100% 100%;
  143 + }
  144 +
  145 + .eye {
  146 + position: absolute;
  147 + top: 20px;
  148 + right: 10px;
  149 + width: 19px;
  150 + height: 12px;
  151 + background-image: url('http://static.dev.yohobuy.com/img/passport/eye.png');
  152 + background-size: 100% 100%;
  153 +
  154 + &.close {
  155 + background-image: url('http://static.dev.yohobuy.com/img/passport/eye-close.png');
  156 + }
  157 + }
  158 +
  159 + .row {
  160 + margin-bottom: 10px;
  161 + }
  162 +
  163 + .err-tip {
  164 + position: absolute;
  165 + display: none;
  166 + text-align: center;
  167 + width: 70%;
  168 + padding: 34px 0;
  169 + top: 50%;
  170 + left: 50%;
  171 + margin-left: -35%;
  172 + margin-top: -45px;
  173 + background-color: #000;
  174 + opacity: 0.7;
  175 + color: #fff;
  176 + font-size: 18px;
  177 + border: none;
  178 + @include border-radius(10px);
  179 + }
  180 +}
  1 +@import "common", "register", "login", "back", "code";
  1 +.login-page {
  2 + .yoho-logo {
  3 + position: absolute;
  4 + height: 31px;
  5 + width: 26px;
  6 + background: image-url('passport/yoho.png');
  7 + background-size: 100% 100%;
  8 + top: 10px;
  9 + left: 15px;
  10 + }
  11 +
  12 + .acc-container {
  13 + padding-left: 45px;
  14 + }
  15 +
  16 + .op-container {
  17 + position: relative;
  18 + width: 100%;
  19 + margin: 20px 0;
  20 + text-align: left;
  21 + font-size: 16px;
  22 +
  23 + .go-register {
  24 + text-decoration: underline;
  25 + color: #858585;
  26 + }
  27 +
  28 + .forget-pwd {
  29 + position: absolute;
  30 + right: 0;
  31 + text-decoration: underline;
  32 + color: #858585;
  33 + }
  34 + }
  35 +
  36 + .third-party-login {
  37 + text-align: left;
  38 +
  39 + > span {
  40 + font-size: 16px;
  41 + color: #858585;
  42 + }
  43 +
  44 + .tp-link {
  45 + text-align: center;
  46 + padding: 20px 0;
  47 +
  48 + > a {
  49 + display: inline-block;
  50 + width: 44px;
  51 + height: 44px;
  52 + margin: 0 7px;
  53 + @include border-radius(50%);
  54 + background-color: #333;
  55 + background-repeat: no-repeat;
  56 + background-size: 100% 100%;
  57 + }
  58 +
  59 + .alipay {
  60 + background-image: image-url('passport/alipay.png');
  61 + }
  62 +
  63 + .weibo {
  64 + background-image: image-url('passport/weibo.png');
  65 + }
  66 +
  67 + .weixin {
  68 + background-image: image-url('passport/weixin.png');
  69 + }
  70 +
  71 + .qq {
  72 + background-image: image-url('passport/qq.png');
  73 + }
  74 + }
  75 + }
  76 +
  77 + .interational {
  78 + display: block;
  79 + width: 200px;
  80 + padding: 5px 10px;
  81 + background-color: #333;
  82 + border: none;
  83 + border-radius: 20px;
  84 + margin: 0 auto;
  85 + font-size: 16px;
  86 + color: #d8d8d8;
  87 + }
  88 +
  89 + .login-tip {
  90 + font-size: 16px;
  91 + position: relative;
  92 + color: #d8d8d8;
  93 + margin: 15px 0;
  94 +
  95 + .info-icon {
  96 + display: inline-block;
  97 + height: 12px;
  98 + width: 12px;
  99 + background-image: image-url('passport/info.png');
  100 + background-size: 100% 100%;
  101 + }
  102 + }
  103 +
  104 + .mask {
  105 + position: fixed;
  106 + display: none;
  107 + top: 0;
  108 + bottom: 0;
  109 + right: 0;
  110 + left: 0;
  111 + background-color: rgba(0,0,0,.5);
  112 + }
  113 +
  114 + .retrive-pwd-ways {
  115 + position: fixed;
  116 + display: none;
  117 + bottom: 5px;
  118 + left: 10px;
  119 + right: 10px;
  120 + font-size: 16px;
  121 +
  122 + li {
  123 + background-color: #fff;
  124 + width: 100%;
  125 + height: 40px;
  126 + line-height: 40px;
  127 + text-align: center;
  128 +
  129 + &:nth-child(1) {
  130 + @include border-top-left-radius(5px);
  131 + @include border-top-right-radius(5px);
  132 + border-bottom: 1px solid #9f9f9f;
  133 + }
  134 +
  135 + &:nth-child(2) {
  136 + @include border-bottom-left-radius(5px);
  137 + @include border-bottom-right-radius(5px);
  138 + }
  139 +
  140 + &:last-child {
  141 + margin-top: 10px;
  142 + @include border-radius(5px);
  143 + }
  144 + }
  145 + }
  146 +
  147 +}
  1 +.reg-page .register-tip {
  2 + color: #fff;
  3 + font-size: 15px;
  4 +}
  1 +{{> layout/header}}
  2 +<div class="back-email-success-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + <p class="tip">验证邮件已发送至你的邮箱</p>
  6 + <p class="sub-tip">请在24小时内通过邮件内的链接设置新密码</p>
  7 + <a class="go-email btn" href={{goEmail}}>去邮箱看看</a>
  8 + <a id="resend" class="resend" data-url={{resendUrl}}>重新发送邮件</a>
  9 + </div>
  10 +</div>
  11 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="back-email-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + <div class="input-container row has-clear">
  6 + <input id="email" class="input email" type="text" placeholder="请输入邮箱" autocomplete="off">
  7 + </div>
  8 + <span id="btn-sure" class="btn btn-sure disable row">确定</span>
  9 + </div>
  10 +</div>
  11 +{{> layout/footer}}
1 -<?php  
2 -  
3 -/*  
4 - * To change this license header, choose License Headers in Project Properties.  
5 - * To change this template file, choose Tools | Templates  
6 - * and open the template in the editor.  
7 - */  
8 -  
  1 +{{> layout/header}}
  2 +<div class="back-code-page passport-page yoho-page">
  3 + {{> passport/code}}
  4 +</div>
  5 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="back-mobile-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + {{> passport/country_list}}
  6 + <div class="input-container phone-container row has-clear">
  7 + <span id="country-code" class="country-code">{{countryCode}}</span>
  8 + <input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
  9 + </div>
  10 + <span id="btn-next" class="btn btn-next disable row">下一步</span>
  11 + </div>
  12 +</div>
  13 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="back-new-password-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + <div class="input-container row has-eye">
  6 + <input id="pwd" class="input pwd" type="password" placeholder="请输入新密码" autocomplete="off" maxlength="20">
  7 + </div>
  8 + <span id="btn-ok" class="btn btn-ok disable">完成</span>
  9 + </div>
  10 +</div>
  11 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="login-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + <div class="acc-container input-container row has-clear">
  6 + <div class="yoho-logo"></div>
  7 + <input id="account" class="input account" type="text" placeholder="手机号/邮箱" autocomplete="off" value={{account}}>
  8 + </div>
  9 + <div class="input-container row has-eye">
  10 + <input id="pwd" class="pwd input" type="password" placeholder="密码">
  11 + </div>
  12 + <span id="btn-login" class="btn btn-login disable">登录</span>
  13 + <p class="op-container">
  14 + <a class="go-register" href={{registerUrl}}>免费注册</a>
  15 + <span id="forget-pwd" class="forget-pwd">忘记密码</span>
  16 + </p>
  17 + <div class="third-party-login">
  18 + <span>其他登录方式</span>
  19 + <div class="tp-link">
  20 + <a class="alipay" href={{aliLoginUrl}}></a>
  21 + <a class="weibo" href={{weiboLoginUrl}}></a>
  22 + <a class="qq" href={{qqLoginUrl}}></a>
  23 + </div>
  24 + </div>
  25 + <a class="interational" href={{interationalUrl}}>Interational Customer</a>
  26 + <div class="login-tip">
  27 + <div class="info-icon"></div>
  28 + Yoho!Family账号可登录YOHO!有货
  29 + </div>
  30 + <div id="retrive-pwd-mask" class="mask"></div>
  31 + <ul id="retrive-pwd-ways" class="retrive-pwd-ways">
  32 + <li>
  33 + <a href={{phoneRetriveUrl}}>通过手机找回密码</a>
  34 + </li>
  35 + <li>
  36 + <a href={{emailRetriveUrl}}>通过邮箱找回密码</a>
  37 + </li>
  38 + <li id="cancel-retrive">
  39 + 取消
  40 + </li>
  41 + </ul>
  42 + </div>
  43 +</div>
  44 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="login-interational-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + {{> passport/country_list}}
  6 + <div class="input-container phone-container row has-clear">
  7 + <span id="country-code" class="country-code">{{countryCode}}</span>
  8 + <input id="phone-num" class="input phone-num" type="text" placeholder="手机号" value={{phoneNum}}>
  9 + </div>
  10 + <div class="input-container row has-eye">
  11 + <input id="pwd" class="pwd input" type="password" placeholder="密码">
  12 + </div>
  13 + <span id="btn-login" class="btn btn-login disble row">登录</span>
  14 + </div>
  15 +</div>
  16 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="reg-code-page passport-page yoho-page">
  3 + {{> passport/code}}
  4 +</div>
  5 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="reg-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + {{> passport/country_list}}
  6 + <div class="input-container phone-container row has-clear">
  7 + <span id="country-code" class="country-code">{{countryCode}}</span>
  8 + <input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
  9 + </div>
  10 + <span id="btn-next" class="btn btn-next disable row">下一步</span>
  11 + <p class="register-tip">YOHO!Family账号可登录YOHO!有货、YOHO!Boys、YOHO!Girls及SHOW</p>
  12 + </div>
  13 +</div>
  14 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="reg-password-page passport-page yoho-page">
  3 + {{> passport/header}}
  4 + <div class="content">
  5 + <div class="input-container row has-eye">
  6 + <input id="pwd" class="input pwd" type="text" placeholder="请输入密码" autocomplete="off" maxlength="20">
  7 + </div>
  8 + <span id="btn-sure" class="btn btn-sure disable row">确定</span>
  9 + </div>
  10 +</div>
  11 +{{> layout/footer}}
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 seajs.config({ 3 seajs.config({
4 base: 'http://172.16.6.248:8000' 4 base: 'http://172.16.6.248:8000'
5 }); 5 });
6 - seajs.use('js/index'); 6 + seajs.use('js/{{modulePath}}');
7 </script> 7 </script>
8 </body> 8 </body>
9 </html> 9 </html>
@@ -25,4 +25,4 @@ @@ -25,4 +25,4 @@
25 </script> 25 </script>
26 <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> 26 <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
27 </head> 27 </head>
28 -<body>  
  28 +<body {{#if isPassportPage}}class=passport-body{{/if}}>
  1 +{{> passport/header}}
  2 +<div class="content">
  3 + <div class="text-container">
  4 + 验证码已发送至
  5 + <span class="phone">
  6 + {{areaCode}} {{phoneNum}}
  7 + </span>
  8 + </div>
  9 + <div class="input-container row has-clear">
  10 + <input id="captcha" class="input captcha" type="text" placeholder="验证码" maxlength="6" autocomplete="off">
  11 + <div id="captcha-tip" class="captcha-tip disable">重发验证码 (60秒)</div>
  12 + </div>
  13 + <span id="btn-next" class="btn btn-next disable row">下一步</span>
  14 +</div>
  1 +<div class="select-container row">
  2 + <span class="select-title">国家和地区</span>
  3 + <select id="country-select" class="country-select select in-android-uc">
  4 + {{# countrys}}
  5 + <option value={{areaCode}} {{#if selected}}selected{{/if}}>{{name}}</option>
  6 + {{/ countrys}}
  7 + </select>
  8 + <div class="arrow-right"></div>
  9 +</div>
  1 +<div class="header">
  2 + {{#if showGoBack}}
  3 + <a class="go-back" href={{../backUrl}}>
  4 + <img src="http://static.dev.yohobuy.com/img/passport/go-back.png">
  5 + </a>
  6 + {{/if}}
  7 + {{#if showHeaderImg}}
  8 + <img class="img-header" src="http://static.dev.yohobuy.com/img/passport/yoho-family.png">
  9 + {{/if}}
  10 + {{#if showHeaderText}}
  11 + <p class="title">{{../headerText}}</p>
  12 + {{/if}}
  13 +</div>
1 <?php 1 <?php
2 -  
3 -/*  
4 - * To change this license header, choose License Headers in Project Properties.  
5 - * To change this template file, choose Tools | Templates  
6 - * and open the template in the editor. 2 +use Action\AbstractAction;
  3 +/**
  4 + * 频道选择
7 */ 5 */
  6 +class BackController extends AbstractAction
  7 +{
  8 + public function indexAction()
  9 + {
  10 + echo '密码找回';
  11 + }
  12 +
  13 + public function emailAction()
  14 + {
  15 + $data = array(
  16 + 'showGoBack' => true,
  17 + 'backUrl' => '',
  18 + 'showHeaderText' => true,
  19 + 'headerText' => '找回密码',
  20 + 'isPassportPage' => true,
  21 + 'modulePath' => 'passport/back/email'
  22 + );
  23 +
  24 + $this->_view->assign('title', 'YOHO!有货');
  25 + $this->_view->display('email', $data);
  26 + }
  27 +
  28 + public function successAction()
  29 + {
  30 + $data = array(
  31 + 'showGoBack' => true,
  32 + 'backUrl' => '',
  33 + 'showHeaderText' => true,
  34 + 'headerText' => '找回密码',
  35 + 'isPassportPage' => true,
  36 + 'modulePath' => 'passport/back/email-success',
  37 + 'goEmail' => '',
  38 + 'resendUrl' => ''
  39 + );
  40 +
  41 + $this->_view->assign('title', 'YOHO!有货');
  42 + $this->_view->display('email-success', $data);
  43 + }
  44 +
  45 + public function mobileAction()
  46 + {
  47 + $data = array(
  48 + 'showGoBack' => true,
  49 + 'backUrl' => '',
  50 + 'showHeaderText' => true,
  51 + 'headerText' => '找回密码',
  52 + 'isPassportPage' => true,
  53 + 'modulePath' => 'passport/back/mobile',
  54 + 'countrys' => array(
  55 + array(
  56 + 'areaCode' => '+86',
  57 + 'selected' => true,
  58 + 'name' => '中国'
  59 + ),
  60 + array(
  61 + 'areaCode' => '+864',
  62 + 'name' => '中国香港'
  63 + )
  64 + ),
  65 + 'countryCode' => '+86'
  66 + );
  67 +
  68 + $this->_view->assign('title', 'YOHO!有货');
  69 + $this->_view->display('mobile', $data);
  70 + }
  71 +
  72 + public function codeAction()
  73 + {
  74 + $data = array(
  75 + 'showGoBack' => true,
  76 + 'backUrl' => '',
  77 + 'showHeaderText' => true,
  78 + 'headerText' => '找回密码',
  79 + 'isPassportPage' => true,
  80 + 'modulePath' => 'passport/back/code',
  81 + 'areaCode' => '+86',
  82 + 'phoneNum' => '15895869035'
  83 + );
  84 +
  85 + $this->_view->assign('title', 'YOHO!有货');
  86 + $this->_view->display('mobile-code', $data);
  87 + }
  88 +
  89 + public function passwordAction()
  90 + {
  91 + $data = array(
  92 + 'showGoBack' => true,
  93 + 'backUrl' => '',
  94 + 'showHeaderText' => true,
  95 + 'headerText' => '找回密码',
  96 + 'isPassportPage' => true,
  97 + 'modulePath' => 'passport/back/new-password'
  98 + );
8 99
  100 + $this->_view->assign('title', 'YOHO!有货');
  101 + $this->_view->display('new-password', $data);
  102 + }
  103 +}
1 <?php 1 <?php
  2 +use Action\AbstractAction;
2 3
3 -/*  
4 - * To change this license header, choose License Headers in Project Properties.  
5 - * To change this template file, choose Tools | Templates  
6 - * and open the template in the editor.  
7 - */ 4 +class LoginController extends AbstractAction
  5 +{
  6 + public function indexAction()
  7 + {
  8 + $data = array(
  9 + 'showGoBack' => true,
  10 + 'backUrl' => '',
  11 + 'showHeaderImg' => true,
  12 + 'isPassportPage' => true,
  13 + 'modulePath' => 'passport/login/login'
  14 + );
8 15
  16 + $this->_view->assign('title', '登录');
  17 + $this->_view->display('index', $data);
  18 + }
  19 +
  20 + public function interationalAction()
  21 + {
  22 + $data = array(
  23 + 'showGoBack' => true,
  24 + 'backUrl' => '',
  25 + 'showHeaderText' => true,
  26 + 'headerText' => '登录',
  27 + 'isPassportPage' => true,
  28 + 'modulePath' => 'passport/login/interational',
  29 + 'countrys' => array(
  30 + array(
  31 + 'areaCode' => '+86',
  32 + 'selected' => true,
  33 + 'name' => '中国'
  34 + ),
  35 + array(
  36 + 'areaCode' => '+864',
  37 + 'name' => '中国香港'
  38 + )
  39 + ),
  40 + 'countryCode' => '+86'
  41 + );
  42 +
  43 + $this->_view->assign('title', '国际账号登录');
  44 + $this->_view->display('interational', $data);
  45 + }
  46 +}
1 <?php 1 <?php
  2 +use Action\AbstractAction;
2 3
3 -/*  
4 - * To change this license header, choose License Headers in Project Properties.  
5 - * To change this template file, choose Tools | Templates  
6 - * and open the template in the editor.  
7 - */ 4 +class RegController extends AbstractAction
  5 +{
  6 + public function indexAction()
  7 + {
  8 + $data = array(
  9 + 'showGoBack' => true,
  10 + 'backUrl' => '',
  11 + 'showHeaderText' => true,
  12 + 'headerText' => '注册',
  13 + 'isPassportPage' => true,
  14 + 'modulePath' => 'passport/register/register',
  15 + 'countrys' => array(
  16 + array(
  17 + 'areaCode' => '+86',
  18 + 'selected' => true,
  19 + 'name' => '中国'
  20 + ),
  21 + array(
  22 + 'areaCode' => '+864',
  23 + 'name' => '中国香港'
  24 + )
  25 + ),
  26 + 'countryCode' => '+86'
  27 + );
8 28
  29 + $this->_view->assign('title', '注册');
  30 + $this->_view->display('index', $data);
  31 + }
  32 +
  33 + public function codeAction()
  34 + {
  35 + $data = array(
  36 + 'showGoBack' => true,
  37 + 'backUrl' => '',
  38 + 'showHeaderText' => true,
  39 + 'headerText' => '注册',
  40 + 'isPassportPage' => true,
  41 + 'modulePath' => 'passport/register/code',
  42 + 'areaCode' => '+86',
  43 + 'phoneNum' => '15895869035'
  44 + );
  45 +
  46 + $this->_view->assign('title', '注册-验证码');
  47 + $this->_view->display('code', $data);
  48 + }
  49 +
  50 + public function passwordAction()
  51 + {
  52 + $data = array(
  53 + 'showGoBack' => true,
  54 + 'backUrl' => '',
  55 + 'showHeaderText' => true,
  56 + 'headerText' => '注册',
  57 + 'isPassportPage' => true,
  58 + 'modulePath' => 'passport/register/password'
  59 + );
  60 +
  61 + $this->_view->assign('title', '注册-密码');
  62 + $this->_view->display('password', $data);
  63 + }
  64 +}