Authored by biao

更新频道选择页顶部导航

@@ -183,5 +183,6 @@ if ($genderItem.length > 0) { @@ -183,5 +183,6 @@ if ($genderItem.length > 0) {
183 $genderItem.on('touchstart', function() { 183 $genderItem.on('touchstart', function() {
184 $('.genderNav ul .active').removeClass('active'); 184 $('.genderNav ul .active').removeClass('active');
185 $(this).addClass('active'); 185 $(this).addClass('active');
  186 + window.location.search = "channel=" + ($(this).data('id') + 1);
186 }); 187 });
187 } 188 }
@@ -189,7 +189,7 @@ window.reMarginFooter('.footer-tab'); @@ -189,7 +189,7 @@ window.reMarginFooter('.footer-tab');
189 exports.set = function(c) { 189 exports.set = function(c) {
190 window.setCookie('_Channel', c, { 190 window.setCookie('_Channel', c, {
191 expires: 365, 191 expires: 365,
192 - domain: '.m.yohobuy.com' 192 + domain: '.dev.yohobuy.com'
193 }); 193 });
194 }; 194 };
195 195
@@ -21,8 +21,8 @@ module.exports = function(specificGender) { @@ -21,8 +21,8 @@ module.exports = function(specificGender) {
21 url; 21 url;
22 22
23 //The kidsType can be specified by the parameter. Add by @ZhaoBiao 23 //The kidsType can be specified by the parameter. Add by @ZhaoBiao
24 - var kidsType = specificGender === 'kidsType' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,  
25 - lifestyleType = specificGender === 'lifestyleType' || 24 + var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
  25 + lifestyleType = specificGender === 'lifestyle' ||
26 $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false; 26 $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false;
27 27
28 var $curNav, 28 var $curNav,
@@ -148,6 +148,11 @@ module.exports = function(specificGender) { @@ -148,6 +148,11 @@ module.exports = function(specificGender) {
148 } 148 }
149 } 149 }
150 150
  151 + // 优惠券页面直接加载你可能喜欢。add by @zhaobiao
  152 + if (specificGender) {
  153 + search();
  154 + }
  155 +
151 //srcoll to load more 156 //srcoll to load more
152 $(window).scroll(function() { 157 $(window).scroll(function() {
153 window.requestAnimationFrame(scrollHandler); 158 window.requestAnimationFrame(scrollHandler);
@@ -4,13 +4,9 @@ @@ -4,13 +4,9 @@
4 * @date: 2015/12/30 4 * @date: 2015/12/30
5 */ 5 */
6 6
7 -//var $ = require('jquery');  
8 -//  
9 -//function getGender () {  
10 -// // body...  
11 -//} 7 +function getGender () {
  8 + return window.cookie('_Channel');
  9 +}
12 10
13 -  
14 -  
15 -require('../home/maybe-like')(); 11 +require('../home/maybe-like')(getGender());
16 12
@@ -2,7 +2,16 @@ @@ -2,7 +2,16 @@
2 <div class="brand-page yoho-page"> 2 <div class="brand-page yoho-page">
3 {{# channel}} 3 {{# channel}}
4 4
5 - {{> home/top_nav}} 5 + <div class="genderNav">
  6 + <ul>
  7 + {{# channels}}
  8 + <li {{#if active}}class="active"{{/if}} data-id="{{@index}}">
  9 + <span>{{name}}</span>
  10 + <span class="split-border"></span>
  11 + </li>
  12 + {{/channels}}
  13 + </ul>
  14 + </div>
6 15
7 <div class="newbrand-search re-pos-search"> 16 <div class="newbrand-search re-pos-search">
8 <div class="search-box clearfix"> 17 <div class="search-box clearfix">
1 -<div class="genderNav">  
2 - <ul>  
3 - <li class="active">  
4 - <span>Boy</span>  
5 - <span class="split-border"></span>  
6 - </li>  
7 - <li>  
8 - <span>Girl</span>  
9 - <span class="split-border"></span>  
10 - </li>  
11 - <li>  
12 - <span>Kid</span>  
13 - <span class="split-border"></span>  
14 - </li>  
15 - <li>  
16 - <span>Lifestyle</span>  
17 - <span class="split-border"></span>  
18 - </li>  
19 - </ul>  
20 -</div>  
@@ -40,20 +40,20 @@ class BrandModel @@ -40,20 +40,20 @@ class BrandModel
40 40
41 // 设置品牌一览顶部频道导航 41 // 设置品牌一览顶部频道导航
42 $channels = array( 42 $channels = array(
43 - 1 => array( 43 + array(
44 'name' => 'Boy' 44 'name' => 'Boy'
45 ), 45 ),
46 - 2 => array( 46 + array(
47 'name' => 'Girl' 47 'name' => 'Girl'
48 ), 48 ),
49 - 3 => array( 49 + array(
50 'name' => 'Kid' 50 'name' => 'Kid'
51 ), 51 ),
52 - 4 => array( 52 + array(
53 'name' => 'Lifestyle' 53 'name' => 'Lifestyle'
54 ) 54 )
55 ); 55 );
56 - $channels[$channel]['active'] = true; 56 + $channels[$channel-1]['active'] = true;
57 $result['channels'] = $channels; 57 $result['channels'] = $channels;
58 58
59 /* 根据频道调用接口 */ 59 /* 根据频道调用接口 */