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`); @@ -10,6 +10,7 @@ const guangProcess = require(`${global.utils}/guang-process`);
10 const mRoot = '../models'; 10 const mRoot = '../models';
11 const DetailModel = require(`${mRoot}/guang`); 11 const DetailModel = require(`${mRoot}/guang`);
12 const typeLib = require('../../../config/type-lib'); 12 const typeLib = require('../../../config/type-lib');
  13 +const moment = require('moment');
13 const channels = { 14 const channels = {
14 boys: 1, 15 boys: 1,
15 girl: 2, 16 girl: 2,
@@ -17,6 +18,10 @@ const channels = { @@ -17,6 +18,10 @@ const channels = {
17 lifestyle: 4 18 lifestyle: 4
18 }; 19 };
19 20
  21 +const mipDate = (day) => {
  22 + return moment(day).format('YYYY-MM-DDTHH:mm:ss');
  23 +};
  24 +
20 // const testStr = ''; 25 // const testStr = '';
21 26
22 /** 27 /**
@@ -202,7 +207,11 @@ const detailIndex = (req, res, next) => { @@ -202,7 +207,11 @@ const detailIndex = (req, res, next) => {
202 css: yield css('guang/detail.css'), 207 css: yield css('guang/detail.css'),
203 gender: gender, 208 gender: gender,
204 localStyle: processContents.css, 209 localStyle: processContents.css,
205 - title: detail.getArticle.article_title 210 + title: detail.getArticle.article_title,
  211 + mipId: id,
  212 + mipPublishTime: mipDate(detail.getArticle.publish_time * 1000),
  213 + mipPic: detail.getArticle.cover_image ? detail.getArticle.cover_image.split('?')[0] : '',
  214 + mipDes: detail.getArticle.article_summary
206 }, data)); 215 }, data));
207 })().catch(next); 216 })().catch(next);
208 }; 217 };
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> 5 <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
6 <title>{{title}} | Yoho!Buy有货 | 潮流购物逛不停</title> 6 <title>{{title}} | Yoho!Buy有货 | 潮流购物逛不停</title>
7 <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/v1/mip.css"> 7 <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/v1/mip.css">
8 - <link rel="canonical" href="{{canonical}}"> 8 + <link rel="canonical" href="https://www.yohobuy.com/guang/{{mipId}}.html"/>
9 <style mip-custom> 9 <style mip-custom>
10 .main-wrap{width: 100%;max-width: 750px;margin: 0 auto;} 10 .main-wrap{width: 100%;max-width: 750px;margin: 0 auto;}
11 {{css}} 11 {{css}}
@@ -19,5 +19,20 @@ @@ -19,5 +19,20 @@
19 <script src="https://mipcache.bdstatic.com/static/v1/mip-stats-baidu/mip-stats-baidu.js"></script> 19 <script src="https://mipcache.bdstatic.com/static/v1/mip-stats-baidu/mip-stats-baidu.js"></script>
20 <script src="https://mipcache.bdstatic.com/static/v1/mip-anim/mip-anim.js"></script> 20 <script src="https://mipcache.bdstatic.com/static/v1/mip-anim/mip-anim.js"></script>
21 <script src="https://mipcache.bdstatic.com/static/v1/mip-audio/mip-audio.js"></script> 21 <script src="https://mipcache.bdstatic.com/static/v1/mip-audio/mip-audio.js"></script>
  22 +<script src="https://mipcache.bdstatic.com/extensions/platform/v1/mip-cambrian/mip-cambrian.js"></script>
  23 +<script type="application/ld+json">
  24 + {
  25 + @context: "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
  26 + @id: "https://m.yohobuy.com/mip/guang/info/{{mipId}}.html",
  27 + appid: "1583402501013173",
  28 + title: "{{title}} | Yoho!Buy有货 | 潮流购物逛不停",
  29 + images: [
  30 + "{{mipPic}}"
  31 + ],
  32 + description: "{{mipDes}}",
  33 + pubDate: "{{mipPublishTime}}"
  34 + }
  35 +</script>
22 </body> 36 </body>
  37 +<mip-cambrian site-id="1583402501013173"></mip-cambrian>
23 </html> 38 </html>