index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <template>
  2. <view class="container" :style="{ '--font-scale': fontScale }">
  3. <!-- 通用登录浮层(未登录点击开通会员时先登录) -->
  4. <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
  5. <!-- Member Upgrade Banner -->
  6. <view v-if="!isMember" class="member-banner" @click="goUpgrade">
  7. <view class="member-banner-content">
  8. <text class="member-banner-icon">👑</text>
  9. <view class="member-banner-texts">
  10. <text class="member-banner-title">开通会员</text>
  11. <text class="member-banner-desc">享专属折扣与成长服务</text>
  12. </view>
  13. </view>
  14. <text class="member-banner-action">立即开通 ›</text>
  15. </view>
  16. <!-- 搜索栏 + 购物车 -->
  17. <view class="search-row">
  18. <view class="search-bar" @click="goSearch">
  19. <text class="search-icon">🔍</text>
  20. <text class="search-placeholder">搜索商品</text>
  21. </view>
  22. <view class="cart-btn" @click="goCart">
  23. <text class="cart-icon">🛒</text>
  24. <text v-if="cartCount > 0" class="cart-badge">{{ cartCount > 99 ? '99+' : cartCount }}</text>
  25. </view>
  26. </view>
  27. <!-- Level 1 分类:横向滚动chips -->
  28. <scroll-view
  29. scroll-x
  30. enable-flex
  31. show-scrollbar="false"
  32. class="cat-level1-scroll"
  33. >
  34. <view class="cat1-chips">
  35. <view
  36. v-for="cat in categories"
  37. :key="cat.id"
  38. :class="['cat1-chip', currentCat1 && currentCat1.id === cat.id ? 'active' : '']"
  39. @click="onCat1Select(cat)"
  40. >{{ cat.name }}</view>
  41. </view>
  42. </scroll-view>
  43. <!-- Level 2 子分类:横向滚动chips -->
  44. <scroll-view
  45. v-if="currentCat1 && currentCat1.children && currentCat1.children.length"
  46. scroll-x
  47. enable-flex
  48. show-scrollbar="false"
  49. class="cat-level2-scroll"
  50. >
  51. <view class="cat2-chips">
  52. <view
  53. :class="['cat2-chip', !currentCat2 ? 'active' : '']"
  54. @click="onCat2Select(null)"
  55. >全部</view>
  56. <view
  57. v-for="child in currentCat1.children"
  58. :key="child.id"
  59. :class="['cat2-chip', currentCat2 && currentCat2.id === child.id ? 'active' : '']"
  60. @click="onCat2Select(child)"
  61. >{{ child.name }}</view>
  62. </view>
  63. </scroll-view>
  64. <!-- 商品列表 -->
  65. <scroll-view
  66. scroll-y
  67. class="product-list"
  68. @scrolltolower="onLoadMore"
  69. refresher-enabled
  70. :refresher-triggered="refreshing"
  71. @refresherrefresh="onRefresh"
  72. >
  73. <!-- 推荐商品 -->
  74. <view class="recommend-section" v-if="recommended.length > 0">
  75. <view class="recommend-header">
  76. <text class="recommend-title">🔥 推荐商品</text>
  77. </view>
  78. <scroll-view scroll-x enable-flex show-scrollbar="false" class="recommend-scroll">
  79. <view
  80. v-for="item in recommended"
  81. :key="item.id"
  82. class="recommend-card"
  83. @click="goDetail(item.id)"
  84. >
  85. <image
  86. class="recommend-img"
  87. :src="getImageUrl(item.image || item.coverImage) || '/static/default-product.png'"
  88. mode="aspectFill"
  89. lazy-load />
  90. <text class="recommend-name">{{ item.name }}</text>
  91. <text class="recommend-price">{{ formatPriceWithSymbol(item.price) }}</text>
  92. </view>
  93. </scroll-view>
  94. </view>
  95. <!-- Loading skeleton -->
  96. <view v-if="loading && products.length === 0" class="skeleton-grid">
  97. <view class="skeleton-card" v-for="n in 6" :key="n">
  98. <view class="skeleton-img"></view>
  99. <view class="skeleton-body">
  100. <view class="skeleton-line skeleton-title"></view>
  101. <view class="skeleton-line skeleton-price"></view>
  102. <view class="skeleton-line skeleton-vendor"></view>
  103. </view>
  104. </view>
  105. </view>
  106. <view v-else-if="products.length === 0" class="empty-wrap">
  107. <text class="empty-icon">📦</text>
  108. <text class="empty-text">暂无商品</text>
  109. </view>
  110. <view v-else class="grid fade-in">
  111. <view
  112. v-for="item in products"
  113. :key="item.id"
  114. class="product-card"
  115. @click="goDetail(item.id)"
  116. >
  117. <image
  118. class="cover"
  119. :src="getImageUrl(item.image || item.coverImage) || '/static/default-product.png'"
  120. mode="aspectFill"
  121. lazy-load />
  122. <view class="card-body">
  123. <text class="product-name">{{ item.name }}</text>
  124. <view class="price-row">
  125. <text class="price">{{ formatPriceWithSymbol(item.price) }}</text>
  126. <text v-if="item.memberPrice" class="member-price">会员{{ formatPriceWithSymbol(item.memberPrice) }}</text>
  127. <text v-if="item.giftLevelName" class="gift-badge">🎁</text>
  128. </view>
  129. <text class="vendor-name">{{ item.brandName || '平台官方' }}</text>
  130. </view>
  131. </view>
  132. </view>
  133. <view v-if="loadingMore" class="loading-more">
  134. <text class="loading-text">加载中...</text>
  135. </view>
  136. <view v-if="noMore && products.length > 0" class="no-more">
  137. <text class="no-more-text">— 没有更多了 —</text>
  138. </view>
  139. <view v-if="!isLoggedIn" class="login-hint-bar">
  140. <text class="login-hint-text">🔒 登录查看全部商品和会员价</text>
  141. </view>
  142. <view class="bottom-spacer"></view>
  143. </scroll-view>
  144. </view>
  145. </template>
  146. <script>
  147. import { goodsCategory, productList, getMyMembership, cartCount, reportAppEnter} from '@/utils/api.js'
  148. import config from '@/config.js'
  149. import fontScaleMixin from '@/mixins/font-scale.js'
  150. export default {
  151. mixins: [fontScaleMixin],
  152. data() {
  153. return {
  154. categories: [],
  155. currentCat1: null,
  156. currentCat2: null,
  157. products: [],
  158. page: 1,
  159. size: 20,
  160. loading: false,
  161. loadingMore: false,
  162. refreshing: false,
  163. noMore: false,
  164. isLoggedIn: false,
  165. isMember: false,
  166. recommended: [],
  167. cartCount: 0
  168. }
  169. },
  170. onLoad() {
  171. reportAppEnter('shop');
  172. this.checkMemberStatus()
  173. this.isLoggedIn = !!uni.getStorageSync('token')
  174. this.loadCategories()
  175. this.loadProducts()
  176. this.loadRecommended()
  177. this.loadCartCount()
  178. this._onLoadFired = true
  179. },
  180. onShow() {
  181. if (this._onLoadFired) {
  182. this._onLoadFired = false
  183. } else {
  184. this.checkMemberStatus()
  185. this.isLoggedIn = !!uni.getStorageSync('token')
  186. this.loadCartCount()
  187. }
  188. },
  189. methods: {
  190. loadCategories() {
  191. goodsCategory('0').then(res => {
  192. if (res.code === 200 && res.data) {
  193. this.categories = res.data || []
  194. }
  195. }).catch(() => {})
  196. },
  197. onCat1Select(cat) {
  198. if (this.currentCat1 && this.currentCat1.id === cat.id) return
  199. this.currentCat1 = cat
  200. this.currentCat2 = null
  201. this.page = 1
  202. this.products = []
  203. this.noMore = false
  204. this.loadProducts()
  205. },
  206. onCat2Select(cat) {
  207. this.currentCat2 = cat
  208. this.page = 1
  209. this.products = []
  210. this.noMore = false
  211. this.loadProducts()
  212. },
  213. loadProducts() {
  214. if (this.loading) return
  215. this.loading = true
  216. const params = { page: this.page, size: this.size }
  217. if (this.currentCat2) {
  218. params.categoryId = this.currentCat2.id
  219. } else if (this.currentCat1) {
  220. params.categoryId = this.currentCat1.id
  221. }
  222. productList(params).then(res => {
  223. this.loading = false
  224. this.refreshing = false
  225. if (res.code === 200 && res.data) {
  226. const records = res.data.records || []
  227. if (this.page === 1) {
  228. this.products = records
  229. } else {
  230. this.products = this.products.concat(records)
  231. }
  232. const total = res.data.total || 0
  233. this.noMore = this.products.length >= total
  234. }
  235. }).catch(() => {
  236. this.loading = false
  237. this.refreshing = false
  238. })
  239. },
  240. onRefresh() {
  241. this.refreshing = true
  242. this.page = 1
  243. this.noMore = false
  244. this.loadProducts()
  245. },
  246. onLoadMore() {
  247. if (this.noMore || this.loadingMore) return
  248. this.page++
  249. this.loadingMore = true
  250. const params = { page: this.page, size: this.size }
  251. if (this.currentCat2) {
  252. params.categoryId = this.currentCat2.id
  253. } else if (this.currentCat1) {
  254. params.categoryId = this.currentCat1.id
  255. }
  256. productList(params).then(res => {
  257. this.loadingMore = false
  258. if (res.code === 200 && res.data) {
  259. const records = res.data.records || []
  260. this.products = this.products.concat(records)
  261. const total = res.data.total || 0
  262. this.noMore = this.products.length >= total
  263. }
  264. }).catch(() => {
  265. this.loadingMore = false
  266. })
  267. },
  268. checkMemberStatus() {
  269. if (!uni.getStorageSync('token')) {
  270. this.isMember = false
  271. return
  272. }
  273. var that = this
  274. getMyMembership().then(function(res) {
  275. if (res.data && res.data.memberLevel) {
  276. that.isMember = res.data.memberLevel !== 'FREE'
  277. }
  278. }).catch(function() {
  279. that.isMember = false
  280. })
  281. },
  282. goUpgrade() {
  283. // 未登录:先弹出登录浮层,登录成功后再进入会员开通页
  284. if (!uni.getStorageSync('token')) {
  285. this._pendingUpgrade = true
  286. this.openLoginSheet({ redirect: '/pages/membership/upgrade' })
  287. return
  288. }
  289. uni.navigateTo({ url: '/pages/membership/upgrade' })
  290. },
  291. // 登录成功回调(login-sheet @success → 全局 mixin onSheetLoginSuccess → 此处)
  292. onLoginSuccess() {
  293. if (this._pendingUpgrade) {
  294. this._pendingUpgrade = false
  295. uni.navigateTo({ url: '/pages/membership/upgrade' })
  296. }
  297. },
  298. goDetail(id) {
  299. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + id })
  300. },
  301. goSearch() {
  302. uni.navigateTo({ url: '/pages/shop/search/search' })
  303. },
  304. goCart() {
  305. uni.navigateTo({ url: '/pages/shop/cart/cart' })
  306. },
  307. loadCartCount() {
  308. if (!uni.getStorageSync('token')) {
  309. this.cartCount = 0
  310. return
  311. }
  312. cartCount().then(res => {
  313. if (res.code === 200) {
  314. this.cartCount = res.data || 0
  315. }
  316. }).catch(() => {})
  317. },
  318. loadRecommended() {
  319. productList({ page: 1, size: 6, sort: 'sales' }).then(res => {
  320. if (res.code === 200 && res.data) {
  321. this.recommended = res.data.records || []
  322. }
  323. }).catch(() => {})
  324. },
  325. formatPriceWithSymbol(price) {
  326. if (price === null || price === undefined) return ''
  327. return '¥' + (Number(price) / 100).toFixed(2)
  328. },getImageUrl: function(path) {
  329. if (!path || path === 'null' || path === 'undefined' || path === '/null') return ''
  330. var s = String(path).trim()
  331. if (!s || s === 'null' || s === '/null') return ''
  332. if (s.indexOf('http://') === 0 || s.indexOf('https://') === 0) return s
  333. return config.API_BASE_URL + (s.charAt(0) === '/' ? s : '/' + s)
  334. }
  335. }
  336. }
  337. </script>
  338. <style scoped lang="scss">
  339. .container {
  340. display: flex;
  341. flex-direction: column;
  342. height: 100vh;
  343. background: $facade-fill-2;
  344. }
  345. /* ==================== 分类布局 ==================== */
  346. /* Level 1 分类:横向滚动chips */
  347. .cat-level1-scroll {
  348. background: $app-surface;
  349. white-space: nowrap;
  350. padding: 12rpx 16rpx;
  351. border-bottom: 1rpx solid $facade-hairline-2;
  352. }
  353. .cat1-chips {
  354. display: inline-flex;
  355. gap: 12rpx;
  356. padding: 0 4rpx;
  357. }
  358. .cat1-chip {
  359. display: inline-block;
  360. padding: 10rpx 28rpx;
  361. font-size: calc(26rpx * var(--font-scale, 1));
  362. color: $facade-text-body;
  363. background: $facade-fill;
  364. border-radius: 24rpx;
  365. flex-shrink: 0;
  366. }
  367. .cat1-chip.active {
  368. background: $brand-primary;
  369. color: $app-surface;
  370. font-weight: 500;
  371. }
  372. /* 搜索栏 + 购物车 */
  373. .search-row {
  374. display: flex;
  375. align-items: center;
  376. margin: 16rpx 16rpx 0;
  377. gap: 16rpx;
  378. }
  379. .search-bar {
  380. flex: 1;
  381. display: flex;
  382. align-items: center;
  383. background: $app-surface;
  384. padding: 16rpx 24rpx;
  385. border-radius: 24rpx;
  386. border: 1rpx solid $facade-hairline-2;
  387. }
  388. .search-icon {
  389. font-size: calc(32rpx * var(--font-scale, 1));
  390. margin-right: 12rpx;
  391. }
  392. .search-placeholder {
  393. font-size: calc(26rpx * var(--font-scale, 1));
  394. color: $facade-text-ghost-light;
  395. }
  396. .cart-btn {
  397. position: relative;
  398. width: 72rpx;
  399. height: 72rpx;
  400. border-radius: 50%;
  401. background: $app-surface;
  402. border: 1rpx solid $facade-hairline-2;
  403. display: flex;
  404. align-items: center;
  405. justify-content: center;
  406. flex-shrink: 0;
  407. }
  408. .cart-icon {
  409. font-size: calc(36rpx * var(--font-scale, 1));
  410. }
  411. .cart-badge {
  412. position: absolute;
  413. top: -6rpx;
  414. right: -6rpx;
  415. min-width: 32rpx;
  416. height: 32rpx;
  417. line-height: 32rpx;
  418. padding: 0 8rpx;
  419. border-radius: 16rpx;
  420. background: $status-danger-2;
  421. color: $app-surface;
  422. font-size: calc(20rpx * var(--font-scale, 1));
  423. text-align: center;
  424. box-sizing: border-box;
  425. }
  426. /* Member Upgrade Banner */
  427. .member-banner {
  428. display: flex;
  429. align-items: center;
  430. justify-content: space-between;
  431. background: linear-gradient(135deg, $uni-primary-pale, $facade-brand-tint-2);
  432. margin: 16rpx;
  433. padding: 20rpx 24rpx;
  434. border-radius: 16rpx;
  435. border: 2rpx solid $brand-primary-light-2;
  436. }
  437. .member-banner-content {
  438. display: flex;
  439. align-items: center;
  440. }
  441. .member-banner-icon {
  442. font-size: calc(40rpx * var(--font-scale, 1));
  443. margin-right: 16rpx;
  444. }
  445. .member-banner-texts {
  446. display: flex;
  447. flex-direction: column;
  448. }
  449. .member-banner-title {
  450. font-size: calc(28rpx * var(--font-scale, 1));
  451. font-weight: bold;
  452. color: $brand-primary-deep;
  453. }
  454. .member-banner-desc {
  455. font-size: calc(22rpx * var(--font-scale, 1));
  456. color: $brand-primary;
  457. margin-top: 4rpx;
  458. }
  459. .member-banner-action {
  460. font-size: calc(26rpx * var(--font-scale, 1));
  461. color: $brand-primary;
  462. font-weight: 500;
  463. }
  464. /* 推荐商品 */
  465. .recommend-section {
  466. background: $app-surface;
  467. border-radius: 16rpx;
  468. margin: 16rpx;
  469. padding: 20rpx;
  470. }
  471. .recommend-header {
  472. margin-bottom: 16rpx;
  473. }
  474. .recommend-title {
  475. font-size: calc(28rpx * var(--font-scale, 1));
  476. font-weight: bold;
  477. color: $facade-text-strong;
  478. }
  479. .recommend-scroll {
  480. white-space: nowrap;
  481. padding-bottom: 8rpx;
  482. }
  483. .recommend-card {
  484. display: inline-flex;
  485. flex-direction: column;
  486. width: 160rpx;
  487. margin-right: 12rpx;
  488. flex-shrink: 0;
  489. }
  490. .recommend-img {
  491. width: 160rpx;
  492. height: 160rpx;
  493. border-radius: 8rpx;
  494. background: $facade-fill;
  495. margin-bottom: 6rpx;
  496. }
  497. .recommend-name {
  498. font-size: calc(22rpx * var(--font-scale, 1));
  499. color: $facade-text-strong;
  500. lines: 1;
  501. overflow: hidden;
  502. text-overflow: ellipsis;
  503. white-space: nowrap;
  504. margin-bottom: 4rpx;
  505. }
  506. .recommend-price {
  507. font-size: calc(24rpx * var(--font-scale, 1));
  508. color: $brand-primary;
  509. font-weight: bold;
  510. }
  511. /* Level 2 子分类:横向滚动chips */
  512. .cat-level2-scroll {
  513. background: $app-surface;
  514. white-space: nowrap;
  515. padding: 12rpx 16rpx;
  516. border-bottom: 1rpx solid $facade-fill;
  517. }
  518. .cat2-chips {
  519. display: inline-flex;
  520. gap: 12rpx;
  521. padding: 0 4rpx;
  522. }
  523. .cat2-chip {
  524. display: inline-block;
  525. padding: 8rpx 24rpx;
  526. font-size: calc(24rpx * var(--font-scale, 1));
  527. color: $facade-text-body;
  528. background: $facade-fill;
  529. border-radius: 24rpx;
  530. flex-shrink: 0;
  531. }
  532. .cat2-chip.active {
  533. background: $brand-primary;
  534. color: $app-surface;
  535. }
  536. /* ==================== 商品列表 ==================== */
  537. .product-list {
  538. flex: 1;
  539. min-height: 0;
  540. }
  541. .login-hint-bar {
  542. text-align: center;
  543. padding: 20rpx;
  544. background: $hint-cream-bg;
  545. border-top: 1rpx solid $hint-cream-border;
  546. }
  547. .login-hint-text {
  548. font-size: calc(24rpx * var(--font-scale, 1));
  549. color: $hint-gold-ink;
  550. }
  551. .bottom-spacer {
  552. height: 120rpx;
  553. }
  554. .grid {
  555. display: flex;
  556. flex-wrap: wrap;
  557. padding: 20rpx;
  558. justify-content: space-between;
  559. }
  560. .product-card {
  561. width: 49%;
  562. background: $app-surface;
  563. border-radius: 16rpx;
  564. overflow: hidden;
  565. margin-bottom: 20rpx;
  566. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  567. }
  568. .cover {
  569. width: 100%;
  570. height: 320rpx;
  571. background: $facade-fill;
  572. }
  573. .card-body {
  574. padding: 16rpx;
  575. }
  576. .product-name {
  577. display: block;
  578. font-size: calc(28rpx * var(--font-scale, 1));
  579. color: $facade-text-strong;
  580. lines: 2;
  581. overflow: hidden;
  582. text-overflow: ellipsis;
  583. display: -webkit-box;
  584. -webkit-line-clamp: 2;
  585. -webkit-box-orient: vertical;
  586. margin-bottom: 12rpx;
  587. }
  588. .price-row {
  589. display: flex;
  590. align-items: baseline;
  591. margin-bottom: 8rpx;
  592. }
  593. .price {
  594. font-size: calc(32rpx * var(--font-scale, 1));
  595. color: $brand-primary;
  596. font-weight: bold;
  597. margin-right: 12rpx;
  598. }
  599. .member-price {
  600. font-size: calc(22rpx * var(--font-scale, 1));
  601. color: $facade-text-muted;
  602. }
  603. .vendor-name {
  604. font-size: calc(22rpx * var(--font-scale, 1));
  605. color: $facade-text-muted;
  606. }
  607. .loading-wrap,
  608. .empty-wrap {
  609. display: flex;
  610. flex-direction: column;
  611. align-items: center;
  612. padding-top: 200rpx;
  613. }
  614. .loading-text {
  615. font-size: calc(26rpx * var(--font-scale, 1));
  616. color: $facade-text-muted;
  617. }
  618. .empty-icon {
  619. font-size: calc(100rpx * var(--font-scale, 1));
  620. margin-bottom: $uni-space-lg;
  621. }
  622. .empty-text {
  623. font-size: calc(28rpx * var(--font-scale, 1));
  624. color: $facade-text-muted;
  625. }
  626. .loading-more,
  627. .no-more {
  628. text-align: center;
  629. padding: $uni-space-page;
  630. }
  631. .loading-text {
  632. font-size: calc(24rpx * var(--font-scale, 1));
  633. color: $facade-text-muted;
  634. }
  635. .no-more-text {
  636. font-size: calc(24rpx * var(--font-scale, 1));
  637. color: $facade-text-ghost;
  638. }
  639. /* Loading skeleton grid */
  640. .skeleton-grid {
  641. display: flex;
  642. flex-wrap: wrap;
  643. padding: 20rpx;
  644. justify-content: space-between;
  645. }
  646. .skeleton-card {
  647. width: 49%;
  648. background: $app-surface;
  649. border-radius: 16rpx;
  650. overflow: hidden;
  651. margin-bottom: 20rpx;
  652. }
  653. .skeleton-img {
  654. width: 100%;
  655. height: 320rpx;
  656. background: linear-gradient(90deg, $facade-fill 25%, $facade-fill-4 50%, $facade-fill 75%);
  657. background-size: 200% 100%;
  658. animation: shimmer 1.5s infinite;
  659. }
  660. .skeleton-body {
  661. padding: 16rpx;
  662. }
  663. .skeleton-line {
  664. height: 24rpx;
  665. border-radius: 8rpx;
  666. background: linear-gradient(90deg, $facade-fill 25%, $facade-fill-4 50%, $facade-fill 75%);
  667. background-size: 200% 100%;
  668. animation: shimmer 1.5s infinite;
  669. }
  670. .skeleton-title { width: 70%; margin-bottom: 12rpx; }
  671. .skeleton-price { width: 40%; margin-bottom: 8rpx; }
  672. .skeleton-vendor { width: 50%; }
  673. @keyframes shimmer {
  674. 0% { background-position: 200% 0; }
  675. 100% { background-position: -200% 0; }
  676. }
  677. /* Product grid fade-in */
  678. .grid.fade-in {
  679. animation: gridFadeIn 0.3s ease-out;
  680. }
  681. @keyframes gridFadeIn {
  682. from { opacity: 0; transform: translateY(10rpx); }
  683. to { opacity: 1; transform: translateY(0); }
  684. }
  685. </style>