图书馆小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
8.9 KiB

2 weeks ago
1 week ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
1 week ago
2 weeks ago
1 week ago
2 weeks ago
2 weeks ago
2 weeks ago
  1. <template>
  2. <view>
  3. <view class="ranking-header">
  4. <image
  5. class="ranking-heander-bg"
  6. src="@/static/images/ranking-bg.png"
  7. mode="aspectFill"
  8. />
  9. <view class="ranking-header-txt">
  10. <view class="ranking-title">
  11. <uni-icons custom-prefix="iconfont" type="icon-paihangbang2" size="20"></uni-icons>
  12. <text class="title-text">借阅排行</text>
  13. </view>
  14. <text class="ranking-header-tip">由本图书馆累计借阅而定期生成排行榜单</text>
  15. <!-- <text class="ranking-num">{{ bookList.length }}</text> -->
  16. </view>
  17. </view>
  18. <view class="ranking-list">
  19. <view
  20. class="ranking-item"
  21. :class="[
  22. index === 0 ? 'first-item' : '',
  23. index === 1 ? 'two-item' : '',
  24. index === 2 ? 'three-item' : ''
  25. ]"
  26. v-for="(item, index) in bookList"
  27. :key="index"
  28. >
  29. <!-- 第一名 -->
  30. <uni-icons class="ranking-icon" v-if="index === 0" custom-prefix="iconfont" type="icon-TOP2" size="26" color="#E6CB97"></uni-icons>
  31. <!-- 第二名 -->
  32. <uni-icons class="ranking-icon" v-if="index === 1" custom-prefix="iconfont" type="icon-TOP" size="26" color="#a2b2c3"></uni-icons>
  33. <!-- 第三名 -->
  34. <uni-icons class="ranking-icon" v-if="index === 2" custom-prefix="iconfont" type="icon-TOP1" size="26" color="#D0BA9D"></uni-icons>
  35. <!-- 4~15 显示数字 -->
  36. <view v-if="index >= 3" class="ranking-common-icon">
  37. <uni-icons custom-prefix="iconfont" type="icon-tag" size="28" color="#8899ab"></uni-icons>
  38. <text class="common-num">{{ index + 1 }}</text>
  39. </view>
  40. <!-- 书籍封面 -->
  41. <view class="ranking-item-img">
  42. <image
  43. class="book-cover"
  44. :src="item.cover"
  45. mode="scaleToFill"
  46. />
  47. </view>
  48. <!-- 书籍信息 -->
  49. <view class="ranking-book-info">
  50. <text class="book-info-title">{{ item.title }}</text>
  51. <text class="book-info-name">{{ item.author }}</text>
  52. <text class="book-info-desc line-clamp-3 ">{{ item.desc }}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. bookList: [
  63. {
  64. cover: "https://qiniu.aiyxlib.com/1606124577077",
  65. title: "名侦探柯南",
  66. author: "青山刚昌",
  67. desc: "《名侦探柯南》是日本漫画家青山刚昌创作的著名侦探漫画作品,讲述了高中生侦探工藤新一被灌下毒药后身体缩小,化名为江户川柯南,秘密调查黑暗组织,并解决无数离奇案件的故事。作品兼具推理、冒险、情感与幽默元素,是全球极具影响力的经典漫画。"
  68. },
  69. {
  70. cover: "https://qiniu.aiyxlib.com/1606124577077",
  71. title: "海贼王",
  72. author: "尾田荣一郎",
  73. desc: "《海贼王》讲述了主角蒙奇·D·路飞为了成为海贼王,与伙伴们在伟大航路上冒险,寻找传说中的One Piece的故事。"
  74. },
  75. {
  76. cover: "https://qiniu.aiyxlib.com/1606124577077",
  77. title: "火影忍者",
  78. author: "岸本齐史",
  79. desc: "《火影忍者》讲述了鸣人从小被孤立,通过努力成为忍者,最终成为英雄守护村子的故事。"
  80. },
  81. {
  82. cover: "https://qiniu.aiyxlib.com/1606124577077",
  83. title: "三体",
  84. author: "刘慈欣",
  85. desc: "《三体》是刘慈欣创作的长篇科幻小说,讲述了人类与三体文明之间的生死博弈。"
  86. },
  87. {
  88. cover: "https://qiniu.aiyxlib.com/1606124577077",
  89. title: "盗墓笔记",
  90. author: "南派三叔",
  91. desc: "《盗墓笔记》讲述了吴邪等人在古墓中探险,揭开一系列神秘谜团的故事。"
  92. },
  93. {
  94. cover: "https://qiniu.aiyxlib.com/1606124577077",
  95. title: "斗罗大陆",
  96. author: "唐家三少",
  97. desc: "《斗罗大陆》讲述了唐三穿越到斗罗大陆,一步步成为魂师巅峰的故事。"
  98. },
  99. {
  100. cover: "https://qiniu.aiyxlib.com/1606124577077",
  101. title: "斗破苍穹",
  102. author: "天蚕土豆",
  103. desc: "《斗破苍穹》讲述了萧炎从废柴少年逆袭成为斗气大陆最强者的故事。"
  104. },
  105. {
  106. cover: "https://qiniu.aiyxlib.com/1606124577077",
  107. title: "西游记",
  108. author: "吴承恩",
  109. desc: "《西游记》是中国古典四大名著之一,讲述了唐僧师徒西天取经的故事。"
  110. },
  111. {
  112. cover: "https://qiniu.aiyxlib.com/1606124577077",
  113. title: "红楼梦",
  114. author: "曹雪芹",
  115. desc: "《红楼梦》以贾史王薛四大家族为背景,讲述了贾宝玉与林黛玉的爱情悲剧。"
  116. },
  117. {
  118. cover: "https://qiniu.aiyxlib.com/1606124577077",
  119. title: "水浒传",
  120. author: "施耐庵",
  121. desc: "《水浒传》讲述了108位好汉在梁山起义,最终接受招安的故事。"
  122. },
  123. {
  124. cover: "https://qiniu.aiyxlib.com/1606124577077",
  125. title: "三国演义",
  126. author: "罗贯中",
  127. desc: "《三国演义》描写了从东汉末年到西晋初年的群雄割据与英雄争霸。"
  128. },
  129. {
  130. cover: "https://qiniu.aiyxlib.com/1606124577077",
  131. title: "沉默的大多数",
  132. author: "王小波",
  133. desc: "《沉默的大多数》是王小波的杂文精选,探讨了社会、文化与人性。"
  134. },
  135. {
  136. cover: "https://qiniu.aiyxlib.com/1606124577077",
  137. title: "活着",
  138. author: "余华",
  139. desc: "《活着》讲述了福贵在苦难中坚守生命的故事。"
  140. },
  141. {
  142. cover: "https://qiniu.aiyxlib.com/1606124577077",
  143. title: "人间失格",
  144. author: "太宰治",
  145. desc: "《人间失格》讲述了主人公叶藏从青年到颓废堕落的人生历程。"
  146. },
  147. {
  148. cover: "https://qiniu.aiyxlib.com/1606124577077",
  149. title: "解忧杂货店",
  150. author: "东野圭吾",
  151. desc: "《解忧杂货店》讲述了一家神奇杂货店帮助人们解决烦恼的温暖故事。"
  152. }
  153. ]
  154. };
  155. }
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. .ranking-header{
  160. position: relative;
  161. width: 100%;
  162. height: 150px;
  163. .ranking-heander-bg{
  164. width: 100%;
  165. height: 100%;
  166. }
  167. .ranking-header-txt{
  168. position: absolute;
  169. top: 0;
  170. left: 0;
  171. height: 150px;
  172. padding: 20px;
  173. display: flex;
  174. flex-direction: column;
  175. justify-content: flex-start;
  176. .ranking-title{
  177. display: flex;
  178. justify-content: flex-start;
  179. align-items: center;
  180. font-size: 26px;
  181. font-weight: bold;
  182. color: #1a1a1a;
  183. ::v-deep .uni-icons{
  184. color: #01a4fe !important;
  185. }
  186. .title-text{
  187. // 多层阴影 = 立体 + 好看
  188. text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15),
  189. 0 1px 2px rgba(0, 0, 0, 0.1);
  190. letter-spacing: 1px; /* 文字间距更舒服 */
  191. margin-left: 8px;
  192. }
  193. }
  194. .ranking-header-tip,
  195. .ranking-num{
  196. color: #333;
  197. font-size: 14px;
  198. padding-top: 15px;
  199. }
  200. }
  201. }
  202. .ranking-list{
  203. position: relative;
  204. background-color: #fff;
  205. border-radius: 26px 26px 0 0;
  206. margin-top: -30px;
  207. z-index: 999;
  208. padding: 20px 0;
  209. }
  210. .ranking-item{
  211. position: relative;
  212. display: flex;
  213. justify-content: space-between;
  214. margin: 30px 20px 0 20px;
  215. padding: 10px;
  216. background-color: #f7f8fc;
  217. border-radius: 6px;
  218. .ranking-item-img{
  219. margin-right: 10px;
  220. .book-cover{
  221. width: 100px;
  222. height: 150px;
  223. border-radius: 10px;
  224. padding: 0 10px;
  225. background-color: #fff;
  226. }
  227. }
  228. .ranking-book-info{
  229. flex: 1;
  230. display: flex;
  231. flex-direction: column;
  232. font-size: 14px;
  233. color: #666;
  234. .book-info-title{
  235. font-size: 16px;
  236. font-weight: bold;
  237. color: #000;
  238. padding-top: 10px;
  239. }
  240. .book-info-name,
  241. .book-info-desc{
  242. padding-top: 10px;
  243. line-height: 24px;
  244. }
  245. }
  246. &.first-item{
  247. background-color: #fBF0BB;
  248. }
  249. &.two-item{
  250. background-color: #e9eff6;
  251. }
  252. &.three-item{
  253. background-color: #fBF0BB;
  254. }
  255. .ranking-icon{
  256. position: absolute;
  257. right: 10px;
  258. top: -10px;
  259. // width: 64px;
  260. // height: 28px;
  261. }
  262. .ranking-common-icon{
  263. position: absolute;
  264. right: 10px;
  265. top: -4px;
  266. .common-num{
  267. position: absolute;
  268. left: 0;
  269. top: 0;
  270. width: 28px;
  271. height: 28px;
  272. text-align: center;
  273. color: #fff;
  274. }
  275. }
  276. }
  277. </style>