两个视频源

This commit is contained in:
姚俊旭 2025-05-30 15:57:50 +08:00
parent e639338d4f
commit 5c612db1c7
4 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@
<div class="agricultural-detail-info"> <div class="agricultural-detail-info">
<div class="top-title"> <div class="top-title">
<div class="father-title" @click="toBack(-1)"> <div class="father-title" @click="toBack(-1)">
<el-icon><ArrowLeftBold /></el-icon>农资交易 <el-icon><ArrowLeftBold /></el-icon>商品信息
</div> </div>
<div class="current-title">查看详情</div> <div class="current-title">查看详情</div>
</div> </div>

View File

@ -23,6 +23,13 @@ const props = defineProps({
return items; return items;
}, },
}, },
num: {
type: Number,
default: () => 1,
validator: (items) => {
return items;
},
},
devices: { devices: {
type: Array, type: Array,
required: true, required: true,
@ -99,7 +106,8 @@ onMounted(async () => {
</div> </div>
<div style="display: flex; justify-content: space-between; align-items: center"> <div style="display: flex; justify-content: space-between; align-items: center">
<div class="video-wrapper"> <div class="video-wrapper">
<video ref="videoPlayer" src="../components/jiankong.mp4" controls autoplay muted></video> <video v-if="num === 1" ref="videoPlayer" src="../components/jiankong.mp4" controls loop autoplay muted></video>
<video v-else ref="videoPlayer" src="../components/jiankong1.mp4" controls loop autoplay muted></video>
<div v-if="loading" class="status-message">正在加载直播流...</div> <div v-if="loading" class="status-message">正在加载直播流...</div>
<div v-if="error" class="status-message error">{{ error }}</div> <div v-if="error" class="status-message error">{{ error }}</div>
</div> </div>

View File

@ -158,7 +158,7 @@ const chooseIcon = (type) => {
</div> </div>
<div style="margin-top: 10px; display: flex; justify-content: space-between"> <div style="margin-top: 10px; display: flex; justify-content: space-between">
<div style="display: flex; justify-content: space-between; margin-top: 10px; width: 100%"> <div style="display: flex; justify-content: space-between; margin-top: 10px; width: 100%">
<stream :title="'虫害监测实时监控'" :devices="devices" style="width: 60%; height: fit-content"></stream> <stream :title="'虫害监测实时监控'" :num="2" :devices="devices" style="width: 60%; height: fit-content"></stream>
<div style="width: 38%"> <div style="width: 38%">
<el-card style="border-radius: 16px; padding: 10px"> <el-card style="border-radius: 16px; padding: 10px">
<div style="font-size: 16px; font-weight: bold; text-align: left; color: #000">虫害数据</div> <div style="font-size: 16px; font-weight: bold; text-align: left; color: #000">虫害数据</div>