Authored by 梁志锋

Merge remote-tracking branch 'remotes/origin/release/4.4'

... ... @@ -21,7 +21,7 @@ class ListProcess
$result = array();
if (isset($data['product_list'])) {
$result['new'] = self::getProductData($data['product_list'], $showTag, $tagNew, $tagSale);
$result['new'] = self::getProductData($data['product_list'], false, $showTag, $tagNew, $tagSale);
}
if ($returnFilter && isset($data['filter'])) {
$result['filter'] = self::getFilterData($data['filter']);
... ... @@ -36,13 +36,13 @@ class ListProcess
* @param $data
* @return array 处理之后的商品数据
*/
public static function getProductData($data, $isApp = false)
public static function getProductData($data, $isApp = false, $showTag = true, $tagNew = true, $tagSale = true)
{
// 处理商品
$products = array();
foreach ($data as $value) {
$products[] = Helpers::formatProduct($value, true, true, true, 235, 314, true);
$products[] = Helpers::formatProduct($value, $showTag, $tagNew, $tagSale, 235, 314, true);
}
return $products;
... ...
... ... @@ -13,7 +13,10 @@ class ShopProcess
private static $shopData = array();
private static $shopId = 0;
private static $appVersion = 0;
//店铺品牌
private static $brandId;
//单品店
private static $single = false;
/**
* 组织店铺页面数据
... ... @@ -25,7 +28,7 @@ class ShopProcess
*/
public static function formShopData($data, $shopId, $appVersion)
{
self::$shopId = $shopId;
self::$shopData['shopId'] = self::$shopId = $shopId;
self::$shopData['appVersion'] = self::$appVersion = $appVersion;
foreach ($data as $key => $val) {
if (empty($val) || !is_callable("self::$key")) {
... ... @@ -47,15 +50,23 @@ class ShopProcess
self::$shopData['storeName'] = $data['data']['is_show_shop_name'] == 'Y' ? $data['data']['shop_name'] : '';
//用户是否收藏店铺
self::$shopData['collect'] = $data['data']['is_favorite'] == 'Y' ? true : false;
//店铺id
self::$shopData['shopId'] = self::$shopId;
//全部商品链接
$allGoodsParam['title'] = '全部商品';
//单品店
if (self::$single) {
$allGoodsParam['brand'] = self::$brandId;
} else {
//店铺id
self::$shopData['shopId'] = self::$shopId;
$allGoodsParam['shop_id'] = self::$shopId;
}
if (empty(self::$appVersion)) {
//全部商品链接
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search');
self::$shopData['allGoods'] = Helpers::url('', $allGoodsParam, 'search');
//店铺简介页地址
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId));
} else {
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search').'&openby:yohobuy={"action":"go.list","params":{"title":"全部商品", "actiontype":"0","shop_id":"'.self::$shopId.'","page":"1"}}';
self::$shopData['allGoods'] = Helpers::url('', $allGoodsParam, 'search').'&openby:yohobuy={"action":"go.list","params":{"title":"全部商品", "actiontype":"0","shop_id":"'.self::$shopId.'","page":"1"}}';
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId, 'app_version' => self::$appVersion));
}
//搜索链接
... ... @@ -125,8 +136,9 @@ class ShopProcess
$brandNumber = count($data);
//少于2个不展示 单品店:单品店根据品牌id查询
if ($brandNumber < 2) {
self::$shopData['brand'] = $data[0]['id'];
self::$shopData['shopId']= '';
self::$brandId = self::$shopData['brand'] = $data[0]['id'];
self::$single = true;
// self::$shopData['shopId']= '';
return;
}
foreach ($data as $val) {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -145,12 +145,12 @@ function getPageGoods(info) {
}
function getParam(req) {
if (shopId) {
req.data.shop_id = shopId;
}
if (brand) {
req.data.brand = brand;
} else {
if (shopId) {
req.data.shop_id = shopId;
}
}
}
... ... @@ -393,49 +393,51 @@ function search(opt) {
}
}
switch (opt.type) {
case 'shop_id':
ext = {
shop_id: opt.id
};
break;
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'sort':
ext = {
sort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
if (opt.id) {
switch (opt.type) {
case 'shop_id':
ext = {
shop_id: opt.id
};
break;
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'sort':
ext = {
sort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
}
$.extend(defaultOpt, ext); //扩展筛选项
}
$.extend(defaultOpt, ext); //扩展筛选项
}
//导航类别
... ... @@ -464,10 +466,10 @@ function search(opt) {
if (brand) {
setting.brand = brand;
}
if (shopId) {
setting.shop_id = shopId;
} else {
if (shopId) {
setting.shop_id = shopId;
}
}
searching = true;
... ... @@ -537,7 +539,7 @@ $.ajax({
type: 'GET',
url: '/search/filter',
data: {
shop_id: shopId,
shop_id: brand ? '' : shopId,
brand: brand
},
success: function(data) {
... ...
... ... @@ -466,19 +466,43 @@
&:first-child {
border-left: none;
}
a {
display: block;
box-sizing: border-box;
text-align: center;
width: 100%;
height: 100%;
color: #999;
}
}
.active .cur {
color: #000;
}
.active a {
color: #000;
}
.iconfont {
.new .iconfont {
transform: scale(0.8);
font-weight: bold;
}
}
.price .iconfont {
transform: scale(0.8);
font-weight: bold;
}
.filter .iconfont {
font-size: 22px;
transition: transform 0.1 ease-in;
}
.filter.active .iconfont {
transform: rotate(-180deg);
}
}
}
\ No newline at end of file
... ...
... ... @@ -295,10 +295,10 @@ class SearchController extends AbstractAction
$showTag = $this->get('showTag', 0);
$showTag = $showTag === 0 ? true : false;
//显示标签new
$tagNew = $this->get('newTag', 0);
$tagNew = $this->get('tagNew', 0);
$tagNew = $tagNew === 0 ? true : false;
//显示标签sale
$tagSale = $this->get('saleTag', 0);
$tagSale = $this->get('tagSale', 0);
$tagSale = $tagSale === 0 ? true : false;
// 过滤掉值为空的条件
$condition = array_filter($condition);
... ...
... ... @@ -414,10 +414,11 @@ class ListModel
public static function shopData($shopId, $uid, $appVersion = '')
{
$data = array();
//店铺信息
$data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
//店铺装修资源数据
$data['decorator'] = ListData::getShopDecorator($shopId);
//店铺信息
$data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
//店铺分类
$channel = Helpers::getChannelByCookie();
$data['shopCategory'] = ListData::getShopCategory($shopId, $channel);
... ...