You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

236 lines
6.1 KiB

<template>
<view class="container">
<view class="padding-wrap">
<view class="message-box">
<view class="message-image">
<image class="image" src="@/static/msg-icon.png" mode="widthFix"></image>
</view>
<view class="message-info">
<view class="message-title">
{{detailInfo.content}}
</view>
<view class="message-des">
{{detailInfo.reportTime}} <uni-icons type="location-filled" size="18" color="#F5343E" @click="mapView"/>
</view>
<uni-forms label-width="200upx" style="margin-top: 43upx;">
<uni-forms-item label="设备名称:"><text class="form-text">{{detailInfo.deviceId}}</text></uni-forms-item>
<uni-forms-item label="设备编号:"><text class="form-text">{{detailInfo.deviceName}}</text></uni-forms-item>
<uni-forms-item label="设备类型:"><text class="form-text">{{detailInfo.productName}}</text></uni-forms-item>
<uni-forms-item label="安装位置:"><text class="form-text">{{detailInfo.buildId}}号楼{{detailInfo.floorNo}}</text></uni-forms-item>
<uni-forms-item label="经度:"><text class="form-text">{{detailInfo.longidute}}</text></uni-forms-item>
<uni-forms-item label="纬度:"><text class="form-text">{{detailInfo.latidute}}</text></uni-forms-item>
</uni-forms>
</view>
</view>
</view>
<!-- 视频联动 -->
<view class="video-box">
<view class="tit_box">
<view class="video-box-title">视频联动</view>
<view v-show="videoList.length > 0" class="video-box-title" @click="goVideo()">查看视频</view>
</view>
<view v-for="item in videoList" :key="item.id" class="video-item" >
<view class="name">{{item.name}}</view>
<!-- <view class="act"><uni-icons type="videocam-filled" size="18"/></view> -->
</view>
<view v-if="videoList.length == 0">没有查询到关联摄像头...</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detailInfo: {},
videoList: []
}
},
onLoad(options) {
console.log('详情options ===>',options,)
this.detailInfo = options.data ? JSON.parse(options.data) : {};
this.queryVideo(this.detailInfo);
},
methods: {
//报警位置地图定位
mapView() {
uni.navigateTo({
url: '/pages/map/map?floorNo=' + this.detailInfo.floorNo + '&lng=' + this.detailInfo.longidute + '&lat=' + this.detailInfo.latidute
// url: '/pages/map/map?floorNo=6&lat=120.42052985815123&lng=36.112617268776845'
})
},
//查询报警点摄像头
queryVideo(row) {
let code = row.cameraCode;
// this.videoList = [{name:'摄像头1',code:'item1'}]
if(code != ''){
code.split('-').map((item1,index)=>{
this.videoList.push({name:'摄像头' + (index + 1),code:item1})
})
}else{
this.videoList = []
}
// this.videoList = [{name:'摄像头1'}]
// let token = uni.getStorageSync('bizToken');
// if(token == undefined || !token) {
// uni.request({
// url: 'http://171.16.8.58:8080/prod-api/api/Login',
// method: 'POST',
// data: { appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' },
// success: (res) => {
// if(res.data.code == 0) {
// uni.setStorageSync('bizToken', res.data.data.token);
// this.queryVideo(deviceId);
// }
// }
// })
// } else {
// uni.request({
// url: 'http://171.16.8.58:8080/prod-api/api/bizDevice/list?params[pmac]=' + deviceId,
// method: 'GET',
// header: {
// Authorization: token
// },
// success: (res) => {
// console.log('摄像头列表===>',res.data.rows)
// uni.showToast({
// title:'接口请求成功' + res.data,
// icon:'none'
// })
// if(res.data.code == 401){
// uni.removeStorageSync('bizToken');
// this.queryVideo(deviceId);
// }else{
// setTimeout(() =>{
// uni.showToast({
// title:'获取摄像头列表' + res.data.rows,
// icon:'none'
// })
// },5000)
// this.videoList = res.data.rows;
// }
// }
// })
// }
},
goVideo() {
// console.log('item ===>',item)
// uni.navigateTo({
// url: '/pages/videoPlayer/index?item=' + JSON.stringify(item)
// })
uni.navigateTo({
url: '/pages/H5player/index?list=' + JSON.stringify(this.videoList)
})
}
}
}
</script>
<style lang="scss" scoped>
page,
.container {
min-height: 100vh;
background-color: #FFFFFF;
/deep/.uni-forms-item {
display: flex;
align-items: center;
margin-bottom: 15upx;
}
/deep/.uni-forms-item__label {
color: #90959D;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
.form-text {
color: #031945;
line-height: 40upx;
font-size: 28upx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
}
.padding-wrap {
padding: 30upx;
}
.message-box {
display: flex;
flex-direction: row;
margin-bottom: 44upx;
.message-image {
display: block;
margin-right: 20upx;
.image {
width: 88upx;
height: 88upx;
}
}
.message-info {
flex: 1;
color: #031945;
font-size: 28upx;
line-height: 40upx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
.message-title {
white-space: nowrap;
text-overflow: ellipsis;
}
.message-des {
color: #90959D;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
// 视频联动
.video-box {
border-top: 14upx solid #F4F8FB;
padding: 30upx;
.tit_box{
display: flex;
align-items: center;
justify-content: space-between;
}
.video-box-title {
color: #031945;
font-size: 28upx;
line-height: 40upx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
margin-bottom: 30upx;
}
.video-item {
display: flex;
align-items: center;
font-size: 22upx;
line-height: 40upx;
.name {
display: inline-block;
width: 80%;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
}
.act {
float: right;
margin-left: 20upx;
}
}
}
</style>