Files
boursecu_user/src/views/base/wallet/components/WalletDepositGuideModal.vue
T

312 lines
7.4 KiB
Vue
Raw Normal View History

2026-06-16 19:47:28 +03:30
<template>
<BasicModal
v-model:visible="localVisible"
custom-footer
:closable="false"
2026-10-22 10:36:43 +03:30
wrap-class-name="app-premium-modal--no-header"
2026-06-16 19:47:28 +03:30
width="min(92vw, 380px)"
>
<div class="deposit-guide">
<div class="deposit-guide__icon-wrap" aria-hidden="true">
<BasicIcon icon="vuesax-linear:empty-wallet-add" size="34" color="#16a34a" />
</div>
<h2 class="deposit-guide__title">{{ title }}</h2>
<div class="deposit-guide__body">
<slot />
</div>
<div class="deposit-guide__accounts">
<div v-if="hasDepositCardValue" class="deposit-guide__account-row">
<span class="deposit-guide__account-label">{{ depositCardLabel }}</span>
<button
type="button"
class="deposit-guide__account-value"
:aria-label="`کپی ${depositCardLabel}`"
@click="copyDepositCardNumber"
>
<span class="deposit-guide__account-text" dir="ltr">{{ depositCardNumber }}</span>
<BasicIcon
icon="vuesax-linear:copy"
size="18"
color="#15803d"
class="deposit-guide__copy-icon"
/>
</button>
</div>
<div v-if="hasDepositAccountNumberValue" class="deposit-guide__account-row">
<span class="deposit-guide__account-label">{{ depositAccountNumberLabel }}</span>
<button
type="button"
class="deposit-guide__account-value"
:aria-label="`کپی ${depositAccountNumberLabel}`"
@click="copyDepositAccountNumber"
>
<span class="deposit-guide__account-text" dir="ltr">{{ depositAccountNumber }}</span>
<BasicIcon
icon="vuesax-linear:copy"
size="18"
color="#15803d"
class="deposit-guide__copy-icon"
/>
</button>
</div>
<div v-if="hasDepositShebaValue" class="deposit-guide__account-row">
<span class="deposit-guide__account-label">{{ depositShebaLabel }}</span>
<button
type="button"
class="deposit-guide__account-value"
:aria-label="`کپی ${depositShebaLabel}`"
@click="copyDepositShebaNumber"
>
<span class="deposit-guide__account-text" dir="ltr">{{ depositSheba }}</span>
<BasicIcon
icon="vuesax-linear:copy"
size="18"
color="#15803d"
class="deposit-guide__copy-icon"
/>
</button>
</div>
<a
v-if="hasMessengerLink"
ref="supportMessengerTriggerEl"
class="deposit-guide__support-link"
href="#"
@click.prevent="onDepositSupportClick"
>
2026-06-16 19:47:28 +03:30
<span class="deposit-guide__support-btn">
<BasicIcon icon="vuesax-linear:headphone" size="18" color="#16a34a" />
<span>پیام به پشتیبانی</span>
</span>
</a>
2026-06-16 19:47:28 +03:30
<a
v-if="smsLink"
class="deposit-guide__support-link"
:class="{ 'deposit-guide__support-link--spaced': hasMessengerLink }"
:href="smsLink"
>
2026-06-16 19:47:28 +03:30
<span class="deposit-guide__support-btn">
<BasicIcon icon="vuesax-linear:direct-inbox" size="18" color="#16a34a" />
<span>پیام به پشتیبانی (sms)</span>
</span>
</a>
</div>
2026-06-16 19:47:28 +03:30
</div>
<template #footer>
2026-10-22 10:36:43 +03:30
<BasicButton
type="primary"
class="app-premium-modal__btn-primary deposit-guide__confirm w-full"
@click="localVisible = false"
>
2026-06-16 19:47:28 +03:30
متوجه شدم
</BasicButton>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue'
2026-06-16 19:47:28 +03:30
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import BasicModal from '@/components/BasicPacks/BasicModal.vue'
import { useSupportMessenger } from '@/composables/useSupportMessenger'
import { loadSupportMessengerFromSettings } from '@/utils/supportMessenger'
2026-06-16 19:47:28 +03:30
const props = withDefaults(
defineProps<{
visible: boolean
title?: string
supportLink?: string
smsLink?: string
}>(),
{
title: 'راهنمای شارژ حساب',
supportLink: '',
smsLink: '',
},
)
const {
depositCardNumber,
depositAccountNumber,
depositSheba,
depositCardLabel,
depositAccountNumberLabel,
depositShebaLabel,
hasDepositCardValue,
hasDepositAccountNumberValue,
hasDepositShebaValue,
copyDepositCardNumber,
copyDepositAccountNumber,
copyDepositShebaNumber,
hasMessengerLink,
openDepositSupportMessenger,
} = useSupportMessenger()
const supportMessengerTriggerEl = ref<HTMLElement | null>(null)
function onDepositSupportClick() {
void openDepositSupportMessenger(supportMessengerTriggerEl.value)
}
2026-06-16 19:47:28 +03:30
const emit = defineEmits<{
'update:visible': [value: boolean]
}>()
const localVisible = computed({
get: () => props.visible,
set: (value: boolean) => emit('update:visible', value),
})
watch(
() => props.visible,
(visible) => {
if (visible) {
void loadSupportMessengerFromSettings(true)
}
},
)
2026-06-16 19:47:28 +03:30
</script>
<style scoped lang="less">
.deposit-guide {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 0.25rem 0.5rem 0.5rem;
}
.deposit-guide__icon-wrap {
display: flex;
align-items: center;
justify-content: center;
width: 4.5rem;
height: 4.5rem;
border-radius: 9999px;
background: #ecfdf3;
margin-bottom: 1rem;
}
.deposit-guide__title {
margin: 0 0 0.75rem;
font-size: 1.05rem;
font-weight: 700;
color: #111827;
}
.deposit-guide__body {
width: 100%;
font-size: 0.92rem;
line-height: 1.9;
color: #4b5563;
}
.deposit-guide__accounts {
display: flex;
flex-direction: column;
gap: 0.75rem;
width: 100%;
margin-top: 0.85rem;
text-align: right;
}
.deposit-guide__account-row {
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.deposit-guide__account-label {
font-size: 0.78rem;
font-weight: 700;
color: #6b7280;
}
.deposit-guide__account-value {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
width: 100%;
min-height: 2.75rem;
padding: 0.65rem 0.85rem;
border: 1px solid #bbf7d0;
border-radius: 0.75rem;
background: #f0fdf4;
color: #111827;
font-size: 0.88rem;
font-weight: 600;
cursor: pointer;
transition: background 0.15s ease, border-color 0.15s ease;
text-align: left;
&:hover:not(.deposit-guide__account-value--empty) {
background: #dcfce7;
border-color: #86efac;
}
&--empty {
color: #9ca3af;
cursor: not-allowed;
}
}
.deposit-guide__account-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.deposit-guide__copy-icon {
flex-shrink: 0;
&--disabled {
opacity: 0.45;
}
}
2026-06-16 19:47:28 +03:30
.deposit-guide__support-link {
display: block;
width: 100%;
margin-top: 1.25rem;
text-decoration: none;
&--spaced {
margin-top: 0.65rem;
}
}
.deposit-guide__support-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
width: 100%;
min-height: 2.75rem;
padding: 0.65rem 1rem;
border: 1px solid #bbf7d0;
border-radius: 0.75rem;
background: #f0fdf4;
color: #15803d;
font-size: 0.92rem;
font-weight: 600;
}
.deposit-guide__confirm {
min-height: 2.75rem;
font-weight: 700;
}
</style>