<template>
	<view class="order-detail1-list">
		<view class="list-item" v-for="(item, index) in list" :key="index">
			<view class="info">
				<view class="name">{{ item.name }}</view>
				<view class="num">
					<text>尺码：{{ item.size.length }}</text>
					<text>数量：{{ item.num.reduce((t, e) => t + e, 0) }}</text>
				</view>
			</view>
			<view class="size-item" v-for="(sizeItem, sizeIndex) in item.size" :key="sizeIndex">
				<image :src="item.main_img"></image>
				<view class="info">
					<text class="size">尺码：{{ sizeItem }}</text>
					<text class="basecolor">￥{{ item.money }}/{{ item.unit }}</text>
				</view>
				<view class="num">数量：{{ item.num[sizeIndex] }}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		onLoad({ list }) {
			this.list = JSON.parse(uni.getStorageSync('lll'))
			console.log(this.list)
		}
	}
</script>

<style lang="scss" scoped>
	.order-detail1-list {
		height: 100vh;
		overflow: auto;
		background: $app-base-bg;
		.list-item {
			margin-bottom: 20rpx;
			> .info {
				height: 90rpx;
				@include flex();
				padding: 30rpx;
				background: #FFFFFF;
				margin-bottom: 1rpx;
				box-sizing: border-box;
				justify-content: space-between;
				.name {
					font-size: 32rpx;
					font-weight: bold;
				}
				.num {
					font-size: 28rpx;
					text {
						margin-left: 24rpx;
					}
				}
			}
			.size-item {
				@include flex();
				height: 200rpx;
				background: #FFFFFF;
				border-bottom: 2rpx;
				background: #FFFFFF;
				box-sizing: border-box;
				align-items: flex-end;
				justify-content: space-between;
				padding: 30rpx 81rpx 30rpx 30rpx;
				image {
					width: 140rpx;
					height: 140rpx;
					border-radius: 6rpx;
					margin-right: 30rpx;
				}
				> .info {
					@include flex(column);
					justify-content: space-between;
					align-items: flex-start;
					height: 100%;
					flex: 1;
					line-height: 2;
					.size {
						font-size: 32rpx;
						font-weight: bold;
					}
					.basecolor {
						font-weight: bold;
					}
				}
				.num {
					line-height: 2;
					font-size: 28rpx;
				}
			}
		}
	}
</style>
