...
|
...
|
@@ -22,46 +22,68 @@ const _formatTime = (a, b) => { |
|
|
// 获取精选视频
|
|
|
const _getBestList = () => {
|
|
|
return api.get('v1/living/best', {}, true).then(result => {
|
|
|
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:
|
|
|
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;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取直播中所有视频
|
|
|
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 => {
|
|
|
if (result && result.code === 200) {
|
|
|
let list = result.data;
|
|
|
|
|
|
for (let item of list) {
|
|
|
item.starting_time = _formatTime(item.starting_time);
|
|
|
}
|
|
|
return result;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取回看列表
|
|
|
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;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 返回所有数据
|
...
|
...
|
|