Authored by 毕凯

Merge branch 'gray' of git.yoho.cn:fe/yohobuywap-node into gray

Showing 51 changed files with 316 additions and 133 deletions
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 {{# list}} 5 {{# list}}
6 <li class="swiper-slide"> 6 <li class="swiper-slide">
7 <a href="{{url}}"> 7 <a href="{{url}}">
8 - <img src="{{image2 img q=60}}" alt=""> 8 + <img src="{{image2 img q=60}}" alt="{{textCn}}">
9 </a> 9 </a>
10 <span class="brands-title">{{textCn}}</span> 10 <span class="brands-title">{{textCn}}</span>
11 </li> 11 </li>
@@ -270,12 +270,21 @@ const index = (req, res, next) => { @@ -270,12 +270,21 @@ const index = (req, res, next) => {
270 let shareInfo = _shareInfo(id, detail.getArticle); 270 let shareInfo = _shareInfo(id, detail.getArticle);
271 271
272 Object.assign(guang, shareInfo); 272 Object.assign(guang, shareInfo);
273 - data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停'; 273 + data.title = detail.getArticle.article_title + '-YOHO!BUY 有货网';
274 data.title_more = true; 274 data.title_more = true;
275 - data.description = detail.getArticle.article_summary; 275 + data.description = detail.getArticle.descriptionText;
276 data.description_more = true; 276 data.description_more = true;
277 } 277 }
278 278
  279 + if (detail.getArticle.article_title) {
  280 + parameter.tltle = detail.getArticle.article_title + '-YOHO!BUY 有货网';
  281 + parameter.keywords = detail.getArticle.article_title;
  282 + }
  283 +
  284 + if (detail.getArticle.descriptionText) {
  285 + parameter.description = detail.getArticle.descriptionText;
  286 + }
  287 +
279 // 标识有微信分享 288 // 标识有微信分享
280 data.hasWxShare = true; 289 data.hasWxShare = true;
281 290
@@ -21,6 +21,34 @@ const channels = { @@ -21,6 +21,34 @@ const channels = {
21 lifestyle: 4 21 lifestyle: 4
22 }; 22 };
23 23
  24 +const listTDK = {
  25 + 0: {
  26 + title: '最新潮流文章,逛最新潮流资讯-YOHO!BUY 有货网',
  27 + keywords: '最新潮流文章,潮流资讯,逛潮流',
  28 + description: '有货网每天提供全球最新最潮的潮流文章资讯,宣传潮流商品,潮流文化,潮流品牌等信息,想更多了解潮流最新资讯就来有货网!'
  29 + }, // 最新
  30 + 1001: {
  31 + title: '高人气潮流文章,逛人气潮流资讯-YOHO!BUY 有货网',
  32 + keywords: '人气潮流文章,潮流人气,逛潮流人气',
  33 + description: '有货网每天提供全球人气最高的潮流文章资讯,宣传潮流商品,潮流文化,潮流品牌等信息,想更多了解高人气潮流资讯就来有货网!'
  34 + }, // 人气
  35 + 2: {
  36 + title: '各种潮流搭配,逛潮流搭配资讯-YOHO!BUY 有货网',
  37 + keywords: '搭配潮流文章,潮流搭配',
  38 + description: '有货网每天提供全球最新最潮的潮流搭配文章资讯,宣传潮流商品,潮流文化,潮流品牌等信息,想更多了解学习潮流搭配资讯就来有货网!'
  39 + }, // 搭配
  40 + 4: {
  41 + title: '潮流品牌,逛各种潮流品牌资讯-YOHO!BUY 有货网',
  42 + keywords: '逛潮品,潮流潮品,潮品资讯',
  43 + description: '有货网每天提供全球最新最潮的潮流潮品文章资讯,宣传潮流商品,潮流文化,潮流品牌等信息,想更多了解学习潮流潮品资讯就来有货网!'
  44 + }, // 潮品
  45 + 22: {
  46 + title: '潮流视频,欣赏最新最好玩的潮流视频-YOHO!BUY 有货网',
  47 + keywords: '潮流视频,看潮流',
  48 + description: '有货网每天提供全球最新最潮最精彩的潮流视频,宣传潮流商品,潮流文化,潮流品牌等信息,想更多欣赏潮流视频就来有货网!'
  49 + } // 视频
  50 +};
  51 +
24 /** 52 /**
25 * [编辑页面] 53 * [编辑页面]
26 */ 54 */
@@ -68,9 +96,9 @@ const editor = (req, res, next) => { @@ -68,9 +96,9 @@ const editor = (req, res, next) => {
68 96
69 res.render('index/list', Object.assign({ 97 res.render('index/list', Object.assign({
70 page: 'index-editor', 98 page: 'index-editor',
71 - title: `潮流编辑${name}|YOHO!BUY有货`,  
72 - keywords: `潮流编辑${name}`,  
73 - description: `YOHO!BUY有货潮流编辑${name}!`, 99 + title: `【${name}】潮流编辑${name}-YOHO!BUY 有货网`,
  100 + keywords: `${name},潮流编辑${name},潮流编辑`,
  101 + description: `有货逛潮流,潮流编辑${name}分享大量原创潮流资讯,掌握大量不同类别的潮流文化知识信息,尽在有货逛潮流。`,
74 guangList: true, 102 guangList: true,
75 gender: gender, 103 gender: gender,
76 guang: { 104 guang: {
@@ -196,9 +224,9 @@ const index = (req, res, next) => { @@ -196,9 +224,9 @@ const index = (req, res, next) => {
196 let responseData = { 224 let responseData = {
197 module: 'guang', 225 module: 'guang',
198 page: 'index', 226 page: 'index',
199 - title: '逛|逛潮流,逛购物,官方授权正品潮流购物中心|YOHO!BUY有货',  
200 - keywords: '逛,逛潮流,逛购物',  
201 - description: 'YOHO!BUY有货逛频道,来YOHO!玩潮流!潮搭大解析!年轻人潮流购物中心,中国潮流购物风向标,吴亦凡重磅代言!YOHO!BUY有货100%正品保证,支持货到付款。', 227 + title: '逛潮流,最新原创潮流资讯 |YOHO!BUY有货',
  228 + keywords: '潮流资讯,潮流文章,有货潮流分享',
  229 + description: '来有货玩潮流,潮流资讯大分享!年轻人潮流购物中心,了解潮流趋势、掌握潮流文化知识信息,尽在有货逛潮流!',
202 showFooterTab: footerModel.getUrlData('guang') 230 showFooterTab: footerModel.getUrlData('guang')
203 }; 231 };
204 232
@@ -209,6 +237,8 @@ const index = (req, res, next) => { @@ -209,6 +237,8 @@ const index = (req, res, next) => {
209 gender: req.query.gender || req.query.channel && typeLib.gender[req.query.channel] || '1,3' 237 gender: req.query.gender || req.query.channel && typeLib.gender[req.query.channel] || '1,3'
210 }; 238 };
211 239
  240 + responseData = Object.assign(responseData, listTDK[param.type]);
  241 +
212 req.ctx(IndexModel).getArticle(param).then(result => { 242 req.ctx(IndexModel).getArticle(param).then(result => {
213 if (result && result.guang && result.guang.infos) { 243 if (result && result.guang && result.guang.infos) {
214 if (!result.guang.infos.length) { 244 if (!result.guang.infos.length) {
@@ -243,9 +273,9 @@ const tag = (req, res, next) => { @@ -243,9 +273,9 @@ const tag = (req, res, next) => {
243 pageHeader: headerData, 273 pageHeader: headerData,
244 module: 'guang', 274 module: 'guang',
245 page: 'index-editor', 275 page: 'index-editor',
246 - title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停',  
247 - keywords: tagTitle,  
248 - description: 'YOHO!BUY有货潮流' + tagTitle + '!' 276 + title: '【' + tagTitle + '】' + tagTitle + '潮流资讯-YOHO!BUY 有货网',
  277 + keywords: tagTitle + ',' + tagTitle + '潮流资讯,' + tagTitle + '文章',
  278 + description: '来有货逛潮流,' + tagTitle + '潮流资讯大分享!了解' + tagTitle + '潮流趋势,掌握' + tagTitle + '潮流文化知识信息,尽在有货逛潮流。'
249 }; 279 };
250 280
251 let param = { 281 let param = {
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 const serviceAPI = global.yoho.ServiceAPI; 7 const serviceAPI = global.yoho.ServiceAPI;
8 const _ = require('lodash'); 8 const _ = require('lodash');
9 const helpers = global.yoho.helpers; 9 const helpers = global.yoho.helpers;
  10 +const redis = require('../../../utils/redis');
10 11
11 const URI_PACKAGE_ARTICLE = 'guang/service/v2/article/'; 12 const URI_PACKAGE_ARTICLE = 'guang/service/v2/article/';
12 const URI_PACKAGE_AUTHOR = 'guang/service/v1/author/'; 13 const URI_PACKAGE_AUTHOR = 'guang/service/v1/author/';
@@ -204,6 +205,21 @@ class DetailModel extends global.yoho.BaseModel { @@ -204,6 +205,21 @@ class DetailModel extends global.yoho.BaseModel {
204 }); 205 });
205 } 206 }
206 207
  208 + // 获取逛文章分词内容
  209 + _getGuangArticleKeyword(id) {
  210 + return redis.all([
  211 + ['get', `global:yoho:guang:detail:${id}`]
  212 + ]).then(redisData => {
  213 + redisData = JSON.parse(redisData[0] || '{}');
  214 +
  215 + if (!redisData.data) {
  216 + return this._getArticleContent(id);
  217 + }
  218 +
  219 + return redisData;
  220 + });
  221 + }
  222 +
207 /** 223 /**
208 * [逛资讯详情页数据封装] 224 * [逛资讯详情页数据封装]
209 * @param {[int]} id [内容ID] 225 * @param {[int]} id [内容ID]
@@ -229,7 +245,7 @@ class DetailModel extends global.yoho.BaseModel { @@ -229,7 +245,7 @@ class DetailModel extends global.yoho.BaseModel {
229 let article = result.getArticle = data && data.data || {}; 245 let article = result.getArticle = data && data.data || {};
230 let promises = [ 246 let promises = [
231 this._getAuthor(article.author_id), 247 this._getAuthor(article.author_id),
232 - this._getArticleContent(id), 248 + this._getGuangArticleKeyword(id),
233 this._getBrand(id) 249 this._getBrand(id)
234 ]; 250 ];
235 251
@@ -260,7 +276,19 @@ class DetailModel extends global.yoho.BaseModel { @@ -260,7 +276,19 @@ class DetailModel extends global.yoho.BaseModel {
260 } 276 }
261 277
262 if (datas[1]) { 278 if (datas[1]) {
  279 + let textPosition = 1,
  280 + descriptionText;
  281 +
263 result.getArticleContent = getArticleContent = datas[1].data; 282 result.getArticleContent = getArticleContent = datas[1].data;
  283 +
  284 + for (let i = 0; i < getArticleContent.length; i++) {
  285 +
  286 + if (getArticleContent[i].text && textPosition === 1) {
  287 + descriptionText = getArticleContent[i].text.data.text;
  288 + result.getArticle.descriptionText = descriptionText.replace(/<\/?[^>]*>/g, '');
  289 + textPosition++;
  290 + }
  291 + }
264 } 292 }
265 293
266 if (isApp && datas[4] && datas[4].data) { 294 if (isApp && datas[4] && datas[4].data) {
@@ -330,6 +358,10 @@ class DetailModel extends global.yoho.BaseModel { @@ -330,6 +358,10 @@ class DetailModel extends global.yoho.BaseModel {
330 358
331 if (datas[2]) { 359 if (datas[2]) {
332 result.getBrand = datas[2].data; 360 result.getBrand = datas[2].data;
  361 +
  362 + _.forEach(result.getBrand, function(val) {
  363 + val.url = `//m.yohobuy.com/shop?domain=${val.brandDomain}`;
  364 + });
333 } 365 }
334 366
335 if (isShare && datas[4]) { 367 if (isShare && datas[4]) {
@@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
7 {{type}} 7 {{type}}
8 </li> 8 </li>
9 {{/ navs}} 9 {{/ navs}}
  10 + <li class="guang-nav-item news-jump" data-type=-1>
  11 + <a href='//m.yohobuy.com/guang/news' title='资讯'>资讯</a>
  12 + </li>
10 </ul> 13 </ul>
11 14
12 <div id="info-list" class="info-list-container"> 15 <div id="info-list" class="info-list-container">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 {{# detail}} 17 {{# detail}}
18 <div class="detail" data-id="{{id}}"> 18 <div class="detail" data-id="{{id}}">
19 <div class="post-title"> 19 <div class="post-title">
20 - <p class="title">{{title}}</p> 20 + <h1 class="title">{{title}}</h1>
21 {{> index/tvls}} 21 {{> index/tvls}}
22 </div> 22 </div>
23 <div class="post-content"> 23 <div class="post-content">
@@ -31,9 +31,9 @@ @@ -31,9 +31,9 @@
31 {{#if bigImage}} 31 {{#if bigImage}}
32 <div class="post-block big-img-block"> 32 <div class="post-block big-img-block">
33 {{#if noLazy}} 33 {{#if noLazy}}
34 - <img src={{image2 bigImage q=60}}> 34 + <img src={{image2 bigImage q=60}} alt="{{@root.guang.detail.title}}">
35 {{else}} 35 {{else}}
36 - <img class="lazy" data-original={{image2 bigImage q=60}}> 36 + <img class="lazy" data-original={{image2 bigImage q=60}} alt="{{@root.guang.detail.title}}">
37 {{/if}} 37 {{/if}}
38 {{#if tagList}} 38 {{#if tagList}}
39 <div class="tag-list-box"> 39 <div class="tag-list-box">
@@ -49,11 +49,11 @@ @@ -49,11 +49,11 @@
49 <div class="post-block small-img-block clearfix"> 49 <div class="post-block small-img-block clearfix">
50 {{#if noLazy}} 50 {{#if noLazy}}
51 {{# smallImage}} 51 {{# smallImage}}
52 - <img src={{image2 src q=60}}> 52 + <img src={{image2 src q=60}} alt="{{@root.guang.detail.title}}">
53 {{/ smallImage}} 53 {{/ smallImage}}
54 {{else}} 54 {{else}}
55 {{# smallImage}} 55 {{# smallImage}}
56 - <img class="lazy" data-original={{image2 src q=60}}> 56 + <img class="lazy" data-original={{image2 src q=60}} alt="{{@root.guang.detail.title}}">
57 {{/ smallImage}} 57 {{/ smallImage}}
58 {{/if}} 58 {{/if}}
59 59
@@ -153,7 +153,7 @@ @@ -153,7 +153,7 @@
153 <li class="brand buriedpoint" data-bp-id="guang_brand_{{name}}_0"> 153 <li class="brand buriedpoint" data-bp-id="guang_brand_{{name}}_0">
154 <a href={{url}}> 154 <a href={{url}}>
155 <div class="brand-logo"> 155 <div class="brand-logo">
156 - <img class="lazy" data-original="{{image2 thumb q=60}}"> 156 + <img class="lazy" data-original="{{image2 thumb q=60}}" alt="{{name}}">
157 </div> 157 </div>
158 <p class="brand-name">{{name}}</p> 158 <p class="brand-name">{{name}}</p>
159 </a> 159 </a>
@@ -19,9 +19,9 @@ exports.index = (req, res, next) => { @@ -19,9 +19,9 @@ exports.index = (req, res, next) => {
19 } 19 }
20 20
21 return res.render('news-index', Object.assign({ 21 return res.render('news-index', Object.assign({
22 - title: '新闻 | ' + (res.locals.title || ''), 22 + title: '资讯 | ' + (res.locals.title || ''),
23 pageHeader: headerModel.setNav({ 23 pageHeader: headerModel.setNav({
24 - navTitle: '新闻' 24 + navTitle: '资讯'
25 }), 25 }),
26 module: 'news', 26 module: 'news',
27 localCss: true, 27 localCss: true,
@@ -51,13 +51,13 @@ exports.detail = (req, res, next) => { @@ -51,13 +51,13 @@ exports.detail = (req, res, next) => {
51 req.ctx(newsService).detail(channel, query).then(result => { 51 req.ctx(newsService).detail(channel, query).then(result => {
52 return res.render('news-detail', Object.assign({ 52 return res.render('news-detail', Object.assign({
53 pageHeader: headerModel.setNav({ 53 pageHeader: headerModel.setNav({
54 - navTitle: result.header && result.header.title || '新闻详情页' 54 + navTitle: result.header && result.header.title || '资讯详情页'
55 }), 55 }),
56 module: 'news', 56 module: 'news',
57 localCss: true, 57 localCss: true,
58 pageFooter: true, 58 pageFooter: true,
59 page: 'detail', 59 page: 'detail',
60 - cononical: { 60 + canonical: {
61 currentHref: `//www.yohobuy.com${req.originalUrl}` 61 currentHref: `//www.yohobuy.com${req.originalUrl}`
62 } 62 }
63 }, result)); 63 }, result));
@@ -2,8 +2,10 @@ @@ -2,8 +2,10 @@
2 2
3 const _ = require('lodash'); 3 const _ = require('lodash');
4 const helpers = global.yoho.helpers; 4 const helpers = global.yoho.helpers;
  5 +const utils = '../../../utils';
  6 +const redis = require(`${utils}/redis`);
5 const NewsAPi = require('./news-api'); 7 const NewsAPi = require('./news-api');
6 -const utils = require('./utils'); 8 +const newsUtils = require('./utils');
7 const moment = require('moment'); 9 const moment = require('moment');
8 const ATYPE = 'yohobuy4008899646,yohogroup,YOHO_GIRL,mars-app'; 10 const ATYPE = 'yohobuy4008899646,yohogroup,YOHO_GIRL,mars-app';
9 11
@@ -24,7 +26,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -24,7 +26,7 @@ module.exports = class extends global.yoho.BaseModel {
24 26
25 lresult = { 27 lresult = {
26 id: articleData.id, 28 id: articleData.id,
27 - url: helpers.urlFormat(`/news/${articleData.id}_${articleData.cid}.html`), 29 + url: helpers.urlFormat(`/guang/news/${articleData.id}_${articleData.cid}.html`),
28 img: helpers.image(articleData.image, width, height, 1), 30 img: helpers.image(articleData.image, width, height, 1),
29 title: articleData.title, 31 title: articleData.title,
30 publishTime: articleData.update_time && moment(articleData.update_time * 1000).format('MM月DD HH:mm'), 32 publishTime: articleData.update_time && moment(articleData.update_time * 1000).format('MM月DD HH:mm'),
@@ -80,15 +82,21 @@ module.exports = class extends global.yoho.BaseModel { @@ -80,15 +82,21 @@ module.exports = class extends global.yoho.BaseModel {
80 title: contents.title, 82 title: contents.title,
81 summary: contents.summary, 83 summary: contents.summary,
82 tag: contents.tag, 84 tag: contents.tag,
  85 + syncTypeName: contents.syncTypeName || 'YOHO潮流志',
83 publishTime: contents.update_time && moment(contents.update_time * 1000).format('MM月DD HH:mm'), 86 publishTime: contents.update_time && moment(contents.update_time * 1000).format('MM月DD HH:mm'),
84 }; 87 };
85 - let content = utils.filterPhtml(contents.content, [  
86 - '阅读原文',  
87 - '点击这里',  
88 - '点这里'  
89 - ]);  
90 -  
91 - return {header: header, content: utils.filterAhtml(content)}; 88 + let content = newsUtils.filterPhtml(
  89 + contents.content.replace(/www.yohobuy.com\/chanpin\//ig, 'm.yohobuy.com/chanpin/'),
  90 + [
  91 + '阅读原文',
  92 + '点击这里',
  93 + '点这里'
  94 + ]
  95 + );
  96 +
  97 + content = newsUtils.filterAhtml(content);
  98 +
  99 + return {header: header, content: newsUtils.imgAlt(content, contents.title, 5)};
92 } 100 }
93 101
94 detail(channel, param) { 102 detail(channel, param) {
@@ -96,16 +104,25 @@ module.exports = class extends global.yoho.BaseModel { @@ -96,16 +104,25 @@ module.exports = class extends global.yoho.BaseModel {
96 id: param.id, 104 id: param.id,
97 cid: param.cid 105 cid: param.cid
98 }; 106 };
99 - let newsAPi = new NewsAPi(this.ctx);  
100 107
101 - return newsAPi.getContentDetail(params).then(result => { 108 + return redis.all([
  109 + ['get', `global:yoho:news:detail:${params.id}-${params.cid}`]
  110 + ]).then(redisData => {
  111 + redisData = JSON.parse(redisData[0] || '{}');
  112 +
  113 + if (!redisData.data) {
  114 + return new NewsAPi(this.ctx).getContentDetail(params);
  115 + }
  116 +
  117 + return redisData;
  118 + }).then(result => {
102 let responseData = {}; 119 let responseData = {};
103 120
104 // 详情页数据 121 // 详情页数据
105 Object.assign(responseData, this._formatDetail(result, params)); 122 Object.assign(responseData, this._formatDetail(result, params));
106 123
107 // seo 124 // seo
108 - let title = _.get(responseData, 'header.title', '新闻详情页'); 125 + let title = _.get(responseData, 'header.title', '资讯详情页');
109 let keywords = []; 126 let keywords = [];
110 let tags = _.compact(_.get(responseData, 'header.tag', []).map(el => { 127 let tags = _.compact(_.get(responseData, 'header.tag', []).map(el => {
111 return el.tag_name; 128 return el.tag_name;
@@ -23,7 +23,10 @@ const util = { @@ -23,7 +23,10 @@ const util = {
23 23
24 }); 24 });
25 25
26 - return $.html(); 26 + html = $.html();
  27 + $ = '';
  28 +
  29 + return html;
27 }, 30 },
28 31
29 // 过滤 a标签连接和删除html标签中的script和link脚本 32 // 过滤 a标签连接和删除html标签中的script和link脚本
@@ -34,9 +37,33 @@ const util = { @@ -34,9 +37,33 @@ const util = {
34 37
35 let $ = cheerio.load(html, {decodeEntities: false}); 38 let $ = cheerio.load(html, {decodeEntities: false});
36 39
37 - $('a').attr('href', 'javascript:void(0);').css({cursor: 'text'});// eslint-disable-line 40 + $('a').removeAttr('style').not('.a-anchor').attr('href', 'javascript:void(0);').css({cursor: 'text'});// eslint-disable-line
38 $('script,link').remove(); 41 $('script,link').remove();
39 - return $.html(); 42 +
  43 + html = $.html();
  44 + $ = '';
  45 +
  46 + return html;
  47 + },
  48 +
  49 + // 过滤 a标签连接和删除html标签中的script和link脚本
  50 + imgAlt: (html, alt, num) => {
  51 + if (!html) {
  52 + return html;
  53 + }
  54 +
  55 + let $ = cheerio.load(html, {decodeEntities: false});
  56 +
  57 + _.each($('img').slice(0, num), item => {
  58 + let $dom = $(item);
  59 +
  60 + $dom.attr('alt', $dom.attr('alt') || alt);
  61 + });
  62 +
  63 + html = $.html();
  64 + $ = '';
  65 +
  66 + return html;
40 } 67 }
41 }; 68 };
42 69
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="detail" data-id="{{id}}"> 2 <div class="detail" data-id="{{id}}">
3 {{# header}} 3 {{# header}}
4 <div class="post-title"> 4 <div class="post-title">
5 - <p class="title">{{title}}</p> 5 + <h1 class="title">{{title}}</h1>
6 {{> news-index/tvls}} 6 {{> news-index/tvls}}
7 </div> 7 </div>
8 {{/header}} 8 {{/header}}
1 <div class="time-view-like-share clearfix"> 1 <div class="time-view-like-share clearfix">
2 - <i class="iconfont">&#xe603;</i>  
3 - {{publishTime}}&nbsp;&nbsp;&nbsp;&nbsp;  
4 - {{#if pageView}}  
5 - <i class="iconfont">&#xe602;</i>  
6 - <span class="page-view">{{pageView}}</span> 2 + {{#if syncTypeName}}
  3 + <span class="page-view">来源于微信公众号:{{syncTypeName}}</span>
7 {{/if}} 4 {{/if}}
8 <div class="like-share-container"> 5 <div class="like-share-container">
  6 + <i class="iconfont">&#xe603;</i>
  7 + {{publishTime}}&nbsp;&nbsp;&nbsp;&nbsp;
  8 + {{#if pageView}}
  9 + <i class="iconfont">&#xe602;</i>
  10 + <span class="page-view">{{pageView}}</span>
  11 + {{/if}}
9 {{#like}} 12 {{#like}}
10 <i class="iconfont like-btn{{#isLiked}} like{{/isLiked}}">&#xe601;</i> 13 <i class="iconfont like-btn{{#isLiked}} like{{/isLiked}}">&#xe601;</i>
11 <span class="like-count">{{count}}</span> 14 <span class="like-count">{{count}}</span>
@@ -83,7 +83,7 @@ const keyId = (req, res, next) => { @@ -83,7 +83,7 @@ const keyId = (req, res, next) => {
83 description: `YOHO!BUY有货网yohobuy.com是国内专业的${queryKey}网上潮流购物商城,为您找到${_.get(result, 83 description: `YOHO!BUY有货网yohobuy.com是国内专业的${queryKey}网上潮流购物商城,为您找到${_.get(result,
84 'total', 0)}${queryKey}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${queryKey},就上YOHO!BUY有货`, 84 'total', 0)}${queryKey}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${queryKey},就上YOHO!BUY有货`,
85 pageFooter: true, 85 pageFooter: true,
86 - cononical: { 86 + canonical: {
87 currentHref: `//www.yohobuy.com${req.originalUrl}` 87 currentHref: `//www.yohobuy.com${req.originalUrl}`
88 } 88 }
89 }); 89 });
@@ -313,8 +313,8 @@ exports.index = (req, res, next) => { @@ -313,8 +313,8 @@ exports.index = (req, res, next) => {
313 title: result.goodsName, 313 title: result.goodsName,
314 pageFooter: true, 314 pageFooter: true,
315 localCss: true, 315 localCss: true,
316 - cononical: {  
317 - currentHref: result.cononical 316 + canonical: {
  317 + currentHref: result.canonical
318 } 318 }
319 }); 319 });
320 }).catch(next); 320 }).catch(next);
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 const headerModel = require('../../../doraemon/models/header'); 3 const headerModel = require('../../../doraemon/models/header');
4 const model = require('../models/global'); 4 const model = require('../models/global');
  5 +const _ = require('lodash');
5 6
6 const list = (req, res, next) => { 7 const list = (req, res, next) => {
7 let brand = req.query.brand; 8 let brand = req.query.brand;
@@ -84,6 +85,13 @@ const detail = (req, res, next) => { @@ -84,6 +85,13 @@ const detail = (req, res, next) => {
84 let appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.globalpurchase","params":${JSON.stringify(appParams)}}`; 85 let appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.globalpurchase","params":${JSON.stringify(appParams)}}`;
85 86
86 res.render('global/detail', { 87 res.render('global/detail', {
  88 + title: (_.get(result, 'brand_info.brand_name', '') ? '【' + result.brand_info.brand_name + '】' : '') +
  89 + _.get(result, 'product_name', '') + '|YOHO!BUY 有货',
  90 + keywords: _.get(result, 'brand_info.brand_name', '') + ',' + _.get(result, 'brand_info.brand_name', '') +
  91 + '价格,' + _.get(result, 'brand_info.brand_name', '') + '图片,',
  92 + description: _.get(result, 'product_name', '') + ' 有货网仅售' + _.get(result, 'sales_price', '') + '元,购买' +
  93 + _.get(result, 'brand_info.brand_name', '') + ',了解' + _.get(result, 'brand_info.brand_name', '') +
  94 + '商品信息就上有货网!',
87 module: 'product', 95 module: 'product',
88 page: 'global-detail', 96 page: 'global-detail',
89 pageHeader: headerModel.setNav({ 97 pageHeader: headerModel.setNav({
@@ -248,6 +248,9 @@ const category = (req, res, next) => { @@ -248,6 +248,9 @@ const category = (req, res, next) => {
248 _noLazy: true, // 首屏不使用lazyload 248 _noLazy: true, // 首屏不使用lazyload
249 module: 'product', 249 module: 'product',
250 page: 'search-list', 250 page: 'search-list',
  251 + canonical: {
  252 + currentHref: 'https://www.yohobuy.com/list?' // TODO
  253 + },
251 pageHeader: headerModel.setNav({ 254 pageHeader: headerModel.setNav({
252 navTitle: req.query.title || req.query.sort_name 255 navTitle: req.query.title || req.query.sort_name
253 }), 256 }),
@@ -62,13 +62,14 @@ const newDetail = { @@ -62,13 +62,14 @@ const newDetail = {
62 pageHeader: headerData, 62 pageHeader: headerData,
63 result: result, 63 result: result,
64 page: 'new-detail', 64 page: 'new-detail',
65 - title: `${result.brandName}|${result.sortName}|${result.goodsName}|YOHO!BUY 有货`,  
66 - keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' +  
67 - result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' +  
68 - result.brandName + '折扣店,' +  
69 - result.brandName + '真品,' + result.brandName + '代购',  
70 - description: `YOHO!BUY 有货-${result.brandName}官方授权店,${result.goodsName}图片、报价、介绍。` +  
71 - `YOHO!BUY 有货${result.brandName}官网专卖店提供${result.brandName}正品、${result.brandName}真品、 ${result.brandName}打折、${result.brandName}代购等。`, // eslint-disable-line 65 + canonical: {
  66 + currentHref: `//www.yohobuy.com${req.originalUrl}`
  67 + },
  68 + title: `【${result.brandName}${result.sortName}${result.goodsName}|YOHO!BUY 有货`,
  69 + keywords: result.brandName + result.sortName + ',' + result.brandName + result.sortName + '价格,' +
  70 + result.brandName + result.sortName + '图片,',
  71 + description: result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' +
  72 + result.brandName + result.sortName + ',了解' + result.brandName + result.sortName + '商品信息就上有货网!',
72 pageFooter: true, 73 pageFooter: true,
73 localCss: true, 74 localCss: true,
74 appPath: appPath, 75 appPath: appPath,
@@ -17,6 +17,18 @@ const stringProcess = require(`${utils}/string-process`); @@ -17,6 +17,18 @@ const stringProcess = require(`${utils}/string-process`);
17 const shopPrcs = require(`${utils}/shop-process`); 17 const shopPrcs = require(`${utils}/shop-process`);
18 const co = require('bluebird').coroutine; 18 const co = require('bluebird').coroutine;
19 19
  20 +/**
  21 + * SEO 优化,页面 TDK
  22 + * @param {*} keyword
  23 + */
  24 +const _tdkProcess = (keyword) => {
  25 + return {
  26 + title: `${keyword}| ${keyword}品牌旗舰店 |正品保证, YOHO!BUY 有货`,
  27 + keywords: `${keyword}${keyword}品牌旗舰店,${keyword}正品`,
  28 + description: `有货网${keyword}旗舰店销售${keyword}正品商品,100%质量保证,支持货到付款,想了解${keyword}价格、图片、评价等信息,就上YOHO!BUY 有货中国最大的潮流商品购物网站!`, // eslint-disable-line
  29 + };
  30 +};
  31 +
20 const shop = { 32 const shop = {
21 33
22 /** 34 /**
@@ -199,7 +211,7 @@ const shop = { @@ -199,7 +211,7 @@ const shop = {
199 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', [])); 211 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
200 212
201 213
202 - res.render('newshop/shop-brand', { 214 + res.render('newshop/shop-brand', _.assign({
203 module: 'product', 215 module: 'product',
204 page: 'shop-brand', 216 page: 'shop-brand',
205 pageHeader: headerModel.setNav({ 217 pageHeader: headerModel.setNav({
@@ -207,15 +219,12 @@ const shop = { @@ -207,15 +219,12 @@ const shop = {
207 }), 219 }),
208 showDownloadApp: true, 220 showDownloadApp: true,
209 pageFooter: true, 221 pageFooter: true,
210 - title: title + '|' + title + '潮流服装服饰-Yoho!Buy有货',  
211 - keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',  
212 - description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
213 brandId: brandId, 222 brandId: brandId,
214 goodsList: goodsList, 223 goodsList: goodsList,
215 shopPage: true, 224 shopPage: true,
216 _noLazy: true, 225 _noLazy: true,
217 localCss: true 226 localCss: true
218 - }); 227 + }, _tdkProcess(title)));
219 })().catch(next); 228 })().catch(next);
220 }, 229 },
221 230
@@ -253,10 +262,6 @@ const shop = { @@ -253,10 +262,6 @@ const shop = {
253 shopInfo.shop_intro_link = helpers.urlFormat('/product/index/intro', { shop_id: shopId }); 262 shopInfo.shop_intro_link = helpers.urlFormat('/product/index/intro', { shop_id: shopId });
254 263
255 let finalResult = { 264 let finalResult = {
256 - title: shopInfo.shop_name + '|' + shopInfo.shop_name + '潮流服装服饰-Yoho!Buy有货',  
257 - keywords: shopInfo.shop_name + ',' + shopInfo.shop_name + '服装服饰,' + shopInfo.shop_name + '潮流服装服饰',  
258 - description: shopInfo.shop_name + '|Yoho!Buy有货' + shopInfo.shop_name +  
259 - '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
260 pageHeader: _.assign({ 265 pageHeader: _.assign({
261 shopPage: { 266 shopPage: {
262 text: '分类', 267 text: '分类',
@@ -288,7 +293,7 @@ const shop = { @@ -288,7 +293,7 @@ const shop = {
288 293
289 if (domain) { 294 if (domain) {
290 _.assign(finalResult, { 295 _.assign(finalResult, {
291 - cononical: { 296 + canonical: {
292 currentHref: `https://${domain}.m.yohobuy.com` 297 currentHref: `https://${domain}.m.yohobuy.com`
293 } 298 }
294 }); 299 });
@@ -299,7 +304,7 @@ const shop = { @@ -299,7 +304,7 @@ const shop = {
299 304
300 res.render('newshop/shop-reds', _.assign(finalResult, { 305 res.render('newshop/shop-reds', _.assign(finalResult, {
301 shppFavHide: shppFavHide 306 shppFavHide: shppFavHide
302 - })); 307 + }, _tdkProcess(shopInfo.shop_name)));
303 })().catch(next); 308 })().catch(next);
304 }, 309 },
305 310
@@ -339,7 +344,7 @@ const shop = { @@ -339,7 +344,7 @@ const shop = {
339 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' + 344 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' +
340 shopId + '","shop_name":"' + shopInfo.shop_name + '"}}'; 345 shopId + '","shop_name":"' + shopInfo.shop_name + '"}}';
341 346
342 - res.render('newshop/shop-list', { 347 + res.render('newshop/shop-list', _.assign({
343 module: 'product', 348 module: 'product',
344 page: 'shop-list', 349 page: 'shop-list',
345 pageHeader: headerModel.setNav({ 350 pageHeader: headerModel.setNav({
@@ -347,9 +352,6 @@ const shop = { @@ -347,9 +352,6 @@ const shop = {
347 }), 352 }),
348 showDownloadApp: true, 353 showDownloadApp: true,
349 pageFooter: true, 354 pageFooter: true,
350 - title: title + '|' + title + '潮流服装服饰-Yoho!Buy有货',  
351 - keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',  
352 - description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
353 shopId: shopId, 355 shopId: shopId,
354 shopInfo: shopInfo, 356 shopInfo: shopInfo,
355 goodsList: goodsList, 357 goodsList: goodsList,
@@ -358,7 +360,7 @@ const shop = { @@ -358,7 +360,7 @@ const shop = {
358 _noLazy: true, 360 _noLazy: true,
359 localCss: true, 361 localCss: true,
360 couponData 362 couponData
361 - }); 363 + }, _tdkProcess(title)));
362 364
363 })().catch(next); 365 })().catch(next);
364 }, 366 },
@@ -145,6 +145,9 @@ let breakingYards = (req, res, next) => { @@ -145,6 +145,9 @@ let breakingYards = (req, res, next) => {
145 }).then((result) => { 145 }).then((result) => {
146 146
147 res.render('sale/break-code', Object.assign(params.renderData, result, { 147 res.render('sale/break-code', Object.assign(params.renderData, result, {
  148 + title: '断码商品|断码折扣商品|YOHO!BUY有货',
  149 + keywords: '断码商品、断码专区、断码折扣',
  150 + description: '有货网为您带断码专区精选商品,大量断码商品,价格优惠幅度大,支持货到付款,让您全面了解潮流断码商品价格、品牌、图片、折扣等方面信息,想网购潮流断码区商品就上有货网!',
148 localCss: true 151 localCss: true
149 })); 152 }));
150 }).catch(next); 153 }).catch(next);
@@ -185,6 +188,9 @@ let discountDetail = (req, res, next) => { @@ -185,6 +188,9 @@ let discountDetail = (req, res, next) => {
185 res.locals.appPath = result.activity && result.activity.cover_url ? `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.discountmarketpro","params":{"id":"${id}","cover_url":"${result.activity.cover_url.split('?')[0]}","title":"${result.title}"}}` : ''; 188 res.locals.appPath = result.activity && result.activity.cover_url ? `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.discountmarketpro","params":{"id":"${id}","cover_url":"${result.activity.cover_url.split('?')[0]}","title":"${result.title}"}}` : '';
186 189
187 res.render('sale/discount-detail', Object.assign(params.renderData, result, { 190 res.render('sale/discount-detail', Object.assign(params.renderData, result, {
  191 + title: `【${result.title}】潮流折扣商品|YOHO!BUY 有货`,
  192 + keywords: `${result.title}`,
  193 + description: `有货网为您提供大量${result.title}商品,支持货到付款,质量保证,让您全面了解${result.title}商品价格、品牌、图片、折扣等方面信息,想网购${result.title}商品就上有货网!`, // eslint-disable-line
188 localCss: true 194 localCss: true
189 })); 195 }));
190 }).catch(next); 196 }).catch(next);
@@ -209,6 +215,9 @@ let vip = (req, res, next) => { @@ -209,6 +215,9 @@ let vip = (req, res, next) => {
209 215
210 saleModel.getVipData(params.channel).then((result) => { 216 saleModel.getVipData(params.channel).then((result) => {
211 res.render('sale/vip', Object.assign(params.renderData, { 217 res.render('sale/vip', Object.assign(params.renderData, {
  218 + title: 'VIP会员专享|会员专享|YOHO!BUY有货',
  219 + keywords: '会员专享,VIP专享,专享商品',
  220 + description: '有货网为您带VIP会员专享精选商品,大量潮流品牌商品,VIP价格优惠幅度大,支持货到付款,让您全面了解VIP会员专享商品价格、品牌、图片、折扣等方面信息,想网购VIP会员专享商品就上有货网!', // eslint-disable-line
212 content: result, 221 content: result,
213 localCss: true 222 localCss: true
214 })); 223 }));
@@ -292,7 +292,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -292,7 +292,7 @@ module.exports = class extends global.yoho.BaseModel {
292 } 292 }
293 293
294 /* tar add 161129 SEO 优化使用 */ 294 /* tar add 161129 SEO 优化使用 */
295 - finalResult.cononical = result.product_url; 295 + finalResult.canonical = result.product_url;
296 296
297 return finalResult; 297 return finalResult;
298 }); 298 });
@@ -4,6 +4,7 @@ const utils = '../../../utils'; @@ -4,6 +4,7 @@ const utils = '../../../utils';
4 const productProcess = require(`${utils}/product-process`); 4 const productProcess = require(`${utils}/product-process`);
5 const globalapi = global.yoho.GlobalAPI; 5 const globalapi = global.yoho.GlobalAPI;
6 const $ = require('cheerio'); 6 const $ = require('cheerio');
  7 +const _ = require('lodash');
7 8
8 exports.list = (param) => { 9 exports.list = (param) => {
9 return globalapi.get('product/api/v2/detail/getlist', param).then((result) => { 10 return globalapi.get('product/api/v2/detail/getlist', param).then((result) => {
@@ -46,13 +47,15 @@ exports.detail = (param) => { @@ -46,13 +47,15 @@ exports.detail = (param) => {
46 47
47 if (goods.length === 1) { 48 if (goods.length === 1) {
48 result.bannerTop = { 49 result.bannerTop = {
49 - img: (goods[0].images_list[0] || {}).image_url 50 + img: (goods[0].images_list[0] || {}).image_url,
  51 + imgAlt: _.get(result, 'brand_info.brand_name', '') + '|' + _.get(result, 'product_name', '')
50 }; 52 };
51 } else { 53 } else {
52 result.bannerTop = { 54 result.bannerTop = {
53 list: goods.map((g) => { 55 list: goods.map((g) => {
54 return { 56 return {
55 - img: (g.images_list[0] || {}).image_url 57 + img: (g.images_list[0] || {}).image_url,
  58 + imgAlt: _.get(result, 'brand_info', 'brand_name', '') + '|' + _.get(result, 'product_name', '')
56 }; 59 };
57 }) 60 })
58 }; 61 };
@@ -31,32 +31,33 @@ @@ -31,32 +31,33 @@
31 {{/ bannerTop}} 31 {{/ bannerTop}}
32 </div> 32 </div>
33 33
34 - <h2 class="goods-name"> 34 + <div class="goods-name">
35 {{# marketPhrase}} 35 {{# marketPhrase}}
36 <span class="activity-phrase">{{.}}</span> 36 <span class="activity-phrase">{{.}}</span>
37 {{/ marketPhrase}} 37 {{/ marketPhrase}}
38 {{# goodsName}} 38 {{# goodsName}}
39 - <span class="name">{{.}}</span> 39 + <h1 class="name">{{.}}</h1>
40 {{/ goodsName}} 40 {{/ goodsName}}
41 - </h2> 41 + </div>
42 42
43 {{# goodsSubtitle}} 43 {{# goodsSubtitle}}
44 - <h1 class="goods-subtitle"><span>{{.}}</span></h1> 44 + <h2 class="goods-subtitle"><span>{{.}}</span></h2>
45 {{/ goodsSubtitle}} 45 {{/ goodsSubtitle}}
46 46
47 <div class="price-date"> 47 <div class="price-date">
48 <div class="goods-price"> 48 <div class="goods-price">
49 - <h1 class="current-price">{{goodsPrice.currentPrice}}</h1>  
50 - <h1 class="previous-price">{{goodsPrice.previousPrice}}</h1> 49 + <h2 class="current-price">{{goodsPrice.currentPrice}}</h2>
  50 + <h2 class="previous-price">{{goodsPrice.previousPrice}}</h2>
51 </div> 51 </div>
52 <button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button> 52 <button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
53 <button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button> 53 <button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
54 <button class="got-limit-sale data-got-code data-bind">已获取限购码</button> 54 <button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
55 </div> 55 </div>
  56 +
56 {{#if periodOfMarket}} 57 {{#if periodOfMarket}}
57 <div class="period-of-market"> 58 <div class="period-of-market">
58 - <h1>上市期:</h1>  
59 - <h1 >{{periodOfMarket}}</h1> 59 + <h2>上市期:</h2>
  60 + <h2>{{periodOfMarket}}</h2>
60 </div> 61 </div>
61 {{/if}} 62 {{/if}}
62 63
@@ -85,7 +86,7 @@ @@ -85,7 +86,7 @@
85 {{!--占位: 购物车部分--}} 86 {{!--占位: 购物车部分--}}
86 <div id="placeholder-infodata"> 87 <div id="placeholder-infodata">
87 <div class="cart-bar"> 88 <div class="cart-bar">
88 - <a href="javascript:;" class="new-foot-ico"> 89 + <a href="javascript:;" class="new-foot-ico" rel="nofollow">
89 <div class="num-incart iconfont"> 90 <div class="num-incart iconfont">
90 <span class="num-tag {{#unless @root.cartCount}}hide{{/unless}}">{{@root.cartCount}}</span> 91 <span class="num-tag {{#unless @root.cartCount}}hide{{/unless}}">{{@root.cartCount}}</span>
91 &#xe62c; 92 &#xe62c;
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 {{/ bannerTop}} 20 {{/ bannerTop}}
21 </div> 21 </div>
22 22
23 - <div class="goods-name"><span class="name">{{product_name}}</span></div> 23 + <div class="goods-name"><h1 class="name">{{product_name}}</h1></div>
24 24
25 <div class="price-date"> 25 <div class="price-date">
26 <div> 26 <div>
@@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
6 <li class="swiper-slide"> 6 <li class="swiper-slide">
7 <a href="javascript:;"> 7 <a href="javascript:;">
8 {{#if @first}} 8 {{#if @first}}
9 - <img src="{{image2 img w=450 h=600 q=60}}" alt=""> 9 + <img src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
10 {{else}} 10 {{else}}
11 - <img class="swiper-lazy" data-src="{{image2 img w=450 h=600 q=60}}" alt=""> 11 + <img class="swiper-lazy" data-src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
12 {{/if}} 12 {{/if}}
13 </a> 13 </a>
14 </li> 14 </li>
@@ -27,10 +27,10 @@ @@ -27,10 +27,10 @@
27 <div class="banner-top-single"> 27 <div class="banner-top-single">
28 {{#if url}} 28 {{#if url}}
29 <a href="{{url}}"> 29 <a href="{{url}}">
30 - <img class="img" src="{{image2 img w=450 h=600 q=60}}"> 30 + <img class="img" src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
31 </a> 31 </a>
32 {{^}} 32 {{^}}
33 - <img class="img" src="{{image2 img w=450 h=600 q=60}}"> 33 + <img class="img" src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
34 {{/if}} 34 {{/if}}
35 35
36 </div> 36 </div>
1 <div class="item"> 1 <div class="item">
2 - <a {{#if link}}href="{{link}}"{{/if}}> 2 + <a {{#if link}}href="{{link}}"{{/if}}{{#if isGood}} title="{{alt}}"{{/if}}>
3 {{#if isGood}} 3 {{#if isGood}}
4 {{#ifor triple double single}} 4 {{#ifor triple double single}}
5 {{#within index 3}} 5 {{#within index 3}}
6 - <img class="item-pic" src="{{image2 src w=235 h=314}}"> 6 + <img class="item-pic" src="{{image2 src w=235 h=314}}" alt="{{alt}}">
7 {{^}} 7 {{^}}
8 - <img class="item-pic lazy" data-original="{{image2 src w=235 h=314}}"> 8 + <img class="item-pic lazy" data-original="{{image2 src w=235 h=314}}" alt="{{alt}}">
9 {{/within}} 9 {{/within}}
10 {{/ifor}} 10 {{/ifor}}
11 {{^}} 11 {{^}}
12 {{#within index 3}} 12 {{#within index 3}}
13 - <img class="item-pic" src="{{image2 src}}" alt=""> 13 + <img class="item-pic" src="{{image2 src}}" alt="{{@root.title}}">
14 {{^}} 14 {{^}}
15 <img class="item-pic lazy" data-original="{{image2 src}}"> 15 <img class="item-pic lazy" data-original="{{image2 src}}">
16 {{/within}} 16 {{/within}}
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <li class="swiper-slide"> 17 <li class="swiper-slide">
18 <a{{#if link}} href="{{link}}"{{/if}}> 18 <a{{#if link}} href="{{link}}"{{/if}}>
19 {{#within @../index 3}} 19 {{#within @../index 3}}
20 - <img src="{{image2 src}}" alt=""> 20 + <img src="{{image2 src}}" alt="{{@root.title}}">
21 {{^}} 21 {{^}}
22 <img class="lazy" data-original="{{image2 src}}" alt=""> 22 <img class="lazy" data-original="{{image2 src}}" alt="">
23 {{/within}} 23 {{/within}}
@@ -74,7 +74,7 @@ module.exports = { @@ -74,7 +74,7 @@ module.exports = {
74 maxFiles: 7 74 maxFiles: 7
75 }, 75 },
76 console: { 76 console: {
77 - level: 'info', 77 + level: 'debug',
78 colorize: 'all', 78 colorize: 'all',
79 prettyPrint: true 79 prettyPrint: true
80 } 80 }
@@ -15,8 +15,8 @@ module.exports = app => { @@ -15,8 +15,8 @@ module.exports = app => {
15 15
16 // 业务模块 16 // 业务模块
17 app.use('/product', require('./apps/product')); 17 app.use('/product', require('./apps/product'));
  18 + app.use('/guang/news', require('./apps/news'));// seo-潮流资讯页
18 app.use('/guang', require('./apps/guang')); 19 app.use('/guang', require('./apps/guang'));
19 - app.use('/news', require('./apps/news'));  
20 app.use('/activity', require('./apps/activity')); 20 app.use('/activity', require('./apps/activity'));
21 app.use('/cart', require('./apps/cart')); 21 app.use('/cart', require('./apps/cart'));
22 22
@@ -21,11 +21,11 @@ module.exports = () => { @@ -21,11 +21,11 @@ module.exports = () => {
21 } 21 }
22 } else if (req.subdomains.length) { 22 } else if (req.subdomains.length) {
23 switch (req.subdomains[0]) { 23 switch (req.subdomains[0]) {
24 - case 'guang': // 逛 24 + case 'guang':
25 case 'cdnsrcguang': // CDN 逛 回源地址 25 case 'cdnsrcguang': // CDN 逛 回源地址
26 req.url = req.url.replace('/guang', ''); 26 req.url = req.url.replace('/guang', '');
27 - req.url = `/guang${req.url}`;  
28 - break; 27 + req.url = `//m.yohobuy.com/guang${req.url}`;
  28 + return res.redirect(301, req.url);
29 case 'list': // list 29 case 'list': // list
30 case 'cdnsrclist':// CDN list 回源域名 30 case 'cdnsrclist':// CDN list 回源域名
31 if (req.path === '/') { 31 if (req.path === '/') {
1 /** 1 /**
2 * URL 重写(主要用于兼容原来PHP的连接) 2 * URL 重写(主要用于兼容原来PHP的连接)
3 */ 3 */
  4 +const querystring = require('querystring');
4 const helpers = global.yoho.helpers; 5 const helpers = global.yoho.helpers;
5 6
6 module.exports = () => { 7 module.exports = () => {
@@ -71,6 +72,11 @@ module.exports = () => { @@ -71,6 +72,11 @@ module.exports = () => {
71 req.url = `/product/${req.url}`; 72 req.url = `/product/${req.url}`;
72 } 73 }
73 74
  75 + if (/^\/list/.test(req.url)) {
  76 + // 列表页路由重写 新路由
  77 + req.url = `/product/index/index?${querystring.stringify(req.query)}`;
  78 + }
  79 +
74 next(); 80 next();
75 }; 81 };
76 }; 82 };
@@ -12,7 +12,7 @@ exports.getUrlData = function(type, gender) { @@ -12,7 +12,7 @@ exports.getUrlData = function(type, gender) {
12 const urlData = { 12 const urlData = {
13 indexUrl: helpers.urlFormat('/?go=1'), // 首页 13 indexUrl: helpers.urlFormat('/?go=1'), // 首页
14 categoryUrl: helpers.urlFormat('/cate'), // 分类 14 categoryUrl: helpers.urlFormat('/cate'), // 分类
15 - guangUrl: helpers.urlFormat('', gender ? {gender: gender} : null, 'guang'), // 逛首页 15 + guangUrl: helpers.urlFormat('/guang', gender ? {gender: gender} : null), // 逛首页
16 shoppingCartUrl: helpers.urlFormat('/cart/index/index'), // 购物车 16 shoppingCartUrl: helpers.urlFormat('/cart/index/index'), // 购物车
17 mineUrl: helpers.urlFormat('/home') // 个人中心 17 mineUrl: helpers.urlFormat('/home') // 个人中心
18 }; 18 };
@@ -11,10 +11,10 @@ @@ -11,10 +11,10 @@
11 <meta content="telephone=no" name="format-detection" /> 11 <meta content="telephone=no" name="format-detection" />
12 <meta content="email=no" name="format-detection" /> 12 <meta content="email=no" name="format-detection" />
13 <meta name="referrer" content="always"> 13 <meta name="referrer" content="always">
14 - {{# cononical}} 14 + {{# canonical}}
15 <meta name="applicable-device" content="mobile"> 15 <meta name="applicable-device" content="mobile">
16 - <link rel="cononical" href="{{currentHref}}">  
17 - {{/ cononical}} 16 + <link rel="canonical" href="{{currentHref}}">
  17 + {{/ canonical}}
18 {{#if miphtml}} 18 {{#if miphtml}}
19 <link rel="miphtml" href="{{miphtml}}"> 19 <link rel="miphtml" href="{{miphtml}}">
20 {{/if}} 20 {{/if}}
@@ -34,9 +34,9 @@ @@ -34,9 +34,9 @@
34 <div class="good-detail-img"> 34 <div class="good-detail-img">
35 <a class="good-thumb" href="{{url}}"> 35 <a class="good-thumb" href="{{url}}">
36 {{#if @root._noLazy}} 36 {{#if @root._noLazy}}
37 - <img src="{{image2 default_images w=235 h=314 q=60}}"/> 37 + <img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
38 {{else}} 38 {{else}}
39 - <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}"/> 39 + <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
40 {{/if}} 40 {{/if}}
41 </a> 41 </a>
42 {{# is_soon_sold_out}} 42 {{# is_soon_sold_out}}
@@ -77,13 +77,13 @@ @@ -77,13 +77,13 @@
77 </a> 77 </a>
78 </li> 78 </li>
79 <li> 79 <li>
80 - <a href="{{ shoppingCartUrl }}"> 80 + <a href="{{ shoppingCartUrl }}" rel="nofollow">
81 <i class="iconfont">&#xe62c;</i> 81 <i class="iconfont">&#xe62c;</i>
82 <span>购物车</span> 82 <span>购物车</span>
83 </a> 83 </a>
84 </li> 84 </li>
85 <li> 85 <li>
86 - <a href="{{ mineUrl }}"> 86 + <a href="{{ mineUrl }}" rel="nofollow">
87 <i class="iconfont">&#xe62b;</i> 87 <i class="iconfont">&#xe62b;</i>
88 <span>我的</span> 88 <span>我的</span>
89 </a> 89 </a>
@@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
7 <li> 7 <li>
8 <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}"> 8 <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}">
9 {{#within @index 3}} 9 {{#within @index 3}}
10 - <img src="{{image2 cover_url w=640 h=250 q=60}}"/> 10 + <img src="{{image2 cover_url w=640 h=250 q=60}}" alt="{{title}}"/>
11 {{^}} 11 {{^}}
12 - <img class="lazy" data-original="{{image2 cover_url w=640 h=250 q=60}}"/> 12 + <img class="lazy" data-original="{{image2 cover_url w=640 h=250 q=60}}" alt="{{title}}"/>
13 {{/within}} 13 {{/within}}
14 <p class="discount-cont"> 14 <p class="discount-cont">
15 <span class="discount-title">{{title}}</span> 15 <span class="discount-title">{{title}}</span>
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 {{# list}} 24 {{# list}}
25 <div class="brand-wall-box"> 25 <div class="brand-wall-box">
26 <a href="{{url}}"> 26 <a href="{{url}}">
27 - <img class="lazy" data-original="{{img}}"></img> 27 + <img class="lazy" data-original="{{img}}" alt="{{brandName}}"></img>
28 <div class="brand-name">{{brandName}}</div> 28 <div class="brand-name">{{brandName}}</div>
29 </a> 29 </a>
30 </div> 30 </div>
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 {{# list}} 37 {{# list}}
38 <div class="brand-wall-box"> 38 <div class="brand-wall-box">
39 <a href="{{url}}"> 39 <a href="{{url}}">
40 - <img class="lazy" data-original="{{img}}"></img> 40 + <img class="lazy" data-original="{{img}}" alt="{{brandName}}"></img>
41 <div class="brand-name">{{brandName}}</div> 41 <div class="brand-name">{{brandName}}</div>
42 </a> 42 </a>
43 </div> 43 </div>
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 </div> 57 </div>
58 {{/ consults}} 58 {{/ consults}}
59 </div> 59 </div>
60 - <a class="consult-content-footer tap-hightlight" href="{{consultsUrl}}"> 60 + <a class="consult-content-footer tap-hightlight" href="{{consultsUrl}}" rel="nofollow">
61 查看更多 61 查看更多
62 <span class="iconfont">&#xe604;</span> 62 <span class="iconfont">&#xe604;</span>
63 </a> 63 </a>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 {{#unless @root.wap.common.removeCartCount}} 3 {{#unless @root.wap.common.removeCartCount}}
4 <input type="hidden" id="remove-cart-count" value="1"> 4 <input type="hidden" id="remove-cart-count" value="1">
5 {{/unless}} 5 {{/unless}}
6 - <a class="new-foot-ico" href="{{cartUrl}}"> 6 + <a class="new-foot-ico" href="{{cartUrl}}" rel="nofollow">
7 <div class="num-incart iconfont"> 7 <div class="num-incart iconfont">
8 <span class="num-tag {{#unless @root.cartCount}}hide{{/unless}}">{{@root.cartCount}}</span> 8 <span class="num-tag {{#unless @root.cartCount}}hide{{/unless}}">{{@root.cartCount}}</span>
9 &#xe62c; 9 &#xe62c;
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 <div class="goods-discount" id="goodsDiscount"> 3 <div class="goods-discount" id="goodsDiscount">
4 {{#each promotion}} 4 {{#each promotion}}
5 {{#if @first}} 5 {{#if @first}}
6 - <h1 class="first-item short-text tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1> 6 + <h2 class="first-item short-text tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}<span class="icon-down iconfont dropdown">&#xe609;</span></h2>
7 {{else}} 7 {{else}}
8 <div class="discount-folder"> 8 <div class="discount-folder">
9 - <h1 class="folder-item tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}</h1> 9 + <h2 class="folder-item tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}</h2>
10 </div> 10 </div>
11 {{/if}} 11 {{/if}}
12 {{/each}} 12 {{/each}}
@@ -206,9 +206,9 @@ $.extend({ @@ -206,9 +206,9 @@ $.extend({
206 206
207 // 未登录 207 // 未登录
208 $op.prepend( 208 $op.prepend(
209 - '<a href="/signin.html?refer=' + location.href + '">登录</a>' + 209 + '<a href="/signin.html?refer=' + location.href + '" rel="nofollow">登录</a>' +
210 '<span class="sep-line">|</span>' + 210 '<span class="sep-line">|</span>' +
211 - '<a href="/reg.html">注册</a>' 211 + '<a href="/reg.html" rel="nofollow">注册</a>'
212 ); 212 );
213 } else { 213 } else {
214 214
@@ -29,7 +29,7 @@ const getComments = () => { @@ -29,7 +29,7 @@ const getComments = () => {
29 29
30 $.ajax({ 30 $.ajax({
31 type: 'get', 31 type: 'get',
32 - url: '//guang.m.yohobuy.com/guang/info/getComments', 32 + url: '//m.yohobuy.com/guang/info/getComments',
33 data: { 33 data: {
34 article_id: article_id, 34 article_id: article_id,
35 page: page++ 35 page: page++
@@ -63,6 +63,10 @@ $nav.bind('contextmenu', function() { @@ -63,6 +63,10 @@ $nav.bind('contextmenu', function() {
63 }); 63 });
64 $nav.on('touchend touchcancel', function(e) { 64 $nav.on('touchend touchcancel', function(e) {
65 65
  66 + if ($(e.target).closest('.news-jump').length > 0) {
  67 + return true;
  68 + }
  69 +
66 let $this = $(e.target).closest('.guang-nav-item'), 70 let $this = $(e.target).closest('.guang-nav-item'),
67 $content, 71 $content,
68 index; 72 index;
@@ -62,7 +62,7 @@ export class IndexView extends View { @@ -62,7 +62,7 @@ export class IndexView extends View {
62 62
63 this.indexModel.loadMoreAjax({ 63 this.indexModel.loadMoreAjax({
64 type: 'GET', 64 type: 'GET',
65 - url: '/news/index/page', 65 + url: '/guang/news/index/page',
66 dataType: 'html', 66 dataType: 'html',
67 data: that.navState[index] 67 data: that.navState[index]
68 }).then(rdata => { 68 }).then(rdata => {
@@ -873,6 +873,11 @@ $focus-size: 42px; @@ -873,6 +873,11 @@ $focus-size: 42px;
873 overflow: visible; 873 overflow: visible;
874 } 874 }
875 } 875 }
  876 +
  877 + .a-anchor {
  878 + color: #93b4c5;
  879 + text-decoration: underline;
  880 + }
876 } 881 }
877 882
878 .guang-detail-page.menu-open { 883 .guang-detail-page.menu-open {
@@ -75,6 +75,10 @@ @@ -75,6 +75,10 @@
75 &.focus { 75 &.focus {
76 color: #000; 76 color: #000;
77 } 77 }
  78 +
  79 + &.news-jump a {
  80 + color: inherit;
  81 + }
78 } 82 }
79 83
80 .bytouch { 84 .bytouch {
@@ -87,6 +87,9 @@ $focus-size: 42px; @@ -87,6 +87,9 @@ $focus-size: 42px;
87 87
88 img { 88 img {
89 height: auto; 89 height: auto;
  90 + width: auto;
  91 + max-width: 100%;
  92 + color: #fff;
90 } 93 }
91 } 94 }
92 95
@@ -877,6 +880,11 @@ $focus-size: 42px; @@ -877,6 +880,11 @@ $focus-size: 42px;
877 overflow: visible; 880 overflow: visible;
878 } 881 }
879 } 882 }
  883 +
  884 + .a-anchor {
  885 + color: #93b4c5;
  886 + text-decoration: underline;
  887 + }
880 } 888 }
881 889
882 .news-detail-page.menu-open { 890 .news-detail-page.menu-open {
@@ -560,7 +560,7 @@ $basicBtnC: #eb0313; @@ -560,7 +560,7 @@ $basicBtnC: #eb0313;
560 float: left; 560 float: left;
561 font-size: 34.59px; 561 font-size: 34.59px;
562 562
563 - h1 { 563 + h2 {
564 display: inline-block; 564 display: inline-block;
565 line-height: 88px; 565 line-height: 88px;
566 } 566 }
@@ -603,7 +603,7 @@ $basicBtnC: #eb0313; @@ -603,7 +603,7 @@ $basicBtnC: #eb0313;
603 font-size: 24px; 603 font-size: 24px;
604 border-bottom: 1px solid #e0e0e0; 604 border-bottom: 1px solid #e0e0e0;
605 605
606 - h1 { 606 + h2 {
607 display: inline-block; 607 display: inline-block;
608 line-height: 88px; 608 line-height: 88px;
609 } 609 }
@@ -729,7 +729,7 @@ $basicBtnC: #eb0313; @@ -729,7 +729,7 @@ $basicBtnC: #eb0313;
729 color: $mainFontC; 729 color: $mainFontC;
730 font-size: 28px; 730 font-size: 28px;
731 731
732 - h1 { 732 + h2 {
733 position: relative; 733 position: relative;
734 padding: 30px 60px 30px 30px; 734 padding: 30px 60px 30px 30px;
735 line-height: 36px; 735 line-height: 36px;
@@ -111,7 +111,10 @@ class DetailProcess { @@ -111,7 +111,10 @@ class DetailProcess {
111 value.img = _.replace(value.img, '/quality/80', '/quality/70'); 111 value.img = _.replace(value.img, '/quality/80', '/quality/70');
112 112
113 bannerList.push({ 113 bannerList.push({
114 - img: value.img 114 + img: value.img,
  115 + imgAlt: _.compact([origin.brand_info.brand_name_en, origin.brand_info.brand_name_cn,
  116 + (_.get(origin, 'gender', '1') === '1' ? '男' : '女'), origin.small_sort_name,
  117 + origin.product_name]).join('|')
115 }); 118 });
116 }); 119 });
117 120
@@ -83,7 +83,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, top) => { @@ -83,7 +83,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, top) => {
83 id: articleData.id, 83 id: articleData.id,
84 showTags: showTag, 84 showTags: showTag,
85 img: articleData.src ? helpers.image(articleData.src, 640, 640) : '', 85 img: articleData.src ? helpers.image(articleData.src, 640, 640) : '',
86 - url: isApp ? `${helpers.https(articleData.url)}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${articleData.id}"},"shareparam":{"id":"${articleData.id}"},"share":"/guang/api/v1/share/guang","id":${articleData.id},"type":1,"url":"http:${helpers.urlFormat('/info/index', null, 'guang')}","islogin":"N"}}` : articleData.url, //eslint-disable-line 86 + url: isApp ? `//m.yohobuy.com/guang/info/${articleData.id}.html?openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${articleData.id}"},"shareparam":{"id":"${articleData.id}"},"share":"/guang/api/v1/share/guang","id":${articleData.id},"type":1,"url":"http://m.yohobuy.com/guang/info/${articleData.id}.html","islogin":"N"}}` : `//m.yohobuy.com/guang/info/${articleData.id}.html`, //eslint-disable-line
87 title: articleData.title, 87 title: articleData.title,
88 text: articleData.intro, 88 text: articleData.intro,
89 publishTime: articleData.publish_time, 89 publishTime: articleData.publish_time,
@@ -246,7 +246,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW @@ -246,7 +246,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW
246 newText = value.text.data.text; 246 newText = value.text.data.text;
247 } 247 }
248 finalDetail.push({ 248 finalDetail.push({
249 - text: newText 249 + text: newText.replace(/www.yohobuy.com\/chanpin\//ig, 'm.yohobuy.com/chanpin/')
250 }); 250 });
251 } 251 }
252 252
@@ -237,6 +237,8 @@ exports.processProductList = (list, options) => { @@ -237,6 +237,8 @@ exports.processProductList = (list, options) => {
237 237
238 product.seoTitle = `${product.brand_name}|${seoGender}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line 238 product.seoTitle = `${product.brand_name}|${seoGender}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line
239 239
  240 + product.imgAlt = _.compact([product.brand_name, (product.gender ? GENDER[product.gender] : false), product.small_sort_name, product.product_name]).join('|');
  241 +
240 pruductList.push(product); 242 pruductList.push(product);
241 }); 243 });
242 244
@@ -4,12 +4,6 @@ @@ -4,12 +4,6 @@
4 * @date: 2016/7/29 4 * @date: 2016/7/29
5 */ 5 */
6 6
7 -const _getGender = {  
8 - '1,3': '男生',  
9 - '2,3': '女生',  
10 - '1,2,3': '',  
11 -};  
12 -  
13 /** 7 /**
14 * 根据频道判断出性别 8 * 根据频道判断出性别
15 */ 9 */
@@ -86,9 +80,9 @@ const getListSeoData = (gender, sort_name) => { @@ -86,9 +80,9 @@ const getListSeoData = (gender, sort_name) => {
86 80
87 if (gender && sort_name) { 81 if (gender && sort_name) {
88 seoData = { 82 seoData = {
89 - title: `${sort_name}|新款${sort_name}${_getGender[gender]}|品牌正品|YOHO!BUY有货`,  
90 - keywords: `新款${sort_name},${_getGender[gender]}${sort_name},品牌正品`,  
91 - description: `正品网购!YOHO!BUY有货提供新款${sort_name}${_getGender[gender]}${sort_name}100%品牌正品保证,支持货到付款。` 83 + title: `${sort_name}|新款${sort_name},${sort_name}品牌正品|YOHO!BUY有货`,
  84 + keywords: `${sort_name},新款${sort_name}${sort_name}品牌正品`,
  85 + description: `有货网${sort_name}专卖店销售正品新款${sort_name},支持货到付款。了解新款${sort_name}${sort_name}品牌价格、评价、图片等信息,网购超低折扣新款${sort_name}就上有货网。` // eslint-disable-line
92 }; 86 };
93 } 87 }
94 return seoData; 88 return seoData;
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-03-23 11:02:31 3 * @Date: 2017-03-23 11:02:31
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-08-11 11:40:02  
6 */ 5 */
7 /* 红人店铺数据处理 */ 6 /* 红人店铺数据处理 */
8 7
@@ -11,6 +10,11 @@ @@ -11,6 +10,11 @@
11 const _ = require('lodash'); 10 const _ = require('lodash');
12 const helpers = global.yoho.helpers; 11 const helpers = global.yoho.helpers;
13 const productPrcs = require('./product-process'); 12 const productPrcs = require('./product-process');
  13 +const GENDER = {
  14 + 1: '男',
  15 + 2: '女',
  16 + 3: '男|女'
  17 +};
14 18
15 let countCarouselImage = 0; // 轮播图模块统计 19 let countCarouselImage = 0; // 轮播图模块统计
16 20
@@ -343,10 +347,15 @@ const pushGoodsInfo = (decorators, goodsList) => { @@ -343,10 +347,15 @@ const pushGoodsInfo = (decorators, goodsList) => {
343 if (salesPrice === 0) { 347 if (salesPrice === 0) {
344 decorators[key].noShowProductInfo = true; 348 decorators[key].noShowProductInfo = true;
345 } 349 }
  350 +
346 decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, ''); 351 decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, '');
347 decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : ''; 352 decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : '';
348 decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : ''; 353 decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : '';
349 decorators[key].pics[subKey].isGood = true; 354 decorators[key].pics[subKey].isGood = true;
  355 + decorators[key].pics[subKey].alt = _.get(goodsObj, `${subValue.skn}.brand_name`, '') +
  356 + '|' + GENDER[_.get(goodsObj, `${subValue.skn}.gender`, '3')] +
  357 + '|' + _.get(goodsObj, `${subValue.skn}.small_sort_name`, '') +
  358 + '|' + _.get(goodsObj, `${subValue.skn}.product_name`, '');
350 359
351 if (value.module_type === 'TripleImage' || 360 if (value.module_type === 'TripleImage' ||
352 value.module_type === 'DoubleImage' || 361 value.module_type === 'DoubleImage' ||