Split desktop and mobile layouts with shared page data so APIs fetch once per context.

Add layout shells, desktop views, module-level page caches, and UI fixes for auth, home, wallet, transactions, address, and related pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-14 10:08:46 +03:30
co-authored by Cursor
parent 4404b4cb92
commit a5e458ed25
234 changed files with 18425 additions and 5503 deletions
+13 -67
View File
@@ -1,78 +1,24 @@
<template>
<div>
<div class="bg-white py-3 px-3 text-black font-bold drop-shadow z-[1999] wrap-fix">کارت هدیه</div>
<div class="px-5 pt-26 pb-2">
<a-form :model="form" class="!mt-5" name="basic" @finish="registerGiftCard">
<div class="border-gray-200 border-1 rounded-xl p-5 trans h-40 relative">
<bg_main />
<div class="z-100 relative">
<a-form-item :rules="[required()]" label="کد کارت هدیه" name="code">
<BasicInput
v-model:value="form.code"
place-holder="کد کارت هدیه را وارد کنید"
size="large"
type="text"
/>
</a-form-item>
<div class="font-bold text-xs mt-3">
کد کارت هدیه خود را در فیلد بالا وارد کنید و سپس دکمه ثبت را بزنید.
</div>
</div>
</div>
<a-form-item>
<BasicButton
:disabled="disableButton"
class="w-full py-2 mt-5"
html-type="submit"
type="primary"
>
<div>
<a-spin v-if="loading" size="small" />
<div v-else>ثبت کد</div>
</div>
</BasicButton>
</a-form-item>
</a-form>
</div>
<div class="gift-card-page-root">
<DesktopGiftCardView v-show="isDesktop" />
<MobileGiftCardView v-show="!isDesktop" />
</div>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { loading } from '@/utils'
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
import Bg_main from '@/components/bg_main.vue'
import { registerCodeGiftCard } from '@/api/giftCard'
import { message } from 'ant-design-vue'
import BasicInput from '@/components/BasicPacks/BasicInput.vue'
import { required } from '@/utils/inputRules'
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
import { useGiftCardPage } from './composables/useGiftCardPage'
import DesktopGiftCardView from './desktop/DesktopGiftCardView.vue'
import MobileGiftCardView from './mobile/MobileGiftCardView.vue'
const form = ref<{ code: string }>({
code: ''
})
const isDesktop = useDesktopBreakpoint()
const disableButton = computed(() => {
if (!loading.value) {
return !form.value.code || form.value.code.trim().length === 0
} else {
return true
}
})
async function registerGiftCard() {
try {
loading.value = true
await registerCodeGiftCard(form.value.code)
message.success('کد کارت هدیه با موفقیت ثبت شد')
form.value.code = ''
} catch (e: any) {
message.error(e?.response?.data?.message || 'خطا در ثبت کد کارت هدیه')
} finally {
loading.value = false
}
}
useGiftCardPage()
</script>
<style scoped>
.gift-card-page-root {
min-height: 100%;
height: 100%;
}
</style>