ranking.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view>
  3. <!-- 顶部渐变 -->
  4. <view class="top_color"></view>
  5. <view class="content">
  6. <view class="label">
  7. <view class="title box_1">排名</view>
  8. <view class="title box_2">姓名</view>
  9. <view class="title box_3">完成数</view>
  10. <view class="title box_4">总用时</view>
  11. </view>
  12. <view class="list">
  13. <view class="item" v-for="(item,index) in list" :key="index">
  14. <view class="index">
  15. <view v-if="index == 0">
  16. <image src="./icon/icon_1.png" mode="aspectFill"></image>
  17. </view>
  18. <view v-else-if="index == 1">
  19. <image src="./icon/icon_2.png" mode="aspectFill"></image>
  20. </view>
  21. <view v-else-if="index == 2">
  22. <image src="./icon/icon_3.png" mode="aspectFill"></image>
  23. </view>
  24. <view v-else>{{index+1}}</view>
  25. </view>
  26. <view class="user">
  27. <view class="img">
  28. <image
  29. :src="item.sign"
  30. mode="aspectFill"></image>
  31. </view>
  32. <view class="info">
  33. <view class="name">{{item.name}}</view>
  34. <view class="section">{{item.mine}}</view>
  35. </view>
  36. </view>
  37. <view class="num">{{item.compele_count}}</view>
  38. <view class="time">{{item.compele_time}} 秒</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. id: "",
  49. list:[]
  50. };
  51. },
  52. onLoad(option) {
  53. uni.setNavigationBarTitle({
  54. title: option.title
  55. })
  56. this.id = option.id
  57. this.get_list()
  58. },
  59. methods: {
  60. get_list() {
  61. uni.showLoading({
  62. mask:true
  63. })
  64. this.$api.jigsawPuzzle_getRankingBySpecialId({
  65. special_id: this.id
  66. }).then((res) => {
  67. uni.hideLoading()
  68. console.log(res)
  69. this.list = res.data.data
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. page {
  77. background-color: #F5F6F8;
  78. }
  79. .top_color {
  80. z-index: 1;
  81. width: 750rpx;
  82. height: 500rpx;
  83. background-image: linear-gradient(to top, #F3F8F7 0%, #009fe8 100%);
  84. position: fixed;
  85. top: 1;
  86. left: 0;
  87. }
  88. .content {
  89. position: relative;
  90. z-index: 2;
  91. box-sizing: border-box;
  92. padding: 40rpx 25rpx;
  93. margin: 0 auto;
  94. width: 700rpx;
  95. min-height: 90vh;
  96. background-color: #FFFFFF;
  97. border-radius: 20rpx;
  98. .label {
  99. width: 650rpx;
  100. height: 90rpx;
  101. border-radius: 40rpx;
  102. background-image: linear-gradient(to top, #CAEBFA 0%, #009fe8 90%);
  103. display: flex;
  104. align-items: center;
  105. justify-content: space-between;
  106. .title {
  107. color: #FFFFFF;
  108. font-size: 28rpx;
  109. font-weight: 700;
  110. }
  111. .box_1 {
  112. width: 80rpx;
  113. text-align: center;
  114. }
  115. .box_2 {
  116. width: 270rpx;
  117. text-indent: 2em;
  118. }
  119. .box_3 {
  120. width: 100rpx;
  121. text-align: center;
  122. }
  123. .box_4 {
  124. width: 100rpx;
  125. text-align: center;
  126. }
  127. }
  128. .list {
  129. .item {
  130. border-bottom: 1rpx solid #EEEEEE;
  131. height: 120rpx;
  132. display: flex;
  133. justify-content: space-between;
  134. align-items: center;
  135. .index {
  136. width: 80rpx;
  137. text-align: center;
  138. font-size: 28rpx;
  139. image {
  140. width: 45rpx;
  141. height: 64rpx;
  142. }
  143. }
  144. .user {
  145. width: 270rpx;
  146. display: flex;
  147. align-items: center;
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. white-space: nowrap;
  151. .img {
  152. margin-right: 20rpx;
  153. image {
  154. width: 74rpx;
  155. height: 74rpx;
  156. display: block;
  157. border-radius: 50%;
  158. }
  159. }
  160. .info {
  161. display: flex;
  162. flex-direction: column;
  163. .name {
  164. color: #01A0E8;
  165. font-size: 28rpx;
  166. font-weight: 700;
  167. }
  168. .section {
  169. margin-top: 6rpx;
  170. color: #909090;
  171. font-size: 24rpx;
  172. }
  173. }
  174. }
  175. .num{
  176. width: 100rpx;
  177. text-align: center;
  178. }
  179. .time {
  180. width: 100rpx;
  181. text-align: center;
  182. }
  183. }
  184. }
  185. }
  186. </style>