INSTANT_DEPOSIT_PAYMENT_URL
This commit is contained in:
@@ -14,6 +14,7 @@ import { useUserStore } from '@/store/userStore'
|
||||
import { isCustomerIdentityVerified } from '@/utils/customerIdentity'
|
||||
import { useConfigStore } from '@/store/configStore'
|
||||
import {
|
||||
getInstantDepositPaymentUrl,
|
||||
getWalletDepositQuickAmountsRial,
|
||||
} from '@/utils/config'
|
||||
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
|
||||
@@ -35,6 +36,7 @@ export interface WalletPageContext {
|
||||
config: ReturnType<typeof useConfigStore>
|
||||
showAddCard: Ref<boolean>
|
||||
chargeAccountModal: Ref<boolean>
|
||||
depositMethodVisible: Ref<boolean>
|
||||
showConfirmCode: Ref<boolean>
|
||||
withdrawInfModal: Ref<boolean>
|
||||
infoVisible: Ref<boolean>
|
||||
@@ -63,6 +65,9 @@ export interface WalletPageContext {
|
||||
formatter: (value: number) => string
|
||||
percentChange: (val: number) => void
|
||||
ok: () => Promise<void>
|
||||
openInstantDepositPayment: () => void
|
||||
chooseInstantDeposit: () => void
|
||||
chooseAccountDeposit: () => void
|
||||
addCard: () => Promise<void>
|
||||
getCards: () => Promise<void>
|
||||
handleOnComplete: (value: string) => Promise<void>
|
||||
@@ -84,6 +89,7 @@ export function useWalletPage() {
|
||||
} = useSupportMessenger()
|
||||
const showAddCard = ref(false)
|
||||
const chargeAccountModal = ref(false)
|
||||
const depositMethodVisible = ref(false)
|
||||
const showConfirmCode = ref(false)
|
||||
const withdrawInfModal = ref(false)
|
||||
const identityRequiredVisible = ref(false)
|
||||
@@ -198,6 +204,25 @@ export function useWalletPage() {
|
||||
else form.value.value = undefined
|
||||
}
|
||||
|
||||
function openInstantDepositPayment() {
|
||||
const url = getInstantDepositPaymentUrl()
|
||||
if (!url) {
|
||||
message.info('لینک پرداخت آنی هنوز تنظیم نشده است')
|
||||
return
|
||||
}
|
||||
window.location.assign(url)
|
||||
}
|
||||
|
||||
function chooseInstantDeposit() {
|
||||
depositMethodVisible.value = false
|
||||
openInstantDepositPayment()
|
||||
}
|
||||
|
||||
function chooseAccountDeposit() {
|
||||
depositMethodVisible.value = false
|
||||
chargeAccountModal.value = true
|
||||
}
|
||||
|
||||
async function ok() {
|
||||
if (!ensureIdentity()) return
|
||||
try {
|
||||
@@ -208,7 +233,7 @@ export function useWalletPage() {
|
||||
showConfirmCode.value = true
|
||||
}
|
||||
if (isDeposit.value) {
|
||||
chargeAccountModal.value = true
|
||||
depositMethodVisible.value = true
|
||||
}
|
||||
} else {
|
||||
message.error('ابتدا مبلغ را وارد کنید')
|
||||
@@ -279,6 +304,7 @@ export function useWalletPage() {
|
||||
config,
|
||||
showAddCard,
|
||||
chargeAccountModal,
|
||||
depositMethodVisible,
|
||||
showConfirmCode,
|
||||
withdrawInfModal,
|
||||
infoVisible,
|
||||
@@ -307,6 +333,9 @@ export function useWalletPage() {
|
||||
formatter,
|
||||
percentChange,
|
||||
ok,
|
||||
openInstantDepositPayment,
|
||||
chooseInstantDeposit,
|
||||
chooseAccountDeposit,
|
||||
addCard,
|
||||
getCards,
|
||||
handleOnComplete,
|
||||
|
||||
Reference in New Issue
Block a user