|
|
/*
|
|
|
* @Author: Targaryen
|
|
|
* @Date: 2016-06-02 15:50:47
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2016-06-06 10:22:22
|
|
|
*/
|
|
|
* @Author: Targaryen
|
|
|
* @Date: 2016-06-02 15:50:47
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2016-06-06 11:12:06
|
|
|
*/
|
|
|
|
|
|
'use strict';
|
|
|
const _ = require('lodash');
|
...
|
...
|
@@ -307,9 +307,12 @@ exports.handleSaleOptsData = (params, total) => { |
|
|
|
|
|
/**
|
|
|
* 处理页面左侧分类筛选数据
|
|
|
* @return {[type]} [description]
|
|
|
* @param {[type]} origin [左側分類數據列表]
|
|
|
* @param {[type]} params [普通篩選規則兩個參數]
|
|
|
* @param {[type]} extra [额外必须添加的参数]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.handleSaleSortData = (origin, params) => {
|
|
|
exports.handleSaleSortData = (origin, params, extra) => {
|
|
|
var leftContent = {};
|
|
|
|
|
|
leftContent.allSort = {};
|
...
|
...
|
@@ -328,10 +331,20 @@ exports.handleSaleSortData = (origin, params) => { |
|
|
let gender = !_.isEmpty(params.gender) ? `&gender=${params.gender}` : '';
|
|
|
|
|
|
_.forEach(value.sub, function(subValue) {
|
|
|
|
|
|
// 拼接額外的必須參數
|
|
|
let href = '?sort=' + subValue.relation_parameter.sort + gender;
|
|
|
|
|
|
if (!_.isEmpty(extra)) {
|
|
|
_.forEach(extra, (thrValue, key) => {
|
|
|
href += '&' + key + '=' + thrValue;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
category.childList.push({
|
|
|
name: subValue.category_name,
|
|
|
num: subValue.node_count,
|
|
|
href: '?sort=' + subValue.relation_parameter.sort + gender
|
|
|
href: href
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
|