revenueRankingPage.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="ranking_body">
  3. <view class="title">
  4. 收益排行 TOP10
  5. </view>
  6. <view class="rank_tab">
  7. <view class="tab_item" @click="tab(1)" :class="{active1:currentTab==1}" :style="{background:currentTab==1?color1:''}">
  8. 总量
  9. </view>
  10. <view class="tab_line"></view>
  11. <view class="tab_item" @click="tab(2)" :class="{active2:currentTab==2}" :style="{background:currentTab==2?color1:''}">
  12. 本月
  13. </view>
  14. <view class="tab_line"></view>
  15. <view class="tab_item" @click="tab(3)" :class="{active3:currentTab==3}" :style="{background:currentTab==3?color1:''}">
  16. 本日
  17. </view>
  18. </view>
  19. <view class="rank_list">
  20. <view class="rank_title">
  21. <view class="rank_title_name" style="width: 20%;">
  22. 排名
  23. </view>
  24. <view class="rank_title_name" style="width: 30%;">
  25. 用户名
  26. </view>
  27. <view class="rank_title_name" style="width: 20%;">
  28. 用户等级
  29. </view>
  30. <view class="rank_title_name" style="width: 30%;">
  31. 累计收益(元)
  32. </view>
  33. </view>
  34. <view class="rank_item" v-for="(item,index) in rankingList" :key='item.userId'>
  35. <view class="rank_item_name" style="width: 20%;">
  36. <image class="icon" v-if="index==0" src="https://dm.static.elab-plus.com/yezhu/icon_first.png" mode=""></image>
  37. <image class="icon" v-if="index==1" src="https://dm.static.elab-plus.com/yezhu/icon_twice.png" mode=""></image>
  38. <image class="icon" v-if="index==2" src="https://dm.static.elab-plus.com/yezhu/icon_thrid.png" mode=""></image>
  39. <text v-if="index!=0&&index!=1&&index!=2" >{{index+1}}</text>
  40. </view>
  41. <view class="rank_item_name" style="width: 30%;" :style="{color:(index==0||index==1||index==2)?color1:'auto'}">
  42. {{item.name}}
  43. </view>
  44. <view class="rank_item_name" style="width: 20%;">
  45. {{item.level?'Lv'+item.level:''}}
  46. </view>
  47. <view class="rank_item_name" style="width: 30%;" :style="{color:(index==0||index==1||index==2)?color1:'auto'}">
  48. {{Number(item.amount).toFixed(2)}}
  49. </view>
  50. <view class="item_line">
  51. </view>
  52. </view>
  53. <view class="empty" v-if="rankingList.length == 0">
  54. <image class="emptyImg" src="https://dm.static.elab-plus.com/yezhu/h5/icon_empty.png" mode=""></image>
  55. <view class="text">暂无数据</view>
  56. </view>
  57. <view class="back_home" :style="{background:color2}" @click="backHome">
  58. <image class="back_home_icon" src="https://dm.static.elab-plus.com/yezhu/icon_home.png" mode=""></image>
  59. <text>返回\n任务大厅</text>
  60. </view>
  61. </view>
  62. <login-notice></login-notice>
  63. <login></login>
  64. </view>
  65. </template>
  66. <script>
  67. let app = getApp();
  68. export default {
  69. data() {
  70. return {
  71. rankingList:[],
  72. color1:"",
  73. color2:"",
  74. currentTab:1,
  75. };
  76. },
  77. created() {
  78. },
  79. mounted() {
  80. this.color1 = app.globalData.color1;
  81. this.color2 = app.globalData.color2;
  82. this.incomeRankTop10Amounts();
  83. },
  84. methods:{
  85. tab(index){
  86. this.currentTab = index;
  87. if(index==1){
  88. this.incomeRankTop10Amounts();
  89. }else if(index==2){
  90. this.incomeRankTop10ThisMonth();
  91. }else if(index==3){
  92. this.incomeRankTop10Today();
  93. }
  94. },
  95. async incomeRankTop10Today(){
  96. const res = await this.$myRequest({
  97. url: '/income/trigger/incomeRankTop10Today',
  98. data:{}
  99. });
  100. this.rankingList = []
  101. if(res&&res.data.success){
  102. this.rankingList = res.data.list||[]
  103. }
  104. },
  105. async incomeRankTop10ThisMonth(){
  106. const res = await this.$myRequest({
  107. url: '/income/trigger/incomeRankTop10ThisMonth',
  108. data:{}
  109. });
  110. this.rankingList = []
  111. if(res&&res.data.success){
  112. this.rankingList = res.data.list||[]
  113. }
  114. },
  115. async incomeRankTop10Amounts(){
  116. const res = await this.$myRequest({
  117. url: '/income/trigger/incomeRankTop10Amounts',
  118. data:{}
  119. });
  120. this.rankingList = []
  121. if(res&&res.data.success){
  122. this.rankingList = res.data.list||[]
  123. }
  124. },
  125. backHome(){
  126. uni.navigateBack({
  127. delta:1,
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. .ranking_body{
  135. margin-left: 20rpx;
  136. margin-right: 20rpx;
  137. background: #ffffff;
  138. border-radius: 16rpx;
  139. padding-top: 20rpx;
  140. margin-top: 20rpx;
  141. min-height: 1200rpx;
  142. .title{
  143. text-align: center;
  144. font-size: 32rpx;
  145. font-family: Verdana, Verdana-Bold;
  146. font-weight: 700;
  147. text-align: center;
  148. color: #262626;
  149. }
  150. .rank_tab{
  151. display: flex;
  152. margin: 0 auto;
  153. margin-top: 40rpx;
  154. width: 450rpx;
  155. height: 60rpx;
  156. background: #ffffff;
  157. border: 2rpx solid #ededed;
  158. border-radius: 8rpx;
  159. .tab_item{
  160. height: 100%;
  161. text-align: center;
  162. flex: auto;
  163. line-height: 60rpx;
  164. font-size: 24rpx;
  165. font-family: Verdana, Verdana-Regular;
  166. font-weight: 400;
  167. color: #b1b1b1;
  168. }
  169. .tab_line{
  170. width: 2rpx;
  171. height: 60rpx;
  172. background: #ededed;
  173. }
  174. .active1{
  175. border-radius: 8rpx 0 0 8rpx;
  176. color: #FFFFFF;
  177. }
  178. .active2{
  179. border-radius: 0;
  180. color: #FFFFFF;
  181. }
  182. .active3{
  183. border-radius: 0 8rpx 8rpx 0 ;
  184. color: #FFFFFF;
  185. }
  186. }
  187. .rank_list{
  188. width: 100%;
  189. .rank_title{
  190. display: flex;
  191. width: 100%;
  192. margin: 0 auto;
  193. margin-top: 40rpx;
  194. .rank_title_name{
  195. font-size: 28rpx;
  196. flex: auto;
  197. font-family: Verdana, Verdana-Bold;
  198. font-weight: 700;
  199. text-align: center;
  200. color: #b1b1b1;
  201. }
  202. }
  203. .rank_item{
  204. display: flex;
  205. align-items: center;
  206. width: 100%;
  207. height: 104rpx;
  208. margin: 0 auto;
  209. position: relative;
  210. .rank_item_name{
  211. font-size: 28rpx;
  212. flex: auto;
  213. font-family: Verdana, Verdana-Bold;
  214. font-weight: 400;
  215. text-align: center;
  216. color: #666666;
  217. .icon{
  218. width: 36rpx;
  219. height: 40rpx;
  220. }
  221. }
  222. .item_line{
  223. position: absolute;
  224. bottom: 0;
  225. left: 50%;
  226. transform: translateX(-50%);
  227. width: 630rpx;
  228. height: 2rpx;
  229. background-color: rgba(0,0,0,0.05);
  230. }
  231. }
  232. }
  233. .back_home{
  234. position: fixed;
  235. bottom: 180rpx;
  236. right: 0;
  237. width: 100rpx;
  238. height: 120rpx;
  239. border-radius: 20rpx 0rpx 0rpx 20rpx;
  240. box-shadow: 0rpx 10rpx 20rpx 0rpx rgba(119,55,12,0.20);
  241. display: flex;
  242. flex-direction: column;
  243. justify-content: center;
  244. align-items: center;
  245. .back_home_icon{
  246. width: 30rpx;
  247. height: 28rpx;
  248. margin-bottom: 9rpx;
  249. }
  250. font-size: 20rpx;
  251. font-family: PingFang SC, PingFang SC-Semibold;
  252. font-weight: 600;
  253. text-align: center;
  254. color: #ffffff;
  255. }
  256. .empty {
  257. display: flex;
  258. flex-direction: column;
  259. align-items: center;
  260. margin-top: 300rpx;
  261. .emptyImg {
  262. width: 283rpx;
  263. height: 227rpx;
  264. }
  265. .text {
  266. margin-top: -20rpx;
  267. font-size: 28rpx;
  268. font-family: PingFang SC, PingFang SC-Medium;
  269. font-weight: 500;
  270. text-align: center;
  271. color: #b1b3ba;
  272. }
  273. }
  274. }
  275. </style>