Authored by yyqing

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

@@ -7,6 +7,7 @@ use LibModels\Web\Product\BrandData; @@ -7,6 +7,7 @@ use LibModels\Web\Product\BrandData;
7 use LibModels\Web\Product\SearchData; 7 use LibModels\Web\Product\SearchData;
8 use Api\Yohobuy; 8 use Api\Yohobuy;
9 use Api\Sign; 9 use Api\Sign;
  10 +use Index\HomeModel;
10 /** 11 /**
11 * 搜索辅助类 12 * 搜索辅助类
12 */ 13 */
@@ -31,7 +32,7 @@ class HelperSearch @@ -31,7 +32,7 @@ class HelperSearch
31 private static function setListNav() 32 private static function setListNav()
32 { 33 {
33 $options = self::$options; 34 $options = self::$options;
34 - $cookieChannel = isset($_COOKIE['_Channel']) ? $_COOKIE['_Channel'] : 'boys'; 35 + $channel = HomeModel::getSwitchChannel();
35 if (isset($options['brandName']) && !empty($options['brandName'])) { 36 if (isset($options['brandName']) && !empty($options['brandName'])) {
36 $initNav = $options['brandNameEn'] . $options['brandNameCn']; 37 $initNav = $options['brandNameEn'] . $options['brandNameCn'];
37 }else{ 38 }else{
@@ -39,7 +40,7 @@ class HelperSearch @@ -39,7 +40,7 @@ class HelperSearch
39 } 40 }
40 self::$listNav[0] = array( 41 self::$listNav[0] = array(
41 'href' => '', 42 'href' => '',
42 - 'name' => strtoupper($cookieChannel).'首页' 43 + 'name' => strtoupper($channel).'首页'
43 ); 44 );
44 self::$listNav[1] = array( 45 self::$listNav[1] = array(
45 'href' => '', 46 'href' => '',
@@ -219,9 +219,9 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() { @@ -219,9 +219,9 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() {
219 $(this).removeClass('highlight'); 219 $(this).removeClass('highlight');
220 }); 220 });
221 221
222 -// $('.nav-home').on('touchstart', function() {  
223 -// $('.homebuttom').toggleClass('none');  
224 -// }); 222 +$('.nav-home').on('touchstart', function() {
  223 + $('.homebuttom').toggleClass('none');
  224 +});
