Authored by 郭成尧

Merge branches 'hotfix/sale' and 'hotfix/sale' of git.yoho.cn:fe/yohobuywap-node into hotfix/sale

... ... @@ -309,7 +309,7 @@ const index = (req, res, next) => {
showAnaJson: {
miptitle: data.title,
mipPublishTime: guang.detail.publishTime,
mipPics: [mipPic],
mipPic: mipPic,
mipDes: guang.shareDesc,
mipUrl: `${req.protocol}://m.yohobuy.com/guang/${id}.html`
}
... ...
... ... @@ -219,7 +219,7 @@ const detailIndex = (req, res, next) => {
miptitle: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`,
mipId: id,
mipPublishTime: mipPublishTime,
mipPics: [mipPic],
mipPic: mipPic,
mipDes: detail.getArticle.article_summary,
mipUrl: `${req.protocol}://m.yohobuy.com${req.originalUrl}`,
miphtml: `${req.protocol}://m.yohobuy.com/mip/guang/${id}.html`
... ...
... ... @@ -58,16 +58,12 @@ const newDetail = {
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' +
JSON.stringify(appParams) +
'}';
let mipPics = _.map(_.get(result, 'bannerTop.list', []), item => {
return item.img.replace(/\?(.*)/g, '?imageView2/{mode}/w/{width}/h/{height}');
});
let mipPic = _.get(result, 'bannerTop.list[0].img', '');
if (mipPics.length <= 0) {
mipPics.push(_.get(result, 'bannerTop.img', '').replace(
/\?(.*)/g,
'?imageView2/{mode}/w/{width}/h/{height}'
));
}
mipPic = (mipPic ? mipPic : _.get(result, 'bannerTop.img', '')).replace(
/\?(.*)/g,
'?imageView2/{mode}/w/{width}/h/{height}'
);
let title = `【${result.brandName}${result.sortName}${result.goodsName}|YOHO!BUY 有货`;
let description = result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' +
... ... @@ -91,7 +87,7 @@ const newDetail = {
showAnaJson: {
miptitle: title,
mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填
mipPics: mipPics.slice(0, 5),
mipPic: mipPic,
mipDes: description,
mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html`
},
... ...
{{# showAnaJson}}
<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script>
<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
... ... @@ -6,13 +7,7 @@
"appid": "1583402501013173",
"title": "{{miptitle}}",
"images": [
{{# mipPics}}
{{#isEqualOr @index 0}}
{{#if .}}"http:{{image . 750 500 1}}"{{/if}}
{{else}}
{{#if .}},"http:{{image . 750 500 1}}"{{/if}}
{{/isEqualOr}}
{{/mipPics}}
{{#if mipPic}}"http:{{image mipPic 750 500 1}}"{{/if}}
],
"description": "{{mipDes}}",
"pubDate": "{{mipPublishTime}}"
... ...