|
|
'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()]);
|
|
|
};
|
|
|
|
|
|
// 处理直播时间
|
...
|
...
|
|