Authored by zzzzzzz

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

@@ -30,7 +30,7 @@ let _getBannerData = () => { @@ -30,7 +30,7 @@ let _getBannerData = () => {
30 code: 200, 30 code: 200,
31 cache: true 31 cache: true
32 }).then((result) => { 32 }).then((result) => {
33 - return result.data ? resourcesProcess(result.data) : []; 33 + return result && result.data ? resourcesProcess(result.data) : [];
34 }); 34 });
35 }; 35 };
36 36
@@ -117,9 +117,13 @@ const fetchReplayInfo = (videoID) => { @@ -117,9 +117,13 @@ const fetchReplayInfo = (videoID) => {
117 d.logo = helpers.image(d.logo, 70, 70); 117 d.logo = helpers.image(d.logo, 70, 70);
118 d.pic = helpers.image(d.pic, 640, 968); 118 d.pic = helpers.image(d.pic, 640, 968);
119 d.master_pic = helpers.image(d.master_pic, 180, 180); 119 d.master_pic = helpers.image(d.master_pic, 180, 180);
120 - d.living = 3; // 自定义的重播 状态  
121 d.humanTime = _formatTime(data.living_start_time * 1000); 120 d.humanTime = _formatTime(data.living_start_time * 1000);
122 d.video_src = d.url; 121 d.video_src = d.url;
  122 +
  123 + // 自定义数据
  124 + d.living = 3; // 重播 状态
  125 + d.canPlay = true;
  126 + d.atEnd = false;
123 } 127 }
124 128
125 return result; 129 return result;
@@ -141,6 +145,11 @@ const fetchLiveInfo = (roomID) => { @@ -141,6 +145,11 @@ const fetchLiveInfo = (roomID) => {
141 d.master_pic = helpers.image(d.master_pic, 180, 180); 145 d.master_pic = helpers.image(d.master_pic, 180, 180);
142 d.humanTime = _formatTime(d.living_start_time * 1000); 146 d.humanTime = _formatTime(d.living_start_time * 1000);
143 d.video_src = d.hls_downstream_address; 147 d.video_src = d.hls_downstream_address;
  148 +
  149 + // 自定义的数据
  150 + d.canPlay = d.living === 1;
  151 + d.notBegin = d.living === 0;
  152 + d.atEnd = d.living === 2;
144 } 153 }
145 154
146 return result; 155 return result;
1 {{! 直播 播放页 }} 1 {{! 直播 播放页 }}
2 <div class="live-wrapper"> 2 <div class="live-wrapper">
  3 + {{#canPlay}}
3 <div class="live-main"> 4 <div class="live-main">
4 <!-- 视频部分start--> 5 <!-- 视频部分start-->
5 <!--http://live-hls-pili.1iptv.com/meipai-live/57651bb975b6255acc01444c.m3u8--> 6 <!--http://live-hls-pili.1iptv.com/meipai-live/57651bb975b6255acc01444c.m3u8-->
6 - <section id="live_container" class="live-video-main" style="height:28.4rem;background-image: url(/img/activity/live/live/video_cover.jpg);"> 7 + <section id="live_container" class="live-video-main" style="background-image: url(/img/activity/live/live/video_cover.jpg);">
7 <div id="video_container" class="video_player" data-video="{{video_src}}"> 8 <div id="video_container" class="video_player" data-video="{{video_src}}">
8 </div> 9 </div>
9 <div class="live-loading-container"> 10 <div class="live-loading-container">
@@ -61,9 +62,10 @@ @@ -61,9 +62,10 @@
61 </a> 62 </a>
62 </section> 63 </section>
63 </div> 64 </div>
  65 + {{/canPlay}}
64 66
65 {{!直播已结束}} 67 {{!直播已结束}}
66 - <div id="live-state-end" class="live-state is-no-start {{#isEqual living 2}}show{{/isEqual}}" style="background-image: url('{{pic}}');"> 68 + <div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}" style="background-image: url('{{pic}}');">
67 <div class="live-state__txt">直播已结束</div> 69 <div class="live-state__txt">直播已结束</div>
68 <ul class="live-state-info"> 70 <ul class="live-state-info">
69 <li class="audience text-center"> 71 <li class="audience text-center">
@@ -92,7 +94,8 @@ @@ -92,7 +94,8 @@
92 </div> 94 </div>
93 95
94 {{!直播未开始}} 96 {{!直播未开始}}
95 - <div class="live-state is-no-start {{#isEqual living 1}}show{{/isEqual}}" style="background-image: url('{{pic}}');"> 97 + {{#notBegin}}
  98 + <div class="live-state is-no-start show" style="background-image: url('{{pic}}');">
96 <div class="live-state__txt">直播未开始</div> 99 <div class="live-state__txt">直播未开始</div>
97 <div class="live-state-info text-center"> 100 <div class="live-state-info text-center">
98 <img src="{{master_pic}}" alt="" class="avatar"><br> 101 <img src="{{master_pic}}" alt="" class="avatar"><br>
@@ -104,6 +107,7 @@ @@ -104,6 +107,7 @@
104 <i class="iconfont">&#xe623</i> 107 <i class="iconfont">&#xe623</i>
105 </a> 108 </a>
106 </div> 109 </div>
  110 + {{/notBegin}}
107 </div> 111 </div>
108 <script> 112 <script>
109 var live_start_time = {{live_start_time}};//该直播开始时间 113 var live_start_time = {{live_start_time}};//该直播开始时间
@@ -117,7 +117,7 @@ if (isProduction) { @@ -117,7 +117,7 @@ if (isProduction) {
117 domains: { 117 domains: {
118 api: 'http://testapi.yoho.cn:28078/', 118 api: 'http://testapi.yoho.cn:28078/',
119 service: 'http://testservice.yoho.cn:28077/', 119 service: 'http://testservice.yoho.cn:28077/',
120 - liveApi: 'http://api.live.yoho.cn/' 120 + liveApi: 'http://testapi.live.yohops.com:9999/'
121 }, 121 },
122 memcache: { 122 memcache: {
123 master: ['127.0.0.1:12111'], 123 master: ['127.0.0.1:12111'],
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window); 18 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
19 </script> 19 </script>
20 {{#if devEnv}} 20 {{#if devEnv}}
21 - <link rel="stylesheet" href="//localhost:5001/css/index.css"> 21 + <link rel="stylesheet" href="//172.16.9.133:5002/css/index.css">
22 {{^}} 22 {{^}}
23 <link rel="stylesheet" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css"> 23 <link rel="stylesheet" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css">
24 {{/if}} 24 {{/if}}
@@ -41,8 +41,8 @@ @@ -41,8 +41,8 @@
41 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script> 41 <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
42 {{/wechatShare}} 42 {{/wechatShare}}
43 {{#if devEnv}} 43 {{#if devEnv}}
44 - <script src="//localhost:5001/libs.js"></script>  
45 - <script src="//localhost:5001/{{module}}.{{page}}.js"></script> 44 + <script src="//172.16.9.133:5002/libs.js"></script>
  45 + <script src="//172.16.9.133:5002/{{module}}.{{page}}.js"></script>
46 {{^}} 46 {{^}}
47 <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js"></script> 47 <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js"></script>
48 <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script> 48 <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
5 "script": "app.js", 5 "script": "app.js",
6 "instances": "max", 6 "instances": "max",
7 "exec_mode": "cluster", 7 "exec_mode": "cluster",
  8 + "merge_logs": true,
  9 + "log_date_format": "YYYY-MM-DD HH:mm Z",
8 "env": { 10 "env": {
9 "PORT": 6001 11 "PORT": 6001
10 } 12 }
@@ -6,6 +6,14 @@ require('./live/yoho_live_detail_main'); @@ -6,6 +6,14 @@ require('./live/yoho_live_detail_main');
6 require('./live/temp'); 6 require('./live/temp');
7 require('./live/yoho_live_share'); 7 require('./live/yoho_live_share');
8 8
  9 +global.$ = $;
  10 +
  11 +$('.live-wrapper').css({
  12 + position: 'relative',
  13 + height: window.innerHeight,
  14 + width: window.innerWidth
  15 +});
  16 +
9 $(function() { 17 $(function() {
10 var $share = $('.live-btn-share'); 18 var $share = $('.live-btn-share');
11 19
@@ -61,7 +61,7 @@ a { @@ -61,7 +61,7 @@ a {
61 } 61 }
62 62
63 .show { 63 .show {
64 - display: block; 64 + display: block !important;
65 } 65 }
66 66
67 .overflow-hidden { 67 .overflow-hidden {