Commit 3d4582e6 authored by yun's avatar yun

修改资料loading

parent d38b3a63
......@@ -425,7 +425,7 @@ export default {
const that = this
setTimeout(() => {
that.itemLoading = false
}, 1200)
}, 800)
if (page === 1) {
setTimeout(() => {
const pdfStyle = document.getElementsByClassName('pdf')
......
......@@ -613,7 +613,7 @@
class="picture-wrapper"
>
<van-loading
v-if="previewType === ''"
v-if="itemLoading"
size="24px"
>
文件加载中...
......@@ -720,6 +720,7 @@ export default {
},
data() {
return {
itemLoading: true,
enrolment: [], // 已报名
absent: [], // 未到场
arrived: [], // 已到场
......@@ -990,6 +991,7 @@ export default {
})
} else if (file.type === '2') {
this.priviewShow = true
this.itemLoading = true
// ppt 文件预览
const temp = {
videoUrl: decodeURIComponent(file.videoUrl),
......@@ -1004,6 +1006,7 @@ export default {
}, 2000)
} else {
this.priviewShow = false
this.itemLoading = false
this.$toast({
type: 'fail',
message: res.data.message,
......@@ -1012,6 +1015,7 @@ export default {
}
}).catch((err) => {
this.priviewShow = false
this.itemLoading = false
console.log(err)
this.$toast({
type: 'fail',
......@@ -1021,6 +1025,7 @@ export default {
})
} else if (file.type === '4') {
this.priviewShow = true
this.itemLoading = true
// word文档预览
const temp = {
videoUrl: decodeURIComponent(file.videoUrl),
......@@ -1035,6 +1040,7 @@ export default {
}, 2000)
} else {
this.priviewShow = false
this.itemLoading = false
this.$toast({
type: 'fail',
message: res.data.message,
......@@ -1042,8 +1048,8 @@ export default {
})
}
}).catch((err) => {
console.log(err, 'sssssssssssssssssssssss')
this.priviewShow = false
this.itemLoading = false
this.$toast({
type: 'fail',
message: err.message || '无法预览',
......@@ -1052,6 +1058,7 @@ export default {
})
} else if (file.type === '3' || file.type === '6') {
this.priviewShow = true
this.itemLoading = true
// pdf txt 文件预览
const temp = {
videoUrl: decodeURIComponent(file.videoUrl),
......@@ -1066,6 +1073,7 @@ export default {
}, 2000)
} else {
this.priviewShow = false
this.itemLoading = false
this.$toast({
type: 'fail',
message: res.data.message,
......@@ -1074,6 +1082,7 @@ export default {
}
}).catch((err) => {
this.priviewShow = false
this.itemLoading = false
this.$toast({
type: 'fail',
message: err.message || '无法预览',
......@@ -1604,6 +1613,8 @@ export default {
this.getTrainPersons()
},
onPdfLoaded(page) {
const that = this
that.itemLoading = false
if (page === 1) {
setTimeout(() => {
const pdfStyle = document.getElementsByClassName('pdf')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment