<template>
	<view class="item" @click="$emit('click')">
		<view class="item-image">
			<image :src="item.image &&
			item.image.split(',')[0]" mode="aspectFill">
			</image>
		</view>

		<view class="info">
			<view class="title">
				{{ item.title }}
			</view>
			<view class="desc">
				{{ item.sku }}
			</view>
			<view class="price"
			v-if="[2].includes(item.type)">
				<view class="">
					会员价￥<text>{{ item.vipPrice }}</text>
				</view>
				<view class="">
					零售价￥<text>{{ item.price }}</text>
				</view>
			</view>
			
			<view class="price"
			v-else>
				<view class="">
					价格￥<text>{{ item.price }}</text>
				</view>
				<view class="">
					原价￥<text>{{ item.oldPrice }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				default: {}
			}
		},
		data() {
			return {

			}
		},
		methods: {

		}
	}
</script>

<style scoped lang="scss">
	.item {
		padding: 10rpx 20rpx;
		align-items: center;
		margin-bottom: 20rpx;
		display: flex;
		width: 100%;
		box-sizing: border-box;
		border-bottom: 1rpx solid #00000012;

		.item-image {
			width: 140rpx;
			height: 140rpx;
			flex-shrink: 0;

			image {
				height: 100%;
				width: 100%;
				border-radius: 20rpx;
			}
		}

		.info {
			padding: 20rpx;
			color: #555;
			flex: 1;

			.title {
				font-size: 28rpx;
				font-weight: 900;
			}

			.desc {
				font-size: 22rpx;
				color: #777;
				margin-top: 10rpx;
			}

			.price {
				text-align: right;
				color: #f40;
				font-size: 26rpx;
				text{
					font-size: 30rpx;
					font-weight: 900;
				}
				&>view:nth-child(2){
					font-size: 22rpx;
					color: #777;
					text{
						font-size: 26rpx;
						font-weight: 900;
					}
				}
			}
		}
	}
</style>