Authored by 毕凯

Merge branch 'feature/mip' into 'gray'

Feature/mip



See merge request !1093
... ... @@ -10,6 +10,7 @@ const guangProcess = require(`${global.utils}/guang-process`);
const mRoot = '../models';
const DetailModel = require(`${mRoot}/guang`);
const typeLib = require('../../../config/type-lib');
const moment = require('moment');
const channels = {
boys: 1,
girl: 2,
... ... @@ -17,6 +18,10 @@ const channels = {
lifestyle: 4
};
const mipDate = (day) => {
return moment(day).format('YYYY-MM-DDTHH:mm:ss');
};
// const testStr = '';
/**
... ... @@ -202,7 +207,11 @@ const detailIndex = (req, res, next) => {
css: yield css('guang/detail.css'),
gender: gender,
localStyle: processContents.css,
title: detail.getArticle.article_title
title: detail.getArticle.article_title,
mipId: id,
mipPublishTime: mipDate(detail.getArticle.publish_time * 1000),
mipPic: detail.getArticle.cover_image ? detail.getArticle.cover_image.split('?')[0] : '',
mipDes: detail.getArticle.article_summary
}, data));
})().catch(next);
};
... ...
... ... @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<title>{{title}} | Yoho!Buy有货 | 潮流购物逛不停</title>
<link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/v1/mip.css">
<link rel="canonical" href="{{canonical}}">
<link rel="canonical" href="https://www.yohobuy.com/guang/{{mipId}}.html"/>
<style mip-custom>
.main-wrap{width: 100%;max-width: 750px;margin: 0 auto;}
{{css}}
... ... @@ -19,5 +19,20 @@
<script src="https://mipcache.bdstatic.com/static/v1/mip-stats-baidu/mip-stats-baidu.js"></script>
<script src="https://mipcache.bdstatic.com/static/v1/mip-anim/mip-anim.js"></script>
<script src="https://mipcache.bdstatic.com/static/v1/mip-audio/mip-audio.js"></script>
<script src="https://mipcache.bdstatic.com/extensions/platform/v1/mip-cambrian/mip-cambrian.js"></script>
<script type="application/ld+json">
{
@context: "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
@id: "https://m.yohobuy.com/mip/guang/info/{{mipId}}.html",
appid: "1583402501013173",
title: "{{title}} | Yoho!Buy有货 | 潮流购物逛不停",
images: [
"{{mipPic}}"
],
description: "{{mipDes}}",
pubDate: "{{mipPublishTime}}"
}
</script>
</body>
<mip-cambrian site-id="1583402501013173"></mip-cambrian>
</html>
... ...