Authored by yyq

fix hot

... ... @@ -292,7 +292,7 @@ const getHotKeywordsSeo = (keyword, num) => {
return {
title: `${keyword}_${keyword}【图片,新款,价格,折扣,搭配】-YOHO!BUY有货`,
keywords: keyword,
description: `YOHO!BUY有货网是国内专业的【${keyword}】网上潮流购物商城,为您找到${num}条【${keyword}】产品的品牌、图片、款式、价格、折扣等信息。买正品【${keyword},就上YOHO!BUY有货!` // eslint-disable-line
description: `YOHO!BUY 有货网是国内专业的${keyword}网上潮流购物商城,为您找到${num}${keyword}产品的品牌、图片、款式、价格、折扣等信息。买正品${keyword},就上YOHO!BUY有货!` // eslint-disable-line
};
};
... ...
... ... @@ -26,6 +26,13 @@ const _setHotKeywordData = (result, params, channel) => {
// 获取商品数据和顶部筛选条件
if (result[1].code === 200) {
let data = result[1].data;
let goodsList = productProcess.processProductList(data.product_list,
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params));
goodsList.map(goods => {
goods.productTitle = `${params.query}|${goods.product_name}`;
return goods;
});
Object.assign(finalResult,
searchHandler.handlePathNavData({total: data.total}, params, 'search', channel),
... ... @@ -34,8 +41,7 @@ const _setHotKeywordData = (result, params, channel) => {
opts: searchHandler.handleOptsData(changeQuery, data.total),
totalCount: data.total,
footPager: searchHandler.handlePagerData(data.total, changeQuery),
goods: productProcess.processProductList(data.product_list,
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params)),
goods: goodsList,
hasNextPage: searchHandler.handleNextPage(changeQuery, data.total)
}
}
... ... @@ -58,8 +64,12 @@ const _setHotKeywordData = (result, params, channel) => {
finalResult.latestWalkExtra = [{
extraTabName: '相关推荐',
active: true,
extraGoodsList: productProcess.processProductList(data.product_list,
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params))
}, {
extraTabName: '最近预览',
latestWalk: 5
}];
}
... ... @@ -96,7 +106,7 @@ module.exports = class extends global.yoho.BaseModel {
searchParams.need_filter = 'yes';
return Promise.all([
headerModel.requestHeaderData(channel),
headerModel.requestHeaderData(channel, true),
this.searchApi.getSeoProductList(searchParams, 'fuzzySearch'),
this.searchApi.getSeoProductList(Object.assign(searchParams, {
order: 's_n_desc',
... ... @@ -130,14 +140,15 @@ module.exports = class extends global.yoho.BaseModel {
val.href = helpers.urlFormat(`/hot/${val.id}.html`);
return val;
});
let seoTDK = seoHandler.getHotKeywordsSeo(keyword.name, _.get(result, 'product.totalCount', '多'));
keyword.list = _.take(hotKeys, 6);
keyword.describe = keyword.describe || seoTDK.description;
Object.assign(result, {
hotKeys: _.drop(hotKeys, 6),
keyword: keyword,
latestWalk: 5
}, seoHandler.getHotKeywordsSeo(keyword.name, _.get(result, 'product.totalCount', '多')));
keyword: keyword
}, seoTDK);
return result;
});
... ...
<div class="yoho-page seo-hot-page product-list-page">
<div class="yoho-page product-page seo-hot-page product-list-page">
{{> common/path-nav}}
<div class="clearfix">
... ... @@ -7,10 +7,10 @@
{{# keyword}}
<div class="sort-intro">
<div class="inline">
<p class="name">
<span class="cn">{{name}}</span>
<div class="name">
<h1 class="cn">{{name}}</h1>
{{# nameEn}}<span class="en">{{.}}</span>{{/ nameEn}}
</p>
</div>
{{# describe}}<p class="desc">{{.}}</p>{{/ describe}}
{{#if list}}
... ... @@ -22,7 +22,7 @@
{{/if}}
</div>
</div>
<img class="thumb" src="{{image2 goods_img}}">
<img class="thumb" src="{{image2 goods_img}}" alt="{{name}}">
{{/ keyword}}
</div>
... ... @@ -34,7 +34,7 @@
<div class="right-content">
{{#if hotKeys}}
<div class="hot-block">
<p class="title">热门关键词</p>
<h3 class="title">热门关键词</h3>
<p class="hot-key">
{{# hotKeys}}
<a href="{{href}}">{{keyword}}</a>
... ... @@ -43,7 +43,7 @@
</div>
{{/if}}
<div class="hot-block">
<p class="title">热门品牌</p>
<h3 class="title">热门品牌</h3>
{{# hotBrands}}
<a href="{{href}}" class="brand-item" target="_blank" title="{{brand_name_cn}}">
... ...
... ... @@ -8,7 +8,7 @@
{{/if}}
{{# latestWalkExtra}}
<span class="tab-item extra-tab-item" data-key="{{@index}}">{{extraTabName}}</span>
<span class="tab-item extra-tab-item{{#if active}} bottom-cur{{/if}}" data-key="{{@index}}">{{extraTabName}}</span>
{{/ latestWalkExtra}}
<div class="bottom-line"></div>
</div>
... ... @@ -44,23 +44,45 @@
{{/if}}
{{# latestWalkExtra}}
<div class="latest-walk-extra-area extra-area-{{@index}}">
<div class="goods clearfix">
{{# extraGoodsList}}
<div class="good">
<a href="{{url}}" target="_blank" title="{{product_name}}">
<img class="lazy" data-original="{{image2 thumb w=280 h=382}}" alt="{{product_name}}" />
</a>
<a class="name" href="{{url}}" target="_blank">{{product_name}}</a>
<p class="price">
{{#if market_price}}
<span class="market-price">¥{{round market_price 2}}</span>
{{/ if}}
<span class="sale-price">¥{{round sales_price 2}}</span>
<div class="latest-walk-extra-area extra-area-{{@index}}{{#if active}} active{{/if}}">
{{#if extraGoodsList}}
<div class="goods clearfix">
{{# extraGoodsList}}
<div class="good">
<a href="{{url}}" target="_blank" title="{{product_name}}">
<img class="lazy" data-original="{{image2 thumb w=280 h=382}}" alt="{{product_name}}" />
</a>
<a class="name" href="{{url}}" target="_blank">{{product_name}}</a>
<p class="price">
{{#if market_price}}
<span class="market-price">¥{{round market_price 2}}</span>
{{/ if}}
<span class="sale-price">¥{{round sales_price 2}}</span>
</p>
</div>
{{/ extraGoodsList}}
</div>
{{/if}}
{{#if latestWalk}}
<div class="latest-walk-area">
<input id="latest-walk-count" type="hidden" value="{{latestWalk}}">
<div class="latest-walk">
<div id="latest-walk-goods" class="goods clearfix"></div>
<p class="null-data">
无最近浏览的商品
</p>
</div>
{{/ extraGoodsList}}
</div>
{{> product/latest-walk-tpl}}
<div class="lazy-load-object">
<textarea class="latest-walk-datalazyload" style="visibility: hidden;">
<script> fetchLatestWalk(); </script>
</textarea>
</div>
</div>
{{/if}}
</div>
{{/ latestWalkExtra}}
</div>
... ...
... ... @@ -127,6 +127,10 @@
display: none;
}
.active {
display: block;
}
.goods {
width: 110%;
height: auto;
... ...