Authored by 郭成尧

shop-list-js

... ... @@ -121,14 +121,14 @@ const shop = {
co(function* () {
let banner = yield listModel.getBrandBanner(brandId);
let brandInfo = yield listModel.getBrandIntro(brandId, uid);
let goodListApi = yield searchModel.getBrandGoods(searchParam);
let goodsListApi = yield searchModel.getBrandGoods(searchParam);
let title = brandInfo.title;
let goodList = productProcess.processProductList(_.get(goodListApi, 'data.product_list', []));
let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
brandInfo.banner = banner;
res.render('newshop/brand', {
res.render('newshop/shop-brand', {
module: 'product',
page: 'brand-index',
pageHeader: headerModel.setNav({
... ... @@ -141,7 +141,7 @@ const shop = {
description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
brandId: brandId,
brandInfo: brandInfo,
newGoods: goodList,
goodsList: goodsList,
shopPage: true,
_noLazy: true,
localCss: true
... ... @@ -153,7 +153,7 @@ const shop = {
* 红人店铺
*/
redShop(req, res, next) {
let shopId = req.shopInfo.shopId; // test3 792
let shopId = req.shopInfo.shopId;
let channel = req.yoho.channel || 'boys';
let uid = req.user.uid || 0;
let udid = req.sessionID || 'yoho';
... ... @@ -216,6 +216,37 @@ const shop = {
*/
list(req, res, next) {
co(function* () {
let title = '商品列表';
let shopId = req.shopInfo.shopId;
let searchParam = {
isApp: req.yoho.isApp,
shop_id: shopId,
app_type: req.query.app_type,
type: 'default',
order: '0',
page: 1
};
let goodsListApi = yield searchModel.getShopGoods(searchParam);
let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
res.render('newshop/shop-list', {
module: 'product',
page: 'shop-list',
pageHeader: headerModel.setNav({
navTitle: title
}),
showDownloadApp: true,
pageFooter: true,
title: title + '|' + title + '潮流服装服饰-Yoho!Buy有货',
keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',
description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
shopId: shopId,
goodsList: goodsList,
shopPage: true,
_noLazy: true,
localCss: true
});
})().catch(next);
},
... ...
... ... @@ -322,14 +322,28 @@ const getBrandGoods = (params) => {
};
/**
* 搜索店铺的商品
*/
const getShopGoods = (params) => {
let finalParams = {
method: 'app.search.shop',
};
finalParams = _.assign(finalParams, searchProcess.getSearchParamsWithoutMethod(params));
return api.get('', finalParams);
};
/**
* 获取筛选数据
*/
const getFilterData = (params) => {
return co(function* () {
let filterDataResult = {};
if (params.isBrandShop === 'Y') {
if (params.isShopBrand === 'Y') { // 店铺之品牌
filterDataResult = yield getBrandGoods(params);
} else if (params.isShopList === 'Y') { // 无店铺有店铺 ID 的商品列表
filterDataResult = yield getShopGoods(params);
} else {
filterDataResult = yield _searchGoods(params);
}
... ... @@ -604,5 +618,6 @@ module.exports = {
getBrandDomain,
getSearchKeywordData,
getSearchKeywordDataById,
getBrandGoods
getBrandGoods,
getShopGoods
};
... ...
... ... @@ -37,9 +37,9 @@
<div id="goods-container" class="goods-container">
<div class="default-goods container clearfix">
{{#newGoods}}
{{#goodsList}}
{{> common/goods}}
{{/newGoods}}
{{/goodsList}}
</div>
</div>
... ...
<div class="good-list-page yoho-page">
{{!--筛选tab--}}
<div class="filter-box">
{{> product/filter-tab-new}}
{{> common/filter}}
</div>
<div id="goods-container" class="goods-container">
<div class="default-goods container clearfix">
{{#goodsList}}
{{> common/goods}}
{{/goodsList}}
</div>
</div>
{{> common/suspend-cart}}
<input type="hidden" id="shopId" value={{shopId}}>
</div>
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@ let productListWithFilterModel =
new ProductListWithFilter({
brand_id: brandId,
page: 2, // 首页服务端已经渲染
isBrandShop: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
isShopBrand: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
}, 'product/search/brand/goods');
productListWithFilterModel.getFilter();
... ...
require('product/shop/shop.page.css');
let ProductListWithFilter = require('product/product-list-with-filter');
let shopId = $('#shopId').val();
let productListWithFilterModel =
new ProductListWithFilter({
shop_id: shopId,
page: 2, // 首页服务端已经渲染
isShopList: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
}, 'product/search/brand/goods');
productListWithFilterModel.getFilter();
... ...