Authored by 毕凯

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

... ... @@ -636,7 +636,15 @@ class HelperSearch
//设置已选中价格
if (!empty($priceId)) {
$price = explode(',' ,$priceId);
$customName = isset($price[1]) && $price[1] == 99999 ? '¥'.$price[0].'以上' : '¥' . intval($price[0]-1) . '-' . intval($price[1]);
if (isset($price[1]) && empty($price[1])) {
$customName = '¥' . intval($price[0]) . '-99999';
}
elseif (isset($price[1]) && $price[1] == 99999) {
$customName = '¥'.intval($price[0]-1).'以上';
}
else {
$customName = '¥' . intval($price[0]) . '-' . intval($price[1]);
}
$name = isset($filter['price'][$priceId]) ? $filter['price'][$priceId] : $customName;
self::$selected['price'] = array(
'name' => $name,
... ... @@ -875,10 +883,12 @@ class HelperSearch
}
$result = array(
'name' => '最新',
'href' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? self::buildUrl($params) : self::buildUrl(array_merge($params, array(
'href' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? self::buildUrl(array_merge($params, array(
'order' => 's_t_asc'
))) : self::buildUrl(array_merge($params, array(
'order' => 's_t_desc'
))) ,
'active' => isset(self::$params['order']) && self::$params['order'] == 's_t_asc' ? true : ''
'active' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? true : ''
);
return $result;
}
... ... @@ -1347,6 +1357,9 @@ class HelperSearch
elseif ($controller == 'list' && $action == 'sale') {
$type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
}
elseif ($controller == 'sale' && $action == 'index') {
$type = isset(self::$params['specialsale_id']) && self::$params['specialsale_id'] ? self::$params['specialsale_id'] : '';
}
// 品牌
elseif ($controller == 'list' && $action == 'sale') {
$type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
... ...
... ... @@ -285,7 +285,7 @@ $('#login-btn').on('click', function() {
}
} else {
$passwordTip.removeClass('hide').children('em').html(data.message);
$password.addClass('error');
$password.addClass('error').val('');
}
},
complete: function() {
... ...
... ... @@ -173,6 +173,18 @@
height: 150px;
line-height: 150px;
}
.logo-brand-switch {
.iconfont {
font-size: 24px;
&.prev {
top: -12px;
}
&.bottom {
bottom: -12px;
}
}
}
}
... ...
... ... @@ -67,9 +67,9 @@ class HotrankModel
public static function getHotrankResource($data, $sid, $page)
{
//焦点图 热门品牌
// $focus = self::getFocusResource($data['channel'], $data['code']);
// $data['slide'] = $focus[0]['slide'];
// $data['hotBrands'] = $focus[1]['hotBrands'];
$focus = self::getFocusResource($data['channel'], $data['code']);
$data['slide'] = $focus[0]['slide'];
$data['hotBrands'] = $focus[1]['hotBrands'];
//人气单品 一周热卖
$sort = ($sid == 1) ? '' : $sid;
$config = array(
... ... @@ -203,6 +203,7 @@ class HotrankModel
public static function getProductList($result, $page, $ajax = 0)
{
$product = array();
$url = Helpers::url('/product/pro', '', 'item');
if (empty($result) || empty($result['data']) || empty($result['data']['product_list'])) {
return $product;
}
... ... @@ -213,36 +214,35 @@ class HotrankModel
if (empty($val['goods_list'])) {
continue;
}
$defaultGoodsId = 0;
//$defaultGoodsId = 0;
foreach ($val['goods_list'] as $v) {
if ($v['is_default'] == 'Y') {
$defaultGoodsId = $v['goods_id'];
$defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
}
}
if (empty($defaultGoodsId)) {
$defaultGoodsId = $val['goods_list'][0]['goods_id'];
}
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
$product['name'] = $val['product_name'];
if ($key <= 9 && $page == 1 && $ajax == 0) {
//人气单品
$product['rank'] = $key + 1;
$product['href'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['title'] = $val['product_name'];
$product['href'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
$product['sPrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
if ($key <= 5) {
//6张大图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $product;
}
else {
//4张小图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $product;
}
}
else {
//一周热卖
// $product['url'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['url'] = Helpers::url('/product/pro',array('product_id' => $product_id,'defaultGoodsId'=> $defaultGoodsId),'item');
$product['name'] = $val['product_name'];
$product['url'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
$product['salePrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
$product['rank'] = '';
... ...
<?php
use Action\WebAction;
use LibModels\Web\Product\FavoriteData;
use Product\BrandsModel;
use product\HotrankModel;
class IndexController extends WebAction
{
/**
* 品牌首页
*/
... ... @@ -60,7 +61,7 @@ class IndexController extends WebAction
$this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
$this->setWebNavHeader();
//渲染模板
$this->_view->display('list',$data);
$this->_view->display('list', $data);
}
//品牌介绍页
... ... @@ -105,7 +106,7 @@ class IndexController extends WebAction
$this->setWebNavHeader();
//渲染模板
$this->_view->display('list',$data);
$this->_view->display('list', $data);
}
//收藏品牌
... ... @@ -120,7 +121,7 @@ class IndexController extends WebAction
);
$uid = $this->getUid();
$brandId = $this->post('brandId');
do{
do {
if (!$uid) {
$result = array(
'code' => 403,
... ... @@ -133,7 +134,8 @@ class IndexController extends WebAction
$result = FavoriteData::changeFavoriteBrand($uid, $brandId);
break;
}
}while(false);
}
while (false);
$this->echoJson($result);
}
... ... @@ -146,28 +148,29 @@ class IndexController extends WebAction
//获取频道
$channel = HotrankModel::getChannelResource();
$this->setWebNavHeader($channel['channel']);
$page = $this->get('page',1);
$sort = $this->get('sid',1);
$data = array( 'hotrankPage' => true,
'footerTop'=> true,
$page = $this->get('page', 1);
$sort = $this->get('sid', 1);
$data = array('hotrankPage' => true,
'footerTop' => true,
'hotrank' => HotrankModel::getHotrankResource($channel, $sort, $page)
);
$this->_view->display('hotrank', $data);
}
/*
* 一周热卖加载更多
*/
public function getdataAction()
{
$page = $this->get('page',1);
$page = $this->get('page', 1);
//加载到100个以后停止
if($page > 2)
{
echo json_encode(array('code'=>201,'data'=>''));
if ($page > 2) {
echo json_encode(array('code' => 201, 'data' => ''));
exit;
}
$sid = $this->get('sid',1);
$sid = $this->get('sid', 1);
//获取频道资源
$channel = HotrankModel::getChannelResource();
//获取一周热卖资源
... ... @@ -175,4 +178,5 @@ class IndexController extends WebAction
echo json_encode($data);
exit;
}
}
... ...