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:
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div class="daddr">
|
||||
<div class="daddr__container">
|
||||
<header class="daddr-topbar">
|
||||
<p class="daddr-topbar__eyebrow">حساب کاربری</p>
|
||||
<h1 class="daddr-topbar__title">آدرسها</h1>
|
||||
<p class="daddr-topbar__subtitle">آدرسهای تحویل سفارش خود را مدیریت کنید</p>
|
||||
</header>
|
||||
|
||||
<div
|
||||
v-if="isBazretalaProject()"
|
||||
class="daddr-notice"
|
||||
>
|
||||
جهت تحویل فیزیکی محصول در تهران و قم ازطریق معرف اقدام فرمائید یا با شماره امورمالی و حسابداری 09925202099 درارتباط باشید.
|
||||
</div>
|
||||
|
||||
<div class="daddr-grid">
|
||||
<section class="daddr-surface daddr-form">
|
||||
<div class="daddr-form__header">
|
||||
<h2 class="daddr-form__title">{{ editId ? 'ویرایش آدرس' : 'ثبت آدرس جدید' }}</h2>
|
||||
<button
|
||||
v-if="editId"
|
||||
type="button"
|
||||
class="daddr-form__reset"
|
||||
@click="openAdd()"
|
||||
>
|
||||
آدرس جدید
|
||||
</button>
|
||||
</div>
|
||||
<AddressForm variant="desktop" />
|
||||
</section>
|
||||
|
||||
<section class="daddr-surface daddr-list">
|
||||
<div class="daddr-list__header">
|
||||
<h3 class="daddr-list__title">آدرسهای ثبتشده</h3>
|
||||
<span class="daddr-list__count">{{ items.length }} مورد</span>
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="daddr-list__skeletons">
|
||||
<TransactionSkeleton v-for="i in 6" :key="i" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div v-else-if="items.length" class="daddr-list__items">
|
||||
<list-anim>
|
||||
<Item
|
||||
v-for="item in items"
|
||||
:key="`desktop-${item.id}`"
|
||||
:item="item"
|
||||
variant="desktop"
|
||||
@edit="openEdit"
|
||||
@refresh="initItems"
|
||||
/>
|
||||
</list-anim>
|
||||
</div>
|
||||
|
||||
<div v-else class="daddr-empty">
|
||||
<BasicIcon icon="vuesax-linear:location" size="36" />
|
||||
<p>هنوز آدرسی ثبت نشده است.</p>
|
||||
<button type="button" class="daddr-empty__btn" @click="openAdd()">
|
||||
افزودن اولین آدرس
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
import ListAnim from '@/components/ListAnim.vue'
|
||||
import TransactionSkeleton from '@/components/TransactionSkeleton.vue'
|
||||
import AddressForm from '../components/AddressForm.vue'
|
||||
import Item from '../components/Item.vue'
|
||||
import { useAddressPageContext } from '../composables/useAddressPage'
|
||||
|
||||
const {
|
||||
items,
|
||||
loading,
|
||||
editId,
|
||||
isBazretalaProject,
|
||||
openAdd,
|
||||
openEdit,
|
||||
initItems,
|
||||
} = useAddressPageContext()
|
||||
</script>
|
||||
Reference in New Issue
Block a user