Authored by 郭成尧

title-alt-process

... ... @@ -11,12 +11,17 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const qs = require('querystring');
const tdk = require('../../../utils/getTDK');
const helpers = global.yoho.helpers;
const GENDER = {
'1,3': '男',
'2,3': '女'
};
const newDetail = {
index(req, res, next) {
let id;
let goodsId;
let productSkn;
let gender = req.cookies._Gender;
if (req.query.id) {
id = req.query.id;
... ... @@ -62,7 +67,7 @@ const newDetail = {
pageHeader: headerData,
result: result,
page: 'new-detail',
title: `${result.brandName}${result.sortName}${result.goodsName}|YOHO!BUY 有货`,
title: `${result.brandName}${GENDER[gender]}${result.sortName}${result.goodsName}|YOHO!BUY 有货`,
keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' +
result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' +
result.brandName + '折扣店,' +
... ...
... ... @@ -53,11 +53,11 @@
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}" title="{{product_name}}">
<a class="good-thumb" href="{{url}}" title="{{seoTitle}}">
{{#if @root._noLazy}}
<img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{product_name}}"/>
<img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/>
{{else}}
<img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{product_name}}"/>
<img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/>
{{/if}}
</a>
{{# is_soon_sold_out}}
... ... @@ -79,7 +79,7 @@
</div>
<div class="good-detail-text">
<div class="name">
<a href="{{url}}">{{product_name}}</a>
<a href="{{url}}" title="{{seoTitle}}">{{product_name}}</a>
</div>
<div class="price">
{{#if @root.saleViplogin}}
... ...
... ... @@ -2,7 +2,6 @@
* @Author: Targaryen
* @Date: 2017-06-20 15:48:39
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-20 16:04:05
*/
const _ = require('lodash');
const helpers = global.yoho.helpers;
... ... @@ -129,7 +128,7 @@ class DetailProcess {
// 底部简介URL链接
dest.introUrl = '/product/detail/intro/' + origin.product_skn;
dest.brandName = _.get(origin, 'brand_info.brand_name', '');
dest.sortName = _.get(origin, 'middle_sort_name', '');
dest.sortName = _.get(origin, 'small_sort_name', '');
return dest;
}
... ...
... ... @@ -2,6 +2,10 @@
require('../app');
const _ = require('lodash');
const helpers = global.yoho.helpers;
const GENDER = {
'1,3': '男',
'2,3': '女'
};
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3
... ... @@ -228,6 +232,8 @@ exports.processProductList = (list, options) => {
product.similar = true;
}
product.seoTitle = `${product.brand_name}|${options.gender ? GENDER[options.gender] + '|': ''}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line
pruductList.push(product);
});
... ...