Authored by biao

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

@@ -660,6 +660,13 @@ @@ -660,6 +660,13 @@
660 name: '', 660 name: '',
661 enName: '', 661 enName: '',
662 desc: '', 662 desc: '',
  663 + keyEntry: [
  664 + {
  665 + name: '',
  666 + url: ''
  667 + },
  668 + ...
  669 + ],
663 img: '' 670 img: ''
664 }, 671 },
665 672
@@ -36,6 +36,22 @@ @@ -36,6 +36,22 @@
36 <div class="list-right pull-right"> 36 <div class="list-right pull-right">
37 {{> product/shop-entry}} 37 {{> product/shop-entry}}
38 38
  39 + {{# sortIntro}}
  40 + <div class="sort-intro clearfix">
  41 + <div class="texts pull-left">
  42 + <p class="name">{{name}}</p>
  43 + <p class="en-name">{{enName}}</p>
  44 + <p class="desc">{{description}}</p>
  45 + <div class="key-entry">
  46 + {{#each keyEntry}}
  47 + <a href="{{url}}">{{name}}</a>
  48 + {{/each}}
  49 + </div>
  50 + </div>
  51 + <img class="pull-right img" src="{{img}}">
  52 + </div>
  53 + {{/ sortIntro}}
  54 +
39 {{> product/standard-content}} 55 {{> product/standard-content}}
40 56
41 {{> product/latest-walk}} 57 {{> product/latest-walk}}
@@ -34,6 +34,22 @@ @@ -34,6 +34,22 @@
34 {{> product/left-content}} 34 {{> product/left-content}}
35 </div> 35 </div>
36 <div class="list-right pull-right"> 36 <div class="list-right pull-right">
  37 + {{# sortIntro}}
  38 + <div class="sort-intro clearfix">
  39 + <div class="texts pull-left">
  40 + <p class="name">{{name}}</p>
  41 + <p class="en-name">{{enName}}</p>
  42 + <p class="desc">{{description}}</p>
  43 + <div class="key-entry">
  44 + {{#each keyEntry}}
  45 + <a href="{{url}}">{{name}}</a>
  46 + {{/each}}
  47 + </div>
  48 + </div>
  49 + <img class="pull-right img" src="{{img}}">
  50 + </div>
  51 + {{/ sortIntro}}
  52 +
37 {{> product/standard-content}} 53 {{> product/standard-content}}
38 54
39 {{> product/latest-walk}} 55 {{> product/latest-walk}}
@@ -155,4 +155,77 @@ @@ -155,4 +155,77 @@
155 color: #f00; 155 color: #f00;
156 } 156 }
157 } 157 }
  158 +
  159 + .sort-intro {
  160 + margin-bottom: 20px;
  161 +
  162 + .texts {
  163 + width: 386px;
  164 + height: 298px;
  165 + padding: 0 50px;
  166 + border: 1px solid #eaeceb;
  167 + text-align: center;
  168 + overflow: hidden;
  169 + }
  170 +
  171 + .name {
  172 + font-size: 30px;
  173 + font-weight: bold;
  174 + margin-top: 60px;
  175 + }
  176 +
  177 + .en-name {
  178 + font-size: 14px;
  179 + font-weight: bold;
  180 + }
  181 +
  182 + .desc {
  183 + margin-top: 15px;
  184 + color: #666;
  185 + margin-top: 15px;
  186 + font-size: 12px;
  187 + line-height: 150%;
  188 + }
  189 +
  190 + .img {
  191 + width: 480px;
  192 + height: 300px;
  193 + }
  194 +
  195 + .key-entry {
  196 + width: 330px;
  197 + margin: 30px auto 0;
  198 +
  199 + a {
  200 + float: left;
  201 + display: block;
  202 + width: 110px;
  203 + height: 14px;
  204 + line-height: 14px;
  205 + font-size: 12px;
  206 + margin-bottom: 5px;
  207 + color: #069;
  208 + text-decoration: underline;
  209 + }
  210 + }
  211 + }
  212 +}
  213 +
  214 +@media (max-width: 1180px) {
  215 + .product-list-page .sort-intro {
  216 + .texts {
  217 + width: 346px;
  218 + height: 248px;
  219 + padding: 0 30px;
  220 + }
  221 +
  222 + .name {
  223 + margin-top: 30px;
  224 + }
  225 +
  226 + .img {
  227 + width: 400px;
  228 + height: 250px;
  229 + }
  230 + }
158 } 231 }
@@ -329,7 +329,6 @@ class HomeModel @@ -329,7 +329,6 @@ class HomeModel
329 public static function getChannel() 329 public static function getChannel()
330 { 330 {
331 $result = array(); 331 $result = array();
332 -  
333 if (USE_CACHE) { 332 if (USE_CACHE) {
334 $key = CacheConfig::KEY_ACTION_INDEX_CONFIG; 333 $key = CacheConfig::KEY_ACTION_INDEX_CONFIG;
335 // 先尝试获取一级缓存(master), 有数据则直接返回. 334 // 先尝试获取一级缓存(master), 有数据则直接返回.
@@ -340,6 +339,7 @@ class HomeModel @@ -340,6 +339,7 @@ class HomeModel
340 } 339 }
341 340
342 $data = IndexData::channelData(); 341 $data = IndexData::channelData();
  342 +
343 if (!empty($data['data']['list'])) { 343 if (!empty($data['data']['list'])) {
344 $build = array(); 344 $build = array();
345 foreach ($data['data']['list'] as $value) { 345 foreach ($data['data']['list'] as $value) {
@@ -372,7 +372,9 @@ class HomeModel @@ -372,7 +372,9 @@ class HomeModel
372 default: 372 default:
373 continue; 373 continue;
374 } 374 }
375 - $result['channelList'][] = $build; 375 + if (!empty($build)) {
  376 + $result['channelList'][] = $build;
  377 + }
376 } 378 }
377 } 379 }
378 380
@@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
71 $controller = 'Index'; 71 $controller = 'Index';
72 $action = 'Index'; 72 $action = 'Index';
73 // 二级域名 73 // 二级域名
74 - if (3 === $level) { 74 + if (2 === $level) {
75 $subDomain = strval($hostParts[0]); 75 $subDomain = strval($hostParts[0]);
76 switch (strtolower($subDomain)) { 76 switch (strtolower($subDomain)) {
77 case 'www': // 主站 77 case 'www': // 主站
@@ -87,6 +87,12 @@ class Bootstrap extends Bootstrap_Abstract @@ -87,6 +87,12 @@ class Bootstrap extends Bootstrap_Abstract
87 break; 87 break;
88 case 'list': // 商品列表 88 case 'list': // 商品列表
89 $module = 'Product'; 89 $module = 'Product';
  90 + $url = strtolower($dispatcher->getRequest()->getRequestUri());
  91 + //list列表的index
  92 + if(empty($url) || $url == '/index') {
  93 + $listRequest = new Yaf\Request\Http('/product/list/index');
  94 + $dispatcher->setRequest($listRequest);
  95 + }
90 break; 96 break;
91 case 'sale'://促销 97 case 'sale'://促销
92 $module = 'Product'; 98 $module = 'Product';
@@ -31,18 +31,42 @@ class IndexModel @@ -31,18 +31,42 @@ class IndexModel
31 //批量调接口获取数据 31 //批量调接口获取数据
32 $result = Yohobuy::getMulti($urlList, array(), true); 32 $result = Yohobuy::getMulti($urlList, array(), true);
33 33
  34 + // 组织模板数据
  35 + $data = HelperSearch::getList($result, $searchCondition['options']);
  36 +
34 //调用接口获取list-index banner数据 37 //调用接口获取list-index banner数据
35 $msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false; 38 $msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
36 $misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false; 39 $misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
  40 + $positionId = isset($searchCondition['options']['positionId']) ? $searchCondition['options']['positionId'] : '';
37 $gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1; 41 $gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
38 if ($msort && $misort) { 42 if ($msort && $misort) {
39 - $bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array(10,$msort,$misort,$gender,0,0,0,0,0)); 43 + $bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array($positionId,$msort,$misort,$gender,0,0,0,0,0));
  44 + if (isset($bannerData['code']) && $bannerData['code'] == '200') {
  45 + $banner = self::formatBanner($bannerData['data']);
  46 + }
  47 + }
  48 + //插入banner数据
  49 + if (!empty($banner)) {
  50 + $data['sortIntro'] = $banner;
40 } 51 }
41 52
42 - // 组织模板数据  
43 - $data = HelperSearch::getList($result, $searchCondition['options']);  
44 -  
45 return $data; 53 return $data;
46 } 54 }
47 55
  56 + //组织list-index banner数据
  57 + public static function formatBanner($bannerData)
  58 + {
  59 + $banner = array();
  60 + $banner['name'] = $bannerData['title'];
  61 + $banner['enName'] = $bannerData['subtitle'];
  62 + $banner['desc'] = $bannerData['intro'];
  63 + $banner['img'] = $bannerData['logo'];
  64 + foreach($bannerData['keyword'] as $key => $vo){
  65 + $banner['keyEntry'][$key]['name'] = $vo['word'];
  66 + $banner['keyEntry'][$key]['url'] = $vo['url'];
  67 + }
  68 +
  69 + return $banner;
  70 + }
  71 +
48 } 72 }
@@ -429,6 +429,26 @@ class Index1Controller extends AbstractAction @@ -429,6 +429,26 @@ class Index1Controller extends AbstractAction
429 'name' => '包类/装备' 429 'name' => '包类/装备'
430 ) 430 )
431 ), 431 ),
  432 + 'sortIntro' => array(
  433 + 'name' => '羽绒服',
  434 + 'enName' => 'DOWN COAT',
  435 + 'desc' => '羽绒服是冬季必不可少的服饰之一,冬天的街头充斥着各种各样的羽绒服,特别是在北方。时下羽绒服融入了毛领、收腰等时尚元素,更显潮人们的完美身材。',
  436 + 'keyEntry' => array(
  437 + array(
  438 + 'name' => 'Livis'
  439 + ),
  440 + array(
  441 + 'name' => 'LEE'
  442 + ),
  443 + array(
  444 + 'name' => 'LE2E'
  445 + ),
  446 + array(
  447 + 'name' => 'LE2E'
  448 + )
  449 + ),
  450 + 'img' => 'http://img13.static.yhbimg.com/adpic/2015/12/22/06/0276abe61367884cea21b779e47141891b.jpg'
  451 + ),
