Authored by hf

fixes bug to version 0.0.3

... ... @@ -56,25 +56,10 @@ class NewsaleData
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
$build = $param;
$build['dayLimit'] = 1;
$build['client_secret'] = Sign::getSign($build);
$urlList['new'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = $param;
$build['dayLimit'] = 2;
$build['client_secret'] = Sign::getSign($build);
$urlList['week'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = $param;
$build['dayLimit'] = 3;
$build['client_secret'] = Sign::getSign($build);
$urlList['sale'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $build);
$build = array();
$param = array();
$param['dayLimit'] = 1;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::getMulti($urlList);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ... @@ -147,13 +132,10 @@ class NewsaleData
$param['limit'] = $limit;
$param['yh_channel'] = $channel;
// 构建url地址列表
$urlList = array();
$param['p_d'] = '0.1,0.9';
$param['client_secret'] = Sign::getSign($param);
$urlList['ALL'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ...
... ... @@ -198,7 +198,7 @@ class ListProcess
$result = array(
'title' => '品类',
'name' => '所有品类',
'dataType' => 'msort',
'dataType' => 'sort',
'subs' => array(
array(
'chosed' => true,
... ...
... ... @@ -20,50 +20,32 @@ class NewSaleProcess
public static function newSaleData($products)
{
$result = array();
$noTab = true;
$productsLi = array();
$tabItem = array();
foreach ($products as $single) {
if (empty($single)) {
continue;
}
// 处理Filter
if(isset($single['filter'])) {
$result['filter'] = ListProcess::getFilterData($single['filter']);
}
// 处理Tabs
$noTab = true;
if (isset($single['tabs']) && $noTab) {
$result['tabs'] = array();
foreach ($single['tabs'] as $key => $one) {
$tabItem = array();
$tabItem['title'] = $one;
$tabItem['dataId'] = $key;
if ($key === 1) {
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
// 处理Tabs
if (isset($products['tabs'])) {
$result['tabs'] = array();
foreach ($products['tabs'] as $key => $one) {
$tabItem = array();
$tabItem['title'] = $one;
$tabItem['dataId'] = $key;
if ($key === 1) {
$tabItem['focus'] = true;
}
$noTab = false;
$result['tabs'][] = $tabItem;
}
}
// 处理商品
$productsLi = array();
if (isset($single['product_list'])) {
foreach ($single['product_list'] as $value) {
$productsLi['goods'][] = Helpers::formatProduct($value, true, false, false);
}
}
// 处理Filter
if(isset($products['filter'])) {
$result['filter'] = ListProcess::getFilterData($products['filter']);
}
// 对于第一个productsLi添加show字段
if (!isset($result['goodsContainer'][0])) {
$productsLi['show'] = true;
}
// 处理商品
if (isset($products['product_list'])) {
foreach ($products['product_list'] as $single) {
$result['goodsContainer'][] = $productsLi;
$result['goods'][] = Helpers::formatProduct($single, true, false, false);
}
}
return $result;
... ...
... ... @@ -22,9 +22,10 @@
color: #444;
.more-btn{
position: absolute;
right: 30rem / $pxConvertRem;
right: 0.75rem;
top: 0;
bottom: 0;
color: #b0b0b0;
font-size: 1.25rem;
}
}
\ No newline at end of file
... ...
... ... @@ -40,11 +40,12 @@
.goods-category .category-list {
background: #f5f7f6;
height: 383rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
overflow: hidden;
li {
float: left;
width: 191rem / $pxConvertRem;
height: 181rem / $pxConvertRem;
height: 191rem / $pxConvertRem;
border-left: 1px solid #e0e0e0;
.first-show {
... ...
... ... @@ -41,7 +41,7 @@
}
.load-more-info {
width: 100%;
height: 570rem / $pxConvertRem;
height: 70rem / $pxConvertRem;
line-height: 70rem / $pxConvertRem;
text-align: center;
font-size: 14px;
... ...
... ... @@ -28,18 +28,13 @@
</ul>
<div id="goods-container" class="goods-container">
{{# goodsContainer}}
<div class="new-goods container clearfix">
{{#if goods}}
{{# goods}}
{{> good}}
{{/ goods}}
{{^}}
<p class="no-result">未找到相关搜索结果</p>
{{/if}}
</div>
{{/ goodsContainer}}
<div class="container clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
<div class="container hide clearfix"></div>
<div class="container hide clearfix"></div>
{{> filter}}
</div>
... ...
... ... @@ -38,19 +38,13 @@
</ul>
<div id="goods-container" class="goods-container">
{{# goodsContainer}}
<div class="new-goods container clearfix">
{{#if goods}}
{{# goods}}
{{> good}}
{{/ goods}}
{{^}}
<p class="no-result">未找到相关搜索结果</p>
{{/if}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{/ goodsContainer}}
<div class="new-goods container clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{> filter}}
</div>
... ...
{{# title}}
<div class="floor-header-more">
<h2>{{title}}</h2>
<a class="more-btn iconfont" href="{{more_url}}">{{more_name}}</a>
<a class="more-btn iconfont" href="{{more_url}}">&#xe618;</a>
</div>
{{/ title}}
\ No newline at end of file
... ...
... ... @@ -118,8 +118,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if (!empty($products)) {
$result = NewSaleProcess::newSaleData($products);
if (isset($products['code']) && $products['code'] == 200) {
$result = NewSaleProcess::newSaleData($products['data']);
}
return $result;
... ... @@ -155,8 +155,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if (!empty($products)) {
$result = NewSaleProcess::newSaleData($products);
if (isset($products['code']) && $products['code'] == 200) {
$result = NewSaleProcess::newSaleData($products['data']);
}
return $result;
... ... @@ -171,6 +171,8 @@ class NewsaleModel
*/
private static function cacheControl($cacheKey, $codeKey)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($cacheKey, 'master');
... ...
... ... @@ -32,11 +32,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data += array(
'brand' => 0,
'sort' => 0,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
'price' => 0,
'size' => 0,
'price' => '0',
'size' => '0',
'dayLimit' => 1,
'discount' => ''
);
... ... @@ -65,11 +65,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data += array(
'brand' => 0,
'sort' => 0,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
'price' => 0,
'size' => 0,
'price' => '0',
'size' => '0',
'discount' => '0.1,0.9'
);
... ...