Authored by Rock Zhang

添加获取收藏的商品,品牌的异步获取接口

... ... @@ -8,40 +8,7 @@
<div class="fav-content" id="fav-content">
<div class="fav-type">
<ul class="fav-product-list">
{{# hasFavProduct}}
<li data-id="{{fav_id}}">
<a href="{{link}}">
<div class="fav-img-box">
<img src="{{imgUrl}}" alt=""/>
</div>
<div class="fav-info-list">
<h2>{{title}}</h2>
<div class="fav-price">
{{# discountPrice}}
<span class="new-price">{{.}}</span>
{{/ discountPrice}}
<span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
</div>
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav"></span>
</div>
{{/ savePrice}}
{{^ savePrice}}
<div class="save-price">
{{# sellOut}}
<span class="sell-out">已售罄</span>
{{/ sellOut}}
<span class="del-fav"></span>
</div>
{{/ savePrice}}
</div>
</a>
</li>
{{/ hasFavProduct}}
{{> home/favorite_product_list}}
</ul>
{{^ hasFavProduct}}
... ... @@ -50,43 +17,7 @@
{{/ hasFavProduct}}
</div>
<div class="fav-type">
{{# hasFavBrand}}
<div class="fav-brand-swiper">
<div class="swiper-header">
<div class="swiper-logo">
<img src="{{brandImg}}" alt=""/>
</div>
<div class="brand-info">
<span class="brand-name">{{brandName}}</span>
<div class="brand-update">
{{# update}}
<span class="brand-new">上新<b>{{.}}</b></span>
{{/ update}}
{{# discount}}
<span class="brand-discount">折扣<b>{{.}}</b></span>
{{/ discount}}
</div>
</div>
<a class="fav-more" href="{{link}}"></a>
</div>
<div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
<div class="brand-product">
<p class="{{# discount}}price-discount{{/ discount}}">
{{price}}
{{# discount}}<span>{{.}}{{/ discount}}<span>
</p>
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ productList}}
</ul>
</div>
</div>
{{/ hasFavBrand}}
{{> home/favorite_brand_list}}
{{^ hasFavBrand}}
<span class="fav-null">您暂无收藏任何品牌</span>
... ...
{{> home/favorite_brand_list}}
\ No newline at end of file
... ...
{{> home/favorite_product_list}}
\ No newline at end of file
... ...
{{# hasFavBrand}}
<div class="fav-brand-swiper">
<div class="swiper-header">
<div class="swiper-logo">
<img src="{{brandImg}}" alt=""/>
</div>
<div class="brand-info">
<span class="brand-name">{{brandName}}</span>
<div class="brand-update">
{{# update}}
<span class="brand-new">上新<b>{{.}}</b></span>
{{/ update}}
{{# discount}}
<span class="brand-discount">折扣<b>{{.}}</b></span>
{{/ discount}}
</div>
</div>
<a class="fav-more" href="{{link}}"></a>
</div>
<div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
<div class="brand-product">
<p class="{{# discount}}price-discount{{/ discount}}">
{{price}}
{{# discount}}<span>{{.}}{{/ discount}}<span>
</p>
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ productList}}
</ul>
</div>
</div>
{{/ hasFavBrand}}
\ No newline at end of file
... ...
{{# hasFavProduct}}
<li data-id="{{fav_id}}">
<a href="{{link}}">
<div class="fav-img-box">
<img src="{{imgUrl}}" alt=""/>
</div>
<div class="fav-info-list">
<h2>{{title}}</h2>
<div class="fav-price">
{{# discountPrice}}
<span class="new-price">{{.}}</span>
{{/ discountPrice}}
<span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
</div>
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav"></span>
</div>
{{/ savePrice}}
{{^ savePrice}}
<div class="save-price">
{{# sellOut}}
<span class="sell-out">已售罄</span>
{{/ sellOut}}
<span class="del-fav"></span>
</div>
{{/ savePrice}}
</div>
</a>
</li>
{{/ hasFavProduct}}
\ No newline at end of file
... ...
... ... @@ -133,7 +133,7 @@ class HomeController extends AbstractAction
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
$this->_view->display('favorite_product', $result);
}
}
... ... @@ -152,7 +152,7 @@ class HomeController extends AbstractAction
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
$this->_view->display('favorite_brand', $result);
}
}
... ...