Authored by 陈轩

Merge remote-tracking branch 'origin/feature/live' into feature/live

@@ -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
@@ -16,4 +16,4 @@ $('.swiper-container').each(function() { @@ -16,4 +16,4 @@ $('.swiper-container').each(function() {
16 pagination: $(this).closest('.banner-top').find('.pagination-inner').get(0) 16 pagination: $(this).closest('.banner-top').find('.pagination-inner').get(0)
17 }); 17 });
18 } 18 }
19 -});  
  19 +});
@@ -30,13 +30,13 @@ $border: #e0e0e0; @@ -30,13 +30,13 @@ $border: #e0e0e0;
30 top: 30px; 30 top: 30px;
31 left: 30px; 31 left: 30px;
32 height: 35px; 32 height: 35px;
33 - padding: 0 10px; 33 + padding: 2px 10px 0;
34 border: 1px solid $white; 34 border: 1px solid $white;
35 border-radius: 20px; 35 border-radius: 20px;
36 color: $white; 36 color: $white;
37 font-size: 22px; 37 font-size: 22px;
38 text-align: center; 38 text-align: center;
39 - line-height: 35px; 39 + line-height: 1.5;
40 } 40 }
41 41
42 .living { 42 .living {
@@ -47,10 +47,11 @@ $border: #e0e0e0; @@ -47,10 +47,11 @@ $border: #e0e0e0;
47 width: 70px; 47 width: 70px;
48 background: $red; 48 background: $red;
49 border-radius: 20px; 49 border-radius: 20px;
  50 + padding-top: 2px;
50 color: $white; 51 color: $white;
51 font-size: 22px; 52 font-size: 22px;
52 text-align: center; 53 text-align: center;
53 - line-height: 35px; 54 + line-height: 1.5;
54 } 55 }
55 56
56 .rec-info { 57 .rec-info {
@@ -87,12 +88,14 @@ $border: #e0e0e0; @@ -87,12 +88,14 @@ $border: #e0e0e0;
87 display: inline-block; 88 display: inline-block;
88 height: 26px; 89 height: 26px;
89 width: 86px; 90 width: 86px;
90 - font-size: 18px; 91 + font-size: 17.9px;
91 background: $black; 92 background: $black;
92 margin-left: 10px; 93 margin-left: 10px;
  94 + padding-top: 2px;
93 border-radius: 20px; 95 border-radius: 20px;
94 color: $white; 96 color: $white;
95 text-align: center; 97 text-align: center;
  98 + line-height: 1.5;
96 } 99 }
97 100
98 .rec-tag { 101 .rec-tag {
@@ -186,10 +189,11 @@ $border: #e0e0e0; @@ -186,10 +189,11 @@ $border: #e0e0e0;
186 width: 70px; 189 width: 70px;
187 background: $red; 190 background: $red;
188 border-radius: 20px; 191 border-radius: 20px;
  192 + padding-top: 2px;
189 color: $white; 193 color: $white;
190 font-size: 22px; 194 font-size: 22px;
191 text-align: center; 195 text-align: center;
192 - line-height: 35px; 196 + line-height: 1.5;
193 } 197 }
194 198
195 .main-intro { 199 .main-intro {
@@ -284,8 +288,9 @@ $border: #e0e0e0; @@ -284,8 +288,9 @@ $border: #e0e0e0;
284 width: 70px; 288 width: 70px;
285 border: 1px solid $black; 289 border: 1px solid $black;
286 border-radius: 20px; 290 border-radius: 20px;
  291 + padding-top: 2px;
287 font-size: 22px; 292 font-size: 22px;
288 - line-height: 35px; 293 + line-height: 1.5;
289 text-align: center; 294 text-align: center;
290 color: $black; 295 color: $black;
291 } 296 }