update image thumb
This commit is contained in:
@@ -144,7 +144,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from "@/utils/message";
|
||||
import { AttachmentAPI, PassTimeLabel, Text, useUserStore } from "timi-web";
|
||||
import { PassTimeLabel, Text, useUserStore } from "timi-web";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
import PointAPI from "@/api/PointAPI";
|
||||
import TagAPI from "@/api/TagAPI";
|
||||
@@ -158,6 +158,7 @@ import type { BodyAreaValue, Customer } from "@/types/Customer";
|
||||
import type { PointAccount } from "@/types/Point";
|
||||
import type { Tag } from "@/types/Tag";
|
||||
import { bodyAreaLabelMap } from "@/utils/bodyArea";
|
||||
import { getAttachmentReadURL } from "@/utils/attachment";
|
||||
import { normalizeBodyAreaValue } from "@/utils/customer";
|
||||
import { corePermissionCodes, permissionCodes } from "@/utils/permission";
|
||||
import { LunarCalendar } from "@/utils/LunarCalendar";
|
||||
@@ -192,15 +193,14 @@ const solarBirthdateText = computed(() => formatSolarBirthdate(customer.value));
|
||||
const birthdateText = computed(() => showSolarBirthdate.value && isLunarBirthdate.value ? solarBirthdateText.value : formatBirthdate(customer.value));
|
||||
const ageText = computed(() => customer.value?.age === undefined || customer.value?.age === null ? "" : `${customer.value.age} 岁`);
|
||||
const inviteeCountText = computed(() => `${customer.value?.invitedCount ?? 0} 人`);
|
||||
const photoList = computed(() => (customer.value?.attachmentList || [])
|
||||
.filter(item => !!item.id)
|
||||
.map(item => AttachmentAPI.getReadURL(item.id || "")));
|
||||
const photoItemList = computed(() => (customer.value?.attachmentList || [])
|
||||
.filter(item => !!item.id)
|
||||
.map(item => ({
|
||||
attachType: item.attachType || "PHOTO",
|
||||
url: AttachmentAPI.getReadURL(item.id || "")
|
||||
previewUrl: getAttachmentReadURL(item.id || ""),
|
||||
url: getAttachmentReadURL(item.id || "", 64)
|
||||
})));
|
||||
const photoList = computed(() => photoItemList.value.map(item => item.url));
|
||||
const selectedAreas = computed<BodyAreaValue>({
|
||||
get() {
|
||||
return normalizeBodyAreaValue(customer.value?.conditioningPart);
|
||||
|
||||
@@ -187,6 +187,7 @@ import { useSettingStore } from "@/store/settingStore";
|
||||
import type { BodyAreaValue, Customer, CustomerAttachmentType, EditableCustomerPhoto } from "@/types/Customer";
|
||||
import type { Tag } from "@/types/Tag";
|
||||
import { bodyAreaLabelMap } from "@/utils/bodyArea";
|
||||
import { getAttachmentReadURL } from "@/utils/attachment";
|
||||
import { normalizeBodyAreaValue } from "@/utils/customer";
|
||||
import { corePermissionCodes, gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
import { compressUploadImage } from "@/utils/imageCompression";
|
||||
@@ -388,7 +389,8 @@ async function loadDetail() {
|
||||
.map(item => ({
|
||||
attachment: item,
|
||||
attachType: normalizeAttachmentType(item.attachType),
|
||||
url: AttachmentAPI.getReadURL(item.id || "")
|
||||
previewUrl: getAttachmentReadURL(item.id || ""),
|
||||
url: getAttachmentReadURL(item.id || "", 64)
|
||||
}));
|
||||
selectedAreas.value = normalizeBodyAreaValue(customer.conditioningPart);
|
||||
introducerCustomerId.value = customer.introducerCustomerId || customer.introducerCustomer?.id || "";
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
</template>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getCustomerPhotoURL(item)"
|
||||
v-if="getCustomerPhotoURL(item, 64)"
|
||||
class="avatar"
|
||||
:src="getCustomerPhotoURL(item)"
|
||||
:src="getCustomerPhotoURL(item, 64)"
|
||||
:alt="item.name"
|
||||
fit="cover"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user