rank.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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">{{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. }
  99. .info{
  100. margin-left: 10rpx;
  101. .name{
  102. font-size: 28rpx;
  103. font-weight: 500;
  104. display: flex;
  105. align-items: center;
  106. margin-bottom: 4rpx;
  107. }
  108. .level{
  109. background: rgba(81, 81, 81, 0.1);
  110. color: #444444;
  111. border-radius: 4rpx;
  112. font-size: 24rpx;
  113. padding: 4rpx 10rpx;
  114. margin-left: 20rpx;
  115. &.levelBlue{
  116. background: #fff;
  117. color: #2199F8;
  118. }
  119. }
  120. .nickname{
  121. color: rgba(0, 0, 0, 0.5);
  122. }
  123. }
  124. }
  125. .button{
  126. font-size: 24rpx;
  127. padding: 10rpx 20rpx;
  128. border-radius: 50rpx;
  129. border: 2rpx solid rgba(0, 0, 0, 0.3);
  130. background: #fff;
  131. }
  132. }
  133. }
  134. }
  135. }
  136. </style>