<template>
	<view>
		<view class="p-3 rounded-lg bg-white mt-2 flex flex-row" v-for="(item,index) in resdata" :key="index" @click="toShow(item)" style="gap: 20rpx;">
			<view class="flex-0" v-if="item.imgs.length > 0" style="flex-basis: 256rpx;">
				<image :src="item.imgs[0]" style="width:256rpx;height: 160rpx; border-radius: 16rpx;" mode="aspectFill"></image>
			</view>
			<view class="flex-5 flex flex-column justify-between" style="height: 160rpx;">
				<view><text class="font32 line15">{{item.title}}</text></view>
				<view class="flex align-center justify-between mt-2">
					<view class="flex align-center">
						<text class="font24 text-muted">{{item.publish_at}}</text>
					</view>
					<view class="flex align-center">
					</view>
					<view class="flex align-center">
						<text class="font24 text-muted">{{item.view_count}}人浏览</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"i-news-list",
		props:{
			resdata:{
				type:Array,
				default() {
				  return [];
				},
			}
		},
		data() {
			return {
				
			};
		},
		created() {
			console.log(this.resdata)
		},
		methods:{
			toShow(item){
				uni.navigateTo({
					url:'/pages/news/detail?id='+item.id,
				})
			}
		}
	}
</script>

<style>

</style>