fix
longz
2026-05-26 cb44316d3975af52a3a9af824094b844dd7df874
yuyueMiniProgram/src/pages/visitRecord/index.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
import { fetchVisitRecords } from '@/api/appointment'
import type { MiniVisitRecordItem } from '@/types/appointment'
import { normalizeVisitReasonText } from '@/utils/visitReason'
@@ -38,6 +38,7 @@
const dateValue = ref('')
const showDatePicker = ref(false)
const loading = ref(false)
const refreshing = ref(false)
const records = ref<VisitRecordCard[]>([])
const pageTitle = ref(props.title || '来访记录')
@@ -178,6 +179,19 @@
  void loadRecords()
}
async function handlePullRefresh() {
  if (refreshing.value) {
    return
  }
  refreshing.value = true
  try {
    await loadRecords()
  }
  finally {
    refreshing.value = false
  }
}
updateDateColumns()
onLoad((options) => {
@@ -188,6 +202,15 @@
onShow(() => {
  void loadRecords()
})
onPullDownRefresh(async () => {
  try {
    await loadRecords()
  }
  finally {
    uni.stopPullDownRefresh()
  }
})
</script>
@@ -247,7 +270,14 @@
    <view :style="{ height: (statusBarHeight + navBarHeight + uni.upx2px(144)) + 'px' }" class="shrink-0" />
    <view class="relative z-10 px-[24rpx] flex-1 flex flex-col min-h-0 box-border pt-[16rpx]">
      <scroll-view scroll-y class="flex-1 min-h-0" :show-scrollbar="false">
      <scroll-view
        scroll-y
        class="flex-1 min-h-0"
        :show-scrollbar="false"
        refresher-enabled
        :refresher-triggered="refreshing"
        @refresherrefresh="handlePullRefresh"
      >
        <view class="pb-[48rpx]">
          <view v-for="item in records" :key="item.id" class="bg-white rounded-[8rpx] shadow-[0_4rpx_8rpx_rgba(6,47,108,0.1608)] mb-[24rpx] px-[40rpx]">
            <view class="flex items-center h-[96rpx]">