Authored by yyq

img alt

... ... @@ -395,7 +395,27 @@ module.exports = class extends global.yoho.BaseModel {
products = nextItem.data;
object.name = item.data.name;
let name = _.get(item, 'data.name', '');
let brandTitle = `${name}品牌`;
_.map(brands, value => {
if (value && value.img) {
!value.alt && (value.alt = brandTitle);
!value.title && (value.title = brandTitle);
}
return value;
});
let productTitle = `${name}商品`;
_.map(products, value => {
if (value && value.img) {
!value.alt && (value.alt = productTitle);
!value.title && (value.title = productTitle);
}
return value;
});
object.name = name;
object.keyword = keyword;
object.category = category;
object.brands = brands;
... ...
... ... @@ -5,7 +5,7 @@
<div class="tpl-nav">
<div class="tpl-keywords">
{{#each keyword}}
<a class="keywords{{@index}}" title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=152}}"/></a>
<a class="keywords{{@index}}" title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=152}}" alt="{{title}}"/></a>
{{/each}}
</div>
<div class="tpl-category clearfix">
... ... @@ -24,7 +24,7 @@
<div class="tpl-types imgopacity clearfix">
<ul>
{{#each types}}
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=248}}" alt="{{alt}}"/></a></li>
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=248}}" alt="{{title}}"/></a></li>
{{/each}}
</ul>
</div>
... ...
... ... @@ -22,7 +22,7 @@
<div class="tpl-types imgopacity clearfix">
<ul>
{{#each types}}
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=504}}" alt="{{alt}}"/></a></li>
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img class="lazy" data-original="{{image2 img w=185 h=504}}" alt="{{title}}"/></a></li>
{{/each}}
</ul>
</div>
... ...
... ... @@ -4,11 +4,11 @@
<ul class="g-list imgopacity clearfix">
{{#each imgHot}}
<li>
<a href="{{url}}" target= "_blank"><div class="commodity-img" title="{{title}}">
<a href="{{url}}" title="{{name}}" target= "_blank"><div class="commodity-img" title="{{title}}">
{{# tip}}
<i class="top">{{.}}</i>
{{/ tip}}
<img class="lazy" data-original="{{image2 thumb w=280 h=373}}" alt="{{alt}}"/></div>
<img class="lazy" data-original="{{image2 thumb w=280 h=373}}" alt="{{name}}"/></div>
<p class="commodity-name">{{name}}</p>
<p class="commodity-price"><span>¥{{salePrice}}</span></p>
</a>
... ...
... ... @@ -77,6 +77,10 @@ a {
left: 0;
}
img {
color: #fff;
}
/*
公共样式
*/
... ...