<template>
	<view>
		<view class="search-bar">
			<input type="text">
		</view>
		<view class="site-list">
			<view class="site-item" v-for="item in siteList" :key="item.id">
				<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>
		</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: {

		}
	}
</script>

<style lang="scss" scoped>
	.site-list {
		.site-item {
			box-shadow: 0 6rpx 0 rgba(0, 0, 0, 0.4);
			margin-left: 16rpx;
			margin-right: 16rpx;
			margin-bottom: 40rpx;
			border-radius: 20rpx;

			.site-title {
				background-color: rgb(153, 153, 153);
				width: 92px;
				height: 30px;
				line-height: 20px;
				border-radius: 20rpx 0rpx 18rpx 0rpx;

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

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

				.camera-item {
					background-color: aquamarine;
					// margin-right: 20rpx;

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

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

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