rank.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="sub-base-container">
  3. <view class="gradient-reflection" data-text="好友排行榜">好友排行榜</view>
  4. <view class="rank-card">
  5. <view class="tabs">
  6. <view :class="['tab-item',{active:active === index}]" v-for="(item,index) in tabsList" :key="index" @click="handleTab(index)">{{item}}</view>
  7. </view>
  8. <view class="rank-list">
  9. <view :class="['rank-item',{bg:(index + 1) <=3}]" v-for="(item,index) in 7" :key="index">
  10. <view class="rank-info">
  11. <text :class="['num',`num-${(index + 1)}`]">{{item}}</text>
  12. <up-image class="avatar" :fade="false"
  13. src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" width="92rpx"
  14. height="92rpx" shape="circle"></up-image>
  15. <view class="info">
  16. <view class="name">
  17. <text>茜茜荔</text>
  18. <view :class="['level',{levelBlue:(index + 1) <=3}]">V4.星勋</view>
  19. </view>
  20. <text class="nickname">昵称:听妈妈的话</text>
  21. </view>
  22. </view>
  23. <view class="button">去看看</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import {ref} from "vue"
  31. const active = ref(0)
  32. const tabsList = ["总榜","桃子","葡萄","香蕉","荔枝"]
  33. const handleTab = (index) =>{
  34. active.value = index
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. @import "@/static/style/mixin.scss";
  39. .sub-base-container {
  40. @include ossBg("subTreePage/rank-bg.png");
  41. .gradient-reflection {
  42. width: 100%;
  43. position: relative;
  44. font-size: 86rpx;
  45. color: #fff;
  46. font-family: "PangMenZhengDao";
  47. text-align: center;
  48. }
  49. .gradient-reflection::after {
  50. content: attr(data-text);
  51. position: absolute;
  52. top: 75%;
  53. left: calc(50% - 430rpx / 2);
  54. transform: scaleY(-1);
  55. background: rgba(255, 255, 255, 0.5);
  56. -webkit-background-clip: text;
  57. background-clip: text;
  58. color: transparent;
  59. opacity: 0.5;
  60. }
  61. .rank-card{
  62. margin-top: 90rpx;
  63. background: rgba(255, 255, 255, 0.74);
  64. border-radius: 20rpx 20rpx 0 0;
  65. padding: 20rpx;
  66. .tabs{
  67. display: flex;
  68. .tab-item{
  69. flex: 1;
  70. text-align: center;
  71. color: rgba(0, 0, 0, 0.5);
  72. font-size: 28rpx;
  73. padding: 10rpx 0;
  74. &.active{
  75. border-radius: 50rpx;
  76. color: #000;
  77. background: #fff;
  78. }
  79. }
  80. }
  81. .rank-list{
  82. .rank-item{
  83. display: flex;
  84. align-items: center;
  85. justify-content: space-between;
  86. padding: 14rpx 20rpx;
  87. border-radius: 10rpx;
  88. margin-top: 20rpx;
  89. &.bg{
  90. background-image: linear-gradient(90deg,rgba(255,255,255,0.6),transparent);
  91. }
  92. .rank-info{
  93. display: flex;
  94. align-items: center;
  95. font-size: 24rpx;
  96. .num{
  97. margin-right: 28rpx;
  98. color: #724E02;
  99. font-family: 'SweiSpringCJKtc';
  100. &-1{
  101. background: linear-gradient(to bottom, #724E02 0%, #F3C11D 100%);
  102. -webkit-background-clip: text;
  103. background-clip: text;
  104. color: transparent;
  105. font-size: 52rpx;
  106. font-family: 'SMILEYSANS';
  107. }
  108. &-2{
  109. background: linear-gradient(to bottom, #898989 0%, #fff 100%);
  110. -webkit-background-clip: text;
  111. background-clip: text;
  112. color: transparent;
  113. font-size: 52rpx;
  114. font-family: 'SMILEYSANS';
  115. }
  116. &-3{
  117. background: linear-gradient(to bottom, #F2BF16 0%, #FF8400 100%);
  118. -webkit-background-clip: text;
  119. background-clip: text;
  120. color: transparent;
  121. font-size: 52rpx;
  122. font-family: 'SMILEYSANS';
  123. }
  124. }
  125. .info{
  126. margin-left: 10rpx;
  127. .name{
  128. font-size: 28rpx;
  129. font-weight: 500;
  130. display: flex;
  131. align-items: center;
  132. margin-bottom: 4rpx;
  133. }
  134. .level{
  135. background: rgba(81, 81, 81, 0.1);
  136. color: #444444;
  137. border-radius: 4rpx;
  138. font-size: 24rpx;
  139. padding: 4rpx 10rpx;
  140. margin-left: 20rpx;
  141. &.levelBlue{
  142. background: #fff;
  143. color: #2199F8;
  144. }
  145. }
  146. .nickname{
  147. color: rgba(0, 0, 0, 0.5);
  148. }
  149. }
  150. }
  151. .button{
  152. font-size: 24rpx;
  153. padding: 10rpx 20rpx;
  154. border-radius: 50rpx;
  155. border: 2rpx solid rgba(0, 0, 0, 0.3);
  156. background: #fff;
  157. }
  158. }
  159. }
  160. }
  161. }
  162. </style>