index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="container">
  3. <view class="navBarBox">
  4. <!-- 状态栏占位 -->
  5. <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
  6. <!-- 真正的导航栏内容 -->
  7. <view class="navBar text-600">
  8. 书架
  9. </view>
  10. </view>
  11. <view class="pdy-30 pdx-30 flex fd_c">
  12. <view class="flex ai_center">
  13. <view class="text-32 text-400">最近阅读</view>
  14. <view class="flex ai_center mgl-20">
  15. <svg t="1752220550288" class="w-36 h-36" fill="#999" viewBox="0 0 1024 1024" version="1.1"
  16. xmlns="http://www.w3.org/2000/svg" p-id="30594" width="128" height="128">
  17. <path
  18. d="M487.664941 430.878118c-51.154824 0-92.777412 41.622588-92.777412 92.777411s41.622588 92.777412 92.777412 92.777412c51.139765 0 92.762353-41.622588 92.762353-92.777412s-41.607529-92.777412-92.762353-92.777411z m0 155.437176c-34.56 0-62.659765-28.114824-62.659765-62.659765s28.099765-62.659765 62.659765-62.659764c34.544941 0 62.644706 28.114824 62.644706 62.659764s-28.099765 62.659765-62.644706 62.659765z"
  19. p-id="30595"></path>
  20. <path
  21. d="M983.838118 591.088941v-109.839059c0-22.693647-35.553882-31.337412-48.082824-32.602353l-49.799529-4.713411c-9.833412-44.137412-29.003294-87.988706-57.118118-130.665412l27.271529-34.876235c13.281882-16.218353 14.576941-38.008471 2.906353-49.679059l-69.49647-69.12c-11.655529-11.655529-33.084235-10.044235-49.814588 3.629176l-36.562824 29.861647c-39.664941-24.681412-82.898824-41.502118-128.768-50.944l-5.240471-42.134588c-1.204706-12.077176-9.803294-44.8-32.617411-44.8h-97.882353c-22.799059 0-31.382588 32.722824-32.587294 44.845177l-5.436236 39.484235c-41.682824 10.209882-83.109647 28.777412-123.392 55.311059l-41.758117-32.993883c-16.323765-13.327059-38.159059-14.682353-49.754353-3.087059L116.555294 228.246588c-11.640471 11.655529-9.953882 33.114353 3.749647 49.844706l35.674353 43.776A389.391059 389.391059 0 0 0 107.504941 442.729412l-68.773647 5.918117C18.296471 450.695529 5.029647 464.414118 5.029647 481.264941v97.882353c0 16.820706 13.266824 30.539294 33.626353 32.587294l70.294588 6.02353a389.752471 389.752471 0 0 0 48.956236 118.889411l-37.376 45.718589c-13.718588 16.745412-15.329882 38.098824-3.749648 49.664l69.150118 69.225411c11.595294 11.610353 32.918588 10.074353 49.588706-3.538823l45.176471-36.698353a392.809412 392.809412 0 0 0 119.521882 50.748235l5.842823 55.43153c2.093176 20.946824 16.112941 36.743529 32.587295 36.743529h97.882353c16.474353 0 30.494118-15.796706 32.572235-36.668235l5.451294-51.922824c4.080941 0 8.402824 0.240941 12.830118 0.481883 11.896471 0.647529 24.199529 1.129412 36.231529-2.243765a243.380706 243.380706 0 0 0 153.871059 54.362353c135.107765 0 245.022118-109.914353 245.022117-245.022118 0-47.104-13.447529-92.446118-38.671058-131.84z m-394.827294 295.002353c-9.984-0.542118-20.269176-1.114353-30.584471 0.737882a14.878118 14.878118 0 0 0-12.182588 13.101177l-6.731294 64.301176c-0.632471 6.264471-3.403294 9.682824-2.981647 9.938824l-96.527059 0.271059c-0.948706-0.542118-3.719529-3.945412-4.367059-10.285177l-6.957177-66.123294a14.848 14.848 0 0 0-11.715764-12.995765 363.52 363.52 0 0 1-128.873412-54.768941 14.908235 14.908235 0 0 0-17.724235 0.768l-53.669647 43.595294c-4.562824 3.734588-8.613647 4.577882-10.661647 4.638118l-67.222589-67.312941c0.015059-1.792 1.008941-6.189176 4.74353-10.767059l44.227764-54.106353a14.878118 14.878118 0 0 0 0.873412-17.648941c-25.554824-38.415059-43.354353-81.588706-52.901647-128.331294a14.863059 14.863059 0 0 0-12.995765-11.821177l-82.612705-7.168c-6.189176-0.617412-8.417882-2.966588-8.493177-2.981647l-0.105412-97.234823c0.286118-0.587294 2.680471-3.072 8.704-3.674353l80.459294-7.092706a14.908235 14.908235 0 0 0 13.025883-12.001882 360.568471 360.568471 0 0 1 52.60047-130.198589 14.863059 14.863059 0 0 0-0.903529-17.513411l-42.285177-52.10353c-3.809882-4.653176-4.713412-9.155765-4.698352-10.962823l67.463529-67.734589c1.746824-0.195765 6.128941 0.647529 10.857412 4.502589l50.507294 39.951058a14.863059 14.863059 0 0 0 17.679059 0.677648c43.324235-29.952 87.883294-49.664 132.457411-59.045648 6.369882-1.340235 11.113412-6.174118 11.745883-12.634352l6.475294-50.898824c0.737882-7.363765 4.080941-17.829647 6.550588-17.829647h90.714353c2.364235 0 5.812706 10.029176 6.595765 17.679059l6.249412 52.103529a14.908235 14.908235 0 0 0 12.242823 13.312 363.248941 363.248941 0 0 1 137.953882 54.964706 14.863059 14.863059 0 0 0 17.573647-0.858353l44.965648-36.442353c4.653176-3.794824 9.728-4.577882 10.902588-4.638117l67.809882 67.132235c0.331294 1.099294-0.015059 5.948235-4.336941 11.203765L798.72 303.435294a14.908235 14.908235 0 0 0-0.527059 17.633882c31.533176 45.613176 51.937882 92.491294 60.717177 139.369412 1.234824 6.520471 6.580706 11.444706 13.17647 12.077177l60.596706 5.75247c7.890824 0.798118 21.022118 4.261647 21.022118 6.836706v79.314824a193.219765 193.219765 0 0 0-27.934118-26.985412 238.095059 238.095059 0 0 0-148.299294-51.983059c-1.776941 0-3.493647 0.225882-5.255529 0.271059a286.494118 286.494118 0 0 0-284.566589-249.344c-158.433882 0-287.307294 128.888471-287.307294 287.307294s128.888471 287.307294 287.307294 287.307294c22.407529 0 44.619294-2.725647 66.243765-7.830588a236.694588 236.694588 0 0 0 36.577882 66.198588c4.698353 5.963294 9.758118 11.640471 14.968471 17.121883-5.104941 0.165647-10.676706-0.075294-16.429176-0.39153z m168.116705-399.631059c-121.434353 10.375529-217.118118 112.368941-217.118117 236.453647 0 22.633412 3.282824 44.664471 9.366588 65.822118-20.148706 4.668235-40.824471 7.168-61.696 7.168-150.121412 0-272.248471-122.127059-272.248471-272.248471s122.127059-272.248471 272.248471-272.24847a271.435294 271.435294 0 0 1 269.447529 235.053176z m20.35953 451.358118c-56.500706 0-97.174588-16.248471-138.330353-50.432-3.930353-3.267765-10.812235-5.240471-16.941177-5.12-0.090353-0.090353-0.120471-0.225882-0.210823-0.316235a223.367529 223.367529 0 0 1-54.964706-86.633412 7.499294 7.499294 0 0 0-0.120471-3.162353 7.303529 7.303529 0 0 0-1.746823-3.041882 222.539294 222.539294 0 0 1-10.11953-66.198589c0-122.639059 99.779765-222.418824 222.433883-222.418823 51.079529 0 99.102118 16.835765 138.887529 48.670117 16.685176 13.372235 28.431059 26.051765 35.870118 38.79153 0.090353 0.165647 0.286118 0.225882 0.391529 0.37647a14.757647 14.757647 0 0 0 1.867294 12.67953 213.699765 213.699765 0 0 1 37.903059 121.886118c-0.015059 118.512941-96.421647 214.919529-214.919529 214.919529z"
  22. p-id="30596"></path>
  23. <path
  24. d="M776.252235 541.093647c-95.472941 0-173.146353 77.673412-173.146353 173.146353s77.673412 173.146353 173.146353 173.146353S949.383529 809.712941 949.383529 714.24s-77.658353-173.146353-173.131294-173.146353z m0 331.233882c-87.175529 0-158.087529-70.912-158.087529-158.087529s70.912-158.087529 158.087529-158.087529c87.160471 0 158.072471 70.912 158.072471 158.087529s-70.912 158.087529-158.072471 158.087529z"
  25. p-id="30597"></path>
  26. <path
  27. d="M776.252235 632.892235c-44.860235 0-81.347765 36.487529-81.347764 81.347765s36.502588 81.347765 81.347764 81.347765 81.332706-36.487529 81.332706-81.347765-36.472471-81.347765-81.332706-81.347765z m0 132.577883c-28.250353 0-51.230118-22.979765-51.230117-51.230118s22.979765-51.230118 51.230117-51.230118 51.215059 22.979765 51.215059 51.230118-22.964706 51.230118-51.215059 51.230118z"
  28. p-id="30598"></path>
  29. </svg>
  30. <view class="text-gray">管理</view>
  31. <checkbox-group class="mgl-30">
  32. <label>
  33. <checkbox value="cb" iconColor="#000" :checked="true" />全选
  34. </label>
  35. </checkbox-group>
  36. </view>
  37. </view>
  38. <scroll-view scroll-y class="scroll">
  39. <view class="book_list">
  40. <view v-for="item in 15" class="book_item" @click="toBookdetail">
  41. <checkbox-group class="check">
  42. <label>
  43. <checkbox value="cb" backgroundColor="transparent" activeBackgroundColor="transparent"
  44. borderColor="#dfe2e5" iconColor="#FFF" :checked="true" />
  45. </label>
  46. </checkbox-group>
  47. <view class="book_top">
  48. <image class="book_img" src="" mode="scaleToFill" />
  49. <view class="book_history">读到1000章</view>
  50. </view>
  51. <view class="book_name ellipsis">斗破苍穹斗破苍穹斗破苍穹斗破苍穹斗破苍穹</view>
  52. <view class="book_author ellipsis">天蚕土豆</view>
  53. </view>
  54. </view>
  55. <view class="scroll_bottom">已经是全部了~~</view>
  56. </scroll-view>
  57. </view>
  58. <!-- 引入自定义 TabBar -->
  59. <custom-tabbar :currentIndex='0' />
  60. </view>
  61. </template>
  62. <script setup>
  63. import { ref, onBeforeMount } from "vue";
  64. import CustomTabbar from "@/components/custom-tabbar.vue";
  65. // 状态栏高度
  66. let statusBarHeight = ref(0);
  67. // 导航栏高度
  68. let navBarHeight = ref(0);
  69. onBeforeMount(() => {
  70. statusBarHeight.value = uni.getSystemInfoSync()['statusBarHeight'];
  71. // #ifndef H5
  72. const custom = uni.getMenuButtonBoundingClientRect();
  73. // 导航栏的高度 = 胶囊的高度 + (胶囊距离顶部的距离 - 状态栏的高度)* 2
  74. // 即胶囊的上下边距
  75. navBarHeight.value = custom.height + (custom.top - statusBarHeight.value) * 2;
  76. // #endif
  77. });
  78. const toBookdetail = () => {
  79. uni.navigateTo({ url: '/pages/redBook/index' })
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .container {
  84. overflow: hidden;
  85. height: calc(100vh - 100rpx);
  86. .navBarBox {
  87. .navBar {
  88. width: 100%;
  89. height: 80rpx !important;
  90. line-height: 80rpx;
  91. padding-left: 30rpx;
  92. font-size: 32rpx;
  93. color: #333;
  94. }
  95. }
  96. .scroll {
  97. margin-top: 30rpx;
  98. width: 100%;
  99. overflow-y: auto;
  100. height: calc(100vh - 300rpx);
  101. .book_list {
  102. display: grid;
  103. justify-content: space-between;
  104. grid-template-columns: repeat(auto-fill, 172rpx);
  105. grid-gap: 10px;
  106. // padding-bottom: 100rpx;
  107. .book_item {
  108. position: relative;
  109. width: 172rpx;
  110. padding: 10rpx 0 20rpx 0;
  111. .check {
  112. position: absolute;
  113. right: 0;
  114. top: 15rpx;
  115. z-index: 99;
  116. }
  117. .book_top {
  118. width: 172rpx; //86
  119. height: 226rpx; //113
  120. border-radius: 10rpx;
  121. position: relative;
  122. .book_img {
  123. width: 100%;
  124. height: 100%;
  125. background-color: rgb(120, 140, 148);
  126. border-radius: 10rpx;
  127. }
  128. .book_history {
  129. position: absolute;
  130. right: 0;
  131. bottom: 0;
  132. font-size: 16rpx;
  133. color: #fff;
  134. padding: 8rpx 16rpx;
  135. background-color: rgba(0, 0, 0, 0.3);
  136. border-radius: 10rpx;
  137. }
  138. }
  139. .book_name {
  140. margin-top: 16rpx;
  141. font-size: 28rpx;
  142. color: #333;
  143. }
  144. .book_author {
  145. margin-top: 6rpx;
  146. font-size: 22rpx;
  147. color: #c4c4c4;
  148. }
  149. // 超出2行
  150. .ellipsis {
  151. line-height: 1.2;
  152. overflow: hidden;
  153. text-overflow: ellipsis;
  154. display: -webkit-box;
  155. line-clamp: 2;
  156. -webkit-line-clamp: 2;
  157. /* 限制显示2行 */
  158. -webkit-box-orient: vertical;
  159. }
  160. }
  161. }
  162. .scroll_bottom {
  163. width: 100%;
  164. height: 200rpx;
  165. display: flex;
  166. align-items: center;
  167. justify-content: center;
  168. color: #aaa5a5;
  169. }
  170. }
  171. }
  172. </style>