432 'shopEntry' => array( 452 'shopEntry' => array(
433 'home' => 'adidas.yohobuy.com', 453 'home' => 'adidas.yohobuy.com',
434 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2013/01/16/09/01f515687de080f94243cb1aa0fedb2fe1.jpg?imageMogr2/thumbnail/80x50/extent/80x50/background/d2hpdGU=/position/center/quality/90', 454 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2013/01/16/09/01f515687de080f94243cb1aa0fedb2fe1.jpg?imageMogr2/thumbnail/80x50/extent/80x50/background/d2hpdGU=/position/center/quality/90',
@@ -5,8 +5,12 @@ class ListController extends WebAction @@ -5,8 +5,12 @@ class ListController extends WebAction
5 { 5 {
6 public function indexAction() 6 public function indexAction()
7 { 7 {
  8 + //获取banner id
  9 + $positionId = 10; //搜素banner 位置id
8 $condition = array(); 10 $condition = array();
9 - $options = array(); 11 + $options = array(
  12 + 'positionId' => $positionId
  13 + );
10 $indexData = Product\IndexModel::getIndexData($condition, $options); 14 $indexData = Product\IndexModel::getIndexData($condition, $options);
11 15
12 $data = array( 16 $data = array(
1 -; list列表(index)  
2 -routes.productindex.type = "rewrite"  
3 -routes.productindex.match = "/sale"  
4 -routes.productindex.route.module = Product  
5 -routes.productindex.route.controller = List  
6 -routes.productindex.route.action = index  
7 -  
8 ; 折扣专区(SALE) 1 ; 折扣专区(SALE)
9 routes.productsale.type = "rewrite" 2 routes.productsale.type = "rewrite"
10 routes.productsale.match = "/sale" 3 routes.productsale.match = "/sale"