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/mall/mall.vue |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/mini-program/pages/mall/mall.vue b/mini-program/pages/mall/mall.vue
index e8821cc..e0260ce 100644
--- a/mini-program/pages/mall/mall.vue
+++ b/mini-program/pages/mall/mall.vue
@@ -12,7 +12,7 @@
 					</view>
 				</view>
 				<view class="head-tabs">
-					<u-tabs lineColor="#E4001D" :list="list" @click="clickCate"></u-tabs>
+					<u-tabs lineColor="#E4001D" :itemStyle="{ height: '100rpx' }" :list="list" @click="clickCate"></u-tabs>
 				</view>
 			</view>
 			
@@ -88,9 +88,10 @@
 			<view class="cart-box">
 				<image src="/static/icon/ic_cart@2x.png" mode="widthFix"></image>
 				<text>璐墿杞�</text>
-				<view class="cart-num">{{cardTotal}}</view>
+				<view class="cart-num" v-if="cardTotal>0">{{cardTotal}}</view>
 			</view>
 		</view>
+		<Login ref="login" />
 	</view>
 </template>
 
@@ -98,7 +99,9 @@
 	import {
 		mapState
 	} from 'vuex'
+	import Login from '@/components/login/login.vue'
 	export default {
+		components: { Login },
 		computed: {
 			...mapState(['navHeight', 'statusbarHeight', 'userInfo'])
 		},
@@ -180,6 +183,10 @@
 		},
 		methods: {
 			jumpCart() {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
 				uni.navigateTo({
 					url: '/pages/shopping-cart/shopping-cart'
 				})
@@ -199,13 +206,17 @@
 				this.getGoodsList()
 			},
 			addCard(e) {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
 				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' })
+						uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success', mask: true })
 						this.getCartNum()
 					}
 				})
@@ -508,8 +519,8 @@
 				.head-tabs {
 					width: 100%;
 					height: 100rpx;
-					display: flex;
-					align-items: flex-end;
+					// display: flex;
+					// align-items: flex-end;
 					border-bottom: 1rpx solid #E5E5E5;
 				}
 			}

--
Gitblit v1.9.3