From 962764e90a4cd06b9f8a18ec8f542e689fd50131 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 16 六月 2025 12:08:21 +0800
Subject: [PATCH] 刷视频-轮播展示多商品,发布视频字段bug
---
components/custom-tabbar.vue | 42 +++++++++++++++++++++++++++---------------
1 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/components/custom-tabbar.vue b/components/custom-tabbar.vue
index c7e2139..5d2cf8b 100644
--- a/components/custom-tabbar.vue
+++ b/components/custom-tabbar.vue
@@ -5,13 +5,13 @@
v-for="(item, index) in list"
:key="index"
class="tabbar-item"
- @click="switchTab(item, index)"
+ @click="switchTab(item)"
>
<image
- :src="selected === index ? item.selectedIconPath : item.iconPath"
- class="tabbar-icon"
+ :src="selected === item.key ? item.selectedIconPath : item.iconPath"
+ :class="{'tabbar-icon': true, 'video-add': item.key == 'video'}"
/>
- <text class="tabbar-text" :style="{color: selected === index ? selectedTextColor : color}">
+ <text class="tabbar-text" v-if="item.text" :style="{color: selected === item.key ? selectedTextColor : color}">
{{item.text}}
</text>
</view>
@@ -23,8 +23,8 @@
name: "CustomTabbar",
props: {
selected: {
- type: Number,
- default: 0
+ type: String,
+ default: 'index'
},
bgColor: {
type: String,
@@ -43,34 +43,43 @@
"pagePath": "/pages/tabbar/index/home",
"iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home-s.png",
- "text": "棣栭〉"
+ "text": "棣栭〉",
+ "key": 'index'
},
{
"pagePath": "/pages/tabbar/category/category",
"iconPath": "/static/tabbar/category.png",
"selectedIconPath": "/static/tabbar/category-s.png",
- "text": "鍒嗙被"
+ "text": "鍟嗗煄",
+ "key": 'shop'
},
-
+ {
+ "pagePath": "/pages/tabbar/video/video",
+ "iconPath": "/static/tabbar/video1.png",
+ "selectedIconPath": "/static/tabbar/video1-selected.png",
+ "key": 'video'
+ },
{
"pagePath": "/pages/tabbar/cart/cartList",
"iconPath": "/static/tabbar/cart.png",
"selectedIconPath": "/static/tabbar/cart-s.png",
- "text": "璐墿杞�"
+ "text": "璐墿杞�",
+ "key": 'buyCar'
},
{
"pagePath": "/pages/tabbar/user/my",
"iconPath": "/static/tabbar/mine.png",
"selectedIconPath": "/static/tabbar/mine-s.png",
- "text": "鎴戠殑"
+ "text": "鎴戠殑",
+ "key": 'my'
}
]
}
},
methods: {
- switchTab(item, index) {
- console.log("鎵ц鍔�", item, index);
- if (this.selected === index) return;
+ switchTab(item) {
+ console.log("鎵ц鍔�", item);
+ if (this.selected === item.key) return;
uni.switchTab({
url: item.pagePath
});
@@ -99,7 +108,10 @@
align-items: center;
justify-content: center;
}
-
+.video-add {
+ width: 30px !important;
+ height: 30px !important;
+}
.tabbar-icon {
width: 24px;
height: 24px;
--
Gitblit v1.8.0