From 3546c0c8485b2bc60fa453fe2e513805bc40d390 Mon Sep 17 00:00:00 2001
From: Jacob <hlnie@tohours.com>
Date: 星期二, 13 十月 2026 16:45:10 +0800
Subject: [PATCH] refactor: 页面按业务拆分至分包并配置分包预加载优化主包体积

---
 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 6b84092..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||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