2026-06-14 10:08:46 +03:30
|
|
|
<template>
|
2026-07-23 14:10:40 +02:00
|
|
|
<div :class="variant === 'desktop' ? desktopRootClass : mobileRootClass">
|
|
|
|
|
<button
|
|
|
|
|
ref="triggerEl"
|
|
|
|
|
type="button"
|
|
|
|
|
class="support-contact-bar__btn"
|
|
|
|
|
:disabled="!canContactSupport"
|
|
|
|
|
@click="onSupportClick"
|
2026-06-17 16:04:01 +03:30
|
|
|
>
|
2026-07-23 14:10:40 +02:00
|
|
|
<BasicIcon icon="vuesax-linear:messages-2" size="20" color="#fff" />
|
|
|
|
|
<span>ارتباط با پشتیبانی</span>
|
|
|
|
|
</button>
|
2026-06-14 10:08:46 +03:30
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2026-07-23 14:10:40 +02:00
|
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
|
|
|
|
import { useSupportMessenger } from '@/composables/useSupportMessenger'
|
|
|
|
|
import { computed, ref } from 'vue'
|
2026-06-14 10:08:46 +03:30
|
|
|
|
|
|
|
|
withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
variant?: 'mobile' | 'desktop'
|
2026-07-23 14:10:40 +02:00
|
|
|
mobileRootClass?: string
|
|
|
|
|
desktopRootClass?: string
|
2026-06-14 10:08:46 +03:30
|
|
|
}>(),
|
2026-07-23 14:10:40 +02:00
|
|
|
{
|
|
|
|
|
variant: 'mobile',
|
|
|
|
|
mobileRootClass: 'wrap-fix bottom-0 px-10 pb-3rem flex bg-white',
|
|
|
|
|
desktopRootClass: 'dpage-support',
|
|
|
|
|
},
|
2026-06-14 10:08:46 +03:30
|
|
|
)
|
|
|
|
|
|
2026-07-23 14:10:40 +02:00
|
|
|
const {
|
|
|
|
|
supportPhoneLink,
|
|
|
|
|
hasMessengerLink,
|
|
|
|
|
hasSupportPhoneLink,
|
|
|
|
|
openSupportMessenger,
|
|
|
|
|
} = useSupportMessenger()
|
|
|
|
|
|
|
|
|
|
const triggerEl = ref<HTMLElement | null>(null)
|
|
|
|
|
|
|
|
|
|
const canContactSupport = computed(() => hasMessengerLink.value || hasSupportPhoneLink.value)
|
|
|
|
|
|
|
|
|
|
async function onSupportClick() {
|
|
|
|
|
// همان رفتار دکمه شناور پشتیبانی — بدون پیشنویس واریز
|
|
|
|
|
if (hasMessengerLink.value) {
|
|
|
|
|
await openSupportMessenger(triggerEl.value)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hasSupportPhoneLink.value && supportPhoneLink.value) {
|
|
|
|
|
window.location.href = supportPhoneLink.value
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-06-14 10:08:46 +03:30
|
|
|
</script>
|
2026-07-23 14:10:40 +02:00
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.support-contact-bar__btn {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 2.75rem;
|
|
|
|
|
padding: 0.65rem 1rem;
|
|
|
|
|
border: 0;
|
|
|
|
|
border-radius: 0.75rem;
|
|
|
|
|
background: var(--App-primary, var(--ant-color-primary, #7f1d1d));
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 0.9375rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
|
transform: scale(0.98);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
opacity: 0.55;
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dpage-support {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|