shopInfo.vue
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
<view class="infoBox">
<view class="name ellipsisT">
{{ info.name }}
</view>
<view class="flexJ" v-if="info.goodstatus === 1">
<view class="inventory" style="margin-bottom: 10rpx">购买可获得{{ info.spec[0].score }}积分</view>
<view class="inventory" style="color: rgb(241, 71, 71)">注: 购买不同规格的商品可获得不同的积分</view>
</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="[2,1].includes(info.goodstatus)">¥{{ 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;
}
.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;
}
}
}
.inventory {
color: #00000066;
font-size: 22rpx;
}
</style>