|
@@ -17,11 +17,11 @@
|
|
|
:src="item.url"
|
|
:src="item.url"
|
|
|
object-fit="cover"
|
|
object-fit="cover"
|
|
|
:controls="false"
|
|
:controls="false"
|
|
|
- :show-center-play-btn="true"
|
|
|
|
|
|
|
+ :show-center-play-btn="false"
|
|
|
:show-play-btn="false"
|
|
:show-play-btn="false"
|
|
|
- :enable-play-gesture="true"
|
|
|
|
|
|
|
+ :enable-play-gesture="false"
|
|
|
/>
|
|
/>
|
|
|
- <view v-if="item.coverUrl" class="play-mask">
|
|
|
|
|
|
|
+ <view class="play-mask">
|
|
|
<up-icon name="play-circle" color="#fff" size="48rpx"></up-icon>
|
|
<up-icon name="play-circle" color="#fff" size="48rpx"></up-icon>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -152,7 +152,6 @@ const formatSize = (bytes) => {
|
|
|
// 预览逻辑:图片/视频/文件
|
|
// 预览逻辑:图片/视频/文件
|
|
|
const onItemClick = (item, displayIndex) => {
|
|
const onItemClick = (item, displayIndex) => {
|
|
|
if (!item) return;
|
|
if (!item) return;
|
|
|
- if (item.type === 'video' && !item.coverUrl) return;
|
|
|
|
|
if (item.type === 'image') return previewImages(item);
|
|
if (item.type === 'image') return previewImages(item);
|
|
|
if (item.type === 'video') return previewVideo(item, displayIndex);
|
|
if (item.type === 'video') return previewVideo(item, displayIndex);
|
|
|
return previewFile(item);
|
|
return previewFile(item);
|
|
@@ -170,10 +169,10 @@ const previewImages = (clickedItem) => {
|
|
|
const previewVideo = (item, index) => {
|
|
const previewVideo = (item, index) => {
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
|
const allVideos = items.value.filter((i) => i.type === 'video');
|
|
const allVideos = items.value.filter((i) => i.type === 'video');
|
|
|
- const sources = allVideos.map((i) => ({ url: i.url, type: 'video', poster: i.coverUrl || '' }));
|
|
|
|
|
|
|
+ const sources = allVideos.map((i) => ({ url: i.url, type: 'video', poster: i?.coverUrl || '' }));
|
|
|
const current = allVideos.findIndex((i) => i.url === item.url);
|
|
const current = allVideos.findIndex((i) => i.url === item.url);
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
- wx.previewMedia({ sources, current: current >= 0 ? current : 0 });
|
|
|
|
|
|
|
+ uni.previewMedia({ sources, current: current >= 0 ? current : 0 });
|
|
|
// #endif
|
|
// #endif
|
|
|
// #ifndef MP-WEIXIN
|
|
// #ifndef MP-WEIXIN
|
|
|
uni.showToast({ title: '当前平台暂不支持视频预览', icon: 'none' });
|
|
uni.showToast({ title: '当前平台暂不支持视频预览', icon: 'none' });
|