hot-sell.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="hot-sell-page">
  3. <!-- Header Background -->
  4. <image class="header-bg" src="/pages-sell/static/hot/top-bg.png" mode="widthFix"></image>
  5. <!-- Custom Navbar -->
  6. <Navbar></Navbar>
  7. <!-- Header Content -->
  8. <view class="header-content">
  9. <view class="title-area">
  10. <text class="main-title">热销榜单</text>
  11. <text class="sub-title">Best Sellers</text>
  12. </view>
  13. </view>
  14. <!-- List Content -->
  15. <view class="list-container">
  16. <hot-sell-item
  17. v-for="(item, index) in bookList"
  18. :key="index"
  19. :rank="index + 1"
  20. :item="item"
  21. ></hot-sell-item>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import HotSellItem from '../components/hot-sell-item/index.vue'
  27. import Navbar from '@/components/navbar/navbar.vue'
  28. export default {
  29. components: {
  30. HotSellItem,
  31. Navbar
  32. },
  33. data() {
  34. return {
  35. statusBarHeight: 20,
  36. bookList: [
  37. {
  38. title: '山河岁月',
  39. author: '本书编写组',
  40. price: '6.80',
  41. originalPrice: '36.80',
  42. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  43. },
  44. {
  45. title: '山河岁月',
  46. author: '本书编写组',
  47. price: '6.80',
  48. originalPrice: '36.80',
  49. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  50. },
  51. {
  52. title: '山河岁月',
  53. author: '本书编写组',
  54. price: '6.80',
  55. originalPrice: '36.80',
  56. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  57. },
  58. {
  59. title: '山河岁月',
  60. author: '本书编写组',
  61. price: '6.80',
  62. originalPrice: '36.80',
  63. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  64. },
  65. {
  66. title: '山河岁月',
  67. author: '本书编写组',
  68. price: '6.80',
  69. originalPrice: '36.80',
  70. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  71. },
  72. {
  73. title: '山河岁月',
  74. author: '本书编写组',
  75. price: '6.80',
  76. originalPrice: '36.80',
  77. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  78. },
  79. {
  80. title: '山河岁月',
  81. author: '本书编写组',
  82. price: '6.80',
  83. originalPrice: '36.80',
  84. cover: 'https://img.yzcdn.cn/vant/cat.jpeg'
  85. }
  86. ]
  87. }
  88. },
  89. created() {
  90. const systemInfo = uni.getSystemInfoSync();
  91. this.statusBarHeight = systemInfo.statusBarHeight || 20;
  92. },
  93. methods: {
  94. goBack() {
  95. uni.navigateBack();
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .hot-sell-page {
  102. min-height: 100vh;
  103. background-color: #fff;
  104. position: relative;
  105. }
  106. .header-bg {
  107. position: fixed;
  108. top: 0;
  109. left: 0;
  110. width: 100%;
  111. height: 458rpx;
  112. z-index: 0;
  113. }
  114. .custom-navbar {
  115. position: fixed;
  116. top: 0;
  117. left: 0;
  118. width: 100%;
  119. z-index: 100;
  120. .navbar-content {
  121. height: 44px;
  122. display: flex;
  123. align-items: center;
  124. padding-left: 40rpx;
  125. .back-icon {
  126. width: 16rpx;
  127. height: 26rpx;
  128. }
  129. }
  130. }
  131. .header-content {
  132. position: relative;
  133. z-index: 1;
  134. padding: 0 40rpx;
  135. height: 200rpx; /* Adjust based on bg image height */
  136. display: flex;
  137. flex-direction: column;
  138. justify-content: center;
  139. margin-top: -20rpx;
  140. .title-area {
  141. .main-title {
  142. font-size: 60rpx;
  143. font-weight: bold;
  144. color: #0B2E16;
  145. display: block;
  146. }
  147. .sub-title {
  148. font-size: 36rpx;
  149. color: #72967D;
  150. }
  151. }
  152. }
  153. .list-container {
  154. position: relative;
  155. z-index: 1;
  156. background-color: #fff;
  157. border-radius: 40rpx 40rpx 0 0; /* Rounded top corners for list area */
  158. padding: 30rpx 40rpx;
  159. min-height: 500rpx;
  160. }
  161. </style>