add customer point card

This commit is contained in:
Timi
2026-08-20 01:30:07 +08:00
parent f4fb604f53
commit 805e8ecb84
3 changed files with 90 additions and 16 deletions
+9 -1
View File
@@ -2,7 +2,15 @@ import { AttachmentAPI } from "timi-web";
import type { BodyAreaValue, Customer } from "@/types/Customer";
export function getCustomerPhotoURL(customer?: Customer): string {
const attachment = customer?.attachmentList?.find(item => item.attachType === "PHOTO");
return getCustomerAttachmentURL(customer, "PHOTO");
}
export function getCustomerPointCardURL(customer?: Customer): string {
return getCustomerAttachmentURL(customer, "POINT_CARD");
}
function getCustomerAttachmentURL(customer: Customer | undefined, attachType: string): string {
const attachment = customer?.attachmentList?.find(item => item.attachType === attachType);
if (!attachment?.id) {
return "";
}