<!-- 组件：事件列表 -->
<template>
	<view class="egersis-list">
		<view class="egersis-item" v-for="(item, index) in list" :key="index" @click="handleClick(item)">
			<view class="left">
				<text class="title">{{item.title}}</text>
				<view style="margin-top: 20rpx;">
					<text class="time">时间：{{item.publishTime}}</text><br/>
					<text class="time">来源：{{item.linkAddr ? item.linkAddr : '未知'}}</text>
				</view>
			</view>
			<!-- <image :src="item.img" style="width: 280rpx;height: 200rpx;flex-shrink: 0;" mode=""></image> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: 'Egersis',
		props: {
			list: Array,
			default: () => []
		},
		methods: {
			handleClick(val) {
				const url = `https://www.xjwljb.com/mobile/#/newsDetail?id=${val.id}&categoryId=${val.catalogId}`
				wx.navigateTo({
					url: '/packageToolList/rumorWebView/rumorWebView?url=' + encodeURIComponent(url)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../common/variables.scss';
	.egersis-list {
		width: 100%;
		box-sizing: border-box;
		.egersis-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: 32rpx;
			border-radius: 16rpx;
			box-shadow: 2rpx 2rpx 8rpx rgba(0, 0, 0, 0.2);
			.left {
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin-right: 20rpx;
				.title {
					font-size: 32rpx;
					color: #000;
					font-weight: 600;
					@include exceeding-line-overflow(3);
				}
				.time {
					font-size: 28rpx;
					color: #c1c1c1;
				}
			}
			.right {
				width: 100rpx;
				height: 100rpx;
			}
		}
	}
</style>