Authored by biao

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

... ... @@ -358,7 +358,7 @@
{
picLink: {
//图片导航
title: 'AA', //图片导航标题
picTitle: 'AA', //图片导航标题
list: [
{
href: '',
... ... @@ -621,6 +621,20 @@
//路径导航
pathNav: [...],
//品牌入口
shopEntry: {
home: '',
logo: '',
shopName: '',
sort: [
{
href: '',
name: '上衣'
},
...
]
},
..//标准页面内容,见上
}
}
... ... @@ -641,20 +655,6 @@
brandAbout: '', //品牌介绍页传HTML文本,非品牌介绍页则不传
leftContent: [], //...
//品牌入口
shopEntry: {
home: '',
logo: '',
shopName: '',
sort: [
{
href: '',
name: '上衣'
},
...
]
},
//分类介绍
sortIntro: {
name: '',
... ...
... ... @@ -3,73 +3,71 @@
{{# passport}}
{{> passport/cover}}
<div class="content">
<form id="login-form" method="POST" action="/passport/login/login">
<ul class="login-ul">
<li class="relative clearfix">
<h2 class="title">会员登录</h2>
<span id="country-code" class="country-code right">
<em>{{countryName}} {{countryCode}}</em>
<i class="iconfont">&#xe600;</i>
<ul id="country-list" class="country-list">
{{#each countryList}}
<li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li>
{{/each}}
</ul>
</span>
</li>
<li class="relative">
<input id="account" class="account input va" name="account" type="text" placeholder="邮箱/手机号码" autocomplete="off">
<ul id="email-autocomplete" class="email-autocomplete hide"></ul>
<span class="err-tip hide">
<i></i>
<em></em>
</span>
</li>
<li class="relative">
<input id="password" class="password input va" name="password" type="text" placeholder="密码" autocomplete="off" maxlength="20">
<span id="caps-lock" class="caps-lock hide">大写状态开启</span>
<span class="err-tip hide">
<i></i>
<em>请输入密码</em>
</span>
</li>
<li>
<span id="login-btn" class="login-btn btn">登录</span>
</li>
<li class="other-opts">
<span class="remeber-me">
<i class="iconfont">&#xe613;</i>
记住登录状态
</span>
<span class="right">
<a class="forget-password" href="{{forgetPwd}}">忘记密码?</a>
|
<a class="fast-reg" href="{{fastReg}}">快速注册</a>
</span>
</li>
<li class="third-party-login">
<a href="{{weixinLogin}}">
<span class="icon weixin"></span>
</a>
<a href="{{qqLogin}}">
<span class="icon qq"></span>
</a>
<a href="{{weiboLogin}}">
<span class="icon weibo"></span>
</a>
<a href="{{alipayLogin}}">
<span class="icon alipay"></span>
</a>
<a href="{{doubanLogin}}">
<span class="icon douban"></span>
</a>
<a href="{{renrenLogin}}">
<span class="icon renren"></span>
</a>
</li>
</ul>
<input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}">
</form>
<ul class="login-ul">
<li class="relative clearfix">
<h2 class="title">会员登录</h2>
<span id="country-code" class="country-code right">
<em>{{countryName}} {{countryCode}}</em>
<i class="iconfont">&#xe600;</i>
<ul id="country-list" class="country-list">
{{#each countryList}}
<li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li>
{{/each}}
</ul>
</span>
</li>
<li class="relative">
<input id="account" class="account input va" name="account" type="text" placeholder="邮箱/手机号码" autocomplete="off">
<ul id="email-autocomplete" class="email-autocomplete hide"></ul>
<span class="err-tip hide">
<i></i>
<em></em>
</span>
</li>
<li class="relative">
<input id="password" class="password input va" name="password" type="password" placeholder="密码" autocomplete="off" maxlength="20">
<span id="caps-lock" class="caps-lock hide">大写状态开启</span>
<span class="err-tip hide">
<i></i>
<em>请输入密码</em>
</span>
</li>
<li>
<span id="login-btn" class="login-btn btn">登录</span>
</li>
<li class="other-opts">
<span class="remeber-me">
<i class="iconfont">&#xe613;</i>
记住登录状态
</span>
<span class="right">
<a class="forget-password" href="{{forgetPwd}}">忘记密码?</a>
|
<a class="fast-reg" href="{{fastReg}}">快速注册</a>
</span>
</li>
<li class="third-party-login">
<a href="{{weixinLogin}}">
<span class="icon weixin"></span>
</a>
<a href="{{qqLogin}}">
<span class="icon qq"></span>
</a>
<a href="{{weiboLogin}}">
<span class="icon weibo"></span>
</a>
<a href="{{alipayLogin}}">
<span class="icon alipay"></span>
</a>
<a href="{{doubanLogin}}">
<span class="icon douban"></span>
</a>
<a href="{{renrenLogin}}">
<span class="icon renren"></span>
</a>
</li>
</ul>
<input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}">
</div>
{{/ passport}}
</div>
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{> product/standard-content}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
{{> product/latest-walk}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{> layout/path-nav}}
{{> product/standard-content}}
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
{{> product/latest-walk}}
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
<p class="path-nav">
{{#each pathNav}}
{{#if href}}
<a href="{{href}}">
{{name}}
{{#if pathNav}}
<p class="path-nav">
{{#each pathNav}}
{{#if href}}
<a href="{{href}}">
{{name}}
{{#unless @last}}
<span class="iconfont">&#xe601;</span>
{{/unless}}
</a>
{{^}}
<span>
{{name}}
{{#unless @last}}
<span class="iconfont">&#xe601;</span>
{{/unless}}
</a>
{{^}}
<span>
{{name}}
{{#unless @last}}
<i class="iconfont">&#xe601;</i>
{{/unless}}
</span>
{{/if}}
{{/each}}
</p>
\ No newline at end of file
{{#unless @last}}
<i class="iconfont">&#xe601;</i>
{{/unless}}
</span>
{{/if}}
{{/each}}
</p>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -38,37 +38,37 @@
{{!-- 全部品类--}}
{{# allSort}}
<div class="sort-container">
<h2>
全部品类
<span>{{updateNum}}</span>
</h2>
<ul>
{{#each list}}
<li class="product-list-nav {{#if active}}active{{/if}}">
<h3>
<span class="icon-triangle"></span>
{{name}}
<span>{{num}}</span>
</h3>
<ul class="sort-child-list">
{{#each childList}}
<li class="{{#if childActive}}active{{/if}}">
<a href="{{href}}">{{name}}</a>
<span>{{num}}</span>
</li>
{{/each}}
</ul>
</li>
{{/each}}
</ul>
</div>
<div class="sort-container">
<h2>
全部品类
<span>{{updateNum}}</span>
</h2>
<ul>
{{#each list}}
<li class="product-list-nav {{#if active}}active{{/if}}">
<h3>
<span class="icon-triangle"></span>
{{name}}
<span>{{num}}</span>
</h3>
<ul class="sort-child-list">
{{#each childList}}
<li class="{{#if childActive}}active{{/if}}">
<a href="{{href}}">{{name}}</a>
<span>{{num}}</span>
</li>
{{/each}}
</ul>
</li>
{{/each}}
</ul>
</div>
{{/ allSort}}
{{!-- 图片链接 --}}
{{# picLink}}
{{#if title}}
<h2 class="nav-pic-title">{{title}}</h2>
{{#if picTitle}}
<h2 class="nav-pic-title">{{picTitle}}</h2>
{{/if}}
<ul class="pic-nav">
{{#each list}}
... ...
... ... @@ -31,6 +31,8 @@ var checkbox = {
unchecked: '&#xe613;'
};
var authing = false;
var emailAcTime;
require('yoho.placeholder');
... ... @@ -46,7 +48,7 @@ function validateAccount() {
if (/^[0-9]+$/.test(account)) {
//如果是纯数字,则作为手机号码处理
if (mailPhoneRegx.phoneRegx['+' + $countryCodeHide.val()].test(account)) {
if (mailPhoneRegx.phoneRegx[$countryCodeHide.val()].test(account)) {
pass = true;
} else {
pass = false;
... ... @@ -97,6 +99,7 @@ function validatePassword() {
$passwordTip.removeClass('hide').children('em').text(err);
$password.addClass('error');
}
return pass;
}
//验证
... ... @@ -254,7 +257,29 @@ $('.va').on('focus', function() {
$('#login-btn').on('click', function() {
var pass = validate();
if (pass) {
$('#login-form').submit();
if (pass && authing === false) {
authing = true;
$.ajax({
url: '/passport/login/auth',
type: 'POST',
data: {
areaCode: $countryCodeHide.val().replace('+', ''),
account: $.trim($account.val()),
password: $.trim($password.val())
},
success: function(data) {
if (data.code === 400) {
$passwordTip.removeClass('hide').children('em').text(data.message);
$password.addClass('error');
return;
} else {
location.href = data.data.href;
}
},
complete: function() {
authing = false;
}
});
}
});
\ No newline at end of file
... ...