SmartBeehive/pages/Apiary/Apiary_vadio/Apiary_vadio.vue

141 lines
2.5 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>
<view class="no_cont" >
<view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/us7oiRxHLVwqu8plEy3o" mode=""></image>
</view>
<view class="txt">
当前还没有添加视频监控哦
</view>
</view>
<view class="btn" @click="addApiary">
添加视频监控
</view>
2024-06-21 18:04:01 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: " #F4FAF8",
},
title: "视频监控",
2024-07-05 20:00:41 +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) {
this.apiaryId = option.apiaryId
2024-06-21 18:04:01 +08:00
},
onShow() {
2024-07-05 20:00:41 +08:00
this.getlist()
2024-06-21 18:04:01 +08:00
},
methods: {
2024-07-05 20:00:41 +08:00
getlist(){
let data = {
pageNum:this.pagesum,
pageSize:this.pagesize,
apiaryId:this.apiaryId
}
this.$u.get(`/farm/video/list`,data).then(res => {
if(res.code == 200){
this.total = res.total
if(this.total >= 1){
this.list = res.rows
this.flag = true
}else{
this.flag = false
}
}
})
},
2024-06-21 18:04:01 +08:00
addApiary(){
uni.navigateTo({
2024-07-05 20:00:41 +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-05 20:00:41 +08:00
.listvideo{
padding: 0 34rpx;
box-sizing: border-box;
margin-top: 56rpx;
.list_item{
width: 682rpx;
height: 388rpx;
border-radius: 28rpx 28rpx 28rpx 28rpx;
overflow: hidden;
margin-top: 20rpx;
video{
width: 100%;
height: 100%;
}
}
}
2024-06-21 18:04:01 +08:00
.btn{
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;
}
.no_cont {
margin: 152rpx auto 0;
width: 432rpx;
.img {
image {
width: 432rpx;
height: 432rpx;
}
}
.txt {
margin-top: 50rpx;
width: 100%;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #808080;
}
}
}
</style>