Authored by 张孝茹

详情页 alt 全球购 tdk

... ... @@ -2,6 +2,7 @@
const headerModel = require('../../../doraemon/models/header');
const model = require('../models/global');
const _ = require('lodash');
const list = (req, res, next) => {
let brand = req.query.brand;
... ... @@ -84,6 +85,13 @@ const detail = (req, res, next) => {
let appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.globalpurchase","params":${JSON.stringify(appParams)}}`;
res.render('global/detail', {
title: (_.get(result, 'brand_info.brand_name', '') ? '【' + result.brand_info.brand_name + '】' : '') +
_.get(result, 'product_name', '') + '|YOHO!BUY 有货',
keywords: _.get(result, 'brand_info.brand_name', '') + ',' + _.get(result, 'brand_info.brand_name', '') +
'价格,' + _.get(result, 'brand_info.brand_name', '') + '图片,',
description: _.get(result, 'product_name', '') + ' 有货网仅售' + _.get(result, 'sales_price', '') + '元,购买' +
_.get(result, 'brand_info.brand_name', '') + ',了解' + _.get(result, 'brand_info.brand_name', '') +
'商品信息就上有货网!',
module: 'product',
page: 'global-detail',
pageHeader: headerModel.setNav({
... ...
... ... @@ -4,6 +4,7 @@ const utils = '../../../utils';
const productProcess = require(`${utils}/product-process`);
const globalapi = global.yoho.GlobalAPI;
const $ = require('cheerio');
const _ = require('lodash');
exports.list = (param) => {
return globalapi.get('product/api/v2/detail/getlist', param).then((result) => {
... ... @@ -46,13 +47,15 @@ exports.detail = (param) => {
if (goods.length === 1) {
result.bannerTop = {
img: (goods[0].images_list[0] || {}).image_url
img: (goods[0].images_list[0] || {}).image_url,
imgAlt: _.get(result, 'brand_info.brand_name', '') + '|' + _.get(result, 'product_name', '')
};
} else {
result.bannerTop = {
list: goods.map((g) => {
return {
img: (g.images_list[0] || {}).image_url
img: (g.images_list[0] || {}).image_url,
imgAlt: _.get(result, 'brand_info', 'brand_name', '') + '|' + _.get(result, 'product_name', '')
};
})
};
... ...
... ... @@ -20,7 +20,7 @@
{{/ bannerTop}}
</div>
<div class="goods-name"><span class="name">{{product_name}}</span></div>
<div class="goods-name"><h1 class="name">{{product_name}}</h1></div>
<div class="price-date">
<div>
... ...
... ... @@ -6,9 +6,9 @@
<li class="swiper-slide">
<a href="javascript:;">
{{#if @first}}
<img src="{{image2 img w=450 h=600 q=60}}" alt="">
<img src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
{{else}}
<img class="swiper-lazy" data-src="{{image2 img w=450 h=600 q=60}}" alt="">
<img class="swiper-lazy" data-src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
{{/if}}
</a>
</li>
... ... @@ -27,10 +27,10 @@
<div class="banner-top-single">
{{#if url}}
<a href="{{url}}">
<img class="img" src="{{image2 img w=450 h=600 q=60}}">
<img class="img" src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
</a>
{{^}}
<img class="img" src="{{image2 img w=450 h=600 q=60}}">
<img class="img" src="{{image2 img w=450 h=600 q=60}}" alt="{{imgAlt}}">
{{/if}}
</div>
... ...
... ... @@ -111,7 +111,11 @@ class DetailProcess {
value.img = _.replace(value.img, '/quality/80', '/quality/70');
bannerList.push({
img: value.img
img: value.img,
imgAlt: _.get(origin, 'brand_info.brand_name_en', '') + '|' +
_.get(origin, 'brand_info.brand_name_cn', '') + '|' +
(_.get(origin, 'gender', '1') === '1' ? '男' : '女') + '|' +
_.get(origin, 'small_sort_name', '') + '|' + _.get(origin, 'product_name', '')
});
});
... ...