Authored by biao

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

... ... @@ -660,6 +660,13 @@
name: '',
enName: '',
desc: '',
keyEntry: [
{
name: '',
url: ''
},
...
],
img: ''
},
... ...
... ... @@ -36,6 +36,22 @@
<div class="list-right pull-right">
{{> product/shop-entry}}
{{# sortIntro}}
<div class="sort-intro clearfix">
<div class="texts pull-left">
<p class="name">{{name}}</p>
<p class="en-name">{{enName}}</p>
<p class="desc">{{description}}</p>
<div class="key-entry">
{{#each keyEntry}}
<a href="{{url}}">{{name}}</a>
{{/each}}
</div>
</div>
<img class="pull-right img" src="{{img}}">
</div>
{{/ sortIntro}}
{{> product/standard-content}}
{{> product/latest-walk}}
... ...
... ... @@ -34,6 +34,22 @@
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# sortIntro}}
<div class="sort-intro clearfix">
<div class="texts pull-left">
<p class="name">{{name}}</p>
<p class="en-name">{{enName}}</p>
<p class="desc">{{description}}</p>
<div class="key-entry">
{{#each keyEntry}}
<a href="{{url}}">{{name}}</a>
{{/each}}
</div>
</div>
<img class="pull-right img" src="{{img}}">
</div>
{{/ sortIntro}}
{{> product/standard-content}}
{{> product/latest-walk}}
... ...
... ... @@ -155,4 +155,77 @@
color: #f00;
}
}
.sort-intro {
margin-bottom: 20px;
.texts {
width: 386px;
height: 298px;
padding: 0 50px;
border: 1px solid #eaeceb;
text-align: center;
overflow: hidden;
}
.name {
font-size: 30px;
font-weight: bold;
margin-top: 60px;
}
.en-name {
font-size: 14px;
font-weight: bold;
}
.desc {
margin-top: 15px;
color: #666;
margin-top: 15px;
font-size: 12px;
line-height: 150%;
}
.img {
width: 480px;
height: 300px;
}
.key-entry {
width: 330px;
margin: 30px auto 0;
a {
float: left;
display: block;
width: 110px;
height: 14px;
line-height: 14px;
font-size: 12px;
margin-bottom: 5px;
color: #069;
text-decoration: underline;
}
}
}
}
@media (max-width: 1180px) {
.product-list-page .sort-intro {
.texts {
width: 346px;
height: 248px;
padding: 0 30px;
}
.name {
margin-top: 30px;
}
.img {
width: 400px;
height: 250px;
}
}
}
... ...
... ... @@ -329,7 +329,6 @@ class HomeModel
public static function getChannel()
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_INDEX_CONFIG;
// 先尝试获取一级缓存(master), 有数据则直接返回.
... ... @@ -340,6 +339,7 @@ class HomeModel
}
$data = IndexData::channelData();
if (!empty($data['data']['list'])) {
$build = array();
foreach ($data['data']['list'] as $value) {
... ... @@ -372,7 +372,9 @@ class HomeModel
default:
continue;
}
$result['channelList'][] = $build;
if (!empty($build)) {
$result['channelList'][] = $build;
}
}
}
... ...
... ... @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller = 'Index';
$action = 'Index';
// 二级域名
if (3 === $level) {
if (2 === $level) {
$subDomain = strval($hostParts[0]);
switch (strtolower($subDomain)) {
case 'www': // 主站
... ... @@ -87,6 +87,12 @@ class Bootstrap extends Bootstrap_Abstract
break;
case 'list': // 商品列表
$module = 'Product';
$url = strtolower($dispatcher->getRequest()->getRequestUri());
//list列表的index
if(empty($url) || $url == '/index') {
$listRequest = new Yaf\Request\Http('/product/list/index');
$dispatcher->setRequest($listRequest);
}
break;
case 'sale'://促销
$module = 'Product';
... ...
... ... @@ -31,18 +31,42 @@ class IndexModel
//批量调接口获取数据
$result = Yohobuy::getMulti($urlList, array(), true);
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
//调用接口获取list-index banner数据
$msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
$misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
$positionId = isset($searchCondition['options']['positionId']) ? $searchCondition['options']['positionId'] : '';
$gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
if ($msort && $misort) {
$bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array(10,$msort,$misort,$gender,0,0,0,0,0));
$bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array($positionId,$msort,$misort,$gender,0,0,0,0,0));
if (isset($bannerData['code']) && $bannerData['code'] == '200') {
$banner = self::formatBanner($bannerData['data']);
}
}
//插入banner数据
if (!empty($banner)) {
$data['sortIntro'] = $banner;
}
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
return $data;
}
//组织list-index banner数据
public static function formatBanner($bannerData)
{
$banner = array();
$banner['name'] = $bannerData['title'];
$banner['enName'] = $bannerData['subtitle'];
$banner['desc'] = $bannerData['intro'];
$banner['img'] = $bannerData['logo'];
foreach($bannerData['keyword'] as $key => $vo){
$banner['keyEntry'][$key]['name'] = $vo['word'];
$banner['keyEntry'][$key]['url'] = $vo['url'];
}
return $banner;
}
}
... ...
... ... @@ -429,6 +429,26 @@ class Index1Controller extends AbstractAction
'name' => '包类/装备'
)
),
'sortIntro' => array(
'name' => '羽绒服',
'enName' => 'DOWN COAT',
'desc' => '羽绒服是冬季必不可少的服饰之一,冬天的街头充斥着各种各样的羽绒服,特别是在北方。时下羽绒服融入了毛领、收腰等时尚元素,更显潮人们的完美身材。',
'keyEntry' => array(
array(
'name' => 'Livis'
),
array(
'name' => 'LEE'
),
array(
'name' => 'LE2E'
),
array(
'name' => 'LE2E'
)
),
'img' => 'http://img13.static.yhbimg.com/adpic/2015/12/22/06/0276abe61367884cea21b779e47141891b.jpg'
),
'shopEntry' => array(
'home' => 'adidas.yohobuy.com',
'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
{
public function indexAction()
{
//获取banner id
$positionId = 10; //搜素banner 位置id
$condition = array();
$options = array();
$options = array(
'positionId' => $positionId
);
$indexData = Product\IndexModel::getIndexData($condition, $options);
$data = array(
... ...
; list列表(index)
routes.productindex.type = "rewrite"
routes.productindex.match = "/sale"
routes.productindex.route.module = Product
routes.productindex.route.controller = List
routes.productindex.route.action = index
; 折扣专区(SALE)
routes.productsale.type = "rewrite"
routes.productsale.match = "/sale"
... ...