<template>
	<view>
		<view class="top">
			<image src="./img/top.jpg" mode=""></image>
		</view>
		<view class="content">
			<view class="list">
				<view class="item" v-for="(item,index) in 6" :key="index" @click="open_draw()">
					<view class="inner">
						<view class="left">
							<view class="name">汝其沟无烟煤分公司</view>
							<view class="text">5条隐患信息</view>
						</view>
						<view class="right">
							<view class="num">0.5分</view>
							<view class="icon">
								<uni-icons type="arrowright"></uni-icons>
							</view>
						</view>
					</view>
				</view>
			</view>


			<!-- 弹出层 -->
			<uni-drawer ref="draw" mode="right" :width="300">
				<view class="drawer">
					<view class="title">汝其沟无烟煤分公司</view>
					<view class="container">
						<view class="item" v-for="(item,index) in 4" :key="index" @click="go_detail()">
							<view class="inner">
								<view class="left">
									<view class="name">白芨沟矿山救护队</view>
									<view class="text">3条隐患信息</view>
								</view>
								<view class="right">
									<view class="num">0.45分</view>
									<view class="icon">
										<uni-icons type="arrowright"></uni-icons>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</uni-drawer>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			open_draw() {
				this.$refs.draw.open()
			},
			go_detail() {
				uni.navigateTo({
					url: "detail/detail"
				})
			}
		}
	}
</script>

<style lang="scss">
	.top {
		image {
			width: 750rpx;
			height: 360rpx;
		}
	}
	.content {
		width: 749rpx;
	}

	.list {
		.item {
			box-sizing: border-box;
			padding: 20rpx 0;
			padding-right: 30rpx;

			border-bottom: 1px solid #eee;

			.inner {
				border-left: 12rpx solid #8BDAFF;

				display: flex;
				justify-content: space-between;
				align-items: center;

				.left {
					box-sizing: border-box;
					padding-left: 30rpx;
					line-height: 45rpx;

					.name {}

					.text {
						font-size: 26rpx;
						color: #999999;
					}
				}

				.right {
					display: flex;
					align-items: center;

					.num {
						font-size: 26rpx;
						color: #AC5158;
					}

					.icon {
						margin-left: 4rpx;
					}
				}
			}
		}
	}

	.drawer {
		width: 600rpx;

		.title {
			line-height: 87rpx;
			box-sizing: border-box;
			padding: 0 30rpx;
			border-bottom: 1px solid #2E8EAA;
		}

		.container {
			width: 600rpx;

			.item {
				box-sizing: border-box;
				padding: 20rpx 0;
				padding-right: 30rpx;

				border-bottom: 1px solid #eee;

				.inner {
					border-left: 12rpx solid #8BDAFF;

					display: flex;
					justify-content: space-between;
					align-items: center;

					.left {
						box-sizing: border-box;
						padding-left: 30rpx;
						line-height: 45rpx;

						width: 390rpx;

						.name {
							width: 390rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}

						.text {
							font-size: 26rpx;
							color: #999999;
						}
					}

					.right {
						display: flex;
						align-items: center;

						.num {
							font-size: 26rpx;
							color: #AC5158;
						}

						.icon {
							margin-left: 4rpx;
						}
					}
				}
			}
		}
	}
</style>
