From ef46d13d5fa70d1c94f25de294f5ed177b751234 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 02 三月 2026 16:40:30 +0800
Subject: [PATCH] 提交

---
 mini-program/pages/special-zone/special-zone.vue |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/mini-program/pages/special-zone/special-zone.vue b/mini-program/pages/special-zone/special-zone.vue
index f9dfd9a..2720fa9 100644
--- a/mini-program/pages/special-zone/special-zone.vue
+++ b/mini-program/pages/special-zone/special-zone.vue
@@ -48,6 +48,7 @@
 				<view class="cart-num" v-if="cardObj && cardObj.cartTypeNum > 0">{{cardObj.cartTypeNum}}</view>
 			</view>
 		</view>
+		<Login ref="login" />
 	</view>
 </template>
 
@@ -55,9 +56,11 @@
 	import {
 		mapState
 	} from 'vuex'
+	import Login from '@/components/login/login.vue'
 	export default {
+		components: {Login},
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight'])
+			...mapState(['navHeight', 'statusbarHeight', 'userInfo'])
 		},
 		data() {
 			return {
@@ -72,7 +75,9 @@
 		onLoad(options) {
 			this.qualityId = options.qualityId
 			this.getGoodsList()
-			this.cardNum()
+			if (this.userInfo) {
+				this.cardNum()
+			}
 		},
 		onReachBottom() {
 			this.getGoodsList()
@@ -84,18 +89,26 @@
 				})
 			},
 			addCard(e) {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
 				this.$u.api.addCart({
 					goodsId: e.id,
-					goodsSkuId: e.skuResponsesList[0].id,
+					goodsSkuId: e.goodsSkuResponseList[0].id,
 					num: 1
 				}).then(res => {
 					if (res.code === 200) {
 						this.cardNum()
-						uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'none' })
+						uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success', mask: true })
 					}
 				})
 			},
 			jumpCard() {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
 				uni.navigateTo({
 					url: '/pages/shopping-cart/shopping-cart'
 				})

--
Gitblit v1.9.3