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