<template>
	<view class="box">
		<view v-if="flag == 1" class="boxlist">
			<view @click="nextTo(item)" class="bb vidLi dfsb" v-for="(item, ind) in list" :key="ind">
				<view class="imgbox">
					<image :src="item.goods_img" mode=""></image>
					<!-- <text class="left-img" v-if="ind < 3">第{{ ind + 1 }}名</text> -->
				</view>
				<view class="dffd flex1">
					<view class="title elli">{{ item.goods_name }}</view> 
					<view class="auth dfsb">
						<text class="priceDan">{{ item.goods_price }}</text>
						<text class="textgrey">{{ item.sale_num }}人已购买</text>
					</view>
				</view>
			</view>
			<u-empty v-if="list.length<1" text="还没有商品哦" mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	props: {
		list: {
			type: Array,
			default: []
		},
		flag: {
			type: [String, Number],
			default: 1
		}
	},
	methods: {
		nextTo(item) {
			uni.navigateTo({
				url: '/pagesA/mall/info?flag=1&id='+item.goods_id
			});
		}
	}
};
</script>

<style scoped lang="scss">
.boxlist {
	.vidLi {
		width: 100%;
		padding: 20rpx 30rpx;
		background-color: #fff;
		.imgbox {
			position: relative;
			width: 180rpx;
			height: 174rpx;
			margin-right: 28rpx;
			// .left-img {
			// 	position: absolute;
			// 	top: 0;
			// 	left: 0;
			// 	height: 33rpx;
			// 	line-height: 33rpx;
			// 	font-size: 18rpx;
			// 	color: #fff;
			// 	padding: 0 5rpx;
			// 	background: #e84325;
			// 	border-radius: 7rpx;
			// }
			image {
				width: 100%;
				height: 100%;
			}
		}
		.title {
			font-size: 26rpx;
			line-height: 40rpx;
			margin-bottom: 12rpx;
		}
		.auth {
			margin-top: 52rpx;
			width: 100%;
			.prosecond {
			}
			.textgrey {
				font-size: 20rpx;
			}
		}
	}
}
</style>
