Merge branches 'hotfix/sale' and 'hotfix/sale' of git.yoho.cn:fe/yohobuywap-node into hotfix/sale
Showing
4 changed files
with
10 additions
and
19 deletions
@@ -309,7 +309,7 @@ const index = (req, res, next) => { | @@ -309,7 +309,7 @@ const index = (req, res, next) => { | ||
309 | showAnaJson: { | 309 | showAnaJson: { |
310 | miptitle: data.title, | 310 | miptitle: data.title, |
311 | mipPublishTime: guang.detail.publishTime, | 311 | mipPublishTime: guang.detail.publishTime, |
312 | - mipPics: [mipPic], | 312 | + mipPic: mipPic, |
313 | mipDes: guang.shareDesc, | 313 | mipDes: guang.shareDesc, |
314 | mipUrl: `${req.protocol}://m.yohobuy.com/guang/${id}.html` | 314 | mipUrl: `${req.protocol}://m.yohobuy.com/guang/${id}.html` |
315 | } | 315 | } |
@@ -219,7 +219,7 @@ const detailIndex = (req, res, next) => { | @@ -219,7 +219,7 @@ const detailIndex = (req, res, next) => { | ||
219 | miptitle: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`, | 219 | miptitle: `${detail.getArticle.article_title} | Yoho!Buy有货 | 潮流购物逛不停`, |
220 | mipId: id, | 220 | mipId: id, |
221 | mipPublishTime: mipPublishTime, | 221 | mipPublishTime: mipPublishTime, |
222 | - mipPics: [mipPic], | 222 | + mipPic: mipPic, |
223 | mipDes: detail.getArticle.article_summary, | 223 | mipDes: detail.getArticle.article_summary, |
224 | mipUrl: `${req.protocol}://m.yohobuy.com${req.originalUrl}`, | 224 | mipUrl: `${req.protocol}://m.yohobuy.com${req.originalUrl}`, |
225 | miphtml: `${req.protocol}://m.yohobuy.com/mip/guang/${id}.html` | 225 | miphtml: `${req.protocol}://m.yohobuy.com/mip/guang/${id}.html` |
@@ -58,16 +58,12 @@ const newDetail = { | @@ -58,16 +58,12 @@ const newDetail = { | ||
58 | let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' + | 58 | let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' + |
59 | JSON.stringify(appParams) + | 59 | JSON.stringify(appParams) + |
60 | '}'; | 60 | '}'; |
61 | - let mipPics = _.map(_.get(result, 'bannerTop.list', []), item => { | ||
62 | - return item.img.replace(/\?(.*)/g, '?imageView2/{mode}/w/{width}/h/{height}'); | ||
63 | - }); | 61 | + let mipPic = _.get(result, 'bannerTop.list[0].img', ''); |
64 | 62 | ||
65 | - if (mipPics.length <= 0) { | ||
66 | - mipPics.push(_.get(result, 'bannerTop.img', '').replace( | ||
67 | - /\?(.*)/g, | ||
68 | - '?imageView2/{mode}/w/{width}/h/{height}' | ||
69 | - )); | ||
70 | - } | 63 | + mipPic = (mipPic ? mipPic : _.get(result, 'bannerTop.img', '')).replace( |
64 | + /\?(.*)/g, | ||
65 | + '?imageView2/{mode}/w/{width}/h/{height}' | ||
66 | + ); | ||
71 | 67 | ||
72 | let title = `【${result.brandName}${result.sortName}】${result.goodsName}|YOHO!BUY 有货`; | 68 | let title = `【${result.brandName}${result.sortName}】${result.goodsName}|YOHO!BUY 有货`; |
73 | let description = result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' + | 69 | let description = result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' + |
@@ -91,7 +87,7 @@ const newDetail = { | @@ -91,7 +87,7 @@ const newDetail = { | ||
91 | showAnaJson: { | 87 | showAnaJson: { |
92 | miptitle: title, | 88 | miptitle: title, |
93 | mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填 | 89 | mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'), // mip日期必填 |
94 | - mipPics: mipPics.slice(0, 5), | 90 | + mipPic: mipPic, |
95 | mipDes: description, | 91 | mipDes: description, |
96 | mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html` | 92 | mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html` |
97 | }, | 93 | }, |
1 | {{# showAnaJson}} | 1 | {{# showAnaJson}} |
2 | +<script src="//msite.baidu.com/sdk/c.js?appid=1583402501013173"></script> | ||
2 | <script type="application/ld+json"> | 3 | <script type="application/ld+json"> |
3 | { | 4 | { |
4 | "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld", | 5 | "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld", |
@@ -6,13 +7,7 @@ | @@ -6,13 +7,7 @@ | ||
6 | "appid": "1583402501013173", | 7 | "appid": "1583402501013173", |
7 | "title": "{{miptitle}}", | 8 | "title": "{{miptitle}}", |
8 | "images": [ | 9 | "images": [ |
9 | - {{# mipPics}} | ||
10 | - {{#isEqualOr @index 0}} | ||
11 | - {{#if .}}"http:{{image . 750 500 1}}"{{/if}} | ||
12 | - {{else}} | ||
13 | - {{#if .}},"http:{{image . 750 500 1}}"{{/if}} | ||
14 | - {{/isEqualOr}} | ||
15 | - {{/mipPics}} | 10 | + {{#if mipPic}}"http:{{image mipPic 750 500 1}}"{{/if}} |
16 | ], | 11 | ], |
17 | "description": "{{mipDes}}", | 12 | "description": "{{mipDes}}", |
18 | "pubDate": "{{mipPublishTime}}" | 13 | "pubDate": "{{mipPublishTime}}" |
-
Please register or login to post a comment