Authored by 郭成尧

shop-index-all-goods

... ... @@ -43,6 +43,9 @@
<div id="red-index" class="tab-panel red-shop-index active">
<div class="shop-coupon coupon-group"></div>
{{> reds-shop/modules}}
<div id="indexGoodsContainer" class="goods-container">
<div class="default-goods container clearfix"></div>
</div>
<div class="all-goods">
<a href="{{allGoodsUrl}}">点击查看全部商品</a>
</div>
... ...
... ... @@ -2,15 +2,17 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:31:51
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-14 11:17:55
* @Last Modified time: 2017-04-25 10:56:07
*/
/** *****************
* 红人店铺首页
********************/
const Swiper2 = require('yoho-swiper2');
const lazyLoad = require('yoho-jquery-lazyload');
let tip = require('../../plugin/tip');
let $goodsContainer = $('.index-goods-container');
let $indexGoodsContaniner = $('#indexGoodsContainer');
let $collect = $('#collect');
const shopId = $('#shopId').val();
... ... @@ -134,3 +136,23 @@ $collect.on('click', function() {
}
});
});
/**
* 异步加载首页全部商品
*/
$.ajax({
type: 'GET',
url: '/product/search/search',
xhrFields: {
withCredentials: true
},
data: {
shop_id: shopId
},
success: function(result) {
let $result = $(result);
lazyLoad($result.find('img[class=lazy]'));
$indexGoodsContaniner.find('.container').html($result);
}
});
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:02:31
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-20 15:41:44
* @Last Modified time: 2017-04-25 09:53:29
*/
/* 红人店铺数据处理 */
... ... @@ -340,7 +340,7 @@ const pushGoodsInfo = (decorators, goodsList) => {
decorators[key].pics[subKey].isGood = true;
if (value.module_type === 'TripleImage' || value.module_type === 'DoubleImage') {
decorators[key].pics[subKey].src = imageSrc;
// decorators[key].pics[subKey].src = imageSrc; // 为了和 APP 统一,图暂时不取商品图
} else if (value.module_type === 'FourImage') {
decorators[key].pics[subKey].isGood = false;
} else {
... ...