|
@@ -16,52 +16,74 @@ const _formatTime = (a, b) => { |
|
@@ -16,52 +16,74 @@ const _formatTime = (a, b) => { |
16
|
status = b ? '预告' : '今天';
|
16
|
status = b ? '预告' : '今天';
|
17
|
}
|
17
|
}
|
18
|
return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
|
18
|
return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
|
19
|
- :${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
19
|
+ :${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
20
|
};
|
20
|
};
|
21
|
|
21
|
|
22
|
// 获取精选视频
|
22
|
// 获取精选视频
|
23
|
const _getBestList = () => {
|
23
|
const _getBestList = () => {
|
24
|
return api.get('v1/living/best', {}, true).then(result => {
|
24
|
return api.get('v1/living/best', {}, true).then(result => {
|
25
|
- let list = result.data;
|
25
|
+ if (result && result.code === 200) {
|
|
|
26
|
+ let list = result.data;
|
26
|
|
27
|
|
27
|
- for (let item of list) {
|
|
|
28
|
- switch (item.living) {
|
|
|
29
|
- case 0:
|
|
|
30
|
- default:
|
|
|
31
|
- item.pre_living = true;
|
|
|
32
|
- break;
|
|
|
33
|
- case 1:
|
|
|
34
|
- item.now_living = true;
|
|
|
35
|
- break;
|
|
|
36
|
- case 2:
|
|
|
37
|
- item.rec_living = true;
|
|
|
38
|
- break;
|
28
|
+ for (let item of list) {
|
|
|
29
|
+ switch (item.living) {
|
|
|
30
|
+ case 0:
|
|
|
31
|
+ item.pre_living = true;
|
|
|
32
|
+ break;
|
|
|
33
|
+ case 1:
|
|
|
34
|
+ default:
|
|
|
35
|
+ item.now_living = true;
|
|
|
36
|
+ break;
|
|
|
37
|
+ case 2:
|
|
|
38
|
+ item.rec_living = true;
|
|
|
39
|
+ break;
|
|
|
40
|
+ }
|
|
|
41
|
+ //格式化时间
|
|
|
42
|
+ item.starting_time = _formatTime(item.starting_time, true);
|
39
|
}
|
43
|
}
|
|
|
44
|
+ return result;
|
|
|
45
|
+ } else {
|
|
|
46
|
+ return false;
|
40
|
}
|
47
|
}
|
41
|
- return result;
|
|
|
42
|
});
|
48
|
});
|
43
|
};
|
49
|
};
|
44
|
|
50
|
|
45
|
// 获取直播中所有视频
|
51
|
// 获取直播中所有视频
|
46
|
const _getLivingList = () => {
|
52
|
const _getLivingList = () => {
|
47
|
- return api.get('v1/living/listing', {}, true);
|
53
|
+ return api.get('v1/living/listing', {}, true).then(result => {
|
|
|
54
|
+ if (result && result.code === 200) {
|
|
|
55
|
+ return result;
|
|
|
56
|
+ } else {
|
|
|
57
|
+ return false;
|
|
|
58
|
+ }
|
|
|
59
|
+ });
|
48
|
};
|
60
|
};
|
49
|
|
61
|
|
50
|
// 获取直播预告列表
|
62
|
// 获取直播预告列表
|
51
|
const _getPrelivingList = () => {
|
63
|
const _getPrelivingList = () => {
|
52
|
return api.get('v1/living/starting', {}, true).then(result => {
|
64
|
return api.get('v1/living/starting', {}, true).then(result => {
|
53
|
- let list = result.data;
|
65
|
+ if (result && result.code === 200) {
|
|
|
66
|
+ let list = result.data;
|
54
|
|
67
|
|
55
|
- for (let item of list) {
|
|
|
56
|
- item.starting_time = _formatTime(item.starting_time);
|
68
|
+ for (let item of list) {
|
|
|
69
|
+ item.starting_time = _formatTime(item.starting_time);
|
|
|
70
|
+ }
|
|
|
71
|
+ return result;
|
|
|
72
|
+ } else {
|
|
|
73
|
+ return false;
|
57
|
}
|
74
|
}
|
58
|
- return result;
|
|
|
59
|
});
|
75
|
});
|
60
|
};
|
76
|
};
|
61
|
|
77
|
|
62
|
// 获取回看列表
|
78
|
// 获取回看列表
|
63
|
const _getRecordList = () => {
|
79
|
const _getRecordList = () => {
|
64
|
- return api.get('v1/living/replaying', {}, true);
|
80
|
+ return api.get('v1/living/replaying', {}, true).then(result => {
|
|
|
81
|
+ if (result && result.code === 200) {
|
|
|
82
|
+ return result;
|
|
|
83
|
+ } else {
|
|
|
84
|
+ return false;
|
|
|
85
|
+ }
|
|
|
86
|
+ });
|
65
|
};
|
87
|
};
|
66
|
|
88
|
|
67
|
// 返回所有数据
|
89
|
// 返回所有数据
|