revenueRankingPage.vue 6.4 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. <backHome></backHome>
  58. </view>
  59. <login-notice></login-notice>
  60. <login></login>
  61. </view>
  62. </template>
  63. <script>
  64. let app = getApp();
  65. import backHome from "@/components/backHome/backHome.vue"
  66. export default {
  67. data() {
  68. return {
  69. rankingList:[],
  70. color1:"",
  71. color2:"",
  72. currentTab:1,
  73. };
  74. },
  75. components:{
  76. backHome
  77. },
  78. created() {
  79. },
  80. mounted() {
  81. this.color1 = app.globalData.color1;
  82. this.color2 = app.globalData.color2;
  83. this.incomeRankTop10Amounts();
  84. },
  85. methods:{
  86. tab(index){
  87. this.currentTab = index;
  88. if(index==1){
  89. this.incomeRankTop10Amounts();
  90. }else if(index==2){
  91. this.incomeRankTop10ThisMonth();
  92. }else if(index==3){
  93. this.incomeRankTop10Today();
  94. }
  95. },
  96. async incomeRankTop10Today(){
  97. const res = await this.$myRequest({
  98. url: '/income/trigger/incomeRankTop10Today',
  99. data:{}
  100. });
  101. this.rankingList = []
  102. if(res&&res.data.success){
  103. this.rankingList = res.data.list||[]
  104. }
  105. },
  106. async incomeRankTop10ThisMonth(){
  107. const res = await this.$myRequest({
  108. url: '/income/trigger/incomeRankTop10ThisMonth',
  109. data:{}
  110. });
  111. this.rankingList = []
  112. if(res&&res.data.success){
  113. this.rankingList = res.data.list||[]
  114. }
  115. },
  116. async incomeRankTop10Amounts(){
  117. const res = await this.$myRequest({
  118. url: '/income/trigger/incomeRankTop10Amounts',
  119. data:{}
  120. });
  121. this.rankingList = []
  122. if(res&&res.data.success){
  123. this.rankingList = res.data.list||[]
  124. }
  125. },
  126. backHome(){
  127. uni.navigateBack({
  128. delta:1,
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. .ranking_body{
  136. margin-left: 20rpx;
  137. margin-right: 20rpx;
  138. background: #ffffff;
  139. border-radius: 16rpx;
  140. padding-top: 20rpx;
  141. margin-top: 20rpx;
  142. min-height: 1200rpx;
  143. .title{
  144. text-align: center;
  145. font-size: 32rpx;
  146. font-family: Verdana, Verdana-Bold;
  147. font-weight: 700;
  148. text-align: center;
  149. color: #262626;
  150. }
  151. .rank_tab{
  152. display: flex;
  153. margin: 0 auto;
  154. margin-top: 40rpx;
  155. width: 450rpx;
  156. height: 60rpx;
  157. background: #ffffff;
  158. border: 2rpx solid #ededed;
  159. border-radius: 8rpx;
  160. .tab_item{
  161. height: 100%;
  162. text-align: center;
  163. flex: auto;
  164. line-height: 60rpx;
  165. font-size: 24rpx;
  166. font-family: Verdana, Verdana-Regular;
  167. font-weight: 400;
  168. color: #b1b1b1;
  169. }
  170. .tab_line{
  171. width: 2rpx;
  172. height: 60rpx;
  173. background: #ededed;
  174. }
  175. .active1{
  176. border-radius: 8rpx 0 0 8rpx;
  177. color: #FFFFFF;
  178. }
  179. .active2{
  180. border-radius: 0;
  181. color: #FFFFFF;
  182. }
  183. .active3{
  184. border-radius: 0 8rpx 8rpx 0 ;
  185. color: #FFFFFF;
  186. }
  187. }
  188. .rank_list{
  189. width: 100%;
  190. .rank_title{
  191. display: flex;
  192. width: 100%;
  193. margin: 0 auto;
  194. margin-top: 40rpx;
  195. .rank_title_name{
  196. font-size: 28rpx;
  197. flex: auto;
  198. font-family: Verdana, Verdana-Bold;
  199. font-weight: 700;
  200. text-align: center;
  201. color: #b1b1b1;
  202. }
  203. }
  204. .rank_item{
  205. display: flex;
  206. align-items: center;
  207. width: 100%;
  208. height: 104rpx;
  209. margin: 0 auto;
  210. position: relative;
  211. .rank_item_name{
  212. font-size: 28rpx;
  213. flex: auto;
  214. font-family: Verdana, Verdana-Bold;
  215. font-weight: 400;
  216. text-align: center;
  217. color: #666666;
  218. .icon{
  219. width: 36rpx;
  220. height: 40rpx;
  221. }
  222. }
  223. .item_line{
  224. position: absolute;
  225. bottom: 0;
  226. left: 50%;
  227. transform: translateX(-50%);
  228. width: 630rpx;
  229. height: 2rpx;
  230. background-color: rgba(0,0,0,0.05);
  231. }
  232. }
  233. }
  234. .back_home{
  235. position: fixed;
  236. bottom: 180rpx;
  237. right: 0;
  238. width: 100rpx;
  239. height: 120rpx;
  240. border-radius: 20rpx 0rpx 0rpx 20rpx;
  241. box-shadow: 0rpx 10rpx 20rpx 0rpx rgba(119,55,12,0.20);
  242. display: flex;
  243. flex-direction: column;
  244. justify-content: center;
  245. align-items: center;
  246. .back_home_icon{
  247. width: 30rpx;
  248. height: 28rpx;
  249. margin-bottom: 9rpx;
  250. }
  251. font-size: 20rpx;
  252. font-family: PingFang SC, PingFang SC-Semibold;
  253. font-weight: 600;
  254. text-align: center;
  255. color: #ffffff;
  256. }
  257. .empty {
  258. display: flex;
  259. flex-direction: column;
  260. align-items: center;
  261. margin-top: 300rpx;
  262. .emptyImg {
  263. width: 283rpx;
  264. height: 227rpx;
  265. }
  266. .text {
  267. margin-top: -20rpx;
  268. font-size: 28rpx;
  269. font-family: PingFang SC, PingFang SC-Medium;
  270. font-weight: 500;
  271. text-align: center;
  272. color: #b1b3ba;
  273. }
  274. }
  275. }
  276. </style>