From 565e056886ba869a126b56d1840cceb2678ccd51 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 9 Jun 2024 13:35:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=9F=A5=E7=9C=8B=E7=85=A7=E7=89=87=E5=8D=A1=E4=BD=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98(Close=20#172)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/ImageViewer.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'}) } }) } From a475c456dd6334b267054c0a5dd84b78294ecfd1 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 9 Jun 2024 14:53:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/VideoPreview.vue | 37 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-) 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()) {