diff --git a/doraemon/views/partial/product/good.hbs b/doraemon/views/partial/product/good.hbs index c21ae5d..d628cc4 100644 --- a/doraemon/views/partial/product/good.hbs +++ b/doraemon/views/partial/product/good.hbs @@ -43,10 +43,10 @@ {{/ is_solded}} </div> <div class="good-detail-text {{#for_stu}} stu-good-detail {{/for_stu}}"> - <a href="{{url}}" target="_blank"{{#if noFollow}} rel="nofollow"{{/if}}>{{{product_name}}}</a> + <a href="{{url}}" target="_blank" title="{{#if productTitle}}{{productTitle}}{{^}}{{product_name}}{{/if}}" {{#if noFollow}} rel="nofollow"{{/if}}>{{{product_name}}}111</a> <p class="brand"> {{#if brand_name}} - <a href="{{brandUrl}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{brand_name}}</a> + <a href="{{brandUrl}}" title="{{#if productTitle}}{{productTitle}}{{^}}{{product_name}}{{/if}}" {{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{brand_name}}</a> {{/if}} </p> <p class="price {{#if vip}}vip-center{{/if}}"> diff --git a/utils/product-process-simple.js b/utils/product-process-simple.js index 469c045..f81a98f 100644 --- a/utils/product-process-simple.js +++ b/utils/product-process-simple.js @@ -3,13 +3,6 @@ const _ = require('lodash'); const helpers = global.yoho.helpers; const logger = global.yoho.logger; -const genderName = { - 1: '男生', - 2: '女生', - '1,3': '男生', - '2,3': '女生' -}; - /** * 处理接口返回图片链接,兼容非正常链接(如:/2015/10/22/08/023a5aa1cbdac7bdcd1685bfdab118b0c5.jpg) * @@ -199,8 +192,17 @@ exports.processProductList = (list, options) => { isfew ? proInfo.is_few = isfew : delete proInfo.is_few; } - proInfo.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name, - genderName[product.gender], product.small_sort_name, product.product_name]).join('|'); + let genderStr = ''; + + if (options.from.params.gender === '1,3') { + genderStr = '男士'; + } else if (options.from.params.gender === '2,3') { + genderStr = '女士'; + } else { + genderStr = ''; + } + + proInfo.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}】${product.product_name}`; if (options.query && _.isString(proInfo.product_name)) { try { diff --git a/utils/product-process.js b/utils/product-process.js index 0be2956..ee68eb2 100644 --- a/utils/product-process.js +++ b/utils/product-process.js @@ -131,13 +131,6 @@ const procProductImgs = (item, gender) => { } }; -const genderName = { - 1: '男生', - 2: '女生', - '1,3': '男生', - '2,3': '女生' -}; - /** * 商品搜索商品数据处理 */ @@ -339,8 +332,17 @@ exports.processProductList = (list, options) => { isfew ? product.is_few = isfew : delete product.is_few; } - product.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name, - genderName[product.gender], product.small_sort_name, product.product_name]).join('|'); + let genderStr = ''; + + if (options.from.params.gender === '1,3') { + genderStr = '男士'; + } else if (options.from.params.gender === '2,3') { + genderStr = '女士'; + } else { + genderStr = ''; + } + + product.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}】${product.product_name}`; if (options.query && _.isString(product.product_name)) { try {