|
|
|
@ -1,19 +1,22 @@ |
|
|
|
|
<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> |
|
|
|
|
<template v-else> |
|
|
|
|
<image v-if="curRow.isPic" class="pic" :src="curRow.viewUrl" mode="widthFix" @click="hidePlayList"></image> |
|
|
|
|
<video v-else-if="curRow.isVideo" class="video" :key="curRow.viewUrl" width="100%" height="100%" autoplay controls :src="curRow.viewUrl" type="video/mp4" @click="hidePlayList" @fullscreenchange="fullScreenChange"></video> |
|
|
|
|
<!-- 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 v-if="curRow.isPpt" class="webview-mask" @click="closePreview"> |
|
|
|
|
<cover-view :class="['webview-mask', {ppt: curRow.isPpt}]" @click="closePreview"> |
|
|
|
|
<cover-image class="icon" src="https://eduvessel.com/images/occupationlab/close-gray.png" alt="" mode="widthFix" /> |
|
|
|
|
</cover-view> |
|
|
|
|
<cover-image v-else class="webview-close" src="https://eduvessel.com/images/occupationlab/close-gray.png" alt="" mode="widthFix" /> |
|
|
|
|
</view> |
|
|
|
|
<!-- <web-view class="webview" :webview-styles="webviewStyles" :fullscreen="false" src="https://huoran.oss-cn-shenzhen.aliyuncs.com/1732589800544.xlsx"></web-view> --> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<cover-view v-show="!playListVisible && curRow.viewUrl && (!curRow.isVideo || videoFullScreen)" class="select-epi"> |
|
|
|
@ -227,6 +230,7 @@ |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
console.log(444,pages) |
|
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
|
this.cid = options.cid |
|
|
|
|
this.mallId = options.mallId |
|
|
|
@ -369,6 +373,8 @@ |
|
|
|
|
row.viewUrl = row.fileUrl |
|
|
|
|
} |
|
|
|
|
this.curRow = row |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
console.log('preview:',pages) |
|
|
|
|
}, |
|
|
|
|
// 预览文件 |
|
|
|
|
secClick(row) { |
|
|
|
@ -395,6 +401,16 @@ |
|
|
|
|
closePreview() { |
|
|
|
|
this.curRow = {} |
|
|
|
|
}, |
|
|
|
|
// 返回 |
|
|
|
|
back() { |
|
|
|
|
if (this.curRow.viewUrl) { |
|
|
|
|
this.curRow = {} |
|
|
|
|
} else { |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/index/index' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
@ -403,6 +419,22 @@ |
|
|
|
|
.wrap { |
|
|
|
|
min-height: 100%; |
|
|
|
|
background-color: #fff; |
|
|
|
|
.header { |
|
|
|
|
position: relative; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 60rpx; |
|
|
|
|
padding: calc(var(--status-bar-height) + 60rpx) 0 10rpx; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
text-align: center; |
|
|
|
|
color: #fff; |
|
|
|
|
background-color: #007EFF; |
|
|
|
|
// box-sizing: border-box; |
|
|
|
|
.back { |
|
|
|
|
position: absolute; |
|
|
|
|
top: calc(var(--status-bar-height) + 60rpx); |
|
|
|
|
left: 10rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.file-wrap { |
|
|
|
|
position: relative; |
|
|
|
@ -441,7 +473,7 @@ |
|
|
|
|
.webview-mask { |
|
|
|
|
z-index: 9; |
|
|
|
|
position: fixed; |
|
|
|
|
top: 0; |
|
|
|
|
top: 20rpx; |
|
|
|
|
left: 0; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-end; |
|
|
|
@ -449,21 +481,16 @@ |
|
|
|
|
width: 100%; |
|
|
|
|
height: 50rpx; |
|
|
|
|
padding: 0 20rpx; |
|
|
|
|
background-color: #fff; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
&.ppt { |
|
|
|
|
top: 0; |
|
|
|
|
background-color: #fff; |
|
|
|
|
} |
|
|
|
|
.icon { |
|
|
|
|
width: 44rpx; |
|
|
|
|
height: 44rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.webview-close { |
|
|
|
|
z-index: 10; |
|
|
|
|
position: fixed; |
|
|
|
|
top: 20rpx; |
|
|
|
|
right: 30rpx; |
|
|
|
|
width: 44rpx; |
|
|
|
|
height: 44rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.webview { |
|
|
|
|
position: absolute; |
|
|
|
|