国外MOSE官网
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.

324 lines
7.1 KiB

4 days ago
  1. <template>
  2. <view class="ranking-page">
  3. <view class="back-button" @click="goBack">
  4. <uv-icon name="arrow-left" color="#ffffff" size="20"></uv-icon>
  5. </view>
  6. <!-- 排行榜背景 -->
  7. <view class="ranking-background">
  8. <image src="/subPages/static/rank_bg.png" class="bg-image" mode="aspectFill"></image>
  9. <!-- 返回按钮 -->
  10. <!-- 前三名定位布局 -->
  11. <view class="top-three">
  12. <!-- 第二名 -->
  13. <view class="rank-item rank-second">
  14. <image src="@/subPages/static/second.png" class="rank-badge"></image>
  15. <image src="@/static/默认头像.png" class="avatar"></image>
  16. <view class="name">李潇亮</view>
  17. <view class="score">3658积分</view>
  18. </view>
  19. <!-- 第一名 -->
  20. <view class="rank-item rank-first">
  21. <image src="/subPages/static/first.png" class="rank-badge"></image>
  22. <image src="/static/默认头像.png" class="avatar"></image>
  23. <view class="name">李潇亮</view>
  24. <view class="score">4658积分</view>
  25. </view>
  26. <!-- 第三名 -->
  27. <view class="rank-item rank-third">
  28. <image src="/subPages/static/third.png" class="rank-badge"></image>
  29. <image src="/static/默认头像.png" class="avatar"></image>
  30. <view class="name">李潇亮</view>
  31. <view class="score">1658积分</view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 我的排名 -->
  36. <view class="my-ranking">
  37. <view class="my-rank-number">{{ myRanking.rank }}</view>
  38. <view class="my-rank-label">我的排名</view>
  39. <image :src="myRanking.avatar" class="my-avatar"></image>
  40. <view class="my-name">{{ myRanking.name }}</view>
  41. <view class="my-score">{{ myRanking.score }}积分</view>
  42. </view>
  43. <!-- 排行榜列表 -->
  44. <view class="ranking-list">
  45. <view class="list-item" v-for="(item, index) in rankingList" :key="index">
  46. <view class="rank-number">{{ item.rank }}</view>
  47. <image :src="item.avatar" class="list-avatar"></image>
  48. <view class="user-info">
  49. <view class="user-name">{{ item.name }}</view>
  50. </view>
  51. <view class="user-score">{{ item.score }}积分</view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. name: 'Ranking',
  59. data() {
  60. return {
  61. myRanking: {
  62. rank: 15,
  63. name: '李潇亮',
  64. avatar: '/static/默认头像.png',
  65. score: 958
  66. },
  67. rankingList: [
  68. { rank: 4, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  69. { rank: 5, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  70. { rank: 6, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  71. { rank: 7, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  72. { rank: 8, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  73. { rank: 9, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 },
  74. { rank: 10, name: '李潇亮', avatar: '/static/默认头像.png', score: 958 }
  75. ]
  76. }
  77. },
  78. onLoad() {
  79. // 获取排行榜数据
  80. this.getRankingData();
  81. },
  82. methods: {
  83. goBack() {
  84. uni.navigateBack();
  85. },
  86. getRankingData() {
  87. // 模拟获取排行榜数据
  88. console.log('获取排行榜数据');
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. // @import '@/uni.scss';
  95. .ranking-page {
  96. min-height: 100vh;
  97. background-color: #f5f5f5;
  98. }
  99. .back-button {
  100. position: absolute;
  101. top: 60rpx;
  102. left: 30rpx;
  103. width: 60rpx;
  104. height: 60rpx;
  105. // background-color: rgba(0, 0, 0, 0.3);
  106. // border-radius: 50%;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. z-index: 10;
  111. &:active {
  112. background-color: rgba(0, 0, 0, 0.5);
  113. }
  114. }
  115. .ranking-background {
  116. position: relative;
  117. width: 100%;
  118. height: 600rpx;
  119. .bg-image {
  120. width: 100%;
  121. height: 100%;
  122. }
  123. .back-button {
  124. position: absolute;
  125. top: 60rpx;
  126. left: 30rpx;
  127. width: 60rpx;
  128. height: 60rpx;
  129. // background-color: rgba(0, 0, 0, 0.3);
  130. // border-radius: 50%;
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. z-index: 10;
  135. &:active {
  136. background-color: rgba(0, 0, 0, 0.5);
  137. }
  138. }
  139. .top-three {
  140. position: absolute;
  141. top: 0;
  142. left: 0;
  143. width: 100%;
  144. height: 100%;
  145. display: flex;
  146. align-items: flex-end;
  147. justify-content: center;
  148. padding-bottom: 80rpx;
  149. .rank-item {
  150. position: relative;
  151. display: flex;
  152. flex-direction: column;
  153. align-items: center;
  154. margin: 0 40rpx;
  155. .rank-badge {
  156. width: 60rpx;
  157. height: 60rpx;
  158. margin-bottom: 10rpx;
  159. }
  160. .avatar {
  161. width: 80rpx;
  162. height: 80rpx;
  163. border-radius: 50%;
  164. margin-bottom: 10rpx;
  165. border: 4rpx solid #fff;
  166. }
  167. .name {
  168. font-size: 24rpx;
  169. color: #fff;
  170. margin-bottom: 5rpx;
  171. font-weight: bold;
  172. }
  173. .score {
  174. font-size: 20rpx;
  175. color: #fff;
  176. opacity: 0.9;
  177. }
  178. }
  179. .rank-first {
  180. transform: translateY(-40rpx);
  181. .avatar {
  182. width: 100rpx;
  183. height: 100rpx;
  184. }
  185. .rank-badge {
  186. width: 80rpx;
  187. height: 80rpx;
  188. }
  189. }
  190. .rank-second {
  191. order: -1;
  192. }
  193. .rank-third {
  194. order: 1;
  195. }
  196. }
  197. }
  198. .my-ranking {
  199. background: #e1f2ff;
  200. border-radius: 12rpx;
  201. margin: 20rpx 30rpx 20rpx 30rpx;
  202. padding: 30rpx;
  203. display: flex;
  204. align-items: center;
  205. // box-shadow: 0 4rpx 12rpx rgba(20, 136, 219, 0.3);
  206. position: relative;
  207. z-index: 5;
  208. .my-rank-number {
  209. font-size: 48rpx;
  210. font-weight: bold;
  211. color: #000;
  212. margin-right: 15rpx;
  213. }
  214. .my-rank-label {
  215. font-size: 24rpx;
  216. color: #1488DB;
  217. opacity: 0.9;
  218. margin-right: 20rpx;
  219. }
  220. .my-avatar {
  221. width: 60rpx;
  222. height: 60rpx;
  223. border-radius: 50%;
  224. // border: 3rpx solid #fff;
  225. margin-right: 15rpx;
  226. }
  227. .my-name {
  228. font-size: 28rpx;
  229. color: #000;
  230. font-weight: 500;
  231. margin-right: 20rpx;
  232. }
  233. .my-score {
  234. font-size: 28rpx;
  235. color: #1488DB;
  236. // font-weight: bold;
  237. }
  238. }
  239. .ranking-list {
  240. padding: 40rpx 30rpx;
  241. background-color: #fff;
  242. margin-top: -40rpx;
  243. border-radius: 40rpx 40rpx 0 0;
  244. .list-item {
  245. display: flex;
  246. align-items: center;
  247. padding: 30rpx 0;
  248. border-bottom: 1rpx solid #f0f0f0;
  249. &:last-child {
  250. border-bottom: none;
  251. }
  252. .rank-number {
  253. width: 60rpx;
  254. font-size: 32rpx;
  255. font-weight: bold;
  256. color: #333;
  257. text-align: center;
  258. }
  259. .list-avatar {
  260. width: 80rpx;
  261. height: 80rpx;
  262. border-radius: 50%;
  263. margin: 0 30rpx;
  264. }
  265. .user-info {
  266. flex: 1;
  267. .user-name {
  268. font-size: 28rpx;
  269. color: #333;
  270. font-weight: 500;
  271. }
  272. }
  273. .user-score {
  274. font-size: 28rpx;
  275. color: $uni-color-primary;
  276. // font-weight: bold;
  277. }
  278. }
  279. }
  280. </style>