wuhb 4 місяців тому
батько
коміт
dbae1848d0

+ 25 - 4
components/custom-tabbar/custom-tabbar.uvue

@@ -15,12 +15,25 @@
     // Props
     type Props = {
         current?: number
+		hide0:number
+		hide1:number
+		hide2:number
+		hide3:number
     }
 
     const props = withDefaults(defineProps<Props>(), {
-        current: 0
+        current: 0,
+		hide0:1,
+		hide1:1,
+		hide2:1,
+		hide3:1
     })
 
+	const hide0 = ref<number>(props.hide0)
+	const hide1 = ref<number>(props.hide1)
+	const hide2 = ref<number>(props.hide2)
+	const hide3 = ref<number>(props.hide3)
+	
     // Tab 列表配置
     type TabItem = {
         pagePath: string
@@ -28,8 +41,8 @@
         iconPath: string
         selectedIconPath: string
     }
-
-    const tabList: TabItem[] = [
+	const tabList: TabItem[] = [];
+    const tabList1: TabItem[] = [
         {
             pagePath: '/pages/index/index',
             text: '首页',
@@ -55,7 +68,15 @@
 		    selectedIconPath: '/static/images/custom-tabbar/66.png'
 		}
     ]
-
+	
+	const hideValues = [props.hide0, props.hide1, props.hide2, props.hide3]
+	for (let i = 0; i < tabList1.length; i++) {
+	    if (i < hideValues.length && hideValues[i] === 1) {
+	        // hide 值为 1 时显示,添加到 tabList
+	        tabList.push(tabList1[i])
+	    }
+	}
+	
     // 当前选中索引
     const currentIndex = ref<number>(props.current)
 

+ 4 - 4
manifest.json

@@ -2,8 +2,8 @@
 	"name": "工效通APP",
 	"appid": "__UNI__1050C07",
 	"description": "工效通任务管理平台",
-	"versionName": "1.2.7",
-	"versionCode": "127",
+	"versionName": "1.2.8",
+	"versionCode": "128",
 	"uni-app-x": {},
 	"quickapp": {},
 	"mp-weixin": {
@@ -53,9 +53,9 @@
 		],
 		"networkSecurityConfig": "@xml/network_security_config",
 		"distribute": {
-			"untrustedCa": "allow",  // 允许不受信任的CA证书
+			"untrustedCa": "allow", // 允许不受信任的CA证书
 			"ssl": {
-			  "verify": false  // 可选:不验证SSL证书
+				"verify": false // 可选:不验证SSL证书
 			},
 			"modules": {
 				"uni-map": {},

+ 4 - 2
pages/index/index.uvue

@@ -121,7 +121,7 @@
         </scroll-view>
 
         <!-- 底部 TabBar -->
-        <custom-tabbar :current="0" />
+        <custom-tabbar :current="0" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
     </view>
 </template>
 
@@ -152,7 +152,9 @@
 	// 		console.log(res)
 	// 	});
 	// };
-
+	
+	const tabbar = [1,1,1,1]
+	
     // 用户名
     const userName = ref<string>('用户')
 

+ 3 - 1
pages/order/index.uvue

@@ -122,7 +122,7 @@
                 </view>
             </template>
         </common-list>
-		<custom-tabbar :current="1" />
+		<custom-tabbar :current="1" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
     </view>
 </template>
 
@@ -147,6 +147,8 @@ import {checkPermi, getUserInfo} from '../../utils/storage'
     const total = ref<number>(0)
 	let currentStatus = ref<string>('') // 添加状态管理
     const statusDictList = ref<SysDictData[]>([]) // 工单状态字典列表
+	
+	const tabbar = [1,1,1,1]
 
 	// 添加防重复请求的标志位(参考score/pending.uvue的实现)
 	const isSearching = ref<boolean>(false)

+ 3 - 1
pages/score/index.uvue

@@ -190,7 +190,7 @@
     </l-popup>
 
     <!-- 底部 TabBar -->
-    <custom-tabbar :current="3" />
+    <custom-tabbar :current="3" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
   </view>
 </template>
 
@@ -223,6 +223,8 @@
     // 添加刷新时间戳,用于防抖
     const lastRefreshTime = ref<number>(0)
 
+	const tabbar = [1,1,1,1]
+
     // 添加防抖定时器
     let searchTimer: number | null = null
 

+ 3 - 1
pages/worktime/index.uvue

@@ -188,7 +188,7 @@
     </l-popup>
 
     <!-- 底部 TabBar -->
-    <custom-tabbar :current="2" />
+    <custom-tabbar :current="2" :hide0="tabbar[0]" :hide1="tabbar[1]" :hide2="tabbar[2]" :hide3="tabbar[3]"/>
   </view>
 </template>
 
@@ -226,6 +226,8 @@ const showEndDatePicker = ref<boolean>(false)
 const startDate = ref<string>('')
 const endDate = ref<string>('')
 
+const tabbar = [1,1,1,1]
+
 // 工单状态字典列表
 const statusDictList = ref<SysDictData[]>([])
 // 维保类型字典列表