Authored by zzzzzzz

Merge branch 'feature/live' of git.yoho.cn:fe/yohobuywap-node into feature/live

@@ -124,13 +124,26 @@ const fetchReplayInfo = (videoID) => { @@ -124,13 +124,26 @@ const fetchReplayInfo = (videoID) => {
124 if (result && result.data) { 124 if (result && result.data) {
125 let d = result.data; 125 let d = result.data;
126 126
127 - d.logo = helpers.image(d.logo, 70, 70); 127 + d.background = helpers.image(d.background, 640, 968);
128 d.pic = helpers.image(d.pic, 640, 968); 128 d.pic = helpers.image(d.pic, 640, 968);
129 d.master_pic = helpers.image(d.master_pic, 180, 180); 129 d.master_pic = helpers.image(d.master_pic, 180, 180);
130 d.humanTime = _formatTime(data.living_start_time * 1000); 130 d.humanTime = _formatTime(data.living_start_time * 1000);
131 d.video_src = d.url; 131 d.video_src = d.url;
132 132
  133 + let durationH = parseInt(d.live_last_time / 3600, 10); // 1h =3600s
  134 + let durationM = parseInt((d.live_last_time - durationH * 3600) / 60, 10);
  135 + let duration = [durationH, durationM];
  136 +
  137 + duration.forEach((val, index) => {
  138 + if (val < 10) {
  139 + duration[index] = `0${val}`;
  140 + } else {
  141 + duration[index] = '' + val;
  142 + }
  143 + });
  144 +
133 // 自定义数据 145 // 自定义数据
  146 + d.duration = `${duration[0]} : ${duration[1]}`;
134 d.living = 3; // 重播 状态 147 d.living = 3; // 重播 状态
135 d.canPlay = true; 148 d.canPlay = true;
136 d.atEnd = false; 149 d.atEnd = false;
@@ -150,13 +163,26 @@ const fetchLiveInfo = (roomID) => { @@ -150,13 +163,26 @@ const fetchLiveInfo = (roomID) => {
150 if (result && result.data) { 163 if (result && result.data) {
151 let d = result.data; 164 let d = result.data;
152 165
153 - d.logo = helpers.image(d.logo, 70, 70); 166 + d.background_pic = helpers.image(d.background_pic, 640, 968);
154 d.pic = helpers.image(d.pic, 640, 968); 167 d.pic = helpers.image(d.pic, 640, 968);
155 d.master_pic = helpers.image(d.master_pic, 180, 180); 168 d.master_pic = helpers.image(d.master_pic, 180, 180);
156 d.humanTime = _formatTime(d.living_start_time * 1000); 169 d.humanTime = _formatTime(d.living_start_time * 1000);
157 d.video_src = d.hls_downstream_address; 170 d.video_src = d.hls_downstream_address;
158 171
159 - // 自定义的数据 172 + let durationH = parseInt(d.live_last_time / 3600, 10); // 1h =3600s
  173 + let durationM = parseInt((d.live_last_time - durationH * 3600) / 60, 10);
  174 + let duration = [durationH, durationM];
  175 +
  176 + duration.forEach((val, index) => {
  177 + if (val < 10) {
  178 + duration[index] = `0${val}`;
  179 + } else {
  180 + duration[index] = '' + val;
  181 + }
  182 + });
  183 +
  184 + // 自定义数据
  185 + d.duration = `${duration[0]} : ${duration[1]}`;
160 d.canPlay = d.living === 1; 186 d.canPlay = d.living === 1;
161 d.notBegin = d.living === 0; 187 d.notBegin = d.living === 0;
162 d.atEnd = d.living === 2; 188 d.atEnd = d.living === 2;
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <!--直播状态--> 41 <!--直播状态-->
42 <div class="live-status"> 42 <div class="live-status">
43 <div class="overflow-hidden"> 43 <div class="overflow-hidden">
44 - <img src="{{ logo }}"> 44 + <img src="/img/activity/live/live/app_logo.png">
45 <div class="live-time"> 45 <div class="live-time">
46 <span>YOHO!直播 ·</span>&nbsp;<span id="live_time"></span> 46 <span>YOHO!直播 ·</span>&nbsp;<span id="live_time"></span>
47 </div> 47 </div>
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 {{/canPlay}} 65 {{/canPlay}}
66 66
67 {{!直播已结束}} 67 {{!直播已结束}}
68 - <div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}" style="background-image: url('{{pic}}');"> 68 + <div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}" style="background-image: url('{{background_pic}}');">
69 <div class="live-state__txt">直播已结束</div> 69 <div class="live-state__txt">直播已结束</div>
70 <ul class="live-state-info"> 70 <ul class="live-state-info">
71 <li class="audience text-center"> 71 <li class="audience text-center">
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 95
96 {{!直播未开始}} 96 {{!直播未开始}}
97 {{#notBegin}} 97 {{#notBegin}}
98 - <div class="live-state is-no-start show" style="background-image: url('{{pic}}');"> 98 + <div class="live-state is-no-start show" style="background-image: url('{{background_pic}}');">
99 <div class="live-state__txt">直播未开始</div> 99 <div class="live-state__txt">直播未开始</div>
100 <div class="live-state-info text-center"> 100 <div class="live-state-info text-center">
101 <img src="{{master_pic}}" alt="" class="avatar"><br> 101 <img src="{{master_pic}}" alt="" class="avatar"><br>
@@ -49,7 +49,7 @@ const bottomBannerContentCode = { @@ -49,7 +49,7 @@ const bottomBannerContentCode = {
49 const outletContentCode = 'c19ffa03f053f4cac3690b22c8da26b7'; 49 const outletContentCode = 'c19ffa03f053f4cac3690b22c8da26b7';
50 50
51 const liveContentCode = { 51 const liveContentCode = {
52 - index: 'ed0c21df811e4d0cb9993815646df482' 52 + index: '345c80537dca15611f37ae4863004bfe'
53 }; 53 };
54 54
55 module.exports = { 55 module.exports = {