Skip to content

Commit 75fa09f

Browse files
committed
chore(product): adjust badge style, add status show
1 parent de33817 commit 75fa09f

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/views/home/product-show/product-card.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<div class="card" @click="handleView">
33
<div class="thumb">
44
<img :src="product.imageUrlUrl" :alt="product.name" />
5-
<div v-if="product.amount === 0" class="badge">缺货</div>
5+
<div class="badges">
6+
<div v-if="product.amount === 0" class="badge">缺货</div>
7+
<div v-if="product.status !== '0'" class="badge">已下架</div>
8+
</div>
69
</div>
710
<div class="body">
811
<div class="title" :title="product.name">{{ product.name }}</div>
@@ -61,10 +64,19 @@ const handleView = () => emit('view')
6164
object-fit: cover;
6265
display: block;
6366
}
64-
.badge {
67+
.badges {
6568
position: absolute;
6669
top: 8px;
6770
left: 8px;
71+
z-index: 1;
72+
display: flex;
73+
flex-direction: column;
74+
align-items: flex-start;
75+
gap: 6px;
76+
}
77+
.badge {
78+
display: inline-flex;
79+
width: fit-content;
6880
background: #f56c6c;
6981
color: #fff;
7082
padding: 4px 8px;

0 commit comments

Comments
 (0)