Authored by Rock Zhang

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

@@ -56,7 +56,7 @@ $clear.bind('tap', function() { @@ -56,7 +56,7 @@ $clear.bind('tap', function() {
56 continue; 56 continue;
57 } 57 }
58 58
59 - html += '<li><a href="?query=' + history + '">' + history + '</li>'; 59 + html += '<li><a href="/?query=' + history + '">' + history + '</li>';
60 } 60 }
61 61
62 $history.html(html); 62 $history.html(html);
1 {{>layout/header}} 1 {{>layout/header}}
2 -  
3 <div class="index-page yoho-page"> 2 <div class="index-page yoho-page">
4 -  
5 - <div class="index-container">  
6 - <div class="index-header clearfix">  
7 - <div class="iconfont index-logo">&#xe60e;</div>  
8 - <form action="http://search.m.yohobuy.com" class="index-search">  
9 - <a href="javascript:void(0);" class="no-search">取消</a>  
10 - <div class="search-box">  
11 - <input type="text" name="query" placeholder="搜索">  
12 - <span class="iconfont clear-text">&#xe623;</span>  
13 - <span class="iconfont search-icon">&#xe60f;</span>  
14 - </div>  
15 - </form>  
16 - </div>  
17 -  
18 - <div class="index-channel">  
19 - <img class="img" src="{{background}}" alt="">  
20 - <div class="index-channel-list">  
21 - <a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>  
22 - <a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>  
23 - <a href="/kids" class="list-item">潮童 <span class="lighter">KIDS</span> <span class="iconfont right-icon">&#xe614;</span></a>  
24 - <a href="/lifestyle" class="list-item">创意生活 <span class="lighter">LIFESTYLE</span> <span class="iconfont right-icon">&#xe614;</span></a>  
25 - </div>  
26 -  
27 - </div>  
28 -  
29 - </div> 3 + <div class="index-container">
  4 + <div class="index-header clearfix">
  5 + <div class="iconfont index-logo">&#xe60e;</div>
  6 + <form action="{{searchUrl}}" class="index-search">
  7 + <a href="javascript:void(0);" class="no-search">取消</a>
  8 + <div class="search-box">
  9 + <input type="text" name="query" placeholder="搜索">
  10 + <span class="iconfont clear-text">&#xe623;</span>
  11 + <span class="iconfont search-icon">&#xe60f;</span>
  12 + </div>
  13 + </form>
  14 + </div>
  15 + <div class="index-channel">
  16 + <img class="img" src="{{background}}" alt="">
  17 + <div class="index-channel-list">
  18 + <a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>
  19 + <a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>
  20 + <a href="/kids" class="list-item">潮童 <span class="lighter">KIDS</span> <span class="iconfont right-icon">&#xe614;</span></a>
  21 + <a href="/lifestyle" class="list-item">创意生活 <span class="lighter">LIFESTYLE</span> <span class="iconfont right-icon">&#xe614;</span></a>
  22 + </div>
  23 + </div>
  24 + </div>
