ranking.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view style="position: relative;height: 100%;">
  3. <view style="width: 100%;">
  4. <image src="/static/rank_bg.png" style="width: 100%;position: relative;top: -80rpx;"></image>
  5. </view>
  6. <view class="box">
  7. <view style="margin-top: 15rpx;">
  8. <u-row gutter="16" justify="center">
  9. <u-col span="2" text-align="center">
  10. <view class="r_t1" >
  11. 我的<br>
  12. 成绩
  13. </view>
  14. </u-col>
  15. <u-col span="5">
  16. <view style="vertical-align: middle;display: flex;">
  17. <image src="/static/avatar.png" style="width: 80rpx;height: 80rpx;"></image>
  18. <view class="r_t2">李宏杰</view>
  19. </view>
  20. </u-col>
  21. <u-col span="5">
  22. <view style="color: #0183FE;font-size: 28rpx;">
  23. <view style="line-height: 80rpx;">
  24. <text>第15名</text>
  25. <text style="margin-left: 30rpx;">12h</text>
  26. </view>
  27. </view>
  28. </u-col>
  29. </u-row>
  30. </view>
  31. <view >
  32. <view>
  33. <u-tabs :list="list" font-size="24" :current="current" @change="change" active-color="#32467B"></u-tabs>
  34. </view>
  35. <view >
  36. <u-row >
  37. <u-col span="2" text-align="center">
  38. <view class="rank_t3">排名</view>
  39. </u-col>
  40. <u-col span="8" >
  41. <view class="rank_t3">姓名</view>
  42. </u-col>
  43. <u-col span="2" >
  44. <view class="rank_t3">时长</view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <scroll-view class='main-scroll' scroll-y >
  49. <view v-for="(item,index) in list2" :key="index" class="rank_item">
  50. <u-row >
  51. <u-col span="2" text-align="center">
  52. <view class="rank_t3">
  53. <image src="/static/sort_1.png" class="rank_img" v-if="index==0"></image>
  54. <image src="/static/sort_2.png" class="rank_img" v-if="index==1"></image>
  55. <image src="/static/sort_3.png" class="rank_img" v-if="index==2"></image>
  56. <view v-if="index>2" class="rank_t5">{{index+1}}</view>
  57. </view>
  58. </u-col>
  59. <u-col span="8" >
  60. <view style="vertical-align: middle;display: flex;">
  61. <image src="/static/avatar.png" style="width: 80rpx;height: 80rpx;"></image>
  62. <view class="rank_t4" style="padding-left: 30rpx;">陈政</view>
  63. </view>
  64. </u-col>
  65. <u-col span="2" text-align="left">
  66. <view class="rank_t4">72h</view>
  67. </u-col>
  68. </u-row>
  69. </view>
  70. </scroll-view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. list: [{
  80. name: '日榜'
  81. }, {
  82. name: '总榜'
  83. }],
  84. current: 0,
  85. list2:[1,1,1,1,1,1,1,1,1,1,1],
  86. }
  87. },
  88. onLoad(option) {
  89. },
  90. onShow(){
  91. },
  92. methods: {
  93. change(index) {
  94. this.current = index;
  95. }
  96. },
  97. }
  98. </script>
  99. <style scope>
  100. .main-scroll{
  101. position: absolute;
  102. left: 0;
  103. right: 0;
  104. top: 300rpx;
  105. bottom: 0;
  106. }
  107. .rank_t5{
  108. color: #AAB1B9;
  109. text-align: center;
  110. }
  111. .rank_t3{
  112. line-height: 80rpx;
  113. }
  114. .rank_t4{
  115. line-height: 80rpx;
  116. font-size: 30rpx;
  117. font-family: PingFang SC;
  118. font-weight: bold;
  119. color: #32467B;
  120. }
  121. .rank_item{
  122. height: 100rpx;
  123. vertical-align: middle;
  124. padding: 0 25rpx;
  125. }
  126. .rank_img{
  127. width: 54rpx;
  128. height: 54rpx;
  129. }
  130. .rank_list{
  131. width: 100%;
  132. height: 100%;
  133. position: relative;
  134. }
  135. .rank_t3{
  136. font-size: 28rpx;
  137. font-family: PingFang SC;
  138. font-weight: 400;
  139. color: #959EA8;
  140. }
  141. .r_t2{
  142. font-size: 32rpx;
  143. font-family: PingFang SC;
  144. font-weight: bold;
  145. color: #32467B;
  146. line-height: 80rpx;
  147. margin-left: 30rpx;
  148. }
  149. .r_t1{
  150. font-size: 32rpx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #0183FE;
  154. }
  155. page {
  156. background: #FFFFFF;
  157. height: 100%;
  158. }
  159. .box{
  160. height: 75%;
  161. width: 100%;
  162. border-top-right-radius: 32rpx;
  163. border-top-left-radius: 32rpx;
  164. z-index: 999;
  165. background-color: #FFFFFF;
  166. position: fixed;
  167. bottom: 0;
  168. padding: 25rpx;
  169. }
  170. </style>