<template>
	<view class="bg">
		<view class="box">
			<navigator :url="'/subPackages/other/foodDetail?id='+item.id" v-for="(item,index) in list" :key="index" class="item">
				<image :src="$geturl4(item.typeImg)" lazy-load="true" mode="aspectFill" class="headimg"></image>
				<view class="content">
					{{item.title}}
					<view class="subtitle" v-html="item.txt"></view>
				</view>
				<image src="https://static.ticket.sz-trip.com/changshu/images/food/rightIcon.png" class="rightIcon"></image>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			}
		},
		onReady() {
			this.getList()
		},
		methods: {
			getList() {
				this.Post({
					apiType: 'old',
					channelIds: 92,
					orderBy: 2,
					first: 0,
					count: 50
				}, '/json/content_list.jspx?channelIds').then(res => {
					if(res) {
						this.list = res
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		height: 100vh;
		background: #A2E0DB;
	}
	
	.box {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-around;
		flex-direction: column;
		height: 100vh;
		overflow-x: auto;
	}
	
	.item {
		width: 533rpx;
		height: 615rpx;
		margin: 40rpx;
		border-radius: 20rpx;
		position: relative;
		overflow: hidden;
		
		.headimg {
			width: 533rpx;
			height: 467rpx;
			border-radius: 20rpx;
		}
		
		.content {
			width: 467rpx;
			height: 203rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
			padding: 20rpx;
			position: absolute;
			bottom: 0;
			left: 33rpx;
			
			.subtitle {
				width: 359rpx;
				font-weight: 500;
				font-size: 24rpx;
				color: #666666;
				display: -webkit-box;
				-webkit-line-clamp: 3;
				-webkit-box-orient: vertical; 
				overflow: hidden;
				text-overflow: ellipsis;
				margin-top: 20rpx;
			}
		}
		
		.rightIcon {
			width: 93.33rpx;
			height: 93.33rpx;
			position: absolute;
			bottom: 33rpx;
			right: 0;
		}
	}
</style>