<!-- 组件：事件列表 -->
<template>
	<view class="event-list">
		<view class="event-item" v-for="(item, index) in list" :key="index" @click="handleClick(item)">
			<view class="left">
				<text class="title">{{item.title}}</text>
				<text class="time">{{item.time}}</text>
			</view>
			<image :src="item.img" style="width: 280rpx;height: 200rpx;flex-shrink: 0;" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'EventList',
		props: {
			list: Array,
			default: () => []
		},
		data() {
			return {
			}
		},
		methods: {
			handleClick(val) {
				wx.navigateTo({
					url: `/pages/messageDetail/messageDetail`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../common/variables.scss';
	.event-list {
		width: 100%;
		box-sizing: border-box;
		.event-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: 100%;
			height: 240rpx;
			padding: 20rpx 32rpx;
			background-color: #fff;
			box-sizing: border-box;
			margin-top: 20rpx;
			.left {
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin-right: 20rpx;
				.title {
					font-size: 32rpx;
					color: #000;
					@include exceeding-line-overflow(3);
				}
				.time {
					font-size: 28rpx;
					color: #c1c1c1;
				}
			}
			.right {
				width: 100rpx;
				height: 100rpx;
			}
		}
	}
</style>