...
|
...
|
@@ -190,6 +190,38 @@ const handleCheckedData = (params, origin, param) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 处理品牌筛选数据 待处理
|
|
|
* @param params
|
|
|
* @param origin
|
|
|
* @returns {{}}
|
|
|
*/
|
|
|
// const handleBrandCheckedData = (params, origin) => {
|
|
|
// let dest = {};
|
|
|
//
|
|
|
// let brands = _.split(params.brand, ',');
|
|
|
//
|
|
|
// if (!_.isEmpty(origin)) {
|
|
|
// _.forEach(origin, (value) => {
|
|
|
// if (!_.isEmpty(_.find(brands, o => {
|
|
|
// return o === value.id;
|
|
|
// }))) {
|
|
|
// let checked = {};
|
|
|
//
|
|
|
// checked.name = value.name;
|
|
|
//
|
|
|
// let tempParam = {};
|
|
|
//
|
|
|
// tempParam.brand = '';
|
|
|
// checked.href = handleFilterUrl(params, tempParam);
|
|
|
//
|
|
|
// dest.push(checked);
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
// return dest;
|
|
|
// };
|
|
|
|
|
|
/**
|
|
|
* 处理断码区尺码筛选数据
|
|
|
* @param origin 尺码原始数据
|
|
|
* @param params 当前 URL 中已有的参数
|
...
|
...
|
@@ -416,7 +448,11 @@ exports.handleSaleOptsData = (params, total, extra) => { |
|
|
} else {
|
|
|
opt.name = '最新';
|
|
|
opt.hasSortOrient = true;
|
|
|
opt.active = true;
|
|
|
if (_.isEmpty(params.order) || params.order === 's_t_desc') {
|
|
|
opt.active = true;
|
|
|
} else {
|
|
|
opt.active = false;
|
|
|
}
|
|
|
opt.desc = true;
|
|
|
}
|
|
|
break;
|
...
|
...
|
@@ -495,14 +531,6 @@ exports.handleSaleOptsData = (params, total, extra) => { |
|
|
|
|
|
dest.curPage = _.isEmpty(params.page) ? 1 : params.page; // 当前页码数
|
|
|
|
|
|
// 上一页下一页
|
|
|
let preHref = (!_.isEmpty(params.page) && parseInt(params.page, 10) > 1) ?
|
|
|
parseInt(params.page, 10) - 1 : 1;
|
|
|
let nextHref = (!_.isEmpty(params.page)) ? parseInt(params.page, 10) + 1 : 2;
|
|
|
|
|
|
dest.preHref = handleFilterUrl(params, {page: preHref});
|
|
|
dest.nextHref = handleFilterUrl(params, {page: nextHref});
|
|
|
|
|
|
// 每页商品数量
|
|
|
dest.countPerPage = _.isEmpty(params.limit) ? 60 : params.limit;
|
|
|
|
...
|
...
|
@@ -512,6 +540,21 @@ exports.handleSaleOptsData = (params, total, extra) => { |
|
|
// 每页多少商品
|
|
|
let paramsLimit = parseInt((_.isEmpty(params.limit) ? 60 : params.limit), 10);
|
|
|
|
|
|
// 上一页下一页
|
|
|
let preHref = (!_.isEmpty(params.page) && parseInt(params.page, 10) > 1) ?
|
|
|
parseInt(params.page, 10) - 1 : 1;
|
|
|
let nextHref = (!_.isEmpty(params.page)) ? parseInt(params.page, 10) + 1 : 2;
|
|
|
|
|
|
if (dest.pageCount > 1 && (parseInt(params.page, 10) !== 1) &&
|
|
|
(parseInt(params.page, 10) !== dest.pageCount)) {
|
|
|
dest.preHref = handleFilterUrl(params, {page: preHref});
|
|
|
dest.nextHref = handleFilterUrl(params, {page: nextHref});
|
|
|
} else if (dest.pageCount > 1 && (parseInt(params.page, 10) === 1)) {
|
|
|
dest.nextHref = handleFilterUrl(params, {page: nextHref});
|
|
|
} else if (dest.pageCount > 1 && (parseInt(params.page, 10) === dest.pageCount)) {
|
|
|
dest.preHref = handleFilterUrl(params, {page: preHref});
|
|
|
}
|
|
|
|
|
|
// 商品开始结束数
|
|
|
dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
|
|
|
dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
|
...
|
...
|
@@ -584,7 +627,7 @@ exports.handleSaleActivityData = (origin, channel) => { |
|
|
activity.link =
|
|
|
helpers.urlFormat('/product/sale/discount/detail', {id: value.id, channel: channel});
|
|
|
activity.img = value.cover_url;
|
|
|
activity.time = processTime(value.left_time);
|
|
|
activity.time = processTime(parseInt(value.left_time, 10) * 1000);
|
|
|
activity.brand = value.logo_url;
|
|
|
activity.title = value.title;
|
|
|
activity = Object.assign(activity, discountSplit(value.promotion_name));
|
...
|
...
|
@@ -610,7 +653,7 @@ exports.handleDiscountTitleData = (origin) => { |
|
|
dest.up = true;
|
|
|
|
|
|
// dest.time = processTimes(origin.left_time);
|
|
|
dest.time = origin.left_time;
|
|
|
dest.time = parseInt(origin.left_time, 10) * 1000;
|
|
|
Object.assign(dest, discountSplit(origin.promotion_name));
|
|
|
|
|
|
return dest;
|
...
|
...
|
|