Bläddra i källkod

fix:微信小程序 search-form.vue 无法点击的问题,因为没 @click 事件
fix:search-form.vue 的 popup 距离高度不对的问题
feat:移除 search-form.vue 的 title,简化交互

YunaiV 4 månader sedan
förälder
incheckning
104468501e

+ 6 - 17
src/pages-infra/apiAccessLog/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索日志
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           用户编号
@@ -54,6 +42,7 @@
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
+import { getNavbarHeight } from '@/utils'
 
 const emit = defineEmits<{
   search: [data: Record<string, any>]

+ 5 - 12
src/pages-infra/apiErrorLog/components/search-form.vue

@@ -1,23 +1,15 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <wd-popup
     v-model="visible"
     position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
     @close="visible = false"
   >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索日志
-      </view>
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           用户编号
@@ -71,6 +63,7 @@
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
+import { getNavbarHeight } from '@/utils'
 
 const emit = defineEmits<{
   search: [data: Record<string, any>]

+ 6 - 17
src/pages-system/dept/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索部门
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           部门名称
@@ -61,6 +49,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 
 const emit = defineEmits<{

+ 6 - 17
src/pages-system/menu/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索菜单
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           菜单名称
@@ -54,6 +42,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import { getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 
 const emit = defineEmits<{

+ 6 - 17
src/pages-system/notice/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索通知公告
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           公告标题
@@ -61,6 +49,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 
 const emit = defineEmits<{

+ 8 - 29
src/pages-system/operate-log/modules/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索操作日志
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           操作人
@@ -77,12 +65,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -91,12 +74,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -131,6 +109,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import UserPicker from '@/pages-system/user/form/components/user-picker.vue'
+import { getNavbarHeight } from '@/utils'
 import { formatDate, formatDateRange } from '@/utils/date'
 
 const emit = defineEmits<{

+ 6 - 17
src/pages-system/post/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索岗位
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           岗位名称
@@ -71,6 +59,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 
 const emit = defineEmits<{

+ 6 - 17
src/pages-system/role/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索角色
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           角色名称
@@ -71,6 +59,7 @@
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 
 const emit = defineEmits<{

+ 6 - 17
src/pages-system/user/components/search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索用户
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           用户名称
@@ -53,6 +41,7 @@
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
+import { getNavbarHeight } from '@/utils'
 
 const emit = defineEmits<{
   search: [data: Record<string, any>]

+ 8 - 29
src/pages/bpm/components/copy-search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索流程
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           流程名称
@@ -46,12 +34,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -60,12 +43,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -89,6 +67,7 @@
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
+import { getNavbarHeight } from '@/utils'
 import { formatDate, formatDateRange } from '@/utils/date'
 
 const emit = defineEmits<{

+ 8 - 29
src/pages/bpm/components/done-search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索任务
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           任务名称
@@ -83,12 +71,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -97,12 +80,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -131,6 +109,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
 import { getCategorySimpleList } from '@/api/bpm/category'
 import { getProcessDefinitionList } from '@/api/bpm/definition'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 import { formatDate, formatDateRange } from '@/utils/date'
 

+ 8 - 29
src/pages/bpm/components/my-search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索流程
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           流程名称
@@ -58,12 +46,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -72,12 +55,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -131,6 +109,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
 import { getCategorySimpleList } from '@/api/bpm/category'
 import { getProcessDefinitionList } from '@/api/bpm/definition'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 import { formatDate, formatDateRange } from '@/utils/date'
 

+ 8 - 29
src/pages/bpm/components/todo-search-form.vue

@@ -1,24 +1,12 @@
 <template>
   <!-- 搜索框入口 -->
-  <wd-search
-    :placeholder="placeholder"
-    :hide-cancel="true"
-    disabled
-    @click="visible = true"
-  />
+  <view @click="visible = true">
+    <wd-search :placeholder="placeholder" hide-cancel disabled />
+  </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索任务
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           任务名称
@@ -83,12 +71,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -97,12 +80,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -131,6 +109,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
 import { getCategorySimpleList } from '@/api/bpm/category'
 import { getProcessDefinitionList } from '@/api/bpm/definition'
 import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
+import { getNavbarHeight } from '@/utils'
 import { DICT_TYPE } from '@/utils/constants'
 import { formatDate, formatDateRange } from '@/utils/date'
 

+ 7 - 30
src/pages/message/components/search-form.vue

@@ -1,13 +1,8 @@
 <template>
   <!-- 搜索框入口 -->
   <view class="flex items-center bg-white pr-30rpx">
-    <view class="flex-1">
-      <wd-search
-        :placeholder="placeholder"
-        :hide-cancel="true"
-        disabled
-        @click="visible = true"
-      />
+    <view class="flex-1" @click="visible = true">
+      <wd-search :placeholder="placeholder" hide-cancel disabled />
     </view>
     <view class="text-28rpx text-[#1890ff]" @click="handleReadAll">
       全部已读
@@ -15,17 +10,8 @@
   </view>
 
   <!-- 搜索弹窗 -->
-  <wd-popup
-    v-model="visible"
-    position="top"
-    custom-style="border-radius: var(--yd-search-form-popup-radius);"
-    safe-area-inset-top
-    @close="visible = false"
-  >
-    <view class="yd-search-form-container">
-      <view class="yd-search-form-title">
-        搜索消息
-      </view>
+  <wd-popup v-model="visible" position="top" @close="visible = false">
+    <view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
       <view class="yd-search-form-item">
         <view class="yd-search-form-label">
           已读状态
@@ -59,12 +45,7 @@
             </view>
           </view>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[0]"
-          v-model="tempCreateTime[0]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
         <view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime0Cancel">
             取消
@@ -73,12 +54,7 @@
             确定
           </wd-button>
         </view>
-        <wd-datetime-picker-view
-          v-if="visibleCreateTime[1]"
-          v-model="tempCreateTime[1]"
-          type="date"
-          :columns-height="200"
-        />
+        <wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
         <view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
           <wd-button size="small" plain @click="handleCreateTime1Cancel">
             取消
@@ -102,6 +78,7 @@
 
 <script lang="ts" setup>
 import { computed, reactive, ref } from 'vue'
+import { getNavbarHeight } from '@/utils'
 import { formatDate, formatDateRange } from '@/utils/date'
 
 const emit = defineEmits<{

+ 7 - 5
src/style/index.scss

@@ -16,9 +16,6 @@ page {
 
   // 修改按钮背景色
   // --wot-button-primary-bg-color: green;
-
-  // yd-search-form:搜索表单弹窗圆角
-  --yd-search-form-popup-radius: 0 0 24rpx 24rpx;
 }
 
 /*
@@ -48,6 +45,11 @@ border-t-1
 
 // ==================== 搜索表单弹窗样式 ====================
 .yd-search-form {
+  // 弹窗圆角
+  &-popup {
+    @apply rounded-t-24rpx;
+  }
+
   // 弹窗容器
   &-container {
     @apply p-32rpx;
@@ -61,7 +63,7 @@ border-t-1
 
   // 表单项
   &-item {
-    @apply mb-24rpx;
+    @apply mt-24rpx;
   }
 
   // 表单项标签
@@ -72,7 +74,7 @@ border-t-1
 
   // 底部按钮组
   &-actions {
-    @apply w-full flex justify-center gap-24rpx;
+    @apply w-full flex justify-center gap-24rpx mt-24rpx;
   }
 
   // 日期范围选择器

+ 17 - 0
src/utils/index.ts

@@ -224,3 +224,20 @@ export function navigateBackPlus(fallbackUrl?: string) {
     uni.reLaunch({ url: targetUrl })
   }
 }
+
+/** 获取 wd-navbar 导航栏高度 */
+export function getNavbarHeight() {
+  const systemInfo = uni.getSystemInfoSync()
+  const statusBarHeight = systemInfo.statusBarHeight || 0
+  // #ifdef MP-WEIXIN
+  // 小程序:根据胶囊按钮位置计算导航栏高度,确保内容与胶囊垂直居中
+  const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
+  // 导航栏高度 = (胶囊顶部到状态栏底部的距离) * 2 + 胶囊高度
+  const navBarHeight = (menuButtonInfo.top - statusBarHeight) * 2 + menuButtonInfo.height
+  return statusBarHeight + navBarHeight
+  // #endif
+  // #ifndef MP-WEIXIN
+  // H5/App:状态栏高度 + 导航栏高度(44px)
+  return statusBarHeight + 44
+  // #endif
+}