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.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Adapted from legacy singleProduct.vue's own fetch (GET /product/:id).
|
||||
// The new API has no single-product-detail endpoint (only GET
|
||||
// /catalog/products, the flat list) — apps/api is out of scope for this port,
|
||||
// so this fetches the full list and finds the matching product client-side.
|
||||
// Wasteful for a large catalog, but honest: no fabricated endpoint, no silent
|
||||
// behavior change.
|
||||
import { ref } from 'vue'
|
||||
import { api, type ProductSummary } from '../api/client'
|
||||
|
||||
export function useProductDetail(id: string) {
|
||||
const loading = ref(false)
|
||||
const flag = ref(false)
|
||||
const notFound = ref(false)
|
||||
const productRef = ref<ProductSummary | null>(null)
|
||||
|
||||
const load = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const products = await api.listProducts()
|
||||
const found = products.find((p) => p.id === id) ?? null
|
||||
productRef.value = found
|
||||
notFound.value = !found
|
||||
flag.value = true
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return { loading, flag, notFound, productRef, load }
|
||||
}
|
||||
Reference in New Issue
Block a user