...
|
...
|
@@ -16,52 +16,74 @@ const _formatTime = (a, b) => { |
|
|
status = b ? '预告' : '今天';
|
|
|
}
|
|
|
return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
|
|
|
:${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
|
|
:${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
|
|
};
|
|
|
|
|
|
// 获取精选视频
|
|
|
const _getBestList = () => {
|
|
|
return api.get('v1/living/best', {}, true).then(result => {
|
|
|
let list = result.data;
|
|
|
if (result && result.code === 200) {
|
|
|
let list = result.data;
|
|
|
|
|
|
for (let item of list) {
|
|
|
switch (item.living) {
|
|
|
case 0:
|
|
|
default:
|
|
|
item.pre_living = true;
|
|
|
break;
|
|
|
case 1:
|
|
|
item.now_living = true;
|
|
|
break;
|
|
|
case 2:
|
|
|
item.rec_living = true;
|
|
|
break;
|
|
|
for (let item of list) {
|
|
|
switch (item.living) {
|
|
|
case 0:
|
|
|
item.pre_living = true;
|
|
|
break;
|
|
|
case 1:
|
|
|
default:
|
|
|
item.now_living = true;
|
|
|
break;
|
|
|
case 2:
|
|
|
item.rec_living = true;
|
|
|
break;
|
|
|
}
|
|
|
//格式化时间
|
|
|
item.starting_time = _formatTime(item.starting_time, true);
|
|
|
}
|
|
|
return result;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取直播中所有视频
|
|
|
const _getLivingList = () => {
|
|
|
return api.get('v1/living/listing', {}, true);
|
|
|
return api.get('v1/living/listing', {}, true).then(result => {
|
|
|
if (result && result.code === 200) {
|
|
|
return result;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取直播预告列表
|
|
|
const _getPrelivingList = () => {
|
|
|
return api.get('v1/living/starting', {}, true).then(result => {
|
|
|
let list = result.data;
|
|
|
if (result && result.code === 200) {
|
|
|
let list = result.data;
|
|
|
|
|
|
for (let item of list) {
|
|
|
item.starting_time = _formatTime(item.starting_time);
|
|
|
for (let item of list) {
|
|
|
item.starting_time = _formatTime(item.starting_time);
|
|
|
}
|
|
|
return result;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
return result;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取回看列表
|
|
|
const _getRecordList = () => {
|
|
|
return api.get('v1/living/replaying', {}, true);
|
|
|
return api.get('v1/living/replaying', {}, true).then(result => {
|
|
|
if (result && result.code === 200) {
|
|
|
return result;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 返回所有数据
|
...
|
...
|
|