revenueRankingPage.vue 6.7 KB

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