refactor(ui): replace modal dialogs with toast/sheet components

Remove DialogVant/NotifyVant and add Toast and Sheet components with
useToast, useReveal, and usePageTransition composables. Rework
Navigation, RegisterView, and styles across both apps; rebuild dist assets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
s.esmaeili
2026-10-04 13:57:25 +03:30
co-authored by Claude Sonnet 5
parent 148b99c4a6
commit c05352d6fd
205 changed files with 3362 additions and 1701 deletions
+16 -8
View File
@@ -38,11 +38,13 @@
<template #loading><Loading size="18" /></template>
<template #success><span /></template>
<template v-if="cart.items.length">
<div class="cart__items">
<div class="cart__items" :class="{ 'is-revealed': revealed }">
<CartItem
v-for="item in cart.items"
v-for="(item, i) in cart.items"
:key="item.pid + item.vid"
:value="item"
class="reveal"
:style="revealDelay(i)"
@note="
cartData.tempRow = item;
cartData.showPopUp = true;
@@ -119,7 +121,7 @@
</template>
<template v-slot:title>آیا مطمئن به ثبت سفارش هستید ؟</template>
<template v-slot:button>
<div class="text-center text-[#1C2D56]" @click="submitOrder">بله</div>
<div class="text-center text-[#23493c]" @click="submitOrder">بله</div>
<div class="text-center text-[#6b7280]" @click="cartData.notify = false">بی خیال</div>
</template>
</DialogVant>
@@ -132,7 +134,7 @@
<div class="p-8 text-justify">برای ثبت سفارش ابتدا باید وارد حساب کاربری خود شوید.</div>
</template>
<template v-slot:button>
<div class="text-center text-[#1C2D56]" @click="router.push({ name: 'login' })">ورود/ثبت نام</div>
<div class="text-center text-[#23493c]" @click="router.push({ name: 'login' })">ورود/ثبت نام</div>
<div class="text-center text-danger" @click="loginNotify = false">بیخیال</div>
</template>
</DialogVant>
@@ -153,6 +155,7 @@ import DialogVant from '../components/DialogVant.vue'
import CartItem from '../components/product/CartItem.vue'
import { useCartStore, type CartItem as CartItemType } from '../stores/cartStore'
import { useSessionStore } from '../stores/session'
import { useReveal } from '../composables/useReveal'
import { api } from '../api/client'
const router = useRouter()
@@ -162,6 +165,10 @@ const session = useSessionStore()
const loginNotify = ref(false)
const refreshing = ref(false)
// First-paint entrance for the basket rows, the same choreography HomeView
// uses with a slightly shorter beat, since a basket can hold many rows.
const { revealed, revealDelay, reveal } = useReveal('cart', 60)
const cartData = reactive({
loadingPage: false,
showPopUp: false,
@@ -227,6 +234,7 @@ async function onRefresh() {
onMounted(async () => {
await cart.init()
reveal()
})
</script>
@@ -274,7 +282,7 @@ onMounted(async () => {
font-size: 12.5px;
font-weight: 700;
color: #fff;
background: @ink;
background: @primary;
}
.cart__done {
@@ -330,7 +338,7 @@ onMounted(async () => {
font-size: 12.5px;
font-weight: 700;
color: #fff;
background: @ink;
background: @primary;
}
.cart__bar {
@@ -390,7 +398,7 @@ onMounted(async () => {
font-size: 13px;
font-weight: 700;
color: #fff;
background: @ink;
background: @primary;
transition: transform 0.15s ease;
}
@@ -419,6 +427,6 @@ onMounted(async () => {
font-size: 13px;
font-weight: 700;
color: #fff;
background: @ink;
background: @primary;
}
</style>