From a670f7bd246641495e31ab6570f8d558ab0e83e2 Mon Sep 17 00:00:00 2001
From: Jacob <hlnie@tohours.com>
Date: 星期二, 13 十月 2026 16:48:59 +0800
Subject: [PATCH] Merge branch 'master' into sit
---
components/productConSwiper/index.vue | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/components/productConSwiper/index.vue b/components/productConSwiper/index.vue
index 812c365..7bb447d 100644
--- a/components/productConSwiper/index.vue
+++ b/components/productConSwiper/index.vue
@@ -20,7 +20,7 @@
<block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item>
<image :src="item" class="slide-image" />
- <image v-if="productSelect.stock !== undefined && productSelect.stock !== null && (!productSelect.stock || productSelect.stock <= 0)" style="position:absolute;left:0;top:0" class="slide-image" src="https://ossacmall.bluedeer.com.cn/app/static/images/noStock.png" mode="aspectFill"></image>
+ <image v-if="isSoldOut" style="position:absolute;left:0;top:0" class="slide-image" src="https://ossacmall.bluedeer.com.cn/app/static/images/noStock.png" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
@@ -72,6 +72,16 @@
type: 'image'
};
},
+ computed: {
+ // 搴撳瓨瀛楁鏈姞杞斤紙undefined/null锛夋椂涓嶈涓� 0锛岄伩鍏嶆帴鍙h繑鍥炲墠璇洊鍞絼姘村嵃
+ isSoldOut() {
+ const stock = this.productSelect && this.productSelect.stock;
+ if (stock === undefined || stock === null || stock === '') {
+ return false;
+ }
+ return Number(stock) <= 0;
+ }
+ },
mounted() {
},
--
Gitblit v1.4.0