|
|
|
@ -1,9 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="wrap"> |
|
|
|
|
<!-- <view class="header"> |
|
|
|
|
<uni-icons class="back" type="back" size="20" color="#fff" @click="back"></uni-icons> |
|
|
|
|
<text>课程详情</text> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- <web-view class="wv" src="https://view.officeapps.live.com/op/view.aspx?src=https://huoran.oss-cn-shenzhen.aliyuncs.com/1732588133977.xlsx"></web-view> --> |
|
|
|
|
<view class="file-wrap"> |
|
|
|
|
<image v-if="!curRow.viewUrl && coverUrl" class="pic" :src="coverUrl" mode="widthFix"></image> |
|
|
|
@ -13,7 +9,7 @@ |
|
|
|
|
<!-- pdf、word、excel、ppt都用webview展示 --> |
|
|
|
|
<view v-else-if="curRow.isDoc" class="webview-wrap"> |
|
|
|
|
<web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" :src="curRow.viewUrl" @click="hidePlayList"></web-view> |
|
|
|
|
<cover-view :class="['webview-mask', {ppt: curRow.isPpt}]" @click="closePreview"> |
|
|
|
|
<cover-view class="webview-mask" @click="closePreview"> |
|
|
|
|
<cover-image class="icon" src="https://eduvessel.com/images/occupationlab/close-gray.png" alt="" mode="widthFix" /> |
|
|
|
|
</cover-view> |
|
|
|
|
</view> |
|
|
|
@ -362,23 +358,15 @@ |
|
|
|
|
// 判断文件是图片/视频/pdf等 |
|
|
|
|
handleFileType(row) { |
|
|
|
|
const type = row.fileType |
|
|
|
|
if (type === 'pptx' || type === 'ppt') { |
|
|
|
|
row.isPpt = true |
|
|
|
|
if (this.$util.exts.video.includes(type)) { |
|
|
|
|
row.isVideo = true |
|
|
|
|
} else if (this.$util.exts.img.includes(type)) { |
|
|
|
|
row.isPic = true |
|
|
|
|
} else if (this.$util.exts.doc.includes(type)) { |
|
|
|
|
row.isDoc = true |
|
|
|
|
row.viewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + row.fileUrl |
|
|
|
|
} else { |
|
|
|
|
if (this.$util.exts.video.includes(type)) { |
|
|
|
|
row.isVideo = true |
|
|
|
|
} else if (this.$util.exts.img.includes(type)) { |
|
|
|
|
row.isPic = true |
|
|
|
|
} else if (this.$util.exts.doc.includes(type)) { |
|
|
|
|
row.isDoc = true |
|
|
|
|
} |
|
|
|
|
row.viewUrl = row.fileUrl |
|
|
|
|
} |
|
|
|
|
row.viewUrl = row.fileUrl |
|
|
|
|
this.curRow = row |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
console.log('preview:',pages) |
|
|
|
|
}, |
|
|
|
|
// 预览文件 |
|
|
|
|
secClick(row) { |
|
|
|
@ -600,7 +588,10 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.detail { |
|
|
|
|
max-height: calc(100vh - 562rpx); |
|
|
|
|
padding: 0 30rpx 30rpx; |
|
|
|
|
overflow: auto; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
.chapters { |
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
} |
|
|
|
|