Authored by 郝肖肖

店铺人气商品

... ... @@ -269,7 +269,21 @@ class DetailData
$param['product_skn'] = $skn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
return Yohobuy::get(API_URL, $param);
}
/**
* 通过skn查询商品详情
* @param {[string || array]} $productSkn 商品skn
* @return {[array]}
*/
public static function productBatch($productSkn) {
$productSkn = is_array($productSkn) ? $productSkn : array($productSkn);
$param = Yohobuy::param();
$param['method'] = 'h5.product.batch';
$param['productSkn'] = implode(',', $productSkn);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
}
... ...
... ... @@ -5,7 +5,7 @@ namespace Plugin\DataProcess;
use LibModels\Wap\Product\SearchData;
use Plugin\Helpers;
use Plugin\Images;
use LibModels\Wap\Product\DetailData;
/**
* 店铺楼层数据处理类
*/
... ... @@ -348,18 +348,22 @@ class ShopProcess
self::$shopData['hotList'][] = $goods;
}
} else {
$productSkn = array();
foreach ($data as $val) {
$goods = array(
'url' => Helpers::getUrlBySkc($val['productId'], $val['goodsId'], $val['cnAlphabet']),
'img' => Helpers::getImageUrl($val['src'], 235, 314) . '?imageView/2/w/235/h/314',
'productName' => $val['productName'],
'salesPrice' => '¥' . $val['salesPrice'],
'presentPrice' => '¥' . $val['salesPrice']
);
if (!empty(self::$appVersion)) {
$goods['url'] .= '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":' . $val['productSkn'] . '}}';
$productSkn[] = $val['productSkn'];
}
$product = DetailData::productBatch($productSkn);
if ($product['code'] === 200 && isset($product['data']['product_list'])) {
foreach ($product['data']['product_list'] as $key => $value) {
$goods = Helpers::formatProduct($value, false, false, false, 235, 314, self::$appVersion);
//店铺人气商品不须要其它标签、即将售罄
$goods['tags'] = array();
$goods['is_soon_sold_out'] = false;
$goods['tags']['is_hot'] = true;
self::$shopData['hotList'][] = $goods;
}
self::$shopData['hotList'][] = $goods;
}
}
}
... ...
... ... @@ -24,6 +24,12 @@
}
}
.hot-tag {
width: 60px;
background-color: #FF575C;
color: #fff;
}
.new-tag {
width: 60px;
background-color: #78dc7e;
... ...
... ... @@ -7,7 +7,7 @@
line-height: 70px;
text-align: center;
font-size: 30px;
color: #b1b1b1;
color: #b0b0b0;
}
.floor-header-more {
... ...
... ... @@ -180,14 +180,15 @@
li {
width: 50%;
height: 168px;
height: 160px;
float: left;
text-align: center;
list-style: none;
display: list-item;
img {
width: 90%;
width: 275px;
height: inherit;
border-radius: 10px;
vertical-align: top;
}
... ... @@ -201,7 +202,7 @@
text-align: center;
line-height: 98px;
font-size: 30px;
margin-top: 40px;
margin-top: 30px;
position: relative;
}
... ... @@ -390,7 +391,7 @@
line-height: 88px;
font-size: 28px;
background: #fff;
border-top: 1px solid #eaeaea;
border-top: 1px solid #e0e0e0;
z-index: 2;
... ... @@ -407,7 +408,7 @@
height: 28px;
margin-top: 30px;
float: right;
border-right: 1px solid #eaeaea;
border-right: 1px solid #e0e0e0;
display: inline-block;
}
}
... ... @@ -415,7 +416,7 @@
.sub-group {
position: absolute;
background: #fff;
border: 1px solid #eaeaea;
border: 1px solid #e0e0e0;
border-radius: 12px;
bottom: 104px;
width: 40%;
... ... @@ -429,7 +430,7 @@
dd {
line-height: 80px;
text-align: center;
border-top: 1px solid #eaeaea;
border-top: 1px solid #e0e0e0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
... ...
... ... @@ -95,27 +95,17 @@
{{/ hotCategory}}
</div>
<div class="popularity-title first">
人气单品
<a class="more buriedpoint" href="{{more_url}}" data-bp-id="shop_popularity_{{more_url}}">&#xe618;</a>
</div>
<div class="product-warp">
<ul class="product-list first">
{{#each hotList}}
<li class="buriedpoint" data-bp-id="shop_hotList_{{url}}">
<a href="{{url}}">
<img src="{{img}}">
</a>
<div class="list-price">
<p>{{productName}}</p>
<p><span class="red">{{originalPrice}}</span>
<span>{{presentPrice}}</span>
</p>
</div>
</li>
{{/each}}
</ul>
</div>
{{#if hotList}}
<div class="popularity-title first">
人气单品
<a class="more buriedpoint" href="{{more_url}}" data-bp-id="shop_popularity_{{more_url}}">&#xe618;</a>
</div>
<div class="product-warp">
{{# hotList}}
{{> good}}
{{/ hotList}}
</div>
{{/if}}
</div>
<div class="discount-area first" id="navlist2">
... ...
... ... @@ -6,6 +6,9 @@
{{# is_new}}
<p class="good-tag new-tag">NEW</p>
{{/ is_new}}
{{# is_hot}}
<p class="good-tag hot-tag">HOT</p>
{{/ is_hot}}
{{# is_advance}}
<p class="good-tag renew-tag">再到着</p>
{{/ is_advance}}
... ...