Commit d44c5938 by zhangquan

修改detail

1 parent 342b2c98
...@@ -36,7 +36,7 @@ import { marketingApi } from '@/api' ...@@ -36,7 +36,7 @@ import { marketingApi } from '@/api'
import { shareMixin } from '@/mixins' import { shareMixin } from '@/mixins'
export default { export default {
mixins: [shareMixin], mixins: [shareMixin],
name: '', name: 'detail',
data() { data() {
return { return {
curIdx: 0, curIdx: 0,
...@@ -52,21 +52,20 @@ export default { ...@@ -52,21 +52,20 @@ export default {
this.getDetail(id) this.getDetail(id)
}, },
mounted() { mounted() {
try {
if(!this.info.videoUrl) return if(!this.info.videoUrl) return
const video = document.getElementById('swiper_video') const video = document.getElementById('swiper_video')
video.addEventListener('play', ()=> { if(video){
this.autoplay = 0 video.addEventListener('play', ()=> {
}) this.autoplay = 0
video.addEventListener('pause', ()=> { })
this.autoplay = 3000 video.addEventListener('pause', ()=> {
}) this.autoplay = 3000
video.addEventListener('ended', ()=> { })
this.autoplay = 3000 video.addEventListener('ended', ()=> {
}, false) this.autoplay = 3000
} catch (error) { }, false)
console.log('监听失败', error) }
}
}, },
methods: { methods: {
changeSwiper(idx) { changeSwiper(idx) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!