revenueRankingPage.vue 6.6 KB

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