Showing
4 changed files
with
17 additions
and
7 deletions
@@ -11,12 +11,17 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model | @@ -11,12 +11,17 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model | ||
11 | const qs = require('querystring'); | 11 | const qs = require('querystring'); |
12 | const tdk = require('../../../utils/getTDK'); | 12 | const tdk = require('../../../utils/getTDK'); |
13 | const helpers = global.yoho.helpers; | 13 | const helpers = global.yoho.helpers; |
14 | +const GENDER = { | ||
15 | + '1,3': '男', | ||
16 | + '2,3': '女' | ||
17 | +}; | ||
14 | 18 | ||
15 | const newDetail = { | 19 | const newDetail = { |
16 | index(req, res, next) { | 20 | index(req, res, next) { |
17 | let id; | 21 | let id; |
18 | let goodsId; | 22 | let goodsId; |
19 | let productSkn; | 23 | let productSkn; |
24 | + let gender = req.cookies._Gender; | ||
20 | 25 | ||
21 | if (req.query.id) { | 26 | if (req.query.id) { |
22 | id = req.query.id; | 27 | id = req.query.id; |
@@ -62,7 +67,7 @@ const newDetail = { | @@ -62,7 +67,7 @@ const newDetail = { | ||
62 | pageHeader: headerData, | 67 | pageHeader: headerData, |
63 | result: result, | 68 | result: result, |
64 | page: 'new-detail', | 69 | page: 'new-detail', |
65 | - title: `${result.brandName}${result.sortName}${result.goodsName}|YOHO!BUY 有货`, | 70 | + title: `${result.brandName}${GENDER[gender]}${result.sortName}${result.goodsName}|YOHO!BUY 有货`, |
66 | keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' + | 71 | keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' + |
67 | result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' + | 72 | result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' + |
68 | result.brandName + '折扣店,' + | 73 | result.brandName + '折扣店,' + |
@@ -53,11 +53,11 @@ | @@ -53,11 +53,11 @@ | ||
53 | {{/ tags}} | 53 | {{/ tags}} |
54 | </div> | 54 | </div> |
55 | <div class="good-detail-img"> | 55 | <div class="good-detail-img"> |
56 | - <a class="good-thumb" href="{{url}}" title="{{product_name}}"> | 56 | + <a class="good-thumb" href="{{url}}" title="{{seoTitle}}"> |
57 | {{#if @root._noLazy}} | 57 | {{#if @root._noLazy}} |
58 | - <img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{product_name}}"/> | 58 | + <img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/> |
59 | {{else}} | 59 | {{else}} |
60 | - <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{product_name}}"/> | 60 | + <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/> |
61 | {{/if}} | 61 | {{/if}} |
62 | </a> | 62 | </a> |
63 | {{# is_soon_sold_out}} | 63 | {{# is_soon_sold_out}} |
@@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
79 | </div> | 79 | </div> |
80 | <div class="good-detail-text"> | 80 | <div class="good-detail-text"> |
81 | <div class="name"> | 81 | <div class="name"> |
82 | - <a href="{{url}}">{{product_name}}</a> | 82 | + <a href="{{url}}" title="{{seoTitle}}">{{product_name}}</a> |
83 | </div> | 83 | </div> |
84 | <div class="price"> | 84 | <div class="price"> |
85 | {{#if @root.saleViplogin}} | 85 | {{#if @root.saleViplogin}} |
@@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-06-20 15:48:39 | 3 | * @Date: 2017-06-20 15:48:39 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-06-20 16:04:05 | ||
6 | */ | 5 | */ |
7 | const _ = require('lodash'); | 6 | const _ = require('lodash'); |
8 | const helpers = global.yoho.helpers; | 7 | const helpers = global.yoho.helpers; |
@@ -129,7 +128,7 @@ class DetailProcess { | @@ -129,7 +128,7 @@ class DetailProcess { | ||
129 | // 底部简介URL链接 | 128 | // 底部简介URL链接 |
130 | dest.introUrl = '/product/detail/intro/' + origin.product_skn; | 129 | dest.introUrl = '/product/detail/intro/' + origin.product_skn; |
131 | dest.brandName = _.get(origin, 'brand_info.brand_name', ''); | 130 | dest.brandName = _.get(origin, 'brand_info.brand_name', ''); |
132 | - dest.sortName = _.get(origin, 'middle_sort_name', ''); | 131 | + dest.sortName = _.get(origin, 'small_sort_name', ''); |
133 | 132 | ||
134 | return dest; | 133 | return dest; |
135 | } | 134 | } |
@@ -2,6 +2,10 @@ | @@ -2,6 +2,10 @@ | ||
2 | require('../app'); | 2 | require('../app'); |
3 | const _ = require('lodash'); | 3 | const _ = require('lodash'); |
4 | const helpers = global.yoho.helpers; | 4 | const helpers = global.yoho.helpers; |
5 | +const GENDER = { | ||
6 | + '1,3': '男', | ||
7 | + '2,3': '女' | ||
8 | +}; | ||
5 | 9 | ||
6 | /** | 10 | /** |
7 | * 根据性别来决定 默认图片获取字段 如果是 2、3 | 11 | * 根据性别来决定 默认图片获取字段 如果是 2、3 |
@@ -228,6 +232,8 @@ exports.processProductList = (list, options) => { | @@ -228,6 +232,8 @@ exports.processProductList = (list, options) => { | ||
228 | product.similar = true; | 232 | product.similar = true; |
229 | } | 233 | } |
230 | 234 | ||
235 | + product.seoTitle = `${product.brand_name}|${options.gender ? GENDER[options.gender] + '|': ''}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line | ||
236 | + | ||
231 | pruductList.push(product); | 237 | pruductList.push(product); |
232 | }); | 238 | }); |
233 | 239 |
-
Please register or login to post a comment