<template>
	<mobile-frame>
		<view class="main">
			<view class="one">
				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
					<view class="list-scroll-view">
						<view class="list" v-for="(item, index) in list" :key="index" @click="toView(item)">
							<image class="image" :src="item.file" mode=""></image>
							<view class="name">
								{{item.name||'暂无'}}
							</view>
							<view class="money">
								<text>¥</text>
								<text>{{item.money}}</text>
							</view>
							<view class="other">
								<view class="other_1">
									{{item.num||0}}人评价
								</view>
								<view class="other_2">
									<text @click="toDel(item)" class="iconfont icon-del"></text>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>

		</view>
	</mobile-frame>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						file: require('@/static/test.png'),
						name: '摩奇桃汁250ml*24盒',
						money: 59.90,
						num: 0
					},
					{
						file: require('@/static/test.png'),
						name: '摩奇桃汁250ml*24盒',
						money: 59.90,
						num: 0
					},
					{
						file: require('@/static/test.png'),
						name: '摩奇桃汁250ml*24盒',
						money: 59.90,
						num: 0
					}
				]
			};
		},
		onShow: function() {

		},
		methods: {
			// 详细信息
			toView(e) {
				const that = this;
				console.log(e);
			},
			// 删除
			toDel(e) {
				const that = this;
				console.log(e);
			},
			// 分页
			toPage(e) {
			
			},
		}
	}
</script>

<style lang="scss">
	.main {
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 100vh;

		.one {
			padding: 2vw 0 0 0;

			.list {
				width: 42vw;
				border: 1px solid var(--f1Color);
				margin: 2vw 2vw 0 2vw;
				padding: 2vw;
				border-radius: 5px;

				.image {
					width: 100%;
					height: 40vw;
				}

				.name {
					font-size: var(--font16Size);
					margin: 0 0 1vw 0;
				}

				.money {
					color: var(--fFB1Color);
					font-size: var(--font14Size);
					margin: 0 0 1vw 0;
				}

				.other {
					display: flex;
					flex-direction: row;
					justify-content: space-between;

					.other_1 {
						font-size: var(--font14Size);
						color: var(--f85Color);
					}
				}
			}

			.list:nth-child(2n) {
				margin: 2vw 0 0 0;
			}
		}
	}

	.scroll-view {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;

		.list-scroll-view {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
		}
	}
</style>
