- Mock adapter implementing @vmall/shared ApiClient (localStorage-persisted cart/orders/invoices), runtime switch via mockApi flag (default on) - Fixed bilingual mock catalog: 3-level categories, 24 products w/ SKUs, stores, brands, banners, floors, seckill/collective/integral, comments, coupons, addresses, seeded orders/shipments/invoices - B2B2C mall shell: top bar, logo/search/cart header, dark nav + category mega-menu, value-prop footer, back-to-top; 1200px grid, #ca151e theme - UI primitives replacing element-plus: carousel, pagination, breadcrumb, qty stepper, rating stars, modal, tabs, step bar, product card - Pages: home floors, search (filters/sort/paging), goods detail (SKU picker, store rail, review tabs), cart -> checkout -> pay -> success, auth pages, user center (dashboard/orders/addresses/favorites/coupons/ invoices), stores, seckill, collective, integral - i18n split into per-domain locale modules (en+zh) - OpenSpec change mall-pc-storefront-replica archived; all specs green
2.5 KiB
2.5 KiB
Tasks: mall-pc-storefront-replica
1. Mock layer
apps/mall/mock/data.ts: fixed bilingual catalog (categories tree, brands, products+SKUs+images, stores, banners, home floors, seckill sessions, collectives, integral goods, comments, coupons, addresses, user profile/orders/invoices), money in minor unitsapps/mall/mock/api.ts:createMockApi()implementing the@vmall/sharedclient surface (auth, products, categories, currencies+convert, cart with in-memory state, checkout, orders, shipments, invoices) returning fixed/derived dataapps/mall/plugins/api.ts: select mock vs real client viaruntimeConfig.public.mockApi(defaulttrue)
2. Shell + shared components
- Layout:
TopBar(30px, city/links/login state),SiteHeader(logo, search box, cart badge, dark nav + category mega-menuCategoryMenu),SiteFooter(value props + copyright), scroll-aware header collapse, back-to-top - Primitives:
ProductCard,Pagination,Breadcrumb,QtyStepper,RatingStars,EmptyState,Modal,Tabs,Carousel,StepBar; classic B2B2C mall theme via scoped CSS (1200px container, #ca151e, #f5f5f5 floors, card hover lift) - i18n: all new UI strings in
apps/mall/locales-extra.ts(en/zh)
3. Browse pages
- Home
/: hero carousel, quick-link/promo strip, category floors (left adv + product cards) - Goods list
/search: category/brand/sort filter block, 5-col cards, pagination, empty state - Goods detail
/goods/[id]: gallery+zoom, attr/SKU picker, qty stepper, price block, coupon/activity strip, store card + sales rail, detail/comments/after-sale tabs
4. Transaction pages (mock)
- Cart
/cart: store-grouped table, select/qty/remove, summary + 结算 - Checkout
/checkout: step bar, address select, store-grouped preview, remark, submit - Pay
/checkout/pay+ success/checkout/success
5. Auth + user center
/login,/register,/forgot-passwordpanels/usershell: left menu; dashboard, orders list + detail, addresses, favorites, coupons, invoices
6. Stores + marketing pages
/storesdirectory +/stores/[id]store home/seckillsessions + countdown grid,/collectivelist,/integralpoints mall home
7. Verify
pnpm --filter @vmall/mall buildgreenopenspec change validate mall-pc-storefront-replica --strictgreen- Browser smoke: home, search, goods detail (SKU pick), cart → checkout → pay → success, login, user center, stores, seckill — in both locales