копирование

This commit is contained in:
2026-10-04 12:17:54 +10:00
parent 5823a42e40
commit ecf39ee199
2 changed files with 55 additions and 22 deletions
+33 -3
View File
@@ -3,8 +3,8 @@ import type { NavItem } from "~/types";
import { CONTACTS } from "~/data/site";
/**
* Подвал с контактными данными. Клики по телефонам открывают звонок
* через tel:-ссылку.
* Подвал с контактными данными. На мобильных клик по номеру начинает
* звонок (tel:-ссылка), на ПК — копирует номер и показывает toast.
*/
interface Props {
links: NavItem[];
@@ -12,6 +12,8 @@ interface Props {
}
const props = defineProps<Props>();
const { toastVisible, toastMessage, onPhoneClick } = usePhoneCopy();
</script>
<template>
@@ -43,7 +45,11 @@ const props = defineProps<Props>();
class="fs-4"
id="phoneNumber"
>
<a :href="phone.href" class="text-ycheba">
<a
:href="phone.href"
class="text-ycheba"
@click="onPhoneClick($event, phone.display)"
>
<img
src="/assets/ico/call.png"
alt="Иконка трубки"
@@ -75,5 +81,29 @@ const props = defineProps<Props>();
</div>
</div>
</div>
<!-- Уведомление о копировании номера (ПК) -->
<div
v-show="toastVisible"
class="copy-toast"
role="status"
aria-live="polite"
>
{{ toastMessage }}
</div>
</footer>
</template>
<style scoped>
.copy-toast {
position: fixed;
bottom: 20px;
right: 20px;
padding: 10px 20px;
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 5px;
font-size: 14px;
z-index: 9999;
}
</style>