diff --git a/src/components/preview/ImageViewer.vue b/src/components/preview/ImageViewer.vue index 9c8ce3e..d168d43 100644 --- a/src/components/preview/ImageViewer.vue +++ b/src/components/preview/ImageViewer.vue @@ -153,11 +153,12 @@ export default { this.images.forEach(image => { imageUrls.push(image.source) }) + const that = this this.vantImagePreview = vant.ImagePreview({ images: imageUrls, startPosition: viewIndex, onClose() { - this.$store.dispatch('updateMessage', { event: 'updateImageViewerStatus'}) + that.$store.dispatch('updateMessage', { event: 'updateImageViewerStatus'}) } }) } diff --git a/src/components/preview/VideoPreview.vue b/src/components/preview/VideoPreview.vue index 321aef2..a284045 100644 --- a/src/components/preview/VideoPreview.vue +++ b/src/components/preview/VideoPreview.vue @@ -79,7 +79,7 @@ export default { style: { marginRight: this.$pc ? '20px' : '0px', }, - html: ``, + html: ``, index: 2, }, { @@ -89,7 +89,7 @@ export default { style: { marginRight: this.$pc ? '20px' : '0px', }, - html: ``, + html: ``, index: 3, }, { @@ -125,6 +125,12 @@ export default { watch: { status: function (visible) { if (visible) { + + if (!this.$pc) { + // 去掉this.option.controls中name为 name: 'iina' + this.option.controls = this.option.controls.filter(item => item.name === 'nplayer' || item.name === 'infuse') + } + let videoUrl = fileConfig.previewUrl(this.$store.state.user.name, this.file, this.$store.getters.token) if (this.shareId) { videoUrl = fileConfig.publicPreviewUrl(this.file, window.shareId, this.$store.getters.shareToken) @@ -207,15 +213,24 @@ export default { getInstance(art) { this.art = art let doc = this.art.controls.$parent - // iina - const iina = doc.querySelector('[data-index="1"]').querySelector('a'); - iina.href = `iina://weblink?url=${this.videoLink}` - // nplayer - const nplayer = doc.querySelector('[data-index="2"]').querySelector('a'); - nplayer.href = `nplayer-${this.videoLink}` - // infuse - const infuse = doc.querySelector('[data-index="3"]').querySelector('a'); - infuse.href = `infuse://x-callback-url/play?url=${this.videoLink}` + if (this.$pc) { + // iina + const iina = doc.querySelector('[data-index="1"]').querySelector('a'); + iina.href = `iina://weblink?url=${this.videoLink}` + // nplayer + const nplayer = doc.querySelector('[data-index="2"]').querySelector('a'); + nplayer.href = `nplayer-${this.videoLink}` + // infuse + const infuse = doc.querySelector('[data-index="3"]').querySelector('a'); + infuse.href = `infuse://x-callback-url/play?url=${this.videoLink}` + } else { + // nplayer + const nplayer = doc.querySelector('[data-index="2"]').querySelector('a'); + nplayer.href = `nplayer-${this.videoLink}` + // infuse + const infuse = doc.querySelector('[data-index="3"]').querySelector('a'); + infuse.href = `infuse://x-callback-url/play?url=${this.videoLink}` + } }, playM3u8(video, url, art) { if (Hls.isSupported()) {