mirror of https://github.com/halo-dev/halo-admin
修复eslint
parent
a8f2d7030e
commit
6bf343286c
|
@ -247,10 +247,10 @@ export default {
|
||||||
handleJudgeMediaType(attachment) {
|
handleJudgeMediaType(attachment) {
|
||||||
var mediaType = attachment.mediaType
|
var mediaType = attachment.mediaType
|
||||||
// 判断文件类型
|
// 判断文件类型
|
||||||
if(mediaType) {
|
if (mediaType) {
|
||||||
var prefix = mediaType.split('/')[0]
|
var prefix = mediaType.split('/')[0]
|
||||||
|
|
||||||
if(prefix === 'image') {
|
if (prefix === 'image') {
|
||||||
// 是图片
|
// 是图片
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
@ -258,7 +258,7 @@ export default {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//没有获取到文件返回false
|
// 没有获取到文件返回false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
<div class="attach-detail-img">
|
<div class="attach-detail-img">
|
||||||
<div v-show="nonsupportPreviewVisible">此文件不支持预览</div>
|
<div v-show="nonsupportPreviewVisible">此文件不支持预览</div>
|
||||||
<img :src="attachment.path" v-show="photoPreviewVisible">
|
<img :src="attachment.path" v-show="photoPreviewVisible">
|
||||||
<video-player class="video-player-box" v-show="videoPreviewVisible"
|
<video-player
|
||||||
|
class="video-player-box"
|
||||||
|
v-show="videoPreviewVisible"
|
||||||
ref="videoPlayer"
|
ref="videoPlayer"
|
||||||
:options="playerOptions"
|
:options="playerOptions"
|
||||||
:playsinline="true">
|
:playsinline="true">
|
||||||
|
@ -179,13 +181,12 @@ export default {
|
||||||
fluid: true,
|
fluid: true,
|
||||||
controls: true,
|
controls: true,
|
||||||
loop: false,
|
loop: false,
|
||||||
muted: false,
|
|
||||||
playbackRates: [0.7, 1.0, 1.5, 2.0],
|
playbackRates: [0.7, 1.0, 1.5, 2.0],
|
||||||
sources: [{
|
sources: [{
|
||||||
type: "video/mp4",
|
type: 'video/mp4',
|
||||||
src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
|
src: 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm'
|
||||||
}],
|
}],
|
||||||
poster: "/static/images/author.jpg",
|
poster: '/static/images/author.jpg',
|
||||||
width: document.documentElement.clientWidth,
|
width: document.documentElement.clientWidth,
|
||||||
notSupportedMessage: '此视频暂无法播放,请稍后再试'
|
notSupportedMessage: '此视频暂无法播放,请稍后再试'
|
||||||
}
|
}
|
||||||
|
@ -297,10 +298,10 @@ export default {
|
||||||
handleJudgeMediaType(attachment) {
|
handleJudgeMediaType(attachment) {
|
||||||
var mediaType = attachment.mediaType
|
var mediaType = attachment.mediaType
|
||||||
// 判断文件类型
|
// 判断文件类型
|
||||||
if(mediaType) {
|
if (mediaType) {
|
||||||
var prefix = mediaType.split('/')[0]
|
var prefix = mediaType.split('/')[0]
|
||||||
|
|
||||||
if(prefix === 'video' || prefix==='flv') {
|
if (prefix === 'video' || prefix === 'flv') {
|
||||||
this.videoPreviewVisible = true
|
this.videoPreviewVisible = true
|
||||||
this.photoPreviewVisible = false
|
this.photoPreviewVisible = false
|
||||||
this.nonsupportPreviewVisible = false
|
this.nonsupportPreviewVisible = false
|
||||||
|
@ -310,7 +311,7 @@ export default {
|
||||||
src: attachment.path
|
src: attachment.path
|
||||||
})
|
})
|
||||||
console.log(this.playerOptions.sources)
|
console.log(this.playerOptions.sources)
|
||||||
} else if(prefix === 'image') {
|
} else if (prefix === 'image') {
|
||||||
this.photoPreviewVisible = true
|
this.photoPreviewVisible = true
|
||||||
this.videoPreviewVisible = false
|
this.videoPreviewVisible = false
|
||||||
this.nonsupportPreviewVisible = false
|
this.nonsupportPreviewVisible = false
|
||||||
|
@ -321,6 +322,19 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// handleDownLoadPhoto(attachment) {
|
||||||
|
// var path = attachment.path
|
||||||
|
|
||||||
|
// var index = path.lastIndexOf('/')
|
||||||
|
// var filename = path.substr(index+1, path.length)
|
||||||
|
// // chrome/firefox
|
||||||
|
// var aTag = document.createElement('a')
|
||||||
|
// aTag.download = filename
|
||||||
|
// aTag.href = path//URL.createObjectURL(blob)
|
||||||
|
// aTag.target = '_blank'
|
||||||
|
// aTag.click()
|
||||||
|
// URL.revokeObjectURL(aTag.href)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue