|
@@ -5,24 +5,6 @@ const liveAPI = global.yoho.LiveAPI; |
|
@@ -5,24 +5,6 @@ const liveAPI = global.yoho.LiveAPI; |
5
|
const contentCodeConfig = require('../../../config/content-code');
|
5
|
const contentCodeConfig = require('../../../config/content-code');
|
6
|
const resourcesProcess = require(`${global.utils}/resources-process`);
|
6
|
const resourcesProcess = require(`${global.utils}/resources-process`);
|
7
|
|
7
|
|
8
|
-// 格式化时间戳,b用来区别两种不同的显示
|
|
|
9
|
-// const _formatTime = (a, b) => {
|
|
|
10
|
-// let time = new Date(a);
|
|
|
11
|
-// let today = new Date();
|
|
|
12
|
-// let judge = time.getDate() - today.getDate();
|
|
|
13
|
-// let status = '';
|
|
|
14
|
-
|
|
|
15
|
-// if (judge === 1) {
|
|
|
16
|
-// status = b ? '预告明日' : '明天';
|
|
|
17
|
-// } else if (judge > 1) {
|
|
|
18
|
-// status = b ? `${(time.getMonth() + 1)}.${time.getDate()}` : `${(time.getMonth() + 1)}月${time.getDate()}日`;
|
|
|
19
|
-// } else {
|
|
|
20
|
-// status = b ? '预告' : '今天';
|
|
|
21
|
-// }
|
|
|
22
|
-// return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
|
|
|
23
|
-// :${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
|
|
|
24
|
-// };
|
|
|
25
|
-
|
|
|
26
|
const _formatTime = (timestamp, b) => {
|
8
|
const _formatTime = (timestamp, b) => {
|
27
|
let date = 'M月D日';
|
9
|
let date = 'M月D日';
|
28
|
let time = 'hh:mm';
|
10
|
let time = 'hh:mm';
|
|
@@ -57,7 +39,7 @@ const _getBestList = () => { |
|
@@ -57,7 +39,7 @@ const _getBestList = () => { |
57
|
code: 200,
|
39
|
code: 200,
|
58
|
cache: false
|
40
|
cache: false
|
59
|
}).then(result => {
|
41
|
}).then(result => {
|
60
|
- let list = result.data;
|
42
|
+ let list = result.data || [];
|
61
|
|
43
|
|
62
|
for (let item of list) {
|
44
|
for (let item of list) {
|
63
|
switch (item.living) {
|
45
|
switch (item.living) {
|
|
@@ -76,7 +58,7 @@ const _getBestList = () => { |
|
@@ -76,7 +58,7 @@ const _getBestList = () => { |
76
|
// 格式化时间
|
58
|
// 格式化时间
|
77
|
item.starting_time = _formatTime(item.starting_time, true);
|
59
|
item.starting_time = _formatTime(item.starting_time, true);
|
78
|
}
|
60
|
}
|
79
|
- return result.data ? result.data : [];
|
61
|
+ return result.data || [];
|
80
|
});
|
62
|
});
|
81
|
};
|
63
|
};
|
82
|
|
64
|
|
|
@@ -86,7 +68,7 @@ const _getLivingList = () => { |
|
@@ -86,7 +68,7 @@ const _getLivingList = () => { |
86
|
code: 200,
|
68
|
code: 200,
|
87
|
cache: false
|
69
|
cache: false
|
88
|
}).then(result => {
|
70
|
}).then(result => {
|
89
|
- return result.data ? result.data : [];
|
71
|
+ return result.data || [];
|
90
|
});
|
72
|
});
|
91
|
};
|
73
|
};
|
92
|
|
74
|
|
|
@@ -96,12 +78,12 @@ const _getPrelivingList = () => { |
|
@@ -96,12 +78,12 @@ const _getPrelivingList = () => { |
96
|
code: 200,
|
78
|
code: 200,
|
97
|
cache: false
|
79
|
cache: false
|
98
|
}).then(result => {
|
80
|
}).then(result => {
|
99
|
- let list = result.data;
|
81
|
+ let list = result.data || [];
|
100
|
|
82
|
|
101
|
for (let item of list) {
|
83
|
for (let item of list) {
|
102
|
item.starting_time = _formatTime(item.starting_time);
|
84
|
item.starting_time = _formatTime(item.starting_time);
|
103
|
}
|
85
|
}
|
104
|
- return result.data ? result.data : [];
|
86
|
+ return result.data || [];
|
105
|
});
|
87
|
});
|
106
|
};
|
88
|
};
|
107
|
|
89
|
|
|
@@ -111,7 +93,7 @@ const _getRecordList = () => { |
|
@@ -111,7 +93,7 @@ const _getRecordList = () => { |
111
|
code: 200,
|
93
|
code: 200,
|
112
|
cache: false
|
94
|
cache: false
|
113
|
}).then(result => {
|
95
|
}).then(result => {
|
114
|
- return result.data ? result.data : [];
|
96
|
+ return result.data || [];
|
115
|
});
|
97
|
});
|
116
|
};
|
98
|
};
|
117
|
|
99
|
|