hot-sell.vue 3.4 KB

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