<template>
|
<view class="monitor_index">
|
<scroll-view
|
scroll-y="true"
|
class="monitor_index_scroll"
|
:scroll-top="scrollTop"
|
refresher-enabled="true"
|
refresher-background="#EAEAEA"
|
:refresher-triggered="triggered"
|
@refresherpulling="refresherrefresh">
|
<view class="monitor_card_index" v-for="(item,index) in monitorData" :key="index">
|
<!-- <view> -->
|
<video :id="`video_${index+1}`" :src="item.hdAddress" class="video_items_tyle" :title="item.channelNo+'-'+item.deviceNum" controls></video>
|
<!-- <cover-view class="video-loaing video-ready" hidden="true"> -->
|
<!-- <live-player :id="`video_${index+1}`" binderror="error" mode="live" :src="item.videoPath" autoplay="true" style="width:100%"></live-player> -->
|
<!-- </cover-view> -->
|
<!-- </view> -->
|
<!-- <view class="monitor_card_bottom">
|
<view class="monitor_card_times">{{item.createTime}}</view>
|
<view class="monitor_card_positions">{{item.videoName}}</view>
|
</view> -->
|
</view>
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
|
</scroll-view>
|
</view>
|
</template>
|
|
<script>
|
import { throttle } from '../../plugins/public.js';
|
export default{
|
data(){
|
return{
|
pageNum: 1,
|
pageSize: 10,
|
loadPage: 0,
|
scrollTop: 0,
|
triggered: true,
|
status: 'loading',
|
loadText: {
|
loading: '努力加载中',
|
nomore: '没有更多数据了'
|
},
|
monitorData:[],//摄像监控画面
|
}
|
},
|
onLoad() {
|
this.searchVideoList()
|
},
|
methods:{
|
//查询列表
|
searchVideoList(){
|
this.triggered = true;
|
this.monitorData = [];
|
let params = {
|
types:1
|
}
|
this.$api.reboSystem.getMonitotLists(params).then(res=>{
|
if(res.statusMsg === 'ok'){
|
res.data.map(item=>{
|
let formData = {};
|
formData.channelNo= item.channelNo
|
formData.deviceNum=item.deviceNum
|
formData.types= 1
|
this.$api.reboSystem.backVideosUrlList(formData).then(resUrl=>{
|
this.monitorData.push({
|
channelNo:item.channelNo,
|
deviceNum:item.deviceNum,
|
hdAddress:resUrl.data.data.hdAddress
|
})
|
})
|
return this.monitorData
|
})
|
this.triggered = false;
|
this.status = 'nomore';
|
}else{
|
uni.$u.toast(res.statusMsg);
|
}
|
}).catch((err) => {
|
uni.$u.toast('请检查网络服务或联系管理员!')
|
})
|
},
|
//自定义下拉刷新
|
refresherrefresh: throttle(function() {
|
this.status = 'loading';
|
this.pageNum = 1;
|
this.searchVideoList();
|
uni.$u.toast('刷新成功');
|
}, 500),
|
//触底刷新
|
// scrolltoLower: throttle(function() {
|
// this.status = 'loading';
|
// if(this.pageNum >= this.loadPage) {
|
// setTimeout(() => {
|
// this.status = 'nomore'
|
// uni.$u.toast('没有更多数据了');
|
// },1000)
|
// return
|
// } else {
|
// this.pageNum+=1
|
// let params = {
|
// pageNum: this.pageNum,
|
// pageSize:this.pageSize,
|
// }
|
// this.$api.reboSystem.getMonitotLists(params).then(res=>{
|
// if(res.statusMsg === 'ok'){
|
// this.monitorData.push(...res.data.list)
|
// this.loadPage = res.data.pages;
|
// this.triggered = false;
|
// this.status = 'nomore';
|
// }else{
|
// uni.$u.toast(res.statusMsg);
|
// }
|
// }).catch((err) => {
|
// uni.$u.toast('请检查网络服务或联系管理员!')
|
// })
|
// }
|
// }, 1500),
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.monitor_index{
|
height: 100vh;
|
background-color: #F6F6F6;
|
padding: 10px 15px;
|
.monitor_index_scroll{
|
height: 90%;
|
|
.monitor_card_index{
|
position: relative;
|
margin-bottom: 15px;
|
.video_items_tyle{
|
width: 100%;
|
border-radius: 6px;
|
}
|
.monitor_card_bottom{
|
width: 100%;
|
height: 30px;
|
background-color: #000000;
|
position: absolute;
|
left: 0px;
|
top: 0px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
border-top-left-radius: 6px;
|
border-top-right-radius: 6px;
|
|
.monitor_card_times{
|
padding-left: 30px;
|
color: #FFFFFF;
|
font-size: 14px;
|
position: relative;
|
&::before{
|
position: absolute;
|
left: 10px;
|
top: 2px;
|
width: 50px;
|
height: 50px;
|
content: "";
|
background: url('../../static/time.png') no-repeat;
|
}
|
}
|
.monitor_card_positions{
|
color: #FFFFFF;
|
font-size: 14px;
|
padding-right: 15px;
|
}
|
}
|
}
|
}
|
}
|
</style>
|