<template>
	<view>
		<view class="page-top">
			<u-navbar title="视频监控" placeholder bgColor="transparent" :leftIcon="null" titleStyle="color:white">
			</u-navbar>
			<view class="search-bar">
				<u--input placeholder="请输入摄像头名称" prefixIcon="search" prefixIconStyle="font-size: 32px;color: #909399">
				</u--input>
			</view>
		</view>
		<view class="sized-box" style="height: 194rpx;"></view>
		<view class="sized-box" style="height:var(--status-bar-height);"></view>
		<view class="site-list">
			<!-- <navigator url="/pages/monitor/site-detail/site-detail"> -->
			<view class="site-item" v-for="item in siteList" :key="item.id" @tap="routerGo">
				<view class="site-title">
					<text>{{item.name}}</text>
				</view>
				<view class="camera-list">
					<view class="camera-item" v-for="(cameraItem,index) in item.camera_list" :key="index">
						<image class="camera-image" src="../../static/camera_example.png" mode=""></image>
						<view class="camera-title">
							{{cameraItem.name}}
						</view>
					</view>
				</view>
				<view class="site-time">
					<text>{{item.time}}</text>
				</view>
			</view>
			<!-- </navigator> -->

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				siteList: [{
						id: 1,
						name: '项目场地1',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					},
					{
						id: 2,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 3,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 4,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 5,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 6,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 7,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}, {
						id: 8,
						name: '项目场地2',
						time: '2022-09-12 12:12:12',
						camera_list: [{
								name: 'camera1'
							},
							{
								name: 'camera1'
							},
							{
								name: 'camera1'
							}
						]
					}
				]
			}
		},
		methods: {
			routerGo() {
				uni.navigateTo({
					url: '/pages/monitor/site-detail/site-detail'
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #f6f6f6;
	}
</style>
<style lang="scss" scoped>
	.page-top {
		z-index: 99;
		background: linear-gradient(to top right, #496df6, #2e9ee8);
		position: fixed;
		width: 100%;
		top: 0;

		.search-bar {
			margin: 0 32rpx 0;
			height: 80rpx;
			padding-bottom: 16rpx;

			.u-input {
				height: 48rpx;
				background-color: white;
			}
		}
	}

	.site-list {
		.site-item {
			// box-shadow: 0 2rpx 0 rgba(0, 0, 0, 0.4);
			margin-left: 16rpx;
			margin-right: 16rpx;
			margin-bottom: 40rpx;
			border-radius: 8rpx;
			background-color: #fff;

			.site-title {
				background-color: #949494;
				width: 92px;
				height: 30px;
				line-height: 20px;
				border-radius: 8rpx 0rpx 18rpx 0rpx;
				display: flex;
				justify-content: center;
				align-items: center;

				text {
					font-family: YSBiaoTiHei-regular;
					color: white;
					font-size: 20rpx;
				}
			}

			.camera-list {
				padding: 0 20rpx 0;
				margin-top: 12rpx;
				white-space: nowrap;
				// width: 100%;
				display: flex;
				justify-content: space-between;

				.camera-item {
					// background-color: aquamarine;

					.camera-image {
						width: 200rpx;
						height: 140rpx;
					}

					.camera-title {
						font-size: 20rpx;
						text-align: center;
					}
				}
			}

			.site-time {
				padding-right: 20rpx;
				margin-top: 26rpx;
				border-radius: 0 0 8rpx 8rpx;
				text-align: right;
				height: 30rpx;
				font-size: 20rpx;
				color: #fff;
				background-color: #d7d7d7;
			}
		}
	}
</style>
