From 3b56de2430fc5ad3fa223140a1000a06a021af6f Mon Sep 17 00:00:00 2001 From: Timi Date: Sat, 22 Aug 2026 01:27:45 +0800 Subject: [PATCH] update image thumb --- src/components/CustomerProfileCard.vue | 5 +++-- src/components/PhotoScroller.vue | 3 ++- src/pages/customer/CustomerDetail.vue | 10 +++++----- src/pages/customer/CustomerEdit.vue | 4 +++- src/pages/customer/CustomerInviteeList.vue | 4 ++-- src/pages/event/EventRecordDetail.vue | 7 +++++-- src/pages/event/EventRecordEdit.vue | 14 +++++++++++--- src/pages/event/EventRecordList.vue | 2 +- src/pages/event/EventRecordRank.vue | 4 ++-- src/pages/home/QuickEntryPage.vue | 5 ++++- src/pages/home/QuickSignInPage.vue | 4 ++-- src/pages/point/PointLedgerList.vue | 4 ++-- src/types/Customer.ts | 1 + src/utils/attachment.ts | 21 +++++++++++++++++++++ src/utils/customer.ts | 13 ++----------- src/utils/eventRecord.ts | 6 +++--- 16 files changed, 69 insertions(+), 38 deletions(-) create mode 100644 src/utils/attachment.ts diff --git a/src/components/CustomerProfileCard.vue b/src/components/CustomerProfileCard.vue index 40fa05a..6836275 100644 --- a/src/components/CustomerProfileCard.vue +++ b/src/components/CustomerProfileCard.vue @@ -48,8 +48,9 @@ const customerName = computed(() => customer.value?.name || customer.value?.code const avatarText = computed(() => customerName.value.slice(0, 1)); const customerCode = computed(() => customer.value?.code || ""); const customerTelephone = computed(() => customer.value?.telephone || ""); -const photoURL = computed(() => customer.value ? getCustomerPhotoURL(customer.value) : ""); -const photoViewerImages = computed(() => photoURL.value ? [photoURL.value] : []); +const photoURL = computed(() => customer.value ? getCustomerPhotoURL(customer.value, 64) : ""); +const originalPhotoURL = computed(() => customer.value ? getCustomerPhotoURL(customer.value) : ""); +const photoViewerImages = computed(() => originalPhotoURL.value ? [originalPhotoURL.value] : []); function handlePhotoClick(event: MouseEvent): void { event.stopPropagation(); diff --git a/src/components/PhotoScroller.vue b/src/components/PhotoScroller.vue index 9ac6488..ee409ec 100644 --- a/src/components/PhotoScroller.vue +++ b/src/components/PhotoScroller.vue @@ -114,6 +114,7 @@ type AddAction = { type PhotoItem = { attachType?: string; + previewUrl?: string; url: string; }; @@ -182,7 +183,7 @@ function removePhoto(index: number): void { function openPhotoViewer(index: number): void { const photoList = [...displayPhotoList.value.slice(index), ...displayPhotoList.value.slice(0, index)]; - photoViewerImages.value = photoList.map(item => item.url); + photoViewerImages.value = photoList.map(item => item.previewUrl || item.url); photoViewerVisible.value = true; } diff --git a/src/pages/customer/CustomerDetail.vue b/src/pages/customer/CustomerDetail.vue index 1bcdc80..1c72562 100644 --- a/src/pages/customer/CustomerDetail.vue +++ b/src/pages/customer/CustomerDetail.vue @@ -144,7 +144,7 @@