<template>
	<view class="container">
		<!-- 投诉列表区域 -->
		<view class="body">
			<!-- 每一个投诉订单区域 -->
			<view class="box" v-for="item in list" :key="item.id" @click="handleGoPage(item)">
				<!-- 标题区域 -->
				<view class="box_header">
					<view class="header_left">{{ item.title }}</view>
					<view class="header_right">{{ item.type }}</view>
				</view>
				<!-- 信息区域 -->
				<view class="box_info">
					<img mode="aspectFill" :src="item.imgUrl" />
					<view class="info_center">
						<view class="center_name">{{ item.name }}</view>
						<view class="center_time">{{ item.time }}</view>
						<view class="center_tags">{{ item.count }}间 {{ item.roomType }}</view>
						<view class="center_price">¥{{ item.price }}</view>
					</view>
					<view class="info_right">{{ item.status }}</view>
				</view>

				<!-- 反馈时间区域 -->
				<view class="box_time">
					<view class="time_left">反馈时间</view>
					<view class="time_right">{{ item.time2 }}</view>
				</view>
			</view>
		</view>

		<view class="noData" v-if="list.length === 0">
			<img lazy-load :lazy-load-margin="0" src="../../static/images/noData.png" />
			暂无数据
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			// 投诉列表区域
			list: [
				// {
				// 	id: 1,
				// 	title: '标题',
				// 	type: '处理中',
				// 	imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
				// 	name: '开心民宿',
				// 	time: '2023-07-26  -  2023-07-27',
				// 	status: '支付超时',
				// 	price: 666,
				// 	time2: '2023-08-15  15:15:15',
				// 	count: 1,
				// 	roomType: '双人标间'
				// },
				// {
				// 	id: 2,
				// 	title: '我要投诉',
				// 	type: '已处理',
				// 	imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
				// 	name: '快乐民宿',
				// 	time: '2023-07-26  -  2023-07-27',
				// 	status: '支付超时',
				// 	price: 888,
				// 	time2: '2023-08-15  15:15:15',
				// 	count: 1,
				// 	roomType: '单人标间'
				// },
				// {
				// 	id: 3,
				// 	title: '投诉',
				// 	type: '处理中',
				// 	imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
				// 	name: '健康民宿',
				// 	time: '2023-07-26  -  2023-07-27',
				// 	status: '支付超时',
				// 	price: 1288,
				// 	time2: '2023-08-15  15:15:15',
				// 	count: 1,
				// 	roomType: '双人标间'
				// },
				// {
				// 	id: 4,
				// 	title: '投诉投诉投诉投诉',
				// 	type: '投诉',
				// 	imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
				// 	name: '木叶村',
				// 	time: '2023-07-26  -  2023-07-27',
				// 	status: '支付超时',
				// 	price: 8888,
				// 	time2: '2023-08-15  15:15:15',
				// 	count: 1,
				// 	roomType: '火影标间'
				// }
			]
		}
	},
	methods: {
		// 点击每一个投诉订单的回调
		handleGoPage(item) {
			uni.navigateTo({
				url: `/pages/complaintProgress/complaintProgress`
			})
		}
	}
}
</script>

<style lang="scss">
.container {
	box-sizing: border-box;
	padding: 20rpx;
	height: 100vh;
	overflow-y: auto;
	background-color: #f7f7f7;

	.body {
		.box {
			box-sizing: border-box;
			padding: 0 20rpx 0 30rpx;
			margin-bottom: 20rpx;
			width: 710rpx;
			height: 390rpx;
			border-radius: 15rpx;
			background-color: #fff;

			.box_header {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 98rpx;
				border-bottom: 1rpx solid #e6e6e6;

				.header_left {
					flex: 4;
					font-size: 32rpx;
					font-weight: bold;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				.header_right {
					flex: 1;
					font-size: 28rpx;
					color: #808080;
					text-align: end;
				}
			}

			.box_info {
				display: flex;
				margin: 34rpx 0 27rpx 0;
				height: 143rpx;

				img {
					width: 143rpx;
					height: 143rpx;
					border-radius: 9rpx;
				}

				.info_center {
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					margin-top: -5rpx;
					margin-left: 17rpx;
					height: 150rpx;
					color: #808080;
					font-size: 24rpx;
					overflow: hidden;

					.center_name {
						font-size: 28rpx;
						font-weight: bold;
						color: #000;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
					.center_time {
					}
					.center_tags {
					}
					.center_price {
					}
				}

				.info_right {
					width: 185rpx;
					text-align: end;
					font-size: 24rpx;
					color: #808080;
				}
			}

			.box_time {
				display: flex;
				align-items: center;
				height: 58rpx;
				font-size: 24rpx;
				border-radius: 9rpx;
				background-color: #f2f2f2;

				.time_left {
					margin: 0 20rpx;
				}
				.time_right {
					color: #808080;
				}
			}
		}
	}

	.noData {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		padding-bottom: 20rpx;

		img {
			margin-top: 160rpx;
			width: 600rpx;
			height: 600rpx;
		}
	}
}
</style>