Authored by ccbikai

live 增加资源位

... ... @@ -10,7 +10,8 @@ exports.index = (req, res, next) => {
best: result[0].data,
living: result[1].data,
pre: result[2].data,
record: result[3].data
record: result[3].data,
constent: result[4]
});
}).catch(next);
};
... ... @@ -21,7 +22,7 @@ const status = {
end: 2
};
exports.main = (req, res, next) => {
exports.main = (req, res) => {
res.locals.module = 'activity';
res.locals.page = 'live-play';
... ...
'use strict';
var api = global.yoho.ServiceAPI;
const api = global.yoho.ServiceAPI;
const contentCodeConfig = require('../../../config/content-code');
const resourcesProcess = require(`${global.utils}/resources-process`);
// 格式化时间戳,b用来区别两种不同的显示
const _formatTime = (a, b) => {
... ... @@ -42,6 +44,18 @@ const _getBestList = () => {
});
};
// 获取顶部bannel
let _getBannerData = () => {
return api.get('operations/api/v5/resource/get', {
content_code: contentCodeConfig.live.index
}, {
code: 200,
cache: true
}).then((result) => {
return result.data ? resourcesProcess(result.data) : [];
});
};
// 获取直播中所有视频
const _getLivingList = () => {
return api.get('v1/living/listing', {}, true);
... ... @@ -66,7 +80,7 @@ const _getRecordList = () => {
// 返回所有数据
const getAllList = () => {
return Promise.all([_getBestList(), _getLivingList(), _getPrelivingList(), _getRecordList()]);
return Promise.all([_getBestList(), _getLivingList(), _getPrelivingList(), _getRecordList(), _getBannerData()]);
};
// 处理直播时间
... ...
<div class="yoho-live">
<div class="yoho-live yoho-page">
{{#content}}
{{! 头部banner}}
{{> resources/banner-top}}
{{/content}}
<div class="live-rec">
{{#best}}
<div class="rec-child">
... ... @@ -19,7 +24,7 @@
<p class="rec-tag">{{title}}</p>
</div>
</div>
</div>
{{/best}}
</div>
... ... @@ -47,7 +52,7 @@
</section>
</div>
{{/living}}
{{#if pre}}
<div class="live-list">
<h2 class="title">直播预告</h2>
... ...
... ... @@ -77,4 +77,4 @@
<div class="share-tag"><img src="//static.yohobuy.com/m/v1/img/invite/yd_share.png"></div>
</div>
</div><!--/invite-page-->
\ No newline at end of file
</div><!--/invite-page-->
... ...
... ... @@ -48,10 +48,15 @@ const bottomBannerContentCode = {
const outletContentCode = 'c19ffa03f053f4cac3690b22c8da26b7';
const liveContentCode = {
index: 'ed0c21df811e4d0cb9993815646df482'
};
module.exports = {
sale: saleContentCode,
outlet: outletContentCode,
channel: channelContentCode,
bottom: bottomBannerContentCode,
guang: guangContentCode
guang: guangContentCode,
live: liveContentCode
};
... ...
... ... @@ -60,7 +60,7 @@
},
"devDependencies": {
"autoprefixer": "^6.3.7",
"ava": "^0.15.2",
"ava": "^0.16.0",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"eslint": "^3.0.1",
... ... @@ -72,8 +72,8 @@
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-util": "^3.0.7",
"husky": "^0.11.4",
"nodemon": "1.9.2",
"nyc": "^6.6.1",
"nodemon": "^1.10.0",
"nyc": "^8.1.0",
"postcss-assets": "^4.0.1",
"postcss-cachebuster": "^0.1.3",
"postcss-calc": "^5.2.1",
... ... @@ -89,7 +89,7 @@
"rewire": "^2.5.2",
"shelljs": "^0.7.0",
"stylelint": "^7.1.0",
"stylelint-config-yoho": "^1.2.6",
"stylelint-config-yoho": "^1.2.7",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"webpack-stream": "^3.1.0",
... ... @@ -100,7 +100,6 @@
"yoho-jquery": "^2.2.4",
"yoho-jquery-lazyload": "^1.9.7",
"yoho-mlellipsis": "0.0.3",
"yoho-node-lib": "0.0.32",
"yoho-swiper": "^3.3.1"
}
}
... ...