小说小程序前端代码仓库(小程序)
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
6.3 KiB

  1. <template>
  2. <view class="tipping-page">
  3. <!-- 顶部导航栏 -->
  4. <uv-navbar title="读者亲密值榜单" fixed placeholder></uv-navbar>
  5. <!-- 榜单前三名 -->
  6. <view class="top-three">
  7. <view class="top-item second">
  8. <image class="avatar" :src="topList[1].avatar" mode="aspectFill" />
  9. <view class="name">{{ topList[1].name }}</view>
  10. <view class="score">{{ topList[1].score }} 亲密值</view>
  11. <view class="level">护书使者 五级</view>
  12. </view>
  13. <view class="top-item first">
  14. <image class="avatar" :src="topList[0].avatar" mode="aspectFill" />
  15. <view class="name">{{ topList[0].name }}</view>
  16. <view class="score">{{ topList[0].score }} 亲密值</view>
  17. <view class="level">护书使者 五级</view>
  18. </view>
  19. <view class="top-item third">
  20. <image class="avatar" :src="topList[2].avatar" mode="aspectFill" />
  21. <view class="name">{{ topList[2].name }}</view>
  22. <view class="score">{{ topList[2].score }} 亲密值</view>
  23. <view class="level">护书使者 五级</view>
  24. </view>
  25. </view>
  26. <!-- 榜单列表 -->
  27. <view class="rank-list">
  28. <RankListItem v-for="(item, idx) in rankList" :key="item.id" :rankIcon="idx < 3 ? rankIcons[idx] : ''"
  29. :rankNumImg="idx >= 3 ? ('/static/rank-num-' + (idx+1) + '.png') : ''" medal="/static/medal.png"
  30. :avatar="item.avatar" :name="item.name" :score="item.score" level="护书使者 五级" />
  31. </view>
  32. <!-- 底部按钮 -->
  33. <view class="bottom-btn-area">
  34. <button class="tipping-btn">互动打赏</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import RankListItem from '@/components/novel/RankListItem.vue'
  40. export default {
  41. components: {
  42. RankListItem
  43. },
  44. data() {
  45. return {
  46. topList: [{
  47. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  48. name: '周海',
  49. score: 6785452
  50. },
  51. {
  52. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  53. name: '冯冉冉',
  54. score: 6785452
  55. },
  56. {
  57. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  58. name: '南静',
  59. score: 6785452
  60. }
  61. ],
  62. rankList: [{
  63. id: 4,
  64. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  65. name: '钱胡胡',
  66. score: 5325324
  67. },
  68. {
  69. id: 5,
  70. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  71. name: '冯艺瑄',
  72. score: 4819704
  73. },
  74. {
  75. id: 6,
  76. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  77. name: '王凡宏',
  78. score: 4696874
  79. },
  80. {
  81. id: 7,
  82. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  83. name: '辛书萍',
  84. score: 3722953
  85. },
  86. {
  87. id: 8,
  88. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  89. name: '李婷',
  90. score: 2872476
  91. },
  92. {
  93. id: 9,
  94. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  95. name: '郑盈',
  96. score: 2464869
  97. },
  98. {
  99. id: 10,
  100. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  101. name: '吴承联',
  102. score: 990238
  103. }
  104. ],
  105. rankIcons: [
  106. 'https://img.yzcdn.cn/vant/rank-1.png',
  107. 'https://img.yzcdn.cn/vant/rank-2.png',
  108. 'https://img.yzcdn.cn/vant/rank-3.png'
  109. ]
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .tipping-page {
  116. min-height: 100vh;
  117. background: linear-gradient(180deg, #b86e3b 0%, #e6b07c 100%);
  118. padding-bottom: 40rpx;
  119. }
  120. .top-three {
  121. display: flex;
  122. justify-content: center;
  123. align-items: flex-end;
  124. margin: 40rpx 0 20rpx 0;
  125. .top-item {
  126. display: flex;
  127. flex-direction: column;
  128. align-items: center;
  129. background: #fff7e0;
  130. border-radius: 20rpx;
  131. margin: 0 16rpx;
  132. padding: 24rpx 18rpx 18rpx 18rpx;
  133. box-shadow: 0 4rpx 16rpx 0 rgba(0, 0, 0, 0.08);
  134. position: relative;
  135. width: 180rpx;
  136. .avatar {
  137. width: 90rpx;
  138. height: 90rpx;
  139. border-radius: 50%;
  140. border: 4rpx solid #ffd700;
  141. margin-bottom: 10rpx;
  142. }
  143. .name {
  144. font-size: 28rpx;
  145. font-weight: bold;
  146. color: #b86e3b;
  147. margin-bottom: 6rpx;
  148. }
  149. .score {
  150. font-size: 24rpx;
  151. color: #e6b07c;
  152. margin-bottom: 4rpx;
  153. }
  154. .level {
  155. font-size: 22rpx;
  156. color: #b86e3b;
  157. background: #ffe7b2;
  158. border-radius: 10rpx;
  159. padding: 2rpx 12rpx;
  160. }
  161. }
  162. .first {
  163. transform: scale(1.15);
  164. z-index: 2;
  165. background: #fffbe6;
  166. box-shadow: 0 8rpx 24rpx 0 rgba(255, 215, 0, 0.18);
  167. }
  168. .second,
  169. .third {
  170. z-index: 1;
  171. opacity: 0.95;
  172. }
  173. }
  174. .rank-list {
  175. background: transparent;
  176. margin: 0 24rpx;
  177. margin-top: 20rpx;
  178. .rank-item {
  179. display: flex;
  180. align-items: center;
  181. justify-content: space-between;
  182. background: #fffbe6;
  183. border-radius: 16rpx;
  184. margin-bottom: 18rpx;
  185. box-shadow: 0 2rpx 8rpx 0 rgba(184, 110, 59, 0.06);
  186. padding: 0 24rpx;
  187. height: 100rpx;
  188. .rank-left {
  189. display: flex;
  190. align-items: center;
  191. .rank-icon,
  192. .rank-num-img {
  193. width: 38rpx;
  194. height: 38rpx;
  195. margin-right: 10rpx;
  196. }
  197. .medal {
  198. width: 44rpx;
  199. height: 44rpx;
  200. margin-right: 10rpx;
  201. }
  202. .avatar {
  203. width: 44rpx;
  204. height: 44rpx;
  205. border-radius: 50%;
  206. margin-right: 14rpx;
  207. border: 2rpx solid #ffd700;
  208. object-fit: cover;
  209. }
  210. .name {
  211. font-size: 26rpx;
  212. color: #222;
  213. font-weight: 500;
  214. }
  215. }
  216. .rank-right {
  217. display: flex;
  218. flex-direction: column;
  219. align-items: flex-end;
  220. .score {
  221. font-size: 22rpx;
  222. color: #b86e3b;
  223. }
  224. .level {
  225. font-size: 20rpx;
  226. color: #fff;
  227. background: #e6b07c;
  228. border-radius: 8rpx;
  229. padding: 2rpx 10rpx;
  230. margin-top: 6rpx;
  231. font-weight: 500;
  232. }
  233. }
  234. }
  235. }
  236. .bottom-btn-area {
  237. margin: 40rpx 24rpx 90rpx 24rpx;
  238. display: flex;
  239. flex-direction: column;
  240. gap: 24rpx;
  241. .tipping-btn {
  242. width: 100%;
  243. height: 80rpx;
  244. background: #fffbe6;
  245. color: #b86e3b;
  246. font-size: 32rpx;
  247. border-radius: 40rpx;
  248. font-weight: bold;
  249. letter-spacing: 2rpx;
  250. box-shadow: 0 4rpx 16rpx 0 rgba(184, 110, 59, 0.12);
  251. border: none;
  252. }
  253. }
  254. </style>