225 225
226 (function() { 226 (function() {
227 var lastTime = 0, 227 var lastTime = 0,
@@ -144,6 +144,9 @@ @@ -144,6 +144,9 @@
144 overflow: hidden; 144 overflow: hidden;
145 float: left; 145 float: left;
146 text-align: center; 146 text-align: center;
  147 + a{
  148 + color: #fff;
  149 + }
147 i{ 150 i{
148 width: 100%; 151 width: 100%;
149 height: 40%; 152 height: 40%;
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 float: left; 97 float: left;
98 color: #fff; 98 color: #fff;
99 font-size: pxToRem(28px); 99 font-size: pxToRem(28px);
100 - width: pxToRem(320px); 100 + width: pxToRem(212px);
101 // width: pxToRem(213px); 三栏宽度 101 // width: pxToRem(213px); 三栏宽度
102 102
103 &.highlight { 103 &.highlight {
@@ -28,14 +28,10 @@ @@ -28,14 +28,10 @@
28 {{#isLogin}}{{brand_favorite_total}}{{/isLogin}} 28 {{#isLogin}}{{brand_favorite_total}}{{/isLogin}}
29 <p>收藏的品牌</p> 29 <p>收藏的品牌</p>
30 </a> 30 </a>
31 - {{!  
32 <a class="link-item tap-hightlight" href="/home/record"> 31 <a class="link-item tap-hightlight" href="/home/record">
33 - <!-- product_browse -->  
34 - 32 + {{#isLogin}}{{product_browse}}{{/isLogin}}
35 <p>浏览记录</p> 33 <p>浏览记录</p>
36 </a> 34 </a>
37 - }}  
38 -  
39 </div> 35 </div>
40 <div class="my-order"> 36 <div class="my-order">
41 <a class="order-title" href="/home/orders"> 37 <a class="order-title" href="/home/orders">
@@ -38,4 +38,13 @@ @@ -38,4 +38,13 @@
38 {{/ logisticDetail}} 38 {{/ logisticDetail}}
39 </div> 39 </div>
40 </div> 40 </div>
  41 +<div class="banner">
  42 + {{#banner}}
  43 + <a href="{{url}}">
  44 + <img src="{{img}}" alt="img">
  45 + </a>
  46 + {{/banner}}
  47 +</div>
  48 +
  49 +{{> home/maybe_like}}
41 {{> layout/footer}} 50 {{> layout/footer}}
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a> 4 <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a>
5 {{/navBack}} 5 {{/navBack}}
6 {{#navHome}} 6 {{#navHome}}
7 - <a href="{{.}}" class="iconfont nav-home">&#xe611;</a> 7 + <span class="iconfont nav-home">&#xe62d;</span>
8 {{/navHome}} 8 {{/navHome}}
9 {{#currencyPage}} 9 {{#currencyPage}}
10 <a href="/home/helpDetail?code=20151230-102233&caption=YOHO币介绍" class="iconfont nav-home">&#xe639;</a> 10 <a href="/home/helpDetail?code=20151230-102233&caption=YOHO币介绍" class="iconfont nav-home">&#xe639;</a>
@@ -18,32 +18,34 @@ @@ -18,32 +18,34 @@
18 {{#navTitle}} 18 {{#navTitle}}
19 <p class="nav-title">{{.}}</p> 19 <p class="nav-title">{{.}}</p>
20 {{/navTitle}} 20 {{/navTitle}}
21 - {{# navBtn}}  
22 - <span class="nav-btn">{{.}}</span>  
23 - {{!--  
24 - <i class="iconfont nav-home">&#xe638;</i>  
25 - <div class="homebuttom none">  
26 - <ul>  
27 - <li> 21 +</header>
  22 +<div class="homebuttom none">
  23 + <ul>
  24 + <li>
  25 + <a href="/">
28 <i class="iconfont">&#xe62a;</i> 26 <i class="iconfont">&#xe62a;</i>
29 <span>首页</span> 27 <span>首页</span>
30 - </li>  
31 - <li> 28 + </a>
  29 + </li>
  30 + <li>
  31 + <a href="cate">
32 <i class="iconfont">&#xe62d;</i> 32 <i class="iconfont">&#xe62d;</i>
33 <span>分类</span> 33 <span>分类</span>
34 - </li>  
35 - <li> 34 + </a>
  35 + </li>
  36 + <li>
  37 + <a href="cart/index/index">
36 <i class="iconfont">&#xe62c;</i> 38 <i class="iconfont">&#xe62c;</i>
37 <span>购物车</span> 39 <span>购物车</span>
38 - </li>  
39 - <li> 40 + </a>
  41 + </li>
  42 + <li>
  43 + <a href="/home">
40 <i class="iconfont">&#xe62b;</i> 44 <i class="iconfont">&#xe62b;</i>
41 <span>我的</span> 45 <span>我的</span>
42 - </li>  
43 - </ul>  
44 - </div>  
45 - --}}  
46 - {{/ navBtn}}  
47 -</header> 46 + </a>
  47 + </li>
  48 + </ul>
  49 +</div>
48 50
49 {{/pageHeader}} 51 {{/pageHeader}}
@@ -79,6 +79,10 @@ var $ = require('yoho.jquery'), @@ -79,6 +79,10 @@ var $ = require('yoho.jquery'),
79 var brandTpl, 79 var brandTpl,
80 brandHtml; 80 brandHtml;
81 81
  82 + if (!data || data.length === 0) {
  83 + return;
  84 + }
  85 +
82 that._createHelper(); 86 that._createHelper();
83 brandHtml = '\{{#brandList logoBrand}}' + 87 brandHtml = '\{{#brandList logoBrand}}' +
84 '<a href="\{{href}}" target="_blank"><img class="lazy" data-original="\{{img}}" alt=""></a>' + 88 '<a href="\{{href}}" target="_blank"><img class="lazy" data-original="\{{img}}" alt=""></a>' +
@@ -174,6 +174,9 @@ $('.va').keyup(function() { @@ -174,6 +174,9 @@ $('.va').keyup(function() {
174 } else if (v.length < 6 || v.length > 20) { 174 } else if (v.length < 6 || v.length > 20) {
175 $(this).addClass('error'); 175 $(this).addClass('error');
176 $pwdErr.removeClass('hide').find('em').text('密码只支持6-20位'); 176 $pwdErr.removeClass('hide').find('em').text('密码只支持6-20位');
  177 + } else if (/^([a-zA-Z0-9\-\+_!@\#$%\^&\*\(\)\:\;\.=\[\]\\\',\?]){6,20}$/.test(v)) {
  178 + $(this).addClass('error');
  179 + $pwdErr.removeClass('hide').find('em').text('密码不能包含特殊字符');
177 } else { 180 } else {
178 $pwdErr.addClass('hide'); 181 $pwdErr.addClass('hide');
179 if ($repwd.val() !== '') { 182 if ($repwd.val() !== '') {
@@ -11,7 +11,7 @@ $('#brand-favor').on('click', function() { @@ -11,7 +11,7 @@ $('#brand-favor').on('click', function() {
11 uid = window.getUid(); 11 uid = window.getUid();
12 12
13 if (!uid) { 13 if (!uid) {
14 - location.href = '/signin.html?refer=' + location.href; 14 + location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
15 return; 15 return;
16 } 16 }
17 17
@@ -174,6 +174,11 @@ $(document).on('hover', '.good-select-color li', function() { @@ -174,6 +174,11 @@ $(document).on('hover', '.good-select-color li', function() {
174 $goodInfoMain.on('click', '.col-btn', function() { 174 $goodInfoMain.on('click', '.col-btn', function() {
175 var $this = $(this); 175 var $this = $(this);
176 176
  177 + if (!window.getUid()) {
  178 + location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
  179 + return;
  180 + }
  181 +
177 $.ajax({ 182 $.ajax({
178 type: 'POST', 183 type: 'POST',
179 url: '/product/list/changeFavorite', 184 url: '/product/list/changeFavorite',