SmartBeehive/pages/Apiary/Apiary_vadio/Apiary_vadio.vue

148 lines
2.6 KiB
Vue
Raw Normal View History

2024-06-21 18:04:01 +08:00
<template>
<view class="page">
<u-navbar :title="title" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
:title-bold='true' height='45' id="navbar">
</u-navbar>
2024-07-05 20:00:41 +08:00
<view class="listvideo" v-if="flag">
<view class="list_item" v-for="(item,index) in list" :key="index">
<video :src="item.videoStream"></video>
2024-06-21 18:04:01 +08:00
</view>
</view>
2024-07-05 20:00:41 +08:00
<view class="" v-else>
2024-07-06 18:05:22 +08:00
<view class="no_cont">
2024-07-05 20:00:41 +08:00
<view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/us7oiRxHLVwqu8plEy3o" mode=""></image>
</view>
<view class="txt">
当前还没有添加视频监控哦
</view>
2024-07-06 18:05:22 +08:00
</view>
2024-07-05 20:00:41 +08:00
<view class="btn" @click="addApiary">
添加视频监控
</view>
2024-06-21 18:04:01 +08:00
</view>
2024-07-06 18:05:22 +08:00
<view class="btn" v-if="flag" @click="addApiary">
添加视频监控
</view>
2024-06-21 18:04:01 +08:00
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: " #F4FAF8",
},
title: "视频监控",
2024-07-06 18:05:22 +08:00
apiaryId: '',
list: [],
pagesum: 1,
pagesize: 10,
flag: true,
total: ''
2024-06-21 18:04:01 +08:00
}
},
2024-07-05 20:00:41 +08:00
onLoad(option) {
2024-07-06 18:05:22 +08:00
this.apiaryId = option.apiaryId
2024-06-21 18:04:01 +08:00
},
onShow() {
2024-07-06 18:05:22 +08:00
this.getlist()
2024-06-21 18:04:01 +08:00
},
methods: {
2024-07-06 18:05:22 +08:00
getlist() {
2024-07-05 20:00:41 +08:00
let data = {
2024-07-06 18:05:22 +08:00
pageNum: this.pagesum,
pageSize: this.pagesize,
apiaryId: this.apiaryId
2024-07-05 20:00:41 +08:00
}
2024-07-06 18:05:22 +08:00
this.$u.get(`/farm/video/list`, data).then(res => {
if (res.code == 200) {
2024-07-05 20:00:41 +08:00
this.total = res.total
2024-07-06 18:05:22 +08:00
if (this.total >= 1) {
2024-07-05 20:00:41 +08:00
this.list = res.rows
this.flag = true
2024-07-06 18:05:22 +08:00
} else {
2024-07-05 20:00:41 +08:00
this.flag = false
}
}
})
},
2024-07-06 18:05:22 +08:00
addApiary() {
2024-06-21 18:04:01 +08:00
uni.navigateTo({
2024-07-06 18:05:22 +08:00
url: '/pages/Apiary/addVadio?apiaryId=' + this.apiaryId
2024-06-21 18:04:01 +08:00
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #F4FAF8;
}
.page {
// position: relative;
width: 750rpx;
2024-07-06 18:05:22 +08:00
.listvideo {
2024-07-05 20:00:41 +08:00
padding: 0 34rpx;
box-sizing: border-box;
margin-top: 56rpx;
2024-07-06 18:05:22 +08:00
.list_item {
2024-07-05 20:00:41 +08:00
width: 682rpx;
height: 388rpx;
border-radius: 28rpx 28rpx 28rpx 28rpx;
overflow: hidden;
margin-top: 20rpx;
2024-07-06 18:05:22 +08:00
video {
2024-07-05 20:00:41 +08:00
width: 100%;
height: 100%;
}
}
}
2024-07-06 18:05:22 +08:00
.btn {
2024-06-21 18:04:01 +08:00
margin: 86rpx auto;
display: flex;
align-items: center;
justify-content: center;
width: 432rpx;
height: 88rpx;
background: #FFCC25;
border-radius: 20rpx 20rpx 20rpx 20rpx;
font-weight: 500;
font-size: 36rpx;
color: #FFFFFF;
}
2024-07-06 18:05:22 +08:00
2024-06-21 18:04:01 +08:00
.no_cont {
margin: 152rpx auto 0;
width: 432rpx;
2024-07-06 18:05:22 +08:00
2024-06-21 18:04:01 +08:00
.img {
image {
width: 432rpx;
height: 432rpx;
}
}
2024-07-06 18:05:22 +08:00
2024-06-21 18:04:01 +08:00
.txt {
margin-top: 50rpx;
width: 100%;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #808080;
}
}
}
</style>