liushengqiang 1 year ago
parent
commit
6f560f602f

+ 1 - 2
src/views/home/index.module.less

@@ -36,7 +36,6 @@ body {
         :global {
             .van-tab__panel {
                 margin-top: var(--van-tabs-line-height);
-                background: #F8F9FC;
                 padding-top: 8px;
             }
         }
@@ -437,5 +436,5 @@ body {
     width: 100%;
     color: #999;
     font-size: 12px;
-    padding: 0 0.13333rem;
+    padding: 6px 5px;
 }

+ 3 - 16
src/views/schedule-manage/index.module.less

@@ -1,20 +1,8 @@
 .schedule-manage {
   :global {
-    .van-tabs {
-      position: fixed;
-      left: 0;
-      right: 0;
-      top: var(--header-height);
-    }
-
-    .van-tabs__content {
-      height: calc(100vh - var(--header-height) - var(--van-tabs-line-height));
-    }
-
     .van-tab__panel {
-      height: 100%;
-      display: flex;
-      flex-direction: column;
+      position: relative;
+      min-height: 100%;
     }
     .van-tab {
       z-index: 1;
@@ -32,8 +20,6 @@
 
 .list {
   padding: 12px;
-  height: calc(100vh - var(--header-height) - var(--van-tabs-line-height) - 60px);
-  overflow-y: auto;
   &.todo{
     height: calc(100vh - var(--header-height) - var(--van-tabs-line-height));
   }
@@ -120,6 +106,7 @@
   align-items: center;
   background-color: #fff;
   height: 60px;
+  z-index: 1;
   :global {
     .van-search {
       flex: 1;

+ 12 - 2
src/views/schedule-manage/index.tsx

@@ -35,6 +35,7 @@ export default defineComponent({
     const router = useRouter();
 
     const todoData = reactive({
+      barHeight: 0,
       tabActive: toggleTabName('get') as 'todo' | 'complete',
       examineLoading: true,
       refreshLoading: false,
@@ -166,10 +167,19 @@ export default defineComponent({
 
     return () => (
       <div class={styles['schedule-manage']}>
-        <MSticky position="top">
+        <MSticky
+          position="top"
+          onBarHeight={(height: number) => {
+            todoData.barHeight = height;
+          }}>
           <MHeader></MHeader>
         </MSticky>
-        <Tabs swipeable animated v-model:active={todoData.tabActive}>
+        <Tabs
+          sticky
+          offsetTop={todoData.barHeight}
+          swipeable
+          animated
+          v-model:active={todoData.tabActive}>
           <Tab name="todo" title="待审批">
             <MFullRefresh
               v-model:modelValue={todoData.refreshLoading}