update customer profile card

This commit is contained in:
Timi
2026-08-18 15:15:47 +08:00
parent ac11ee6b81
commit 9c57dcfc87
6 changed files with 47 additions and 69 deletions
+6 -19
View File
@@ -1,19 +1,13 @@
<template>
<component
:is="href ? 'a' : 'span'"
v-if="displayText"
:href="href || undefined"
class="telephone-link"
:class="{ clickable: !!href }"
@click="handleClick"
>
<t-icon v-if="value" name="call" />
<span v-text="displayText" />
</component>
<contact-number :value="value" @click="handleClick" underline>
<template #icon>
<t-icon v-if="value" name="call" />
</template>
</contact-number>
</template>
<script setup lang="ts">
import { buildTelephoneURL, canDialTelephone } from "@/utils/telephone";
import { ContactNumber } from "timi-web";
defineOptions({
name: "TelephoneLink"
@@ -27,8 +21,6 @@ const props = withDefaults(defineProps<{
});
const textValue = computed(() => props.value?.trim() || "");
const displayText = computed(() => textValue.value || props.placeholder);
const href = computed(() => canDialTelephone(textValue.value) ? buildTelephoneURL(textValue.value) : "");
function handleClick(event: MouseEvent): void {
if (textValue.value) {
@@ -42,10 +34,5 @@ function handleClick(event: MouseEvent): void {
color: inherit;
word-break: break-all;
text-decoration: none;
&.clickable {
text-decoration: underline;
text-underline-offset: .16rem;
}
}
</style>