Authored by 郭成尧

'shop-category-ok'

... ... @@ -366,6 +366,7 @@ const shopCategory = (req, res, next) => {
}).then(result => {
res.render('shop/category', {
content: result,
allProduct: result.allProduct,
module: 'product',
page: 'category',
pageHeader: headerModel.setNav({
... ...
... ... @@ -11,6 +11,17 @@ const helpers = global.yoho.helpers;
const api = global.yoho.API;
const searchModel = require('./search');
/**
* 频道
* @type {{}}
*/
const yhChannel = {
boys: 1,
girls: 2,
kids : 3,
lifestyle: 4
};
/* 多品牌店铺列表数据信息处理*/
const _processBrandShops = (list) => {
const formatDat = [];
... ... @@ -122,7 +133,7 @@ const _getShopInfo = (shopId, uid) => {
const _getShopCategory = (shopId, channel, gender) => {
return api.get('', {
method: 'app.shop.getSortInfo',
yh_channel: channel,
yh_channel: yhChannel[channel],
gender: gender || '1,3',
shop_id: shopId
}).then(result => {
... ... @@ -672,10 +683,9 @@ const getShopCategory = (params) => {
});
_.forEach(value.sub, (subValue, subKey) => {
value.sub[subKey].url = helpers.urlFormat({
shop: params.shopId,
categoryId: value.categoryId,
subCategoryId: subValue.categoryId,
value.sub[subKey].url = helpers.urlFormat('/product/search/list', {
shop_id: params.shopId,
sort: _.get(value, 'relationParameter.sort', ''),
title: subValue.categoryName,
query: subValue.categoryName
});
... ... @@ -686,7 +696,7 @@ const getShopCategory = (params) => {
});
});
finalResult.allproduct = helpers.urlFormat('/search/list', {
finalResult.allProduct = helpers.urlFormat('/product/search/list', {
shop_id: params.shopId
});
... ...
<div class="product-category yoho-page">
<div id="allproduct" class="allproduct">
<a href={{allproduct}}>
<a href={{allProduct}}>
<p class="allproductParagaraph buriedpoint" data-bp-id ="shop_category_all_1">全部商品</p>
<i class="arrow-icon iconfont">&#xe614;</i>
</a>
... ...
... ... @@ -33,7 +33,7 @@ var $input = $('#search-input input'),
$buriedpoint = $('.buriedpoint'),
$search = $('#search');
var shopId, sort, brand, outlets, app_type;
var shopId, sort, brand, outlets, app_type, age_level, msort, misort;
// 默认筛选条件
var defaultOpt = require('../../common/query-param');
... ... @@ -194,7 +194,8 @@ sort = getQueryString('sort');
outlets = getQueryString('outlets');
age_level = getQueryString('ageLevel');
app_type = getQueryString('app_type');
msort = getQueryString('msort');
misort = getQueryString('misort');
/**
* 筛选注册的回调,筛选子项点击后逻辑
* 需要执行search的场景:1.点选筛选项;2.relaod为true时切换导航;3.下拉加载
... ... @@ -335,6 +336,14 @@ function search(opt) {
params.app_type = app_type;
}
if (msort) {
params.msort = msort;
}
if (misort) {
params.misort = misort;
}
$.extend(setting, defaultOpt, params);
searching = true;
... ...