Authored by 王水玲

sale

... ... @@ -130,7 +130,6 @@ exports.filter = (req, res) => {
let params = Object.assign({}, req.query);
saleModel.getFilterData(params).then((result) => {
console.log(result);
res.render('filter', {
layout: false,
params: params,
... ...
... ... @@ -241,10 +241,26 @@ const processProductList = (list, options) => {
};
/**
* 商品搜索筛选数据处理
* 处理筛选数据
* @param list
* @param string | options
* @return array 处理之后的筛选数据
*/
const processFilter = (list) => {
return list;
const processFilter = (list, options) => {
const filters = {
classify: {}
};
options = Object.assign({
gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有
exclude: null // 需要排除的字段
}, options);
list = camelCase(list);
_.forEach(list, (item, key) => {
console.log(key);
});
return filters;
};
/**
... ... @@ -276,7 +292,9 @@ const processBreakingSort = (list) => {
* 商品搜索接口请求
*/
const searchSales = (params) => {
params = params || {};
params = Object.assign({
limit: '20'
}, params);
if (typeCont[params.type]) {
params.order = typeCont[params.type][params.order];
... ...
... ... @@ -16,8 +16,9 @@ const detail = require(`${cRoot}/detail`);
const sale = require(`${cRoot}/sale`);
// routers
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.index); // /pro_136349_455445/
// HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
// /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.index);
router.get('/detail/intro/:productskn', detail.intro);
router.get('/detail/preference/:productskn/:yhchannel/:brandId', detail.preference);
... ...