Browse Source

chore(components): 移除未使用的 tabBar 组件文件

- 删除了 src/components/tab-bar.unuse 文件
- 该组件此前未被项目引用
- 清理冗余代码以优化项目结构
mcbaiyun 1 month ago
parent
commit
c0aa8dd8f0
1 changed files with 0 additions and 108 deletions
  1. 0 108
      src/components/tab-bar.unuse

+ 0 - 108
src/components/tab-bar.unuse

@@ -1,108 +0,0 @@
-<template>
-  <view class="tab-bar">
-    <view class="tab-item" @click="onTabClick(0)">
-      <!-- <uni-icons type="home" size="20" color="#666"></uni-icons> -->
-       <image src="/static/icons/remixicon/home-3-line.svg" class="icon" mode="widthFix" />
-      <text class="tab-text">首页</text>
-    </view>
-    <view class="tab-item" @click="onTabClick(1)">
-      <image src="/static/icons/remixicon/line-chart-line.svg" class="icon" mode="widthFix" />
-      <!-- <uni-icons type="bars" size="20" color="#666"></uni-icons> -->
-      <text class="tab-text">健康</text>
-    </view>
-    <view class="tab-item" @click="onTabClick(2)">
-      <image src="/static/icons/remixicon/account-circle-line.svg" class="icon" mode="widthFix" />
-      <!-- <uni-icons type="person" size="20" color="#666"></uni-icons> -->
-      <text class="tab-text">我的</text>
-    </view>
-  </view>
-</template>
-
-<script setup lang="ts">
-import { isLoggedIn as checkLogin, getRole } from '../composables/useAuth'
-const onTabClick = (index: number) => {
-  console.log('Tab clicked:', index)
-
-  switch (index) {
-    case 0: // 慢病首页
-      try {
-        const logged = checkLogin()
-        const role = logged ? getRole() : null
-        if (logged && role === 3) {
-          uni.switchTab({ url: '/pages/patient/index/index' })
-        } else {
-          uni.switchTab({ url: '/pages/public/index/index' })
-        }
-      } catch (err) {
-        console.error('tab click index redirect error', err)
-        uni.switchTab({ url: '/pages/public/index/index' })
-      }
-      break
-    case 1: // 健康数据
-      try {
-        // 本地判断:已登录且 role===3 则跳转到患者端健康页(使用 switchTab,因为该页属于 tab)
-        // 未登录或非患者则降级到公共健康页
-        // TODO: 后续支持根据其他角色(医生/患者家属等)跳转到各自的健康页
-        const logged = checkLogin()
-        const role = logged ? getRole() : null
-        if (logged && role === 3) {
-          uni.switchTab({ url: '/pages/patient/health/index' })
-        } else {
-          uni.switchTab({ url: '/pages/public/health/index' })
-        }
-      } catch (err) {
-        console.error('tab click health redirect error', err)
-        uni.switchTab({ url: '/pages/public/health/index' })
-      }
-      break
-    case 2: // 个人中心
-      try {
-        const logged = checkLogin()
-        const role = logged ? getRole() : null
-        if (logged && role === 3) {
-          uni.switchTab({ url: '/pages/patient/profile/index' })
-        } else {
-          uni.switchTab({ url: '/pages/public/profile/index' })
-        }
-      } catch (err) {
-        console.error('tab click profile redirect error', err)
-        uni.switchTab({ url: '/pages/public/profile/index' })
-      }
-      break
-  }
-}
-</script>
-
-<style>
-.icon {
-  width: 45rpx;
-  height: 45rpx;
-  display: inline-block;
-}
-.tab-bar {
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  height: 100rpx;
-  background-color: #ffffffe7;
-  display: flex;
-  justify-content: space-around;
-  align-items: center;
-  border-top: 1rpx solid #eee;
-}
-
-.tab-item {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  flex: 1;
-  height: 100%;
-}
-
-.tab-text {
-  font-size: 24rpx;
-  color: #666;
-}
-</style>