Commit fa7f579c by 胡悦

Merge branch 'dev_2.8.3' of http://192.168.3.233:8090/glsx/scrm-wx-merchant-activity into dev_2.8.3

2 parents 5957b1f8 3d629bf1
...@@ -256,7 +256,7 @@ const date_format = num => { ...@@ -256,7 +256,7 @@ const date_format = num => {
} }
return `${days}天${hours}:${minutes}:${second}` return `${days}天${hours}:${minutes}:${second}`
} }
const draggable = (drag, fun) => { const draggable = (drag, fun, target) => {
var startEvt, moveEvt, endEvt var startEvt, moveEvt, endEvt
// 判断是否支持触摸事件 // 判断是否支持触摸事件
if ('ontouchstart' in window) { if ('ontouchstart' in window) {
...@@ -273,6 +273,7 @@ const draggable = (drag, fun) => { ...@@ -273,6 +273,7 @@ const draggable = (drag, fun) => {
drag.addEventListener(startEvt, startFun) drag.addEventListener(startEvt, startFun)
function startFun (event) { function startFun (event) {
if(!drag.id) return
// 阻止页面的滚动,缩放 // 阻止页面的滚动,缩放
event.preventDefault() event.preventDefault()
// 兼容IE浏览器 // 兼容IE浏览器
...@@ -310,8 +311,8 @@ const draggable = (drag, fun) => { ...@@ -310,8 +311,8 @@ const draggable = (drag, fun) => {
} }
drag.style.left = left + 'px' drag.style.left = left + 'px'
drag.style.top = top + 'px' drag.style.top = top + 'px'
}
}
function endFun (event) { function endFun (event) {
drag.style.cursor = '' drag.style.cursor = ''
document.removeEventListener(moveEvt, moveFun) document.removeEventListener(moveEvt, moveFun)
......
<template> <template>
<div <div
:class="['live-box',{'videoFullscreen':videoFullscreen}]" :class="['live-box',{'videoFullscreen':videoFullscreen}]"
:style="videoStyle"
id="live-box" id="live-box"
> >
<div <div class="mask">
class="mask"
@click="openFullscreen"
>
<div class="sprite-icon icon-live-close"></div> <div class="sprite-icon icon-live-close"></div>
<div class="status flex"> <div class="status flex">
<div class="live-line"> <div class="live-line">
...@@ -90,7 +86,7 @@ export default { ...@@ -90,7 +86,7 @@ export default {
_this.player.ready(function () { //设置播放器初始化完成后的回调 _this.player.ready(function () { //设置播放器初始化完成后的回调
console.log('-------------------------', _this.player.poster()) console.log('-------------------------', _this.player.poster())
_this.player.play() //播放视频 _this.player.play() //播放视频
_this.draggable(document.getElementById('live-box')) _this.draggable(document.getElementById('live-box'), _this.openFullscreen)
}) })
} }
}) })
...@@ -105,12 +101,13 @@ export default { ...@@ -105,12 +101,13 @@ export default {
}, },
methods: { methods: {
openFullscreen (status = true) { //打开关闭全屏 openFullscreen (status = true) { //打开关闭全屏
let [live] = document.getElementsByClassName('live-box')
let [volumePanel] = document.getElementsByClassName('vjs-volume-panel ') let [volumePanel] = document.getElementsByClassName('vjs-volume-panel ')
let [volume] = volumePanel.getElementsByClassName('vjs-mute-control') let [volume] = volumePanel.getElementsByClassName('vjs-mute-control')
volume.click() volume.click()
this.player.play() this.player.play()
this.videoFullscreen = status this.videoFullscreen = status
live.id = status ? '' : 'live-box'
}, },
} }
} }
...@@ -126,7 +123,6 @@ export default { ...@@ -126,7 +123,6 @@ export default {
height: 148px; height: 148px;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
-webkit-user-select: auto;
.mask { .mask {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!