camera.vue 2.18 KB
<template>
	<view class="camera-page">
		<!-- 公共组件-每个页面必须引入 -->
		<public-module></public-module>
		<view class="camera-item"><text>设备</text></view>
		<view class="camera-container">
			<view class="container-item">
				<view @click="openCameraDetail(item.url)" v-for="(item, index) in list" :key="index" class="item">
					<view style="width: 320rpx;height: 320rpx"><video style="width: 320rpx;height: 320rpx;" :src="item.url" controls></video></view>
					<view style="position: relative;top: 8rpx;text-align: center;">{{ item.name }}</view>
				</view>
			</view>
		</view>
		<f-tabbar></f-tabbar>
	</view>
</template>

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

export default {
	components: {
		fTabbar
	},
	data() {
		return {
			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'
				}
			]
		};
	},
	onLoad() {
		// 隐藏原生的tabbar
		uni.hideTabBar();
	},
	methods: {
		openCameraDetail(e) {
			console.log(e);
		}
	}
};
</script>

<style lang="scss" scoped>
.camera-page {
	padding: 0rpx 15rpx;
	min-height: 100vh;
	background-color: #fff;
}
.camera-item {
	height: 200rpx;
	border: 0.1px solid gray;
}
.camera-container {
	padding: 0 15rpx;
	margin-top: 15rpx;
	.container-item {
		width: 717rpx;
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;
		position: relative;
		top: -67rpx;
		.item {
			width: 320rpx;
			height: 320rpx;
			background-color: gray;
			margin-top: 70rpx;
		}
	}
}
</style>