From b0712811a0421dd3d4bc6ea03c54b7b39096439e Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 28 二月 2026 18:27:42 +0800
Subject: [PATCH] 提交

---
 mini-program/pages/mall/mall.vue |   48 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/mini-program/pages/mall/mall.vue b/mini-program/pages/mall/mall.vue
index c6df367..28dd9e1 100644
--- a/mini-program/pages/mall/mall.vue
+++ b/mini-program/pages/mall/mall.vue
@@ -8,11 +8,11 @@
 					<text>鍟嗗煄</text>
 					<view class="head-search-input">
 						<u-search placeholder="鎼滅储鍟嗗搧" height="30" searchIconColor="#999999" borderColor="#eeeeee"
-							bgColor="rgba(255,255,255,0.9)" @custom="search" :showAction="false" v-model="form.goodsName" @search="search" />	
+							bgColor="rgba(255,255,255,0.9)" @clear="search" :showAction="false" v-model="form.goodsName" @search="search" />	
 					</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>
 			
@@ -44,8 +44,9 @@
 				</view>
 			</view>
 			<!-- 鍝佺墝 -->
-			<view class="list" style="padding-top: 30rpx; box-sizing: border-box; justify-content: flex-start;" v-if="show === 2">
+			<view class="list" style="padding-top: 30rpx; box-sizing: border-box;" v-if="show === 2">
 				<view :class="item.active ? 'list-cate active' : 'list-cate'" v-for="(item, index) in pingpai" :key="index" @click="getXiLie(item.id, index)">{{item.name}}</view>
+				<view style="width: 216rpx; height: 0;"></view>
 			</view>
 			<!-- 绯诲垪 -->
 			<view class="list" v-if="show === 3">
@@ -83,13 +84,14 @@
 				</view>
 			</view>
 		</view>
-		<view class="cart">
+		<view class="cart" @click="jumpCart">
 			<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>
 
@@ -97,9 +99,11 @@
 	import {
 		mapState
 	} from 'vuex'
+	import Login from '@/components/login/login.vue'
 	export default {
+		components: { Login },
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight'])
+			...mapState(['navHeight', 'statusbarHeight', 'userInfo'])
 		},
 		watch: {
 			paixu: {
@@ -165,14 +169,28 @@
 			};
 		},
 		onLoad() {
-			this.getCartNum()
 			this.getLabels()
 			this.getGoodsList()
+		},
+		async onShow() {
+			await this.$onLaunched;
+			if (this.userInfo) {
+				this.getCartNum()
+			}
 		},
 		onReachBottom() {
 			this.getGoodsList()
 		},
 		methods: {
+			jumpCart() {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
+				uni.navigateTo({
+					url: '/pages/shopping-cart/shopping-cart'
+				})
+			},
 			getCartNum() {
 				this.$u.api.cartGoodsTypeNum()
 					.then(res => {
@@ -188,6 +206,10 @@
 				this.getGoodsList()
 			},
 			addCard(e) {
+				if (!this.userInfo) {
+					this.$refs.login.open()
+					return;
+				}
 				this.$u.api.addCart({
 					goodsId: e.id,
 					goodsSkuId: e.skuResponsesList[0].id,
@@ -497,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;
 				}
 			}
@@ -528,10 +550,10 @@
 					font-size: 28rpx;
 					color: #333333;
 					margin-bottom: 24rpx;
-					margin-right: 20rpx;
-					&:last-child {
-						margin-right: 0 !important;
-					}
+					// margin-right: 20rpx;
+					// &:last-child {
+					// 	margin-right: 0 !important;
+					// }
 				}
 				.red {
 					text {

--
Gitblit v1.9.3