fix customer invite photo

This commit is contained in:
Timi
2026-08-03 23:45:27 +08:00
parent 2c3f93cd73
commit 615e0b8f9a
2 changed files with 17 additions and 15 deletions
+13 -6
View File
@@ -1,6 +1,6 @@
<template>
<div class="customer-profile-card">
<button v-if="photoURL" type="button" class="avatar-trigger" @click.stop="openPhotoViewer">
<button v-if="photoURL" type="button" class="avatar-trigger" @click="handlePhotoClick">
<t-image :src="photoURL" :alt="customerName" fit="cover" class="avatar" />
</button>
<div v-else class="avatar fallback" v-text="avatarText" />
@@ -14,11 +14,13 @@
</div>
<telephone-link class="telephone gray" :value="customerTelephone" />
</div>
<t-image-viewer
v-model:visible="photoViewerVisible"
:images="photoViewerImages"
show-index
/>
<div @click.stop>
<t-image-viewer
v-model:visible="photoViewerVisible"
:images="photoViewerImages"
show-index
/>
</div>
</div>
</template>
@@ -43,6 +45,11 @@ const customerTelephone = computed(() => customer.value?.telephone || "");
const photoURL = computed(() => customer.value ? getCustomerPhotoURL(customer.value) : "");
const photoViewerImages = computed(() => photoURL.value ? [photoURL.value] : []);
function handlePhotoClick(event: MouseEvent): void {
event.stopPropagation();
openPhotoViewer();
}
function openPhotoViewer(): void {
if (!photoURL.value) {
return;