index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <route lang="json">
  2. {
  3. "style": {
  4. "navigationBarTitleText": "获取榜单",
  5. "navigationStyle": "custom"
  6. }
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import dayjs from 'dayjs'
  11. import { useUserStore } from '@/store'
  12. import { storeToRefs } from 'pinia'
  13. import { leaderV1, leaderV2, leaderV3 } from '@/core/libs/svgs'
  14. import { getCollectionBadgeNotice } from '@/core/libs/requests'
  15. const id = ref()
  16. const theTop3 = ref<any[]>([])
  17. const otherTop = ref<any[]>([])
  18. const { data: rankList, run: setRankList } = useRequest(
  19. () => getCollectionBadgeNotice({ badgeId: id.value }),
  20. {
  21. initialData: [],
  22. },
  23. )
  24. const handleClickLeft = () => {
  25. uni.navigateBack()
  26. }
  27. onLoad(async (query?: Record<string | 'active' | 'id' | 'isShared', string>) => {
  28. if (query?.id) {
  29. id.value = query.id
  30. await setRankList()
  31. theTop3.value = rankList.value.length >= 3 ? rankList.value.slice(0, 3) : rankList.value
  32. otherTop.value = rankList.value.slice(3)
  33. }
  34. })
  35. </script>
  36. <template>
  37. <wd-navbar
  38. fixed
  39. placeholder
  40. left-arrow
  41. safeAreaInsetTop
  42. custom-style="background-color: #22201E !important;"
  43. @click-left="handleClickLeft"
  44. :bordered="false"
  45. >
  46. <template #title>
  47. <view class="wd-navbar__title" style="color: #fff !important">获取榜单</view>
  48. </template>
  49. <template #left>
  50. <wd-icon name="thin-arrow-left" color="#fff" size="24px"></wd-icon>
  51. </template>
  52. </wd-navbar>
  53. <div class="bg-[#22201E] h-full flex flex-[1] flex-col flex-grow">
  54. <!-- 头部区域 -->
  55. <div class="h-[134px] px-[14px]">
  56. <div class="h-[26px] color-[#999999] font-size-[12px] text-center lh-[26px]">
  57. 按获取时间排序
  58. </div>
  59. <div class="mt-[42px] w-[calc(100vw-28px)] mx-[auto] flex justify-around">
  60. <!-- 第二名 leader2 -->
  61. <div class="w-[60px] h-[60px] relative">
  62. <div class="absolute top-[-16px] left-[50%] translate-x-[-50%]">
  63. <wd-img :src="leaderV2" width="46" height="23"></wd-img>
  64. </div>
  65. <!-- 头像 -->
  66. <div
  67. class="w-[60px] h-[60px] rounded-full bg-[#999999] border-[1px] border-[#D1E0EE] border-solid absolute top-[0] left-[0] overflow-hidden z-0"
  68. >
  69. <wd-img :src="theTop3[1]?.avatar" width="60" height="60" class="rounded-full"></wd-img>
  70. </div>
  71. <div
  72. class="absolute bottom-[-16px] left-[50%] translate-x-[-50%] sign-bg2 color-[#657A98] text-center font-size-[12px] fw-400 w-[42px] h-[16px]"
  73. >
  74. NO.2
  75. </div>
  76. </div>
  77. <!-- 第一名 leader1 -->
  78. <div class="w-[66px] h-[66px] relative mt-[-13px]">
  79. <div class="absolute top-[-18px] left-[25px] translate-x-[-20px]">
  80. <wd-img :src="leaderV1" width="50" height="25"></wd-img>
  81. </div>
  82. <!-- 头像 -->
  83. <div
  84. class="w-[66px] h-[66px] rounded-full bg-[#999999] border-[1px] border-[#FFC700] border-solid absolute top-[0] left-[0] overflow-hidden z-0"
  85. >
  86. <wd-img :src="theTop3[0]?.avatar" width="66" height="66" class="rounded-full"></wd-img>
  87. </div>
  88. <div
  89. class="absolute bottom-[-12px] left-[23px] translate-x-[-16px] sign-bg1 color-[#FFDF79] text-center font-size-[12px] fw-400 w-[46px] h-[17px]"
  90. >
  91. NO.1
  92. </div>
  93. </div>
  94. <!-- 第三名 leader3 -->
  95. <div class="w-[60px] h-[60px] relative">
  96. <div class="absolute top-[-16px] left-[50%] translate-x-[-50%]">
  97. <wd-img :src="leaderV3" width="46" height="23"></wd-img>
  98. </div>
  99. <!-- 头像 -->
  100. <div
  101. class="w-[60px] h-[60px] rounded-full bg-[#999999] border-[1px] border-[#A87F79] border-solid absolute top-[0] left-[0] overflow-hidden z-0"
  102. >
  103. <wd-img :src="theTop3[2]?.avatar" width="60" height="60" class="rounded-full"></wd-img>
  104. </div>
  105. <div
  106. class="absolute bottom-[-16px] left-[50%] translate-x-[-50%] sign-bg3 color-[#856660] text-center font-size-[12px] fw-400 w-[42px] h-[16px]"
  107. >
  108. NO.3
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!-- 头部 领奖台 -->
  114. <div class="bg-gradient-to-b pt-[12px] from-[#22201E] to-[#191818] h-[102px]">
  115. <div class="flex justify-around h-[95px] w-[calc(100vw-28px)] mx-[auto]">
  116. <div
  117. class="w-[87px] pr-[50px] h-[95px] mr-[-50px] relative z-5 bg-[url(https://image.zhuchaohui.com/zhucaohui/e5b96189f235d0dee01209cfe50a1e50751459e03099027528f62a8878a4f1a9.png)] bg-[length:100%_100%]"
  118. >
  119. <div class="absolute bottom-[20px] left-[0px]">
  120. <div class="w-[87px] color-[#fff] font-size-[14px] fw-400 lh-[26px] text-center">
  121. {{ theTop3[1]?.name }}
  122. </div>
  123. <div class="w-[87px] color-[#BDBDBD] font-size-[12px] fw-500 text-center">
  124. {{ dayjs(theTop3[1]?.acquisitionTime).format('YYYY-MM-DD') }}
  125. </div>
  126. </div>
  127. </div>
  128. <div
  129. class="w-[137px] h-[107px] mt-[-12px] relative z-10 bg-[url(https://image.zhuchaohui.com/zhucaohui/e5b96189f235d0dee01209cfe50a1e50751459e03099027528f62a8878a4f1a9.png)] bg-[length:100%_100%]"
  130. >
  131. <div class="absolute bottom-[20px] left-[0px] w-[137px]">
  132. <div class="color-[#fff] font-size-[14px] fw-400 lh-[26px] text-center">
  133. {{ theTop3[0]?.name }}
  134. </div>
  135. <div class="color-[#BDBDBD] font-size-[12px] fw-500 text-center">
  136. {{ dayjs(theTop3[0]?.acquisitionTime).format('YYYY-MM-DD') }}
  137. </div>
  138. </div>
  139. </div>
  140. <div
  141. class="w-[97px] h-[95px] ml-[-40px] pl-[40px] relative z-5 bg-[url(https://image.zhuchaohui.com/zhucaohui/e5b96189f235d0dee01209cfe50a1e50751459e03099027528f62a8878a4f1a9.png)] bg-[length:100%_100%]"
  142. >
  143. <div class="absolute bottom-[20px] right-[0px]">
  144. <div class="w-[97px] color-[#fff] font-size-[14px] fw-400 lh-[26px] text-center">
  145. {{ theTop3[2]?.name }}
  146. </div>
  147. <div class="w-[97px] color-[#BDBDBD] font-size-[12px] fw-500 text-center">
  148. {{ dayjs(theTop3[2]?.acquisitionTime).format('YYYY-MM-DD') }}
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <!-- 其他人员 -->
  155. <div class="bg-gradient-to-t from-[#22201E] to-[#191818]">
  156. <div
  157. class="h-[626px] bg-gradient-to-b from-[#22201E] to-[#191818] m-[14px] p-[14px]"
  158. style="border-radius: 16px"
  159. >
  160. <div
  161. class="flex justify-between items-center pb-[20px]"
  162. v-for="item in otherTop"
  163. :key="item.rank1"
  164. >
  165. <div class="w-[20%] color-[#666] text-center font-size-[18px] fw-700">
  166. {{ item.rank1 >= 10 ? item.rank1 : '0' + item.rank1 }}
  167. </div>
  168. <div class="w-[50%] flex items-center">
  169. <wd-img :src="item.avatar" width="44" height="44"></wd-img>
  170. <div class="color-[#fff] font-size-[16px] fw-400 lh-[26px] ml-[10px]">
  171. {{ item.name }}
  172. </div>
  173. </div>
  174. <div class="w-[30%] text-center font-size-[14px] fw-500 color-[#BDBDBD]">
  175. {{ dayjs(item.acquisitionTime).format('YYYY-MM-DD') }}
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </template>
  182. <style lang="scss" scoped>
  183. .sign-bg1 {
  184. border-radius: 20px;
  185. border: 1px solid #e5c57f;
  186. background: linear-gradient(90deg, #f9a939 0%, #d37c2b 100%);
  187. }
  188. .sign-bg2 {
  189. border-radius: 18.603px;
  190. border: 0.75px solid #d5e8ff;
  191. background: linear-gradient(90deg, #d9e4f7 0%, #a8b9d3 100%);
  192. }
  193. .sign-bg3 {
  194. border-radius: 18.603px;
  195. border: 1px solid #dcc4ba;
  196. background: linear-gradient(90deg, #fce7dc 0%, #c39f98 100%);
  197. }
  198. </style>