feat(user): gift card FAB, menu order, wallet deposit status

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-09 11:25:42 +03:30
co-authored by Cursor
parent 036184c68b
commit 2977b479dd
6 changed files with 189 additions and 60 deletions
+64 -3
View File
@@ -32,6 +32,31 @@
</div>
<RequiredKycModal v-if="!showSplash && !isTvBoardRoute && !isLoginRoute" />
</AConfigProvider>
<div
v-if="showGiftCardButton"
id="gift-card-button"
class="fixed z-[5095] cursor-grab select-none rounded-full"
:class="{ 'cursor-grabbing': giftCardDragging }"
:style="giftCardButtonStyle"
title="ثبت کارت هدیه"
@pointerdown="onGiftCardPointerDown"
@pointermove="onGiftCardPointerMove"
@pointerup="handleGiftCardPointerUp"
@pointercancel="onGiftCardPointerCancel"
>
<div
class="relative inline-flex items-center gap-2 rounded-full bg-white border border-solid border-gray-200 shadow-[0_6px_20px_rgba(15,23,42,0.14)] px-3.5 py-[9px] text-slate-800 text-[13px] font-600 leading-none transition-all duration-200"
:class="{ 'shadow-[0_10px_28px_rgba(15,23,42,0.22)]': giftCardDragging }"
>
<BasicIcon
icon="vuesax-linear:gift"
size="18"
:color="giftCardFabAccent"
class="shrink-0"
/>
<span class="whitespace-nowrap">ثبت کارت هدیه</span>
</div>
</div>
<div
v-if="showSupportButton && !showSplash && route.name !== 'support' && route.name !== 'login' && !isTvBoardRoute && !isKycRequired"
id="support-button"
@@ -127,7 +152,7 @@ import { useDraggableFloatingButton } from '@/utils/useDraggableFloatingButton'
import AppCreditLink from '@/components/AppCreditLink.vue'
import EnamadBadge from '@/components/EnamadBadge.vue'
import SupportMessengerPicker from '@/components/SupportMessengerPicker.vue'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { recoverMobileViewportAfterAuth } from '@/layouts/composables/useMobileScrollReset'
import { usePwaInstall } from '@/composables/usePwaInstall'
import PwaInstallBanner from '@/components/pwa/PwaInstallBanner.vue'
@@ -155,6 +180,7 @@ useApplyDesktopLayoutClass()
const isDesktop = useDesktopBreakpoint()
const route = useRoute()
const router = useRouter()
const showDesktopFloatingCredit = computed(() => {
if (!isDesktop.value) return false
// پشتیبانی خودش سایدبار دارد؛ float روی دکمه ارسال می‌افتد
@@ -301,10 +327,44 @@ watch(
)
const userStore = useUserStore()
const settingsStore = useSettingsStore()
const isKycRequired = computed(
() => Boolean(getToken()) && (userStore.userInfo?.is_legal === 0 || !userStore.userInfo?.is_legal),
)
const settingsStore = useSettingsStore()
const giftCardFabAccent = computed(
() => config.config?.color || getProjectPrimaryColor() || '#334155',
)
const showGiftCardButton = computed(() => {
if (showSplash.value) return false
if (isTvBoardRoute.value || isLoginRoute.value || isKycRequired.value) return false
if (route.name === 'giftCard') return false
if (!getToken()) return false
return settingsStore.isSettingTruthy('has_page_gift_card')
})
const {
dragging: giftCardDragging,
fabStyle: giftCardButtonStyle,
handlePointerDown: onGiftCardPointerDown,
handlePointerMove: onGiftCardPointerMove,
handlePointerUp: giftCardPointerUp,
handlePointerCancel: onGiftCardPointerCancel,
} = useDraggableFloatingButton('boursecu_gift_card_button_position_v1', {
width: 148,
height: 42,
defaultBottomGap: 62,
defaultRightOffset: 16,
})
function handleGiftCardPointerUp(event: PointerEvent) {
const clicked = giftCardPointerUp(event)
if (!clicked) return
event.stopPropagation()
void router.push({ name: 'giftCard' })
}
const showLoginCreditExtras = computed(() => {
if (!isLoginRoute.value) return false
const href = String(settingsStore.getSettingByKey('enamad_url') ?? '').trim()
@@ -606,7 +666,8 @@ html.project-boursecu {
}
html.app-layout--desktop {
#support-button {
#support-button,
#gift-card-button {
bottom: 12px;
right: calc(var(--app-desktop-sidebar-width, 260px) + 20px);
}