feat(user): identity gate for wallet/gift card and custom nav icons

This commit is contained in:
2026-10-20 09:10:03 +03:30
parent 5e181fdae9
commit 7626453def
14 changed files with 104 additions and 3 deletions
@@ -11,6 +11,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import { message } from 'ant-design-vue'
import type { Card } from '@/models/wallet'
import { useUserStore } from '@/store/userStore'
import { isCustomerIdentityVerified } from '@/utils/customerIdentity'
import { useConfigStore } from '@/store/configStore'
import {
getWalletDepositQuickAmountsRial,
@@ -37,6 +38,7 @@ export interface WalletPageContext {
showConfirmCode: Ref<boolean>
withdrawInfModal: Ref<boolean>
infoVisible: Ref<boolean>
identityRequiredVisible: Ref<boolean>
refOtpInput: Ref<InstanceType<typeof OtpInput> | null>
form: Ref<Transaction>
extraNote: Ref<string>
@@ -84,6 +86,13 @@ export function useWalletPage() {
const chargeAccountModal = ref(false)
const showConfirmCode = ref(false)
const withdrawInfModal = ref(false)
const identityRequiredVisible = ref(false)
function ensureIdentity(): boolean {
if (isCustomerIdentityVerified(userStore.userInfo?.is_legal)) return true
identityRequiredVisible.value = true
return false
}
const infoVisible = ref(false)
const refOtpInput = ref<InstanceType<typeof OtpInput> | null>(null)
const mobileDepositScrollEl = ref<HTMLElement | null>(null)
@@ -190,6 +199,7 @@ export function useWalletPage() {
}
async function ok() {
if (!ensureIdentity()) return
try {
if (form.value.value !== undefined) {
loading.value = true
@@ -211,6 +221,7 @@ export function useWalletPage() {
}
async function handleOnComplete(value: string) {
if (!ensureIdentity()) return
try {
infoVisible.value = true
showConfirmCode.value = false
@@ -268,6 +279,7 @@ export function useWalletPage() {
showConfirmCode,
withdrawInfModal,
infoVisible,
identityRequiredVisible,
refOtpInput,
form,
extraNote,
+4
View File
@@ -78,6 +78,8 @@
<SkeletonLoading v-model:show="infoVisible" />
<IdentityRequiredDialog v-model:show="identityRequiredVisible" action="واریز یا برداشت" />
<WalletDepositGuideModal
v-model:visible="chargeAccountModal"
:support-link="depositGuideSupportLink"
@@ -117,6 +119,7 @@ import MobileWalletView from './mobile/MobileWalletView.vue'
import SkeletonLoading from './components/SkeletonLoading.vue'
import WalletAddCardForm from './components/WalletAddCardForm.vue'
import WalletDepositGuideModal from './components/WalletDepositGuideModal.vue'
import IdentityRequiredDialog from '@/components/IdentityRequiredDialog.vue'
const isDesktop = useDesktopBreakpoint()
@@ -126,6 +129,7 @@ const {
showConfirmCode,
withdrawInfModal,
infoVisible,
identityRequiredVisible,
refOtpInput,
extraNote,
supportMessengerText,