Authored by 郭成尧

shop-list

... ... @@ -258,12 +258,29 @@ exports.filter = (req, res, next) => {
let params = {};
let currentUrlParams = {}; // 页面链接伪静态固定参数
if (req.query.currentUrl) {
if (req.query.isShopList === 'Y') {
let shopId;
let pathSplitArr = _.compact(_.split(req.query.currentUrl, '/'));
let pathParams = _.last(pathSplitArr);
if (pathSplitArr.length === 2) {
shopId = _.last(_.split(pathParams, '-'));
} else {
currentUrlParams = listParamsProcess.getParams(pathParams);
let shopInfoPath = _.replace(req.query.currentUrl, `/${pathParams}`, '');
shopId = _.last(_.split(shopInfoPath, '-'));
}
_.assign(req.query, currentUrlParams, {shop_id: shopId});
} else {
currentUrlParams = listParamsProcess.getParams(req.query.currentUrl);
delete req.query.currentUrl;
delete req.query.page;
}
delete req.query.currentUrl;
delete req.query.page;
_.assign(params, currentUrlParams, req.query);
let uid = req.user.uid || 0;
... ...
... ... @@ -10,5 +10,5 @@ require('common/footer');
new ProductListWithFilter({
page: 2,
currentUrl: location.pathname,
isNewList: 'Y'
isShopList: 'Y'
}, 'product/shop/goodslist');
... ...