...
|
...
|
@@ -24,6 +24,21 @@ const checksName = { |
|
|
limited: '限量'
|
|
|
};
|
|
|
|
|
|
const sortFilterParam = (param) => {
|
|
|
let resData = [];
|
|
|
|
|
|
_.forEach(param, (value, key) => {
|
|
|
resData.push({
|
|
|
key: key,
|
|
|
value: value
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return _.sortBy(resData, [o => {
|
|
|
return o.key;
|
|
|
}]);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 处理用于筛选的 URL , 拼接 URL 参数
|
|
|
* @param originParam 当前 URL 中的参数
|
...
|
...
|
@@ -39,10 +54,13 @@ const handleFilterUrl = (originParam, newParam, delParam) => { |
|
|
tempOriginParam = Object.assign(tempOriginParam, originParam, newParam);
|
|
|
delete tempOriginParam.uid;
|
|
|
|
|
|
_.forEach(tempOriginParam, function(value, key) {
|
|
|
if (!delParam[key] && value) {
|
|
|
_.forEach(sortFilterParam(tempOriginParam), info => {
|
|
|
if (!delParam[info.key] && info.value) {
|
|
|
// NOTE: 这里会对 query 进行编码,因为 query 有可以能是中文
|
|
|
dest += key === 'query' ? `${key}=${encodeURIComponent(value)}&` : `${key}=${value}&`;
|
|
|
if (info.key === 'query') {
|
|
|
info.value = encodeURIComponent(info.value);
|
|
|
}
|
|
|
dest += `${info.key}=${info.value}&`;
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -65,7 +83,12 @@ const handleCheckedData = (params, origin, param) => { |
|
|
let tempPatam = _.cloneDeep(params);
|
|
|
|
|
|
// 删除选中
|
|
|
delete tempPatam[param];
|
|
|
if (param === 'gender') {
|
|
|
// 某些特殊带频道信息页面,清除性别,需将gender设为1,2,3 (2017-3 配合SEO进行URL改造)
|
|
|
tempPatam[param] = '1,2,3';
|
|
|
} else {
|
|
|
delete tempPatam[param];
|
|
|
}
|
|
|
|
|
|
dest.push({
|
|
|
name: value.name,
|
...
|
...
|
@@ -779,7 +802,8 @@ exports.handleFilterData = (origin, params, total) => { |
|
|
}
|
|
|
|
|
|
// 清除所有选中数据
|
|
|
let remainParams = {};
|
|
|
// 某些特殊带频道信息页面,清除性别,需将gender设为1,2,3 (2017-3 配合SEO进行URL改造)
|
|
|
let remainParams = {gender: '1,2,3'};
|
|
|
|
|
|
if (params.id) {
|
|
|
remainParams.id = params.id;
|
...
|
...
|
|