shopInfo.vue 1.6 KB
<template>
	<view class="infoBox">
		<view class="name ellipsisT">
			{{info.name}}
		</view>
		<view class="priceBox flexJ">
			<view class="price flexA" v-if="info.goodstatus==3">
				<view class="new">{{info.spec[0].coscore}}</view>
				<view class="points">积分</view>
			</view>
			<view class="price flexA" v-else>
				<view class="new">¥{{info.spec[0].goods_price}}</view>
				<text v-if="info.goodstatus==2">¥{{info.spec[0].line_price}}</text>
			</view>
			<!-- 1=普通商品,2=特价商品,3=积分商品 --> 
			<view class="inventory">
			{{ info.goodstatus==1 ? '已售:'
			: info.goodstatus==2 ? '库存:' :'已兑:'
			 }}{{info.goodstatus!=2 ?info.sales_actual :info.spec[0].stock_num}}份</view>
		</view>
		
	</view>
</template>

<script setup>
	import { defineProps,onMounted } from 'vue'
	const props = defineProps({
		isPoints:{
			type:Boolean,
			default:false
		},
		info:{
			type:Object,
			default:{}
		}
	})
	onMounted(()=> {
		// console.log('商品信息',props.info)
	})
</script>

<style lang="scss">
	.infoBox {

		.name {
			height: 80rpx;
			color: #000000e6;
			font-size: 30rpx;
			font-weight: 700;
			line-height: 40rpx;
			margin-bottom: 32rpx
		}

		.priceBox {
			.price {
				text {
					color: #00000042;
					font-size: 24rpx;
					text-decoration: line-through;
					margin-left: 8rpx;
					margin-top: 16rpx
				}

				.new {
					color: #fc4338ff;
					font-size: 40rpx;
					font-weight: 700;
				}
				.points {
					color: #fc4338ff;
					font-size: 22rpx;
					margin: 10rpx 0 0 8rpx;
				}
			}

			.inventory {
				color: #00000066;
				font-size: 22rpx;
			}
		}
	}
</style>