...
|
...
|
@@ -5,24 +5,6 @@ const liveAPI = global.yoho.LiveAPI; |
|
|
const contentCodeConfig = require('../../../config/content-code');
|
|
|
const resourcesProcess = require(`${global.utils}/resources-process`);
|
|
|
|
|
|
// 格式化时间戳,b用来区别两种不同的显示
|
|
|
// const _formatTime = (a, b) => {
|
|
|
// let time = new Date(a);
|
|
|
// let today = new Date();
|
|
|
// let judge = time.getDate() - today.getDate();
|
|
|
// let status = '';
|
|
|
|
|
|
// if (judge === 1) {
|
|
|
// status = b ? '预告明日' : '明天';
|
|
|
// } else if (judge > 1) {
|
|
|
// status = b ? `${(time.getMonth() + 1)}.${time.getDate()}` : `${(time.getMonth() + 1)}月${time.getDate()}日`;
|
|
|
// } else {
|
|
|
// status = b ? '预告' : '今天';
|
|
|
// }
|
|
|
// return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
|
|
|
// :${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
|
|
// };
|
|
|
|
|
|
const _formatTime = (timestamp, b) => {
|
|
|
let date = 'M月D日';
|
|
|
let time = 'hh:mm';
|
...
|
...
|
@@ -57,7 +39,7 @@ const _getBestList = () => { |
|
|
code: 200,
|
|
|
cache: false
|
|
|
}).then(result => {
|
|
|
let list = result.data;
|
|
|
let list = result.data || [];
|
|
|
|
|
|
for (let item of list) {
|
|
|
switch (item.living) {
|
...
|
...
|
@@ -76,7 +58,7 @@ const _getBestList = () => { |
|
|
// 格式化时间
|
|
|
item.starting_time = _formatTime(item.starting_time, true);
|
|
|
}
|
|
|
return result.data ? result.data : [];
|
|
|
return result.data || [];
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -86,7 +68,7 @@ const _getLivingList = () => { |
|
|
code: 200,
|
|
|
cache: false
|
|
|
}).then(result => {
|
|
|
return result.data ? result.data : [];
|
|
|
return result.data || [];
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -96,12 +78,12 @@ const _getPrelivingList = () => { |
|
|
code: 200,
|
|
|
cache: false
|
|
|
}).then(result => {
|
|
|
let list = result.data;
|
|
|
let list = result.data || [];
|
|
|
|
|
|
for (let item of list) {
|
|
|
item.starting_time = _formatTime(item.starting_time);
|
|
|
}
|
|
|
return result.data ? result.data : [];
|
|
|
return result.data || [];
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -111,7 +93,7 @@ const _getRecordList = () => { |
|
|
code: 200,
|
|
|
cache: false
|
|
|
}).then(result => {
|
|
|
return result.data ? result.data : [];
|
|
|
return result.data || [];
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|