From a573a61be7010a50576a410222314fd704ed3c7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=A7=E5=96=B5=E5=92=AA?= <15233722133@163.com>
Date: Wed, 26 Aug 2026 10:40:18 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B7=B2=E5=94=AE?=
=?UTF-8?q?=E7=BD=84=E6=A0=87=E7=AD=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
components/ai_order/ai_order.vue | 91 ++++++++++++-
components/goodsItem/card_goods.vue | 87 ++++++++++++-
manifest.json | 2 +-
.../s-goods-column/s-goods-column.vue | 122 +++++++++++++++++-
5 files changed, 290 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index 22df66e..9e360e3 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
### 项目打包配置
- 更改版本号
- 当前版本号`1.4.1`
-- 包名:`uni.UNI8B187414`
+- 包名:`uni.UNI8B187414/com.yougou.mall`
- 应用名称:`优购商城`
- appId:`__UNI__8B19741`
- api地址`.env`:
diff --git a/components/ai_order/ai_order.vue b/components/ai_order/ai_order.vue
index 2374f30..8077233 100644
--- a/components/ai_order/ai_order.vue
+++ b/components/ai_order/ai_order.vue
@@ -8,6 +8,7 @@
{{ cornerText }}
+ 已售罄
@@ -130,9 +131,25 @@
>
-
- 选规格
+
+ {{ isSoldOut ? '已售罄' : '选规格' }}
+ 已售罄
@@ -191,6 +208,50 @@
if (raw !== '七数商') return '';
return raw;
});
+
+ const isSoldOut = computed(() => {
+ const d = props.data || {};
+ const stockNum = Number(
+ d.stock ?? d.stocks ?? d.pointStock ?? d.leftStock ?? -1,
+ );
+ if (stockNum !== -1 && !Number.isNaN(stockNum)) {
+ if (stockNum <= 0) return true;
+ }
+ if (Array.isArray(d.skuArr) && d.skuArr.length) {
+ const total = d.skuArr.reduce((s, sku) => {
+ const skuStock = Number(
+ (sku && (sku.stock ?? sku.stocks ?? sku.count ?? sku.leftStock)) ?? 0,
+ );
+ return s + (Number.isNaN(skuStock) ? 0 : skuStock);
+ }, 0);
+ if (total <= 0) return true;
+ }
+ if (Array.isArray(d.skus) && d.skus.length) {
+ const total = d.skus.reduce((s, sku) => {
+ const skuStock = Number(
+ (sku && (sku.stock ?? sku.stocks ?? sku.count ?? sku.leftStock)) ?? 0,
+ );
+ return s + (Number.isNaN(skuStock) ? 0 : skuStock);
+ }, 0);
+ if (total <= 0) return true;
+ }
+ if (Array.isArray(d.items1) && d.items1.length) {
+ const total = d.items1.reduce((s, sku) => {
+ const skuStock = Number(
+ (sku && (sku.stock ?? sku.stocks ?? sku.count ?? sku.leftStock)) ?? 0,
+ );
+ return s + (Number.isNaN(skuStock) ? 0 : skuStock);
+ }, 0);
+ if (total <= 0) return true;
+ }
+ return false;
+ });
+
+ const showSoldOutTag = computed(() => {
+ if (!isSoldOut.value) return false;
+ if (props.source === 0) return true;
+ return false;
+ });
let timeText = ref('结束');
let hour = ref(0);
let minute = ref(0);
@@ -291,6 +352,7 @@
}
}
const addCar = () => {
+ if (isSoldOut.value) return;
proxy.$emit('addCar', props.data);
};
const goInfo = () => {
@@ -470,4 +532,29 @@
align-items: baseline;
justify-content: space-between;
}
+
+ .sold-out-tag {
+ position: absolute;
+ right: 0;
+ top: 0;
+ z-index: 3;
+ width: 108rpx;
+ height: 52rpx;
+ line-height: 52rpx;
+ text-align: center;
+ font-size: 24rpx;
+ font-weight: 600;
+ color: #ffffff;
+ background: rgba(0, 0, 0, 0.58);
+ border-radius: 0 0 0 12rpx;
+ backdrop-filter: blur(2px);
+ }
+
+ .btn-soldout {
+ background: #cccccc !important;
+ color: #ffffff !important;
+ filter: grayscale(100%);
+ cursor: not-allowed !important;
+ pointer-events: none !important;
+ }
diff --git a/components/goodsItem/card_goods.vue b/components/goodsItem/card_goods.vue
index aeff26c..8465880 100644
--- a/components/goodsItem/card_goods.vue
+++ b/components/goodsItem/card_goods.vue
@@ -16,6 +16,15 @@
goodsImg3: props.type == 3,
}"
>
+ 已售罄
-->
-
-
+
+
-
-
+
+
+ 售罄
@@ -90,7 +114,7 @@