|
@@ -78,7 +78,6 @@ const shop = { |
|
@@ -78,7 +78,6 @@ const shop = { |
78
|
queryParams: req.query
|
78
|
queryParams: req.query
|
79
|
};
|
79
|
};
|
80
|
data.products = DataHelper.handleProductList(ret.productList);
|
80
|
data.products = DataHelper.handleProductList(ret.productList);
|
81
|
- console.log(data);
|
|
|
82
|
res.display('shop-index', data);
|
81
|
res.display('shop-index', data);
|
83
|
} else {
|
82
|
} else {
|
84
|
shop.list(req, res, next);
|
83
|
shop.list(req, res, next);
|
|
@@ -100,7 +99,7 @@ const shop = { |
|
@@ -100,7 +99,7 @@ const shop = { |
100
|
let uid = req.user.uid;
|
99
|
let uid = req.user.uid;
|
101
|
let shopId = req.query.shopId;
|
100
|
let shopId = req.query.shopId;
|
102
|
let q = req.query;
|
101
|
let q = req.query;
|
103
|
- let hasBrand = !!q.brand;
|
102
|
+ // let hasBrand = !!q.brand;
|
104
|
|
103
|
|
105
|
q.order = q.order || 's_n_desc';
|
104
|
q.order = q.order || 's_n_desc';
|
106
|
q.page = parseInt(q.page || 1, 10);
|
105
|
q.page = parseInt(q.page || 1, 10);
|
|
@@ -135,15 +134,14 @@ const shop = { |
|
@@ -135,15 +134,14 @@ const shop = { |
135
|
let ret = camelCase(result.data);
|
134
|
let ret = camelCase(result.data);
|
136
|
|
135
|
|
137
|
if (ret.filter) {
|
136
|
if (ret.filter) {
|
138
|
- if (!hasBrand) {
|
|
|
139
|
- delete q.brand;
|
|
|
140
|
- }
|
|
|
141
|
ret.filter.standard = ret.standard;
|
137
|
ret.filter.standard = ret.standard;
|
142
|
ret.filter.groupSort = DataHelper.sortConvert(allSort.data.sort);
|
138
|
ret.filter.groupSort = DataHelper.sortConvert(allSort.data.sort);
|
|
|
139
|
+ ret.filter.singleBrand = true;
|
143
|
data.filter = DataHelper.filterHandle(ret.filter, q);
|
140
|
data.filter = DataHelper.filterHandle(ret.filter, q);
|
144
|
data.filter.showPrice = ret.total > 10;
|
141
|
data.filter.showPrice = ret.total > 10;
|
145
|
data.filter.showInfo = (data.filter.style && data.filter.style.length > 0)
|
142
|
data.filter.showInfo = (data.filter.style && data.filter.style.length > 0)
|
146
|
|| (ret.standard && ret.standard.length > 0); //eslint-disable-line
|
143
|
|| (ret.standard && ret.standard.length > 0); //eslint-disable-line
|
|
|
144
|
+
|
147
|
}
|
145
|
}
|
148
|
|
146
|
|
149
|
data.paginationData = {
|
147
|
data.paginationData = {
|