From 63820a55496e99f54d68a1f16e3f6f606c582120 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 11 二月 2026 09:11:16 +0800
Subject: [PATCH] 调试代码

---
 mini-program/pages/index/index.vue |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/mini-program/pages/index/index.vue b/mini-program/pages/index/index.vue
index caa8ba7..14f505b 100644
--- a/mini-program/pages/index/index.vue
+++ b/mini-program/pages/index/index.vue
@@ -86,7 +86,7 @@
 						</view>
 						<view class="commodity-item-shou">
 							<text>宸插敭{{item.saleNum + item.realSaleNum}}</text>
-							<view class="commodity-item-shou-add">+</view>
+							<view class="commodity-item-shou-add" @click.stop="addCard(item)">+</view>
 						</view>
 					</view>
 				</view>
@@ -143,6 +143,17 @@
 			this.getGoodsList()
 		},
 		methods: {
+			addCard(e) {
+				this.$u.api.addCart({
+					goodsId: e.id,
+					goodsSkuId: e.skuResponsesList[0].id,
+					num: 1
+				}).then(res => {
+					if (res.code === 200) {
+						uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success' })
+					}
+				})
+			},
 			jumpDetails(id) {
 				uni.navigateTo({
 					url: '/pages/details/details?id=' + id

--
Gitblit v1.9.3