|
|
|
@ -9,7 +9,8 @@ |
|
|
|
|
<!-- 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> |
|
|
|
|
<!-- <web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" src="http://192.168.31.125:8097/#/previewPPT?src=https%3A%2F%2Fhuoran.oss-cn-shenzhen.aliyuncs.com%2F1725254394528.pptx" @click="hidePlayList"></web-view> --> |
|
|
|
|
<!-- <web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" src="https://eduvessel.com/#/previewPPT" @click="hidePlayList"></web-view> --> |
|
|
|
|
<!-- <web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" src="https://eduvessel.com/#/previewPPT?src=https%3A%2F%2Fhuoran.oss-cn-shenzhen.aliyuncs.com%2F1706689196136.pptx" @click="hidePlayList"></web-view> --> |
|
|
|
|
<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> |
|
|
|
@ -115,7 +116,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { queryChaptersAndSubsections, detailsOfGoods, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth, playRecordSave, recordRecentUsage, getALinkToTheExperimentReport, getExamPaperReportUrl } from '@/apis/modules/course.js' |
|
|
|
|
import { queryChaptersAndSubsections, detailsOfGoods, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth, playRecordSave, recordRecentUsage, getALinkToTheExperimentReport, getExamPaperReportUrl, fileConversion } from '@/apis/modules/course.js' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -356,13 +357,41 @@ |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 判断文件是图片/视频/pdf等 |
|
|
|
|
handleFileType(row) { |
|
|
|
|
async handleFileType(row) { |
|
|
|
|
const type = row.fileType |
|
|
|
|
const platform = uni.getSystemInfoSync().platform |
|
|
|
|
// ppt安卓下没法用webview或者用微软的office服务预览(皆会没法显示),因此用h5嵌套显示(该地址是慧教云舟官网地址) |
|
|
|
|
if (type === 'pptx' || type === 'ppt') { |
|
|
|
|
row.isDoc = true |
|
|
|
|
row.viewUrl = 'https://eduvessel.com/#/previewPPT?src=' + row.fileUrl |
|
|
|
|
this.curRow = row |
|
|
|
|
if ((type === 'pptx' || type === 'ppt') && platform === 'android') { |
|
|
|
|
// row.isDoc = true |
|
|
|
|
// row.viewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + row.fileUrl |
|
|
|
|
// this.curRow = row |
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
uni.downloadFile({ |
|
|
|
|
url: `http://192.168.31.51:9000/nakadai/nakadai/oss/fileConversion?pptUrl=${row.fileUrl}`, |
|
|
|
|
success: function(res) { |
|
|
|
|
console.log(11, res) |
|
|
|
|
// 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。 |
|
|
|
|
uni.openDocument({ |
|
|
|
|
filePath: res.tempFilePath, |
|
|
|
|
// fileType: row.fileType, |
|
|
|
|
fileType: 'pdf', |
|
|
|
|
showMenu: true, // 允许出现分享功能 |
|
|
|
|
success: res => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}, |
|
|
|
|
fail: openError => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
fail: function(err) { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
if (this.$util.exts.video.includes(type)) { |
|
|
|
|
row.isVideo = true |
|
|
|
@ -373,6 +402,7 @@ |
|
|
|
|
} |
|
|
|
|
row.viewUrl = row.fileUrl |
|
|
|
|
this.curRow = row |
|
|
|
|
console.log(11, this.curRow) |
|
|
|
|
} |
|
|
|
|
if (!this.curRow.isVideo) this.videoFullScreen = false |
|
|
|
|
}, |
|
|
|
|