<template>
	<view class="item-container">
		<u-image
			width="176rpx"
			height="176rpx"
			:src="src?.split('http').length > 1 ? src : baseUrl + src"
		></u-image>
		<view class="content">
			<view class="title">
				<text>{{ name }}</text>
				<text style="color: #646566;">{{ brief }}</text>
			</view>
			<view class="price">
				<!-- <text class="new-price">￥{{ counterPrice?.toFixed(2) }}</text> -->
				<!-- <text v-if="counterPrice != 0" class="old-price">
					￥{{ counterPrice?.toFixed(2) }}
				</text> -->
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
import config from '@/utils/config';

let baseUrl = config.baseUrl;

let props = defineProps({
	// 路径
	src: {
		type: String,
		default: '',
	},
	// 主标题
	name: {
		type: String,
		default: '',
	},
	// 副标题
	brief: {
		type: String,
		default: '',
	},
	// 原价格
	counterPrice: {
		type: Number,
		default: 0,
	},
	// 新价格
	retailPrice: {
		type: Number,
		default: 0,
	},
});
</script>

<style lang="scss" scoped>
.item-container {
	box-sizing: border-box;
	width: 100%;
	height: 208rpx;
	padding: 16rpx 32rpx;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	background-color: #fff;
	.content {
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin-left: 20rpx;
		.title {
			display: flex;
			flex-direction: column;
		}
		.price {
			.new-price {
				font-size: 32rpx;
			}
			.old-price {
				margin-left: 10rpx;
				color: #969799;
				font-size: 20rpx;
				text-decoration: line-through;
			}
		}
	}
}
</style>
