Bladeren bron

fix: 去除navigation bar

IlhamTahir 1 jaar geleden
bovenliggende
commit
ace88a7149

+ 1 - 1
src/components/TabBar.vue

@@ -38,7 +38,7 @@ const selectedIndex = computed(() => {
 </script>
 
 <template>
-  <view class="w-full p-2 fixed bottom-0 left-0 safe-area">
+  <view class="w-full p-1 fixed bottom-0 left-0 safe-area  border-t-[0.5px] border-[#E7E7E7] bg-[#fff]">
     <view class="w-full flex gap-2">
       <view v-for="(item, index) in tabList" :key="index" class="flex flex-col items-center justify-center w-1/4" @tap="handleTap(item)">
         <image :src="selectedIndex === index ? item.iconSelect : item.icon" class="w-8 h-8" />

+ 8 - 4
src/pages.json

@@ -6,10 +6,6 @@
     }
   },
   "pages": [
-    {
-      "path": "pages/start-filing/index",
-      "type": "page"
-    },
     {
       "path": "pages/feed-calculator/index",
       "type": "page"
@@ -26,10 +22,18 @@
       "path": "pages/me/index",
       "type": "page"
     },
+    {
+      "path": "pages/pet-manual/index",
+      "type": "page"
+    },
     {
       "path": "pages/setting/index",
       "type": "page"
     },
+    {
+      "path": "pages/start-filing/index",
+      "type": "page"
+    },
     {
       "path": "pages/userInfo/index",
       "type": "page"

+ 0 - 1
src/pages/feed-calculator/index.vue

@@ -83,7 +83,6 @@ function handleStep(step: number) {
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
   <view class="flex flex-col bg-[#F5F6F7] overflow-y-auto" :style="`height:calc(100vh - ${safeHeight}px)`">
     <view v-show="controlFormDisplay.display1">
       <FeedStart :step-info="stepInfo" @ready="handleReady" />

+ 12 - 16
src/pages/feed-plan/index.vue

@@ -3,8 +3,6 @@ import avator from '@/static/image/pet-parameters/avator.png'
 import addBtn from '@/static/image/pet-plan/add_btn.png'
 import card from '@/static/image/pet-plan/card.png'
 import editBtn from '@/static/image/pet-plan/edit.png'
-import miniGoods from '@/static/image/pet-plan/mini_goods.png'
-import nutritionGoods from '@/static/image/pet-plan/nutrition_goods.png'
 import userAddBtn from '@/static/image/pet-plan/user_add_btn.png'
 import ToolApi from '@/utils'
 
@@ -15,21 +13,20 @@ interface User {
   isClick: boolean
   plan: { image: string, name: string, weight: string, energy: string, label: string[] }[]
 }
-const titleName = ref<string>('喂养计划')
 const safeHeight = ToolApi.getSafeHeight()
 // 用户存在情况
-const userList = ref<User[]>([
-  { name: '子龙', image: avator, label: ['1岁', '孟加拉豹猫', '8kg'], plan: [
-    { image: miniGoods, name: 'MINI主食包', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] },
-    { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] },
-  ], isClick: true },
-  { name: '广坤', image: avator, label: ['12岁', '孟加拉豹猫', '8kg'], plan: [
-    { image: miniGoods, name: 'MINI主食包', weight: '600', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] },
-    { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '1000', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] },
-  ], isClick: false },
-])
+// const userList = ref<User[]>([
+//   { name: '子龙', image: avator, label: ['1岁', '孟加拉豹猫', '8kg'], plan: [
+//     { image: miniGoods, name: 'MINI主食包', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] },
+//     { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] },
+//   ], isClick: true },
+//   { name: '广坤', image: avator, label: ['12岁', '孟加拉豹猫', '8kg'], plan: [
+//     { image: miniGoods, name: 'MINI主食包', weight: '600', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] },
+//     { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '1000', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] },
+//   ], isClick: false },
+// ])
 // 用户不存在情况
-// const userList = ref<User[]>([])
+const userList = ref<User[]>([])
 const clickUser = computed(() => {
   return userList.value.filter(user => user.isClick === true)
 })
