Merge origin/modular and keep modular wallet with remote support handler
Co-authored-by: Cursor <cursoragent@cursor.com>
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>({})
|
||||
@@ -65,6 +66,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()
|
||||
@@ -74,6 +83,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)
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useConfigStore } from '@/store/configStore'
|
||||
import { isBazretalaProject } from '@/utils/config'
|
||||
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
|
||||
import {
|
||||
buildDepositSmsUrl,
|
||||
buildSupportMessengerUrl,
|
||||
DEFAULT_SUPPORT_MESSENGER_TEXT,
|
||||
supportMessengerSettings,
|
||||
@@ -51,6 +52,7 @@ export interface WalletPageContext {
|
||||
desktopDepositScrollEl: Ref<HTMLElement | null>
|
||||
supportMessengerText: ReturnType<typeof computed<string>>
|
||||
supportMessengerLink: ReturnType<typeof computed<string | undefined>>
|
||||
depositSmsSupportLink: ReturnType<typeof computed<string>>
|
||||
isBazretalaProject: typeof isBazretalaProject
|
||||
usePriceWithoutType: typeof usePriceWithoutType
|
||||
formatCashWalletBalanceText: typeof formatCashWalletBalanceText
|
||||
@@ -96,6 +98,10 @@ export function useWalletPage() {
|
||||
),
|
||||
)
|
||||
|
||||
const depositSmsSupportLink = computed(() =>
|
||||
buildDepositSmsUrl(supportMessengerSettings.value.depositSmsSupportNumber),
|
||||
)
|
||||
|
||||
const form = ref<Transaction>({
|
||||
value: undefined,
|
||||
percentWallet: 0,
|
||||
@@ -265,6 +271,7 @@ export function useWalletPage() {
|
||||
desktopDepositScrollEl,
|
||||
supportMessengerText,
|
||||
supportMessengerLink,
|
||||
depositSmsSupportLink,
|
||||
isBazretalaProject,
|
||||
usePriceWithoutType,
|
||||
formatCashWalletBalanceText,
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<div class="mt-2">
|
||||
<span>{{ supportMessengerText }}</span>
|
||||
</div>
|
||||
<BasicButton v-if="supportMessengerLink">
|
||||
<BasicButton v-if="supportMessengerLink" class="mt-3">
|
||||
<a
|
||||
class="w-full"
|
||||
:href="supportMessengerLink"
|
||||
@@ -109,6 +109,11 @@
|
||||
پیام به پشتیبانی
|
||||
</a>
|
||||
</BasicButton>
|
||||
<BasicButton v-if="depositSmsSupportLink" class="mt-2">
|
||||
<a class="w-full" :href="depositSmsSupportLink">
|
||||
پیام به پشتیبانی (sms)
|
||||
</a>
|
||||
</BasicButton>
|
||||
</div>
|
||||
<template #footer>
|
||||
<a-button type="primary" class="w-full" @click="chargeAccountModal = false">
|
||||
@@ -160,6 +165,7 @@ const {
|
||||
refOtpInput,
|
||||
supportMessengerText,
|
||||
supportMessengerLink,
|
||||
depositSmsSupportLink,
|
||||
isBazretalaProject,
|
||||
handleOnComplete,
|
||||
loading,
|
||||
|
||||
Reference in New Issue
Block a user