<template>
	<view class="mall_product_cn">
		<view class="">
			<ty-list-list :status="load_status">
				<view class="padding-top-10 padding-lr-20 flex align-center flex-wrap" v-if="type == 1">
					<view class="item" v-for="(item,index) in list" :key="index"
						@click="go('/pages/mall/detail?id='+item.id)">
						<view class="img_box">
							<image :src="item.cover_img" mode="aspectFill" class="jc-image"
								style="width: 345rpx;height: 345rpx;"></image>
						</view>
						<view class="padding-tb-20 padding-lr-15">
							<view class="line-35 height-70 text-cut-two text-28">{{item.name}}</view>
							<view class="margin-top-20 flex align-center">
								<view class="text-price text-32 text-main">{{item.price_min}}</view>
								<view class="margin-left-20 text-24 text-98">已售{{item.sales_number}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class="padding-lr-30 bg-ff" v-if="type == 2">
					<view class="two_item padding-tb-20 flex align-center" v-for="(item,index) in list" :key="index"
						@click="go('/pages/mall/detail?id='+item.id)">
						<view class="">
							<image :src="item.cover_img" mode="aspectFill" class="jc-image-250 radius-10"></image>
						</view>
						<view class="margin-left-20 flex-one">
							<view class="line-40 height-80 text-cut-two text-30">{{item.name}}</view>
							<view class="margin-top-60 text-price text-32 text-main">{{item.price_min}}</view>
							<view class="margin-top-30 text-24 text-98">已售{{item.sales_number}}</view>
						</view>
					</view>
				</view>
			</ty-list-list>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: []
			},
			load_status: {
				type: String,
				default: ''
			},
			type: {
				type: [String, Number],
				default: 1
			}
		},
		data() {
			return {

			}
		},
		methods: {

		}
	}
</script>

<style scoped>
	.item {
		margin-left: 20rpx;
		margin-bottom: 20rpx;
		width: 345rpx;
		border-radius: 10rpx;
		overflow: hidden;
		background: #fff;
	}

	.item:nth-child(2n+1) {
		margin-left: 0;
	}

	.img_box {
		position: relative;
		width: 345rpx;
		height: 345rpx;
	}

	.two_item:first-child {
		padding-top: 30rpx;
	}

	.two_item:last-child {
		padding-bottom: 30rpx;
	}
</style>
