Authored by yyq

style

... ... @@ -13,6 +13,17 @@ const seoHandler = require('./seo-handler');
const utils = '../../../utils';
const productProcess = require(`${utils}/product-process-simple`);
const _handleImageUrl = (url) => {
if (url) {
let imgArr = _.split(url, '?', 1);
imgArr.push('imageView2/1/w/{width}/h/{height}/q/90');
url = imgArr.join('?');
}
return url;
}
const _setHotKeywordData = (result, params, channel) => {
let changeQuery = Object.assign({}, params);
let finalResult = {
... ... @@ -137,17 +148,19 @@ module.exports = class extends global.yoho.BaseModel {
params.query = keyword.name;
return this.getSearchProduct(params, channel).then(result => {
const keyNum = 10;
let hotKeys = (keyword.data || []).map(val => {
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.goods_img = _handleImageUrl(keyword.goods_img);
keyword.list = _.take(hotKeys, keyNum);
keyword.describe = keyword.describe || seoTDK.description;
Object.assign(result, {
hotKeys: _.drop(hotKeys, 6),
hotKeys: _.drop(hotKeys, keyNum),
keyword: keyword
}, seoTDK);
... ...
... ... @@ -22,7 +22,7 @@
{{/if}}
</div>
</div>
<img class="thumb" src="{{image2 goods_img}}" alt="{{name}}">
<img class="thumb" src="{{image2 goods_img w=300 h=300}}" alt="{{name}}">
{{/ keyword}}
</div>
... ...
... ... @@ -12,7 +12,7 @@
position: relative;
.sort-intro {
width: 488px;
width: 650px;
height: 300px;
line-height: 300px;
border: 1px solid #eaeceb;
... ... @@ -21,7 +21,7 @@
.inline {
width: 100%;
padding: 0 50px;
padding: 0 30px;
line-height: 1;
text-align: center;
display: inline-block;
... ... @@ -53,7 +53,7 @@
margin-top: 30px;
> li {
width: 33.33%;
width: 20%;
text-align: center;
float: left;
font-size: 12px;
... ... @@ -67,7 +67,7 @@
}
.thumb {
width: 480px;
width: 300px;
height: 300px;
position: absolute;
top: 0;
... ...