support handler
This commit is contained in:
@@ -13,6 +13,7 @@ export interface SupportMessengerSettings {
|
||||
messenger?: SupportMessengerType | string
|
||||
messengerId?: string
|
||||
messengerText?: string
|
||||
depositSmsSupportNumber?: string
|
||||
}
|
||||
|
||||
export const supportMessengerSettings = ref<SupportMessengerSettings>({})
|
||||
@@ -62,6 +63,14 @@ export function buildSupportMessengerUrl(messenger?: string, messengerId?: strin
|
||||
}
|
||||
}
|
||||
|
||||
export function buildDepositSmsUrl(phoneNumber?: string) {
|
||||
const digits = (phoneNumber ?? '').replace(/\D/g, '')
|
||||
if (!digits) return ''
|
||||
|
||||
const body = encodeURIComponent('شماره حساب')
|
||||
return `sms:${digits}?body=${body}`
|
||||
}
|
||||
|
||||
export async function loadSupportMessengerFromSettings() {
|
||||
try {
|
||||
const settings = await getSettings()
|
||||
@@ -71,6 +80,7 @@ export async function loadSupportMessengerFromSettings() {
|
||||
messenger: getSupportSettingValue(settings, 'support_messenger'),
|
||||
messengerId: getSupportSettingValue(settings, 'support_messenger_id'),
|
||||
messengerText: getSupportSettingValue(settings, 'support_messenger_text'),
|
||||
depositSmsSupportNumber: getSupportSettingValue(settings, 'deposit_sms_support_number'),
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
|
||||
@@ -324,6 +324,14 @@
|
||||
<BasicIcon icon="vuesax-linear:headphone" size="18" />
|
||||
پیام به پشتیبانی
|
||||
</a>
|
||||
<a
|
||||
v-if="depositSmsSupportLink"
|
||||
class="wallet-info-modal__action wallet-info-modal__action--outline"
|
||||
:href="depositSmsSupportLink"
|
||||
>
|
||||
<BasicIcon icon="vuesax-linear:direct-inbox" size="18" />
|
||||
پیام به پشتیبانی (sms)
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- شاخهٔ ثابت بازرتلا: شماره کارت حذف شد؛ از تنظیمات support_messenger استفاده میشود
|
||||
@@ -345,6 +353,14 @@
|
||||
<BasicIcon icon="vuesax-linear:headphone" size="18" />
|
||||
پیام به پشتیبانی
|
||||
</a>
|
||||
<a
|
||||
v-if="depositSmsSupportLink"
|
||||
class="wallet-info-modal__action wallet-info-modal__action--outline"
|
||||
:href="depositSmsSupportLink"
|
||||
>
|
||||
<BasicIcon icon="vuesax-linear:direct-inbox" size="18" />
|
||||
پیام به پشتیبانی (sms)
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -417,6 +433,7 @@ import BasicModal from '@/components/BasicPacks/BasicModal.vue'
|
||||
import { useConfigStore } from '@/store/configStore'
|
||||
import { isBazretalaProject } from '@/utils/config'
|
||||
import {
|
||||
buildDepositSmsUrl,
|
||||
buildSupportMessengerUrl,
|
||||
loadSupportMessengerFromSettings,
|
||||
supportMessengerSettings,
|
||||
@@ -445,6 +462,10 @@ const supportMessengerLink = computed(() =>
|
||||
)
|
||||
)
|
||||
|
||||
const depositSmsSupportLink = computed(() =>
|
||||
buildDepositSmsUrl(supportMessengerSettings.value.depositSmsSupportNumber)
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.query.state === 'deposit') {
|
||||
isDeposit.value = true
|
||||
|
||||
Reference in New Issue
Block a user