Files
tehran_taj/apps/user-app-v2/src/App.vue
T
s.esmaeili 53a304b5d5 SearchView: Removed the dynamic collection-tile grid (e.g. "پرفروش‌های این هفته") and the "نتایج / N محصول" section header from the UI. Underlying data/filtering logic untouched.
DashboardView ("میز کار"): Rebuilt from scratch with a new structure, distinct from the old card+grid layout but visually aligned with HomeView (same blurred bar, @ink/@wine palette, staged reveal animation on mount):

Single hero card (ink→wine gradient) showing balance, gold/fiat debt, and identity — no quick-action icons inside it anymore.

Live gold rate folded into a slim inline row at the bottom instead of a titled section.
Iterated shadow/spacing on the hero card per feedback (softer, less clipped).
DialogVant / DialogVantOneButton (shared modal components, used in 7+ call sites: Dashboard, Cart, SingleProduct, Register, App): Replaced Vant's default dialog chrome with the app's own rounded-card language — circular icon badge for the illustration, pill-shaped primary/secondary buttons. No call-site markup changed.

LoginView: Rebuilt from scratch — full-bleed dark hero (brand + step copy) overlapped by a floating white form sheet, animated crossfade transition between the mobile-number and OTP steps, same staged entrance animation as Home/Dashboard. All auth logic (API check, OTP stub, session login) unchanged.
2026-09-18 12:54:45 +03:30

130 lines
3.3 KiB
Vue

<!--
Ported from legacy henza_pwa/src/App.vue — layout switching, RTL shell, and
the app-version-check / service-worker update dialog.
Not ported (deliberate): Firebase push init and WebOTP autofill. Both were
already commented out in legacy's own App.vue, so neither ran there either.
-->
<template>
<div>
<component :is="getLayout" class="relative">
<router-view v-slot="{ Component, route }">
<keep-alive>
<suspense>
<template #default>
<component :is="Component" :key="route.name" />
</template>
</suspense>
</keep-alive>
</router-view>
</component>
<DialogVantOneButton :timeOut="-1" v-model:show="versionDialog" :closeOnClickOverlay="true">
<template v-slot:img>
<DotLottieVue
class="w-full aspect-square"
autoplay
loop
src="https://lottie.host/cb620e8e-c64a-42e8-a6b5-8844146e5999/nmft7oBO8q.json"
/>
</template>
<template v-slot:title>
<div class="p-8 text-justify">نسخه جدید منتزر منتشر شد!</div>
</template>
<template v-slot:button>
<div class="text-center text-[#1C2D56]" @click="update()">به روز رسانی</div>
</template>
</DialogVantOneButton>
</div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { DotLottieVue } from '@lottiefiles/dotlottie-vue'
import { useRegisterSW } from 'virtual:pwa-register/vue'
import MasterLayout from './layout/MasterLayout.vue'
import FullPageLayout from './layout/FullPageLayout.vue'
import DialogVantOneButton from './components/DialogVantOneButton.vue'
import { useRefresh } from './composables/useRefresh'
import pkg from '../package.json'
const router = useRouter()
const { updateServiceWorker } = useRegisterSW()
const getLayout = computed(() => {
if (router.currentRoute.value.meta && router.currentRoute.value.meta.layout === 'FullPage') {
return FullPageLayout
}
return MasterLayout
})
// Ported from legacy App.vue:52-74 — compare the stored version against the
// bundled package version and offer a one-tap service-worker update.
const versionDialog = ref(false)
function checkVersion() {
const version = localStorage.getItem('version')
if (version) {
if (version !== pkg.version) versionDialog.value = true
} else {
localStorage.setItem('version', pkg.version)
}
}
function update() {
localStorage.setItem('version', pkg.version)
updateServiceWorker()
window.location.reload()
}
onMounted(() => {
useRefresh()
checkVersion()
})
</script>
<style lang="less">
body::-webkit-scrollbar {
display: none;
}
#app {
overflow: hidden;
direction: rtl !important;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: start;
color: @primary;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.slideDown-enter-active,
.slideDown-leave-active {
transition: all @transition-duration ease;
}
.slideDown-enter-from {
transform: translateY(-100vh);
}
.slideDown-leave-to {
transform: translateY(100vh);
}
.slideDown-leave-from {
transform: translateY(0);
}
.slideDown-enter-to {
transform: translateY(0);
}
.fade-down-enter-active,
.fade-down-leave-active {
transition: all @transition-duration ease;
}
</style>