Commit 342b2c98 by zhangquan

提交代码

1 parent 464c42f4
......@@ -53,16 +53,16 @@ export default {
},
mounted() {
try {
const _that = this
if(!this.info.videoUrl) return
const video = document.getElementById('swiper_video')
video.addEventListener('play', function() {
_that.autoplay = 0
video.addEventListener('play', ()=> {
this.autoplay = 0
})
video.addEventListener('pause', function() {
_that.autoplay = 3000
video.addEventListener('pause', ()=> {
this.autoplay = 3000
})
video.addEventListener('ended', function() {
_that.autoplay = 3000
video.addEventListener('ended', ()=> {
this.autoplay = 3000
}, false)
} catch (error) {
console.log('监听失败', error)
......@@ -74,18 +74,19 @@ export default {
},
getDetail(id) {
marketingApi.getTextDetail({ id, flag: 0 }).then(data => {
console.log(data)
const fileList = []
if (data.videoUrl) {
fileList.push({ type: 'video', url: data.videoUrl })
if(data){
const fileList = []
if (data.videoUrl) {
fileList.push({ type: 'video', url: data.videoUrl })
}
if (data.imageUrlList && data.imageUrlList.length) {
data.imageUrlList.forEach(item => {
fileList.push({ type: 'image', url: item })
})
}
this.fileList = fileList
this.info = data
}
if (data.imageUrlList && data.imageUrlList.length) {
data.imageUrlList.forEach(item => {
fileList.push({ type: 'image', url: item })
})
}
this.fileList = fileList
this.info = data
})
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!