Merge branch 'release/live'
Showing
6 changed files
with
55 additions
and
46 deletions
@@ -37,8 +37,7 @@ exports.main = (req, res, next) => { | @@ -37,8 +37,7 @@ exports.main = (req, res, next) => { | ||
37 | model.fetchInfo(id, isReplay) | 37 | model.fetchInfo(id, isReplay) |
38 | .then(result => { | 38 | .then(result => { |
39 | if (!result.data) { | 39 | if (!result.data) { |
40 | - next(result.message); | ||
41 | - return; | 40 | + return next(); |
42 | } | 41 | } |
43 | res.render('live/play', result.data); | 42 | res.render('live/play', result.data); |
44 | }) | 43 | }) |
@@ -179,7 +179,6 @@ const fetchLiveInfo = (roomID) => { | @@ -179,7 +179,6 @@ const fetchLiveInfo = (roomID) => { | ||
179 | d.master_pic = helpers.image(d.master_pic, 180, 180); | 179 | d.master_pic = helpers.image(d.master_pic, 180, 180); |
180 | d.humanTime = _formatTime(d.starting_time * 1000); // 预告 开始时间 | 180 | d.humanTime = _formatTime(d.starting_time * 1000); // 预告 开始时间 |
181 | d.video_src = d.hls_downstream_address; | 181 | d.video_src = d.hls_downstream_address; |
182 | - d.audience_num = false; // 直播 观众人数 由弹幕获取 | ||
183 | 182 | ||
184 | // 自定义数据 | 183 | // 自定义数据 |
185 | d.duration = _getHumanDuration(d.live_last_time); | 184 | d.duration = _getHumanDuration(d.live_last_time); |
@@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
37 | <div class="liverec_info"> | 37 | <div class="liverec_info"> |
38 | <img class="liverec_head" src="{{image master_pic 120 120}}" alt="头像"> | 38 | <img class="liverec_head" src="{{image master_pic 120 120}}" alt="头像"> |
39 | <div class="liverec_pannel"> | 39 | <div class="liverec_pannel"> |
40 | - <p class="liverec_name"> | 40 | + <p class="liverec_name clearfix"> |
41 | <span class="name-name">{{master_name}}</span> | 41 | <span class="name-name">{{master_name}}</span> |
42 | <span class="name-tag">{{master_meta}}</span> | 42 | <span class="name-tag">{{master_meta}}</span> |
43 | </p> | 43 | </p> |
@@ -73,46 +73,51 @@ | @@ -73,46 +73,51 @@ | ||
73 | {{/canPlay}} | 73 | {{/canPlay}} |
74 | 74 | ||
75 | {{!直播已结束}} | 75 | {{!直播已结束}} |
76 | - <div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}" style="background-image: url('{{background_pic}}');"> | ||
77 | - <div class="live-state__txt">直播已结束</div> | ||
78 | - <ul class="live-state-info"> | ||
79 | - <li class="audience text-center"> | ||
80 | - <span class="val">{{audience_num}}</span> | ||
81 | - <span class="label">总观看人数</span> | ||
82 | - </li> | ||
83 | - <li class="duration"> | ||
84 | - <div class="inner pull-right"> | ||
85 | - <span class="val">{{duration}}</span> | 76 | + <div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}"> |
77 | + <div class="live-state-inner" style="background-image: url('{{background_pic}}');"> | ||
78 | + <div class="live-state__txt">直播已结束</div> | ||
79 | + <ul class="live-state-info"> | ||
80 | + <li class="audience text-center"> | ||
81 | + <span class="val">{{audience_num}}</span> | ||
86 | <br> | 82 | <br> |
87 | - <span class="label">直播时长</span> | ||
88 | - </div> | ||
89 | - </li> | ||
90 | - <li class="favorite"> | ||
91 | - <div class="inner pull-left"> | ||
92 | - <span class="val">{{like_num}}</span> | ||
93 | - <br> | ||
94 | - <span class="label">点赞数</span> | ||
95 | - </div> | ||
96 | - </li> | ||
97 | - </ul> | ||
98 | - <a href="javascript: history.back();" class="live-btn-close"> | ||
99 | - <i class="iconfont"></i> | ||
100 | - </a> | 83 | + <span class="label">总观看人数</span> |
84 | + </li> | ||
85 | + <li class="duration"> | ||
86 | + <div class="inner pull-right"> | ||
87 | + <span class="val">{{duration}}</span> | ||
88 | + <br> | ||
89 | + <span class="label">直播时长</span> | ||
90 | + </div> | ||
91 | + </li> | ||
92 | + <li class="favorite"> | ||
93 | + <div class="inner pull-left"> | ||
94 | + <span class="val">{{like_num}}</span> | ||
95 | + <br> | ||
96 | + <span class="label">点赞数</span> | ||
97 | + </div> | ||
98 | + </li> | ||
99 | + </ul> | ||
100 | + <a href="javascript: history.back();" class="live-btn-close"> | ||
101 | + <i class="iconfont"></i> | ||
102 | + </a> | ||
103 | + </div> | ||
101 | </div> | 104 | </div> |
102 | 105 | ||
103 | {{!直播未开始}} | 106 | {{!直播未开始}} |
104 | {{#notBegin}} | 107 | {{#notBegin}} |
105 | - <div class="live-state is-no-start show" style="background-image: url('{{background_pic}}');"> | ||
106 | - <div class="live-state__txt">直播未开始</div> | ||
107 | - <div class="live-state-info text-center"> | ||
108 | - <img src="{{master_pic}}" alt="" class="avatar"> | ||
109 | - <span class="name text-overflow">{{master_name}}</span><br> | ||
110 | - <h5 class="title">直播主题: {{title}}</h5> | ||
111 | - <p class="begin-time">开始时间: {{humanTime}}</p> | 108 | + <div class="live-state is-no-start show"> |
109 | + <div class="live-state-inner" style="background-image: url('{{background_pic}}');"> | ||
110 | + <div class="live-state__txt">直播未开始</div> | ||
111 | + <div class="live-state-info text-center"> | ||
112 | + <img src="{{master_pic}}" alt="" class="avatar"> | ||
113 | + <span class="name text-overflow">{{master_name}}</span><br> | ||
114 | + <h5 class="title">直播主题: {{title}}</h5> | ||
115 | + <p class="begin-time">开始时间: {{humanTime}}</p> | ||
116 | + </div> | ||
117 | + <a href="javascript: history.back();" class="live-btn-close"> | ||
118 | + <i class="iconfont"></i> | ||
119 | + </a> | ||
112 | </div> | 120 | </div> |
113 | - <a href="javascript: history.back();" class="live-btn-close"> | ||
114 | - <i class="iconfont"></i> | ||
115 | - </a> | ||
116 | </div> | 121 | </div> |
117 | {{/notBegin}} | 122 | {{/notBegin}} |
118 | 123 |
@@ -12,12 +12,11 @@ $border: #e0e0e0; | @@ -12,12 +12,11 @@ $border: #e0e0e0; | ||
12 | } | 12 | } |
13 | 13 | ||
14 | .liverec { | 14 | .liverec { |
15 | - height: 423px; | ||
16 | width: 640px; | 15 | width: 640px; |
16 | + overflow: hidden; | ||
17 | 17 | ||
18 | &_child { | 18 | &_child { |
19 | position: relative; | 19 | position: relative; |
20 | - height: 100%; | ||
21 | width: 50%; | 20 | width: 50%; |
22 | float: left; | 21 | float: left; |
23 | border-right: 1px solid $border; | 22 | border-right: 1px solid $border; |
@@ -69,7 +68,6 @@ $border: #e0e0e0; | @@ -69,7 +68,6 @@ $border: #e0e0e0; | ||
69 | } | 68 | } |
70 | 69 | ||
71 | .liverec_info { | 70 | .liverec_info { |
72 | - height: 100px; | ||
73 | padding: 20px 10px 20px 30px; | 71 | padding: 20px 10px 20px 30px; |
74 | } | 72 | } |
75 | 73 | ||
@@ -94,23 +92,27 @@ $border: #e0e0e0; | @@ -94,23 +92,27 @@ $border: #e0e0e0; | ||
94 | 92 | ||
95 | .name-name { | 93 | .name-name { |
96 | display: inline-block; | 94 | display: inline-block; |
97 | - height: 26px; | ||
98 | - max-width: 85px; | 95 | + max-width: 105px; |
96 | + text-overflow: ellipsis; | ||
99 | overflow: hidden; | 97 | overflow: hidden; |
98 | + white-space: nowrap; | ||
100 | } | 99 | } |
101 | 100 | ||
102 | .name-tag { | 101 | .name-tag { |
103 | display: inline-block; | 102 | display: inline-block; |
103 | + float: right; | ||
104 | font-size: 18px; | 104 | font-size: 18px; |
105 | height: 26px; | 105 | height: 26px; |
106 | + max-width: 100%; | ||
106 | line-height: 26px; | 107 | line-height: 26px; |
107 | padding: 0 8px; | 108 | padding: 0 8px; |
108 | - max-width: 90px; | ||
109 | text-align: center; | 109 | text-align: center; |
110 | background: $black; | 110 | background: $black; |
111 | border-radius: 20px; | 111 | border-radius: 20px; |
112 | color: $white; | 112 | color: $white; |
113 | vertical-align: top; | 113 | vertical-align: top; |
114 | + white-space: nowrap; | ||
115 | + text-overflow: ellipsis; | ||
114 | } | 116 | } |
115 | } | 117 | } |
116 | 118 |
@@ -9,14 +9,18 @@ | @@ -9,14 +9,18 @@ | ||
9 | width: 100%; | 9 | width: 100%; |
10 | max-width: 100%; | 10 | max-width: 100%; |
11 | min-height: 100vh; | 11 | min-height: 100vh; |
12 | - background-size: 100% 100%; | ||
13 | color: white; | 12 | color: white; |
14 | - overflow: hidden; | 13 | + overflow: auto; |
15 | .live-btn-close { | 14 | .live-btn-close { |
16 | z-index: 200; | 15 | z-index: 200; |
17 | } | 16 | } |
18 | } | 17 | } |
19 | 18 | ||
19 | +.live-state-inner { | ||
20 | + overflow: hidden; | ||
21 | + background-size: 100% 100%; | ||
22 | +} | ||
23 | + | ||
20 | .live-state__txt { | 24 | .live-state__txt { |
21 | width: 428px; | 25 | width: 428px; |
22 | font-size: 31px; | 26 | font-size: 31px; |
-
Please register or login to post a comment