<template>
	<view class="cookbook">
		<view v-for="(item,index) in list" :key="index" class="cookbook-item">
			<view class="cookbook-item-img">
				<image style="width: 100%;height: 100%;" :src="item.cookbook_photos[0] ?item.cookbook_photos[0] :''" mode=""></image>
			</view>
			<view class="cookbook-item-content">
				<view class="cookbook-item-content-title">
					{{item.cookbook_name}}
				</view>
				<view class="nourishment">
					<view class="nourishment-item">
						<view class="">
							能量
						</view>
						<view class="">
							{{item.energy}}(Kcal)
						</view>
					</view>
					<view class="nourishment-item">
						<view class="">
							碳水化合物
						</view>
						<view class="">
							{{item.carbohydrate}}(g)
						</view>
					</view>
					<view class="nourishment-item">
						<view class="">
							蛋白质
						</view>
						<view class="">
							{{item.protein}}(g)
						</view>
					</view>
					<view class="nourishment-item">
						<view class="">
							维生素C
						</view>
						<view class="">
							{{item.vitamin_c}}(mg)
						</view>
					</view>
					<view class="nourishment-item">
						<view class="">
							膳食纤维
						</view>
						<view class="">
							{{item.dietary_fiber}}(g)
						</view>
					</view>
					<view class="nourishment-item">
						<view class="">
							脂肪
						</view>
						<view class="">
							{{item.fat}}(g)
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "cookbookList",
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.cookbook {
		width: 100%;
		font-family: 'PingFang';

		.cookbook-item {
			width: 100%;
			height: 194rpx;
			background-color: #fff;
			border-radius: 5.33px;
			margin-bottom: 32rpx;
			box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.20);
			overflow: hidden;
			display: flex;

			.cookbook-item-img {
				width: 214rpx;
				height: 100%;
			}

			.cookbook-item-content {
				flex: 1;
				padding: 10rpx;

				.cookbook-item-content-title {

					border-bottom: 1px solid #f2f2f2;
					font-size: 32rpx;
					font-weight: 700;
				}
			}
		}
	}

	.nourishment {
		font-size: 24rpx;
		display: flex;
		flex-wrap: wrap;

		.nourishment-item {
			display: flex;
			width: 50%;
			box-sizing: border-box;
			justify-content: space-between;
			padding-right: 10rpx;
			padding-right: 10rpx;
		}

		
	}
</style>