camera.vue 4.5 KB
<template>
	<view class="camera-page">
		<!-- 公共组件-每个页面必须引入 -->
		<public-module></public-module>
		<view class="org-sty">
			<view @click="openOrg" class="org-item">
				<view class="u-flex" style="flex-direction: row;margin-top: 26rpx;margin-left: 15rpx;">
					<text style="color:#333333;font-size: 15px;margin-left: 14rpx;">组织关系</text>
				</view>
				<view style="margin-top: 5rpx;margin-left: 15rpx;flex-direction: row;" class="u-flex">
					<image style="margin-left: 14rpx;width: 30rpx;height: 30rpx;" src="../../../static/org.png" mode=""></image>
					<text style="margin-left: 10rpx;color:#666666;font-size: 12px;">设备数:{{ deviceTotal }}</text>
				</view>
			</view>
			<view class="org-item" style="">
				<image style="width: 6px;height: 10px;float: right; margin-right: 34rpx; margin-top: 58rpx;" src="../../../static/right-arrow.png" mode=""></image>
			</view>
		</view>
		<!-- 	<view class="camera-container">
			<view class="container-item">
				<view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item">
					<video style="border-radius: 20px;width:300rpx ;height: 200rpx;"  :src="item.url" controls></video>
					<view style="position: relative;top: 8rpx;text-align: center;">
						<text style="color: #333333;font-size: 13px;">{{ item.name }}</text>
					</view>
				</view>
			</view>
		</view> -->

		<view class="camera-container">
			<view class="container-item">
				<view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item">
					<video style="border-radius: 20px;width:300rpx ;height: 200rpx;" :src="item.url" controls></video>
					<view style="position: relative;top: 8rpx;text-align: center;">
						<text style="color: #333333;font-size: 13px;">{{ item.name }}</text>
					</view>
				</view>
			</view>
		</view>
		<view style="height: 30rpx;"></view>
		<f-tabbar></f-tabbar>
	</view>
</template>

<script>
import fTabbar from '@/components/module/f-tabbar/f-tabbar';

export default {
	components: {
		fTabbar
	},
	data() {
		return {
			deviceTotal: 0,
			list: [
				{
					url: 'http://113.204.115.250:83/openUrl/e5NZg76/live.m3u8',
					name: '摄像头1'
				},
				{
					url: 'https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg2.mp4',
					name: '摄像头2'
				},
				{
					url: 'https://stream7.iqilu.com/10339/article/202002/18/2fca1c77730e54c7b500573c2437003f.mp4',
					name: '摄像头3'
				},
				{
					url: 'https://stream7.iqilu.com/10339/article/202002/17/c292033ef110de9f42d7d539fe0423cf.mp4',
					name: '摄像头4'
				},
				{
					url: 'https://stream7.iqilu.com/10339/article/202002/16/3be2e4ef4aa21bfe7493064a7415c34d.mp4',
					name: '摄像头5'
				},
				{
					url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4',
					name: '摄像头6'
				},
				{
					url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4',
					name: '摄像头6'
				},
				{
					url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4',
					name: '摄像头6'
				},
				{
					url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4',
					name: '摄像头6'
				}
			]
		};
	},
	onLoad() {
		// 隐藏原生的tabbar
		uni.hideTabBar();
		this.getDeviceTotalData();
	},
	methods: {
		getDeviceTotalData() {
			let httpData = {
				page: 1,
				pageSize: 10
			};
			uni.$u.http
				.get('/yt/device', { params: httpData, custom: { load: false } })
				.then(res => {
					if (res) {
						this.deviceTotal = res.total;
					}
				})
				.catch(e => {
					uni.$u.toast(e.data?.message);
				});
		},
		openCameraDetail(e) {
			console.log(e);
		},
		openOrg() {
			uni.navigateTo({
				url: './org/org'
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.camera-page {
	min-height: 100vh;
	background-color: #f0f2f5;
}
.org-sty {
	width: 750rpx;
	height: 150rpx;
	margin-top: 1rpx;
	background-color: #fff;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	.org-item {
		width: 350rpx;
		height: 200rpx;
	}
}
.camera-item {
	height: 200rpx;
	border: 0.1px solid gray;
}
.camera-container {
	padding: 0 28rpx;
	margin-top: -27rpx;
	.container-item {
		width: 717rpx;
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;
		margin-left: -42rpx;
		.item {
			margin-top: 83rpx;
			width: 300rpx;
			height: 200rpx;
			background-color: #fff;
			border-radius: 20px;
			margin-left: 58rpx;
		}
	}
}
</style>