提交 c69404fb authored 作者: 杨斌基's avatar 杨斌基

feat(随手拍详情): 图片和视频分开显示

上级 e761352d
......@@ -6,13 +6,13 @@
<view class="right">{{ item.put_date }}</view>
</view>
<view class="line"></view>
<view class="step_box">
<view v-for="option of getOptions(item)" class="step_box">
<view class="tep_one">
<image mode="aspectFill" class="tep_icon" src="/static/icon/ic_rw_zp@2x.png" />
<view class="one">上传照片</view>
<view class="one">{{ option.name }}</view>
</view>
<view class="photo_list">
<view class="photo_item" v-for="(val, index) in mediaList" :key="val.id" @click="previewVideo(val, index)">
<view class="photo_item" v-for="(val, index) in mediaList.filter(v => v.type === option.type)" :key="val.id" @click="previewVideo(val, index)">
<image v-if="val.type === 'image'" mode="aspectFill" :src="val.url" style="display: block; width: 168rpx; height: 168rpx; border-radius: 16rpx" />
<view v-else class="play-wrapper">
<video :controls="video.fullscreen" :object-fit="videoFit" :id="`myVideo${index}`" class="upload_img" :src="val.url" @fullscreenchange="onVideoFullscreenChange" />
......@@ -154,6 +154,28 @@ export default {
if (!fullScreen) {
this.video.ctx.pause()
}
},
getOptions(detail) {
const actionsOptions = [
{
name: '照片',
type: 'image',
},
{
name: '视频',
type: 'video',
}
]
const res = []
if (detail.image_list?.length > 0) {
res.push(actionsOptions[0])
}
if (detail.video_list?.length > 0) {
res.push(actionsOptions[1])
}
return res
}
},
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论