| | |
| | | <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' |
| | |
| | | const dateValue = ref('') |
| | | const showDatePicker = ref(false) |
| | | const loading = ref(false) |
| | | const refreshing = ref(false) |
| | | const records = ref<VisitRecordCard[]>([]) |
| | | const pageTitle = ref(props.title || '来访记录') |
| | | |
| | |
| | | void loadRecords() |
| | | } |
| | | |
| | | async function handlePullRefresh() { |
| | | if (refreshing.value) { |
| | | return |
| | | } |
| | | refreshing.value = true |
| | | try { |
| | | await loadRecords() |
| | | } |
| | | finally { |
| | | refreshing.value = false |
| | | } |
| | | } |
| | | |
| | | updateDateColumns() |
| | | |
| | | onLoad((options) => { |
| | |
| | | |
| | | onShow(() => { |
| | | void loadRecords() |
| | | }) |
| | | |
| | | onPullDownRefresh(async () => { |
| | | try { |
| | | await loadRecords() |
| | | } |
| | | finally { |
| | | uni.stopPullDownRefresh() |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <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]"> |