Authored by zzzzzzz

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

... ... @@ -30,7 +30,7 @@ let _getBannerData = () => {
code: 200,
cache: true
}).then((result) => {
return result.data ? resourcesProcess(result.data) : [];
return result && result.data ? resourcesProcess(result.data) : [];
});
};
... ... @@ -117,9 +117,13 @@ const fetchReplayInfo = (videoID) => {
d.logo = helpers.image(d.logo, 70, 70);
d.pic = helpers.image(d.pic, 640, 968);
d.master_pic = helpers.image(d.master_pic, 180, 180);
d.living = 3; // 自定义的重播 状态
d.humanTime = _formatTime(data.living_start_time * 1000);
d.video_src = d.url;
// 自定义数据
d.living = 3; // 重播 状态
d.canPlay = true;
d.atEnd = false;
}
return result;
... ... @@ -141,6 +145,11 @@ const fetchLiveInfo = (roomID) => {
d.master_pic = helpers.image(d.master_pic, 180, 180);
d.humanTime = _formatTime(d.living_start_time * 1000);
d.video_src = d.hls_downstream_address;
// 自定义的数据
d.canPlay = d.living === 1;
d.notBegin = d.living === 0;
d.atEnd = d.living === 2;
}
return result;
... ...
{{! 直播 播放页 }}
<div class="live-wrapper">
{{#canPlay}}
<div class="live-main">
<!-- 视频部分start-->
<!--http://live-hls-pili.1iptv.com/meipai-live/57651bb975b6255acc01444c.m3u8-->
<section id="live_container" class="live-video-main" style="height:28.4rem;background-image: url(/img/activity/live/live/video_cover.jpg);">
<section id="live_container" class="live-video-main" style="background-image: url(/img/activity/live/live/video_cover.jpg);">
<div id="video_container" class="video_player" data-video="{{video_src}}">
</div>
<div class="live-loading-container">
... ... @@ -61,9 +62,10 @@
</a>
</section>
</div>
{{/canPlay}}
{{!直播已结束}}
<div id="live-state-end" class="live-state is-no-start {{#isEqual living 2}}show{{/isEqual}}" style="background-image: url('{{pic}}');">
<div id="live-state-end" class="live-state is-no-start {{#atEnd}}show{{/atEnd}}" style="background-image: url('{{pic}}');">
<div class="live-state__txt">直播已结束</div>
<ul class="live-state-info">
<li class="audience text-center">
... ... @@ -92,7 +94,8 @@
</div>
{{!直播未开始}}
<div class="live-state is-no-start {{#isEqual living 1}}show{{/isEqual}}" style="background-image: url('{{pic}}');">
{{#notBegin}}
<div class="live-state is-no-start show" style="background-image: url('{{pic}}');">
<div class="live-state__txt">直播未开始</div>
<div class="live-state-info text-center">
<img src="{{master_pic}}" alt="" class="avatar"><br>
... ... @@ -104,6 +107,7 @@
<i class="iconfont">&#xe623</i>
</a>
</div>
{{/notBegin}}
</div>
<script>
var live_start_time = {{live_start_time}};//该直播开始时间
... ...
... ... @@ -117,7 +117,7 @@ if (isProduction) {
domains: {
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/',
liveApi: 'http://api.live.yoho.cn/'
liveApi: 'http://testapi.live.yohops.com:9999/'
},
memcache: {
master: ['127.0.0.1:12111'],
... ...
... ... @@ -18,7 +18,7 @@
(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);
</script>
{{#if devEnv}}
<link rel="stylesheet" href="//localhost:5001/css/index.css">
<link rel="stylesheet" href="//172.16.9.133:5002/css/index.css">
{{^}}
<link rel="stylesheet" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css">
{{/if}}
... ... @@ -41,8 +41,8 @@
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
{{/wechatShare}}
{{#if devEnv}}
<script src="//localhost:5001/libs.js"></script>
<script src="//localhost:5001/{{module}}.{{page}}.js"></script>
<script src="//172.16.9.133:5002/libs.js"></script>
<script src="//172.16.9.133:5002/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js"></script>
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
... ...
... ... @@ -5,6 +5,8 @@
"script": "app.js",
"instances": "max",
"exec_mode": "cluster",
"merge_logs": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"env": {
"PORT": 6001
}
... ...
... ... @@ -6,6 +6,14 @@ require('./live/yoho_live_detail_main');
require('./live/temp');
require('./live/yoho_live_share');
global.$ = $;
$('.live-wrapper').css({
position: 'relative',
height: window.innerHeight,
width: window.innerWidth
});
$(function() {
var $share = $('.live-btn-share');
... ...
... ... @@ -61,7 +61,7 @@ a {
}
.show {
display: block;
display: block !important;
}
.overflow-hidden {
... ...