Authored by 郭成尧

html-end

... ... @@ -6,9 +6,6 @@
'use strict';
const _ = require('lodash');
// const helpers = global.yoho.helpers;
// const utils = require('../../../utils');
const genderMap = {
boys: '1,3',
girls: '2,3',
... ... @@ -39,34 +36,17 @@ module.exports = class extends global.yoho.BaseModel {
// 如果有二级菜单,二级菜单跳转,否则一级菜单跳转
if (firstItem.sub && firstItem.sub.length) {
_.map(firstItem.sub, function(secondItem) {
// secondItem.url = helpers.urlFormat('/', utils.mapSort({
// sort: _.get(secondItem, 'relation_parameter.sort'),
// sort_name: secondItem.category_name,
// gender: genderMap[key] || ''
// }), 'list');
secondItem.url =
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(secondItem, 'category_id')}`;
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(secondItem, 'category_id')}.html`;
});
firstItem.sub.unshift({
category_name: `全部${firstItem.category_name}`,
// url: helpers.urlFormat('/', utils.mapSort({
// sort: _.get(firstItem, 'relation_parameter.sort'),
// sort_name: firstItem.category_name,
// gender: genderMap[key] || ''
// }), 'list'),
url: `//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}?title=${firstItem.category_name}` // eslint-disable-line
url: `//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}.html?title=${firstItem.category_name}` // eslint-disable-line
});
} else {
// firstItem.url = helpers.urlFormat('/', utils.mapSort({
// sort: _.get(firstItem, 'relation_parameter.sort'),
// sort_name: firstItem.category_name,
// gender: genderMap[key] || ''
// }), 'list');
firstItem.url =
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}`;
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}.html`;
}
});
});
... ...
... ... @@ -122,6 +122,8 @@ const resolvePathParams = (req, res, next) => {
let queryParams = req.query;
let pathParams = req.params.pathParams;
pathParams = _.replace(pathParams, '.html', '');
// 1. 取 path 的参数
req.query = listParamsProcess.getParams(pathParams);
... ... @@ -149,6 +151,9 @@ const resolvePathParams = (req, res, next) => {
*/
const resolvePathParamsAjax = (req, res, next) => {
let pathParams = _.last(_.split(req.query.currentUrl, '/'));
pathParams = _.replace(pathParams, '.html', '');
let currentUrlParams = listParamsProcess.getParams(pathParams);
let queryParams = {};
... ...