30 </div> 25 </div>
31 -  
32 {{>layout/footer}} 26 {{>layout/footer}}
33 {{> layout/download_app}} 27 {{> layout/download_app}}
1 -{{> layout/header}}  
2 -<div class="good-list-page yoho-page">  
3 - {{# goodList}}  
4 - {{# search}}  
5 - <div id="search-input" class="search-input">  
6 - <form action="/product/list/index" method="get">  
7 - <i class="search-icon iconfont">&#xe60f;</i>  
8 - <input type="text" value={{default}} name="query">  
9 - <i class="clear-input iconfont hide">&#xe61a;</i>  
10 - <button id="search" class="search" type="submit">搜索</button>  
11 - </form>  
12 - </div>  
13 - {{/ search}}  
14 -  
15 - {{# brandWay}}  
16 - <div class="brand-way">  
17 - <a href={{url}}>  
18 - <img class="brand-thumb" src={{thumb}}>  
19 - <span>{{name}}</span>  
20 - <span class="entry">  
21 - 进入品牌  
22 - <i class="iconfont">&#xe614;</i>  
23 - </span>  
24 - </a>  
25 - </div>  
26 - {{/ brandWay}}  
27 -  
28 - {{# brandHome}}  
29 - <div id="brand-header" class="brand-header" data-id={{id}}>  
30 - <img class="lazy" data-original={{banner}}>  
31 - <a class="btn-intro" href="javascript:void(0);">  
32 - 品牌介绍  
33 - </a>  
34 - <a class="btn-col" href="javascript:void(0);">  
35 - <span class="iconfont">&#xe622;</span>  
36 - 收藏  
37 - </a>  
38 - </div>  
39 - <div id="intro-box" class="brand-intro-box hide">  
40 - <div id="brand-intro" class="brand-intro">  
41 - <h2>品牌介绍</h2>  
42 - <div class="con">  
43 - {{{intro}}}  
44 - </div>  
45 - <p class="fo">  
46 - <span></span>  
47 - 100%品牌授权正品  
48 - </p>  
49 - <span class="iconfont close-intro">&#xe623;</span>  
50 - </div>  
51 - </div>  
52 - {{/ brandHome}}  
53 -  
54 - <ul id="list-nav" class="list-nav clearfix">  
55 - <li class="new active">  
56 - <a href="javascript:void(0);">  
57 - 最新  
58 - <span class="iconfont cur">&#xe616;</span>  
59 - </a>  
60 - </li>  
61 - <li class="price">  
62 - <a href="javascript:void(0);">  
63 - 价格  
64 - <span class="icon">  
65 - <i class="iconfont up">&#xe615;</i>  
66 - <i class="iconfont down cur">&#xe616;</i>  
67 - </span>  
68 - </a>  
69 - </li>  
70 - <li class="discount">  
71 - <a href="javascript:void(0);">  
72 - 折扣  
73 - <span class="icon">  
74 - <i class="iconfont up">&#xe615;</i>  
75 - <i class="iconfont down cur">&#xe616;</i>  
76 - </span>  
77 - </a>  
78 - </li>  
79 - <li class="filter">  
80 - <a href="javascript:void(0);">  
81 - 筛选  
82 - <span class="iconfont">&#xe613;</span>  
83 - </a>  
84 - </li>  
85 - </ul>  
86 - <div id="goods-container" class="goods-container">  
87 - <div class="new-goods container">  
88 - {{# new}}  
89 - {{> good}}  
90 - {{/ new}}  
91 - </div>  
92 - <div class="price-goods container hide"></div>  
93 - <div class="discount-goods container hide"></div>  
94 -  
95 - {{> filter}}  
96 - </div>  
97 -  
98 - {{#if brand}}  
99 - <input id="brand" type="hidden" value={{brand}}>  
100 - {{/if}}  
101 -  
102 - {{#if gender}}  
103 - <input id="gender" type="hidden" value={{gender}}>  
104 - {{/if}}  
105 -  
106 - {{#if sort}}  
107 - <input id="sort" type="hidden" value={{sort}}>  
108 - {{/if}}  
109 -  
110 - {{#if color}}  
111 - <input id="color" type="hidden" value={{color}}>  
112 - {{/if}}  
113 -  
114 - {{#if size}}  
115 - <input id="size" type="hidden" value={{size}}>  
116 - {{/if}}  
117 -  
118 - {{#if price}}  
119 - <input id="price" type="hidden" value={{price}}>  
120 - {{/if}}  
121 -  
122 - {{#if discount}}  
123 - <input id="discount" type="hidden" value={{discount}}>  
124 - {{/if}}  
125 - {{/ goodList}}  
126 -</div>  
127 -{{> layout/footer}}  
1 -{{# new}}  
2 - {{> good}}  
3 -{{/ new}}  
1 {{> layout/page_footer}} 1 {{> layout/page_footer}}
  2 +{{> layout/download_app}}
2 {{#if rlsEnv}} 3 {{#if rlsEnv}}
3 <script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> 4 <script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
4 <script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> 5 <script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 -<title>{{title}}YOHO!有货</title> 5 +<title>{{title}}Yoho!Buy有货</title>
6 <meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> 6 <meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">
7 <meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> 7 <meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">
8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> 8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
1 <?php 1 <?php
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
  4 +use Plugin\Helpers;
4 5
5 /** 6 /**
6 * 频道选择 7 * 频道选择
@@ -20,7 +21,8 @@ class IndexController extends AbstractAction @@ -20,7 +21,8 @@ class IndexController extends AbstractAction
20 $this->_view->display('index', array( 21 $this->_view->display('index', array(
21 'background' => Index\HomeModel::getBgImage(), 22 'background' => Index\HomeModel::getBgImage(),
22 'channelPage' => true, 23 'channelPage' => true,
23 - 'showDownloadApp'=>true 24 + 'showDownloadApp'=>true,
  25 + 'searchUrl' => Helpers::url('', null, 'search'),
24 )); 26 ));
25 } 27 }
26 28
@@ -16,46 +16,10 @@ class SearchController extends AbstractAction @@ -16,46 +16,10 @@ class SearchController extends AbstractAction
16 */ 16 */
17 public function indexAction() 17 public function indexAction()
18 { 18 {
19 - $data = array(  
20 - array(  
21 - /*'hot' => array(  
22 - array(  
23 - 'name' => '夹克',  
24 - 'url' => 'm.yohobuy.com'  
25 - ),  
26 - array(  
27 - 'name' => '休闲运动鞋',  
28 - 'url' => 'm.yohobuy.com'  
29 - ),  
30 - array(  
31 - 'name' => 'Into the Rainbow',  
32 - 'url' => 'm.yohobuy.com'  
33 - )  
34 - ),  
35 - 'history' => array(  
36 - array(  
37 - 'name' => 'what',  
38 - 'url' => 'm.yohobuy.com'  
39 - ),  
40 - array(  
41 - 'name' => 'the',  
42 - 'url' => 'm.yohobuy.com'  
43 - ),  
44 - array(  
45 - 'name' => 'fuck',  
46 - 'url' => 'm.yohobuy.com'  
47 - )  
48 - )*/  
49 - )  
50 - ); 19 + $this->_view->html('search');
51 $this->_view->display('index', array( 20 $this->_view->display('index', array(
52 - 'search' => $data, 21 + 'search' => array('url' => Helpers::url('', null, 'search')),
53 'showDownloadApp' => true, 22 'showDownloadApp' => true,
54 - 'pageHeader' => array (  
55 - 'navBack' => true,  
56 - 'navHome' => '/',  
57 - 'navTitle' => '搜索'  
58 - ),  
59 'searchPage' => true, 23 'searchPage' => true,
60 'pageFooter' => true 24 'pageFooter' => true
61 )); 25 ));
@@ -79,7 +43,7 @@ class SearchController extends AbstractAction @@ -79,7 +43,7 @@ class SearchController extends AbstractAction
79 'discount' => FILTER_DEFAULT, 43 'discount' => FILTER_DEFAULT,
80 'gender' => FILTER_DEFAULT, 44 'gender' => FILTER_DEFAULT,
81 'p_d' => FILTER_DEFAULT,), false); 45 'p_d' => FILTER_DEFAULT,), false);
82 - 46 +
83 $query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null; 47 $query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null;
84 if (isset($condition['discount'])) { 48 if (isset($condition['discount'])) {
85 $condition['p_d'] = rawurldecode($condition['discount']); 49 $condition['p_d'] = rawurldecode($condition['discount']);
@@ -38,14 +38,8 @@ class ClassModel @@ -38,14 +38,8 @@ class ClassModel
38 } 38 }
39 39
40 do { 40 do {
41 - $num = 1;  
42 $data = ClassData::getClassesData(); 41 $data = ClassData::getClassesData();
43 -  
44 - if (!isset($data['code']) || $data['code'] !== 200) {  
45 - break;  
46 - }  
47 -  
48 - if (!isset($data['data'])) { 42 + if (empty($data['data'])) {
49 break; 43 break;
50 } 44 }
51 45
@@ -53,10 +47,7 @@ class ClassModel @@ -53,10 +47,7 @@ class ClassModel
53 $item = array(); 47 $item = array();
54 foreach ($data['data'] as $k => $v) { 48 foreach ($data['data'] as $k => $v) {
55 $oneClass = array('name' => $k, 'ca' => array()); 49 $oneClass = array('name' => $k, 'ca' => array());
56 - if ($num === 1) {  
57 - $oneClass['focus'] = true;  
58 - }  
59 - 50 +
60 foreach ($v as $val) { 51 foreach ($v as $val) {
61 $item = array(); 52 $item = array();
62 $item['name'] = $val['category_name']; 53 $item['name'] = $val['category_name'];
@@ -69,14 +60,12 @@ class ClassModel @@ -69,14 +60,12 @@ class ClassModel
69 'sort' => $value['relation_parameter']['sort'], 60 'sort' => $value['relation_parameter']['sort'],
70 'sort_name' => $value['category_name'] 61 'sort_name' => $value['category_name']
71 ), 'list'); 62 ), 'list');
72 -  
73 $item['sub'][] = $subitem; 63 $item['sub'][] = $subitem;
74 } 64 }
75 65
76 $oneClass['ca'][] = $item; 66 $oneClass['ca'][] = $item;
77 } 67 }
78 68
79 - $num++;  
80 $result[] = $oneClass; 69 $result[] = $oneClass;
81 } 70 }
82 71
@@ -10,22 +10,24 @@ class ClassController extends AbstractAction @@ -10,22 +10,24 @@ class ClassController extends AbstractAction
10 { 10 {
11 public function indexAction() 11 public function indexAction()
12 { 12 {
  13 + $channel = Helpers::getChannelByCookie();
13 $classes = ClassModel::getClassData(); 14 $classes = ClassModel::getClassData();
  15 + // 根据频道设置默认的焦点
  16 + if (!empty($classes)) {
  17 + $classes[$channel - 1]['focus'] = true;
  18 + }
  19 +
  20 + $this->setTitle('商品分类');
  21 + $this->setNavHeader('商品分类');
14 22
15 $data = array( 23 $data = array(
16 'categoryPage' => true, 24 'categoryPage' => true,
17 'showDownloadApp' => true, 25 'showDownloadApp' => true,
18 - 'pageHeader' => array (  
19 - 'navBack' => true,  
20 - 'navHome' => '/',  
21 - 'navTitle' => '商品分类'  
22 - ),  
23 'category' => array( 26 'category' => array(
24 - 'class' => $classes 27 + 'class' => $classes,
  28 + 'searchUrl' => Helpers::url('/search.html', null, 'search'),
25 ) 29 )
26 ); 30 );
27 -  
28 - $this->setTitle('商品分类');  
29 31
30 $this->_view->display('index', $data); 32 $this->_view->display('index', $data);
31 } 33 }
@@ -51,14 +51,14 @@ class IndexController extends AbstractAction @@ -51,14 +51,14 @@ class IndexController extends AbstractAction
51 $this->setTitle($name); 51 $this->setTitle($name);
52 $this->setNavHeader($name, true, SITE_MAIN); 52 $this->setNavHeader($name, true, SITE_MAIN);
53 53
54 - $goodList = Product\ListModel::getClassData($condition);  
55 - if (!empty($condition) && !empty($goodList)) {  
56 - $goodList = array_merge($goodList, $condition);  
57 - } 54 +// $goodList = Product\ListModel::getClassData($condition);
  55 +// if (!empty($condition) && !empty($goodList)) {
  56 +// $goodList = array_merge($goodList, $condition);
  57 +// }
58 $this->_view->display('index', array( 58 $this->_view->display('index', array(
59 'goodListPage' => true, 59 'goodListPage' => true,
60 'showDownloadApp' => true, 60 'showDownloadApp' => true,
61 - 'goodList' => $goodList, 61 + 'goodList' => $condition,
62 )); 62 ));
63 } 63 }
64 64
@@ -13,11 +13,11 @@ routes.error.route.controller = Error @@ -13,11 +13,11 @@ routes.error.route.controller = Error
13 routes.error.route.action = Index 13 routes.error.route.action = Index
14 14
15 ; 搜索页 15 ; 搜索页
16 -routes.reg.type = "rewrite"  
17 -routes.reg.match = "/search.html"  
18 -routes.reg.route.module = Index  
19 -routes.reg.route.controller = Search  
20 -routes.reg.route.action = Index 16 +routes.search.type = "rewrite"
  17 +routes.search.match = "/search.html"
  18 +routes.search.route.module = Index
  19 +routes.search.route.controller = Search
  20 +routes.search.route.action = Index
21 21
22 ; 注册页 22 ; 注册页
23 routes.reg.type = "rewrite" 23 routes.reg.type = "rewrite"