Authored by 姜枫

fix new product list banner

... ... @@ -17,7 +17,7 @@ const list = {
// 列表页
index: (req, res, next) => {
let q = req.query;
let channel = req.cookies._Channel || 'men';
let channel = req.cookies._Channel || req.query._Channel || 'men';
q.page = parseInt(q.page || 1, 10);
q.order = q.order || 's_n_desc';
... ... @@ -69,9 +69,11 @@ const list = {
// 新品到着
newPage: (req, res, next) => {
let q = req.query;
let channel = req.cookies._Channel || req.query._Channel || 'men';
q.page = parseInt(q.page || 1, 10);
q.order = q.order || 's_n_desc';
q.channel = channel;
let retData = {
module: 'product',
... ... @@ -79,7 +81,8 @@ const list = {
title: '新品'
};
Promise.all([Resouces.newProductBanner(), Search.queryAllSort(), Search.queryNewProduct(q)]).then(result => {
Promise.all([Resouces.newProductBanner(channel), Search.queryAllSort(),
Search.queryNewProduct(q)]).then(result => {
let banner = result[0];
let sortData = camelCase(result[1]);
let listData = result[2];
... ...
... ... @@ -14,10 +14,16 @@ const Resources = {
* 获取新品到着-列表页-banner 资源位
* @returns {Promise.<T>}
*/
newProductBanner() {
newProductBanner(channel) {
let codes = {
men: '3d3127b220073fbcda738c8ba26561e5',
women: '2aaf9519b31d1f21c537032f496e7450',
lifestyle: '422bfdb9b410598e11c3e72bd4ee664e'
};
let params = {
content_code: 'a7989369aa86681c678bc40f171b8f1d'
content_code: codes[channel]
};
return api.get('/operations/api/v5/resource/get', params).then(result => {
... ...
... ... @@ -16,10 +16,10 @@
</div>
<div class="right">
{{!-- 新品banner --}}
{{# banner}}
{{#if banner.src}}
<div class="banner-img"
style="height: 200px;margin-bottom:30px; background:url({{image src 850 200 2}}) no-repeat top center;"></div>
{{/banner}}
style="height: 200px;margin-bottom:30px; background:url({{image banner.src 850 200 2}}) no-repeat top center;"></div>
{{/if}}
{{!-- 已选中条件 --}}
{{#filter}}
{{> list/filter-area}}
... ...