<template>
	<view class="body">
		<view class="card" v-for="(item, index) in setMealList" :key="index" @tap="routerTo(item)">
			<image :src="'https://biaodianfuhao.oss-cn-beijing.aliyuncs.com/'+item.imgUrl"></image>
			<view class="title">
				{{item.name}}
			</view>
			<view class="content">
				{{item.title}}
			</view>
			<view class="bottomView">
				<view class="priceView">
					<view class="unit">
						￥
					</view>
					<view class="price">
						{{item.carPrice}}-{{item.truckPrice}}
					</view>
				</view>
				<view class="dprice">
					已售:{{item.buyNum || 0}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {};
		},
		props: {
			setMealList: {
				type: Array,
				default: function() {
					return {};
				}
			},
		},
		methods: {
			// 路由跳转
			routerTo(item) {
				this.$yrouter.push({
					path: "/pages/maintenance/setMeal/setMealDetail/index?item=" + JSON.stringify(item)
				});
			}
		}
	}
</script>

<style lang="less">
	.body {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		margin-top: 30rpx;
		// padding-bottom: 30rpx;
		padding: 0 2rpx 30rpx;
		.card {
			width: 338rpx;
			height: 532rpx;
			background: #FFFFFF;
			border: 1px solid #E5E5E5;
			box-shadow: 0px 0px 14rpx 0px rgba(125, 125, 125, 0.13);
			border-radius: 10rpx;
			margin-top: 26rpx;
			position: relative;
			image {
				width: 338rpx;
				height: 338rpx;
				box-shadow: 0px 0px 14rpx 0px rgba(125, 125, 125, 0.13);
				border-radius: 10rpx;
			}

			.title {
				height: 27rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
				line-height: 39rpx;
				padding: 24rpx 0 0 20rpx;
			}

			.content {
				font-size: 22rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;
				line-height: 28rpx;
				padding: 16rpx 20rpx 0 20rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				line-clamp: 2;
				-webkit-box-orient: vertical;
			}

			.bottomView {
				width: calc(100% - 34rpx);
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0rpx 17rpx 0 17rpx;
				position: absolute;
				bottom: 10rpx;
				.priceView {
					display: flex;
					align-items: baseline;

					.unit {
						font-size: 20rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #FF3C00;
					}

					.price {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #FF3C00;
					}
				}

				.dprice {
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}
			}
		}
	}
</style>