@@ -49,7 +46,6 @@ function handleEdit() {
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
   <view class="flex flex-col bg-[#F5F6F7] overflow-y-auto" :style="`height:calc(100vh - ${safeHeight}px)`">
     <!--  喂养计划未注册  -->
     <view v-if="userList.length === 0" class="w-[calc(100% - 32px)] min-h-[135px]  rounded-lg m-[16px] relative">
@@ -63,7 +59,7 @@ function handleEdit() {
 
       <view class="w-[111px] h-[42px] bg-[black] absolute top-0 right-0 rounded-tr-xl z-10">
         <text class="text-[#999] absolute right-5 top-2 text-[12px]">
-          编辑计划
+          计划
         </text>
       </view>
       <view class="absolute right-0 top-0 w-[78px] h-[24px] z-20" @tap="handleAdd" />

+ 2 - 8
src/pages/home/index.vue

@@ -1,10 +1,7 @@
 <script setup lang="ts">
 import left_top_logo from '@/static/image/shouye/lt_logo.png'
 import Rectangle from '@/static/image/shouye/Rectangle.png'
-import ToolFun from '@/utils/index'
 
-const titleName = ref<string>('首页')
-const safeHeight = ToolFun.getSafeHeight()
 const videoSrc = ref(
   'https://test-cos-1308655658.cos.ap-shanghai.myqcloud.com/bright-intro-video.mp4',
 )
@@ -14,10 +11,8 @@ function startFiling() {
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
   <view
     class="flex flex-col bg-[#F5F6F7] overflow-y-auto"
-    :style="`height: calc(100vh - ${safeHeight}px)`"
   >
     <view class="container">
       <video
@@ -75,10 +70,9 @@ function startFiling() {
 .container
   position: relative
   width: 100%
-  height: 650px /* 根据需要设置视频容器的高度 */
-  /* display: flex; */
+  height: 650px
   overflow: hidden
-  padding-top: calc(100% / (16 / 9)) /* 视频宽高比 */
+  padding-top: calc(100% / (16 / 9))
   .video-player
     position: absolute
     top: 0

+ 0 - 1
src/pages/me/index.vue

@@ -39,7 +39,6 @@ const userModules = ref<UserModule>({
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
   <view class="w-full bg-[#F5F6F7]" :style="`height:calc(100vh - ${safeHeight}px)`">
     <view class="me-container p-4 w-full">
       <view class="me-card bg-[#FFFFFF] h-[229px] flex flex-col justify-center items-center w-full rounded-xl">

+ 0 - 3
src/pages/pet-manual/index.vue

@@ -14,7 +14,6 @@ interface DotStyle {
   border: string
 }
 
-const titleName = ref<string>('养宠手册')
 const listModel = ref<Article[]>([])
 const safeHeight = ToolApi.getSafeHeight()
 const searchValue = ref<string>('')
@@ -148,8 +147,6 @@ init()
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
-
   <view class="flex flex-col bg-[#F5F6F7] overflow-y-auto" :style="`height:calc(100vh - ${safeHeight}px)`">
     <view class="mx-[6px]">
       <uni-search-bar

+ 0 - 2
src/pages/start-filing/index.vue

@@ -10,7 +10,6 @@ interface RecordList {
   aimIndex: number
 }
 
-const titleName = ref<string>('开始建档')
 const safeHeight = ToolApi.getSafeHeight()
 const recordList = ref<RecordList[]>([
   { title: '宠物名字', options: ['子龙'], aimIndex: 0 },
@@ -29,7 +28,6 @@ function handleNext() {
 </script>
 
 <template>
-  <TitleBar :title-name="titleName" />
   <view class="flex flex-col bg-[#F5F6F7] overflow-y-auto" :style="`height:calc(100vh - ${safeHeight}px)`">
     <view class="w-[80px] h-[80px] rounded-full bg-[#D9D9D9] relative mt-[88px] mx-auto">
       <view class="absolute right-1 bottom-1 w-[18px] h-[18px] bg-[#0052D9] rounded-full flex items-center justify-center">

+ 3 - 9
src/uni-pages.d.ts

@@ -9,27 +9,21 @@ interface NavigateToOptions {
        "/pages/home/index" |
        "/pages/me/index" |
        "/pages/pet-manual/index" |
+       "/pages/setting/index" |
        "/pages/start-filing/index" |
+       "/pages/userInfo/index" |
        "/pages/feed-calculator/components/FeedFlogan" |
        "/pages/feed-calculator/components/FeedForm" |
        "/pages/feed-calculator/components/FeedQuestionnaire" |
        "/pages/feed-calculator/components/FeedStart" |
        "/pages/feed-calculator/components/FeedStep" |
        "/pages/feed-calculator/components/ProgressBar" |
-       "/pages/feed-calculator/components/FeedFlogan" |
-       "/pages/feed-calculator/components/FeedForm" |
-       "/pages/feed-calculator/components/FeedQuestionnaire" |
-       "/pages/feed-calculator/components/FeedStart" |
-       "/pages/feed-calculator/components/FeedStep" |
-       "/pages/feed-calculator/components/ProgressBar" |
-       "/pages/setting/index" |
-       "/pages/userInfo/index" |
        "/pages/pet-manual/components/CardList";
 }
 interface RedirectToOptions extends NavigateToOptions {}
 
 interface SwitchTabOptions {
-
+  
 }
 
 type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;

+ 3 - 3
src/utils/index.ts

@@ -1,8 +1,8 @@
 function getSafeHeight(): number {
   const systemInfo: UniApp.GetSystemInfoResult = uni.getSystemInfoSync()
-  const safeAreaInsetBottom: number = systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top
-  const menuButtonInfoHeight: number = uni.getMenuButtonBoundingClientRect().height + 60
-  return safeAreaInsetBottom + menuButtonInfoHeight
+  if (!systemInfo.safeAreaInsets)
+    return 0
+  return systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top
 }
 function getMenuButtonInfoHeight(): number {
   return uni.getMenuButtonBoundingClientRect().height + 60