修复:分享页面播放视频时没有关闭按钮的问题

This commit is contained in:
jmal 2021-01-02 16:23:08 +08:00
parent 80e6007b11
commit ee135d61fc
6 changed files with 33 additions and 33 deletions

View File

@ -2656,7 +2656,7 @@ export default {
isFolder: row.isFolder
}).then(res => {
if (res.data) {
this.shareLink = 'http://' + window.location.host + '/s?s=' + res.data
this.shareLink = window.location.origin + '/s?s=' + res.data
this.generateShareLinkLoading = false
}
})

View File

@ -671,6 +671,7 @@
.files-title {
margin-left: 3%;
font-size: 20px;
line-height: 3.5rem;
}
.operate {
flex: 1;

View File

@ -24,7 +24,7 @@
<div class="url-desc" v-if="uploadState > 0" slot="tip">
<span v-show="uploadState === 1">图片上传中{{uploadPercentage}}%</span>
<span v-show="uploadState === 2">图片上传成功</span>
<span v-show="uploadState === 3">该图片不支持自动上传,请下载后手动上传</span>
<span v-show="uploadState === 3">该图片不支持自动上传</span>
<span v-show="uploadState === 4">图片加载中</span>
<i :class="{
'el-icon-loading': uploadState === 1 || uploadState === 4,

View File

@ -2,9 +2,15 @@
<div class="preview" v-if="show">
<van-overlay :show="show">
<div class="wrapper">
<div class="block" @mousemove="onmousemove" @mouseout="onmouseout" @mouseenter="onmouseenter" @mouseleave="onmouseleave">
<!-- <div role="button" @click="close" class="viewer-button viewer-close" data-viewer-action="mix"></div>-->
<div v-show="pc?closeBarShow:true" class="close-bar" @click="close">
<div class="block"
@mousemove="onmousemove"
@mouseout="onmouseout"
@mouseenter="onmouseenter"
@mouseleave="onmouseleave"
@touchstart="onmouseenter"
@touchend="onmousemove"
>
<div v-show="closeBarShow" class="close-bar" @click="close">
<svg-icon class="audio-player-close" icon-class="close"/>
</div>
<video-player class="video-player vjs-custom-skin"
@ -150,7 +156,9 @@ export default {
if(this.playing){
if(!this.$pc){
const closeBar = document.querySelector('.block .close-bar')
closeBar.style.display = "none"
if(closeBar){
closeBar.style.display = "none"
}
}
this.closeBarShow = false
}
@ -158,25 +166,16 @@ export default {
},
onmouseenter() {
this.closeBarShow = true
let player = document.querySelector('.video-player.video-player.vjs-custom-skin')
// console.log('player',player)
// if(!player) return;
// this.onhover(function() {
// console.log('124')
// }, player, 2000);
},
// onhover(fun, obj, time) {
// var s;
// obj.onmouseover = function() {
// console.log('onmouseover')
// s = setTimeout(fun, 1000);
// };
// obj.onmouseout = function() {
// console.log('onmouseout')
// if(!s) return;
// clearTimeout(s);
// };
// },
ontouchstart() {
console.log('ontouchstart', this.closeBarShow)
this.closeBarShow = true
},
ontouchsend() {
console.log('ontouchsend', this.closeBarShow)
this.closeBarShow = false
this.clearTimeout()
}
}
}
</script>

View File

@ -132,11 +132,11 @@ export function formatSize(size) {
} else if (size < 1024) {
return size + 'B'
} else if (size < 1024 * 1024) {
return (size/1024).toFixed(2) + 'k'
return (size/1024).toFixed(1) + 'k'
} else if (size < 1024 * 1024 * 1024) {
return (size/(1024 * 1024)).toFixed(2) + 'M'
return (size/(1024 * 1024)).toFixed(1) + 'M'
} else {
return (size/(1024 * 1024 * 1024)).toFixed(2) + 'G'
return (size/(1024 * 1024 * 1024)).toFixed(1) + 'G'
}
}
@ -146,14 +146,14 @@ export function formatSize(size) {
*/
export function formatNetSpeed(size) {
if (size === 0) {
return '0 B/s'
return '0B/s'
} else if (size < 1024) {
return size + ' B/s'
return size + 'B/s'
} else if (size < 1024 * 1024) {
return (size/1024).toFixed(2) + ' KB/s'
return (size/1024).toFixed(2) + 'KB/s'
} else if (size < 1024 * 1024 * 1024) {
return (size/(1024 * 1024)).toFixed(2) + ' MB/s'
return (size/(1024 * 1024)).toFixed(2) + 'MB/s'
} else {
return (size/(1024 * 1024 * 1024)).toFixed(2) + ' GB/s'
return (size/(1024 * 1024 * 1024)).toFixed(2) + 'GB/s'
}
}

View File

@ -474,7 +474,7 @@
fileClick(row) {
this.shareDialog = true
this.shareFileName = row.fileName
this.shareLink = 'http://'+window.location.host+'/s?s='+row.id
this.shareLink = window.location.origin+'/s?s='+row.id
this.generateShareLinkLoading = false
},
// 复制分享链接