<template>
	<view class="order-goods">
		<view class="goods-lable">
			<view class="store-name">
				<text class="name-text one-row">古田天猫药品旗舰店 </text>
				<text class="iconfont name-icon" v-if="openShop">&#xe671;</text>
			</view>
			<view class="service-text" v-if="isService">
				<text class="iconfont service-icon">&#xe605;</text>
				<text class="">联系客服</text>
			</view>
		</view>
		<view class="goods-item">
			<image class="goods-icon" :src="$handleImageUrl('/logo.png')" mode="aspectFill" />
			<view class="goods-content">
				<view class="goods-name">阿莫西林 80颗/盒 包邮</view>
				<view class="goods-size">80颗装，三板</view>
				<view class="goods-statistics">
					<view class="price-statistics">
						<text class="price-tag">￥</text>
						<text class="price-num">88.88</text>
					</view>
					<text class="num-statistics">x1</text>
				</view>
			</view>
		</view>
		<view class="goods-item">
			<image class="goods-icon" :src="$handleImageUrl('/logo.png')" mode="aspectFill" />
			<view class="goods-content">
				<view class="goods-name">阿莫西林 80颗/盒 包邮</view>
				<view class="goods-size">80颗装，三板</view>
				<view class="goods-statistics">
					<view class="price-statistics">
						<text class="price-tag">￥</text>
						<text class="price-num">88.88</text>
					</view>
					<text class="num-statistics">x1</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	defineProps({
		openShop: {
			type: Boolean,
			default: false
		},
		isService: {
			type: Boolean,
			default: false
		},
	})
</script>

<style lang="scss" scoped>
	.order-goods {
		background-color: #fff;
	}

	.goods-lable {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 40rpx 30rpx 20rpx;
		border-bottom: 1rpx solid #f0f0f0;

		.store-name {
			flex: 1;
			flex-shrink: 0;
			overflow: hidden;
			color: #1a1a1a;
			display: flex;
			flex-direction: row;
			align-items: center;

			.name-text {
				font-size: 36rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				line-height: 1;
			}

			.name-icon {
				flex-shrink: 0;
				font-size: 40rpx;
				padding-left: 10rpx;
			}
		}

		.service-text {
			flex-shrink: 0;
			display: flex;
			align-items: center;

			font-size: 26rpx;
			font-family: PingFang SC, PingFang SC-Regular;
			font-weight: 400;
			color: #1a1a1a;
			padding-left: 10rpx;

			.service-icon {
				color: #000;
				margin-right: 10rpx;
			}
		}
	}

	.goods-item {
		display: flex;
		align-items: center;
		padding: 30rpx 30rpx 0;

		&:last-child {
			padding-bottom: 40rpx;
		}

		.goods-icon {
			width: 146rpx;
			height: 146rpx;
			border-radius: 14rpx;
		}

		.goods-content {
			width: calc(100% - 146rpx);
			padding-left: 26rpx;
			display: flex;
			flex-direction: column;

			.goods-name {
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #1a1a1a;
				line-height: 42rpx;
				height: 42rpx;
			}

			.goods-size {
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				color: #666666;
				line-height: 33rpx;
				height: 33rpx;
				margin: 8rpx 0;
			}

			.goods-statistics {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.price-statistics {
					color: #da4f4f;
					font-family: PingFang SC, PingFang SC-Bold;
					display: flex;
					align-items: baseline;

					.price-tag {
						font-size: 24rpx;
						font-weight: 700;
					}

					.price-num {
						font-size: 34rpx;
						// font-family: 汉真广标, 汉真广标-regular;
						font-weight: normal;
					}
				}

				.num-statistics {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #666666;
					line-height: 28rpx;
				}
			}
		}
	}
</style>