Ranking.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="Ranking">
  3. <u-navbar title="排行榜" title-color="#ffffff" back-icon-color="#ffffff" :border-bottom="false" :background="{ backgroundColor: '#ff4f63' }"></u-navbar>
  4. <view class="ranking-cont" v-if="grade_list.length > 0">
  5. <image class="ranking-bg" src="https://onlineimg.qianniao.vip/ranking-bg.png" mode=""></image>
  6. <view class="top-three clearfix">
  7. <view class="top-three-li second">
  8. <view class="user-avator-view" v-if="grade_list[1]">
  9. <view class="ranking-sort">
  10. 2
  11. </view>
  12. <image class="r-vip" src="https://onlineimg.qianniao.vip/r-two.png" mode="aspectFill"></image>
  13. <image class="user-avator" :src="grade_list[1].avatar" mode="aspectFill"></image>
  14. </view>
  15. <view class="user-info-view" v-if="grade_list[1]">
  16. <view class="user-name">{{ grade_list[1].name }}</view>
  17. <view class="user-money">¥{{ grade_list[1].totalMoney || 0 }}</view>
  18. </view>
  19. </view>
  20. <view class="top-three-li first">
  21. <view class="user-avator-view">
  22. <view class="ranking-sort">
  23. 1
  24. </view>
  25. <image class="r-vip" src="https://onlineimg.qianniao.vip/r-one.png" mode="aspectFill"></image>
  26. <image class="user-avator" :src="grade_list[0].avatar" mode="aspectFill"></image>
  27. </view>
  28. <view class="user-info-view">
  29. <view class="user-name">{{ grade_list[0].name }}</view>
  30. <view class="user-money">¥{{ grade_list[0].totalMoney || 0 }}</view>
  31. </view>
  32. </view>
  33. <view class="top-three-li third">
  34. <view class="user-avator-view" v-if="grade_list[2]">
  35. <view class="ranking-sort">
  36. 3
  37. </view>
  38. <image class="r-vip" src="https://onlineimg.qianniao.vip/r-three.png" mode="aspectFill"></image>
  39. <image class="user-avator" :src="grade_list[2].avatar" mode="aspectFill"></image>
  40. </view>
  41. <view class="user-info-view" v-if="grade_list[2]">
  42. <view class="user-name">{{ grade_list[2].name }}</view>
  43. <view class="user-money">¥{{ grade_list[2].totalMoney || 0 }}</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="ranking-list">
  48. <block v-for="(item, index) in grade_list" :key="index">
  49. <view class="ranking-li clearfix" v-if="index > 2">
  50. <view class="float_left sort-num">{{ index + 1 }}</view>
  51. <image class="float_left user-avator" :src="item.avatar" mode="aspectFill"></image>
  52. <view class="float_left user-info clearfix">
  53. <view class="user-name float_left">{{ item.name }}</view>
  54. <view class="money float_right">¥{{ item.totalMoney || 0 }}</view>
  55. </view>
  56. </view>
  57. </block>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. grade_list: []
  67. };
  68. },
  69. onLoad() {
  70. this.commissionTop();
  71. },
  72. methods: {
  73. commissionTop() {
  74. this.$u.api.commissionTop().then(res=>{
  75. this.grade_list = res.data.moneyTop;
  76. });
  77. }
  78. }
  79. };
  80. </script>
  81. <style lang="scss">
  82. body {
  83. background-color: #ff4f63;
  84. }
  85. .Ranking {
  86. .ranking-cont {
  87. padding-top: 165upx;
  88. .ranking-bg {
  89. width: 424upx;
  90. height: 79upx;
  91. display: block;
  92. margin: 0 auto;
  93. transform: translateY(-100upx);
  94. }
  95. .top-three {
  96. padding-left: 36upx;
  97. .top-three-li {
  98. float: left;
  99. width: 192upx;
  100. height: 309upx;
  101. background-color: #ff354c;
  102. border-radius: 12upx;
  103. .user-avator-view {
  104. position: relative;
  105. .ranking-sort{
  106. font-size: 24upx;
  107. width: 34upx;
  108. height: 34upx;
  109. line-height: 34upx;
  110. background-color: #8fc7fe;
  111. color: #fff;
  112. border-radius: 100%;
  113. border: 1px solid #6eb7ff;
  114. position: absolute;
  115. bottom: 34upx;
  116. left: 50%;
  117. transform: translateX(-50%);
  118. z-index: 9;
  119. text-align: center;
  120. }
  121. .r-vip {
  122. width: 58upx;
  123. height: 42upx;
  124. display: block;
  125. position: absolute;
  126. top: -68upx;
  127. left: 50%;
  128. transform: translateX(-29upx);
  129. }
  130. .user-avator {
  131. width: 136upx;
  132. height: 136upx;
  133. border-radius: 100%;
  134. display: block;
  135. border: 4upx solid #8cc5fd;
  136. margin: 0 auto;
  137. transform: translateY(-30upx);
  138. }
  139. }
  140. .user-info-view {
  141. text-align: center;
  142. color: #ffffff;
  143. font-weight: bold;
  144. font-size: 32upx;
  145. .user-money {
  146. font-weight: normal;
  147. padding-top: 12upx;
  148. }
  149. }
  150. }
  151. .first {
  152. width: 260upx;
  153. height: 359upx;
  154. margin: 0 16upx;
  155. transform: translateY(-50upx);
  156. .user-avator-view {
  157. .user-avator {
  158. width: 180upx;
  159. height: 180upx;
  160. border-color: #fdb10d;
  161. }
  162. .ranking-sort{
  163. width: 44upx;
  164. height: 44upx;
  165. line-height: 44upx;
  166. border-color: #f9ce72;
  167. font-size: 26upx;
  168. background-color: #febd03;
  169. }
  170. }
  171. }
  172. .third {
  173. .user-avator-view {
  174. .user-avator {
  175. border-color: #ffaa6a;
  176. }
  177. .ranking-sort{
  178. border-color: #f5abb5;
  179. background-color: #ffaa6a;
  180. }
  181. }
  182. }
  183. }
  184. .ranking-list {
  185. min-height: 756upx;
  186. background-color: #fff;
  187. border-top-left-radius: 20upx;
  188. border-top-right-radius: 20upx;
  189. transform: translateY(-70upx);
  190. padding: 30upx 0;
  191. .ranking-li {
  192. padding: 0 36upx 20upx;
  193. .sort-num {
  194. line-height: 100upx;
  195. font-size: 30upx;
  196. font-weight: bold;
  197. padding-right: 26upx;
  198. }
  199. .user-avator {
  200. width: 100upx;
  201. height: 100upx;
  202. border-radius: 100%;
  203. margin-right: 30upx;
  204. }
  205. .user-info {
  206. width: 500upx;
  207. line-height: 100upx;
  208. .user-name {
  209. font-size: 28upx;
  210. font-weight: bold;
  211. }
  212. .money {
  213. color: #fe582e;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. </style>