index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view>
  3. <view class="detailed">
  4. <!-- <view class="public_title acea-row row-middle">
  5. <view class="icons"></view>经验值明细
  6. </view> -->
  7. <view v-if="expList.length" class="list">
  8. <view class="item acea-row row-between-wrapper" v-for="(item,index) in expList">
  9. <view class="text">
  10. <view class="name">{{item.title}}</view>
  11. <view class="data">{{item.add_time}}</view>
  12. </view>
  13. <view class="num" v-if="item.pm">+{{item.number}}</view>
  14. <view class="num on" v-else>-{{item.number}}</view>
  15. </view>
  16. </view>
  17. <view v-if="!expList.length && !loading" class="empty">
  18. <image class="image" :src="imgHost + '/statics/images/empty-box.png'"></image>
  19. <view>{{$t(`暂无经验记录`)}}</view>
  20. </view>
  21. </view>
  22. <view class='loadingicon acea-row row-center-wrapper' v-if="expList.length">
  23. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. getUserInfo,
  30. getlevelInfo,
  31. getlevelExpList
  32. } from '@/api/user.js';
  33. import {HTTP_REQUEST_URL} from '@/config/app';
  34. export default {
  35. data() {
  36. return {
  37. imgHost:HTTP_REQUEST_URL,
  38. loading: false,
  39. loadend: false,
  40. loadTitle: this.$t(`加载更多`), //提示语
  41. page: 1,
  42. limit: 20,
  43. expList: []
  44. }
  45. },
  46. created() {
  47. this.getlevelList();
  48. },
  49. methods: {
  50. getlevelList: function() {
  51. let that = this
  52. if (this.loadend) return false;
  53. if (this.loading) return false;
  54. getlevelExpList({
  55. page: that.page,
  56. limit: that.limit
  57. }).then(res => {
  58. let list = res.data,
  59. loadend = list.length < that.limit;
  60. let expList = that.$util.SplitArray(list, that.expList);
  61. that.$set(that, 'expList', expList);
  62. that.loadend = loadend;
  63. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  64. that.page = that.page + 1;
  65. that.loading = false;
  66. }).catch(err => {
  67. that.loading = false;
  68. that.loadTitle = that.$t(`加载更多`);
  69. });
  70. }
  71. },
  72. onReachBottom: function() {
  73. this.getlevelList();
  74. }
  75. }
  76. </script>
  77. <style>
  78. page {
  79. background-color: #FFFFFF;
  80. }
  81. </style>
  82. <style lang="scss" scoped>
  83. .detailed {
  84. padding: 0 30rpx 0 30rpx;
  85. // margin-top: 15rpx;
  86. background-color: #fff;
  87. .list {
  88. // margin-top: 15rpx;
  89. .item {
  90. height: 122rpx;
  91. border-bottom: 1px solid #EEEEEE;
  92. .text {
  93. .name {
  94. font-size: 28rpx;
  95. color: #282828;
  96. }
  97. .data {
  98. color: #999;
  99. font-size: 24rpx;
  100. }
  101. }
  102. .num {
  103. font-size: 32rpx;
  104. color: #16AC57;
  105. }
  106. .on {
  107. color: #E93323;
  108. }
  109. }
  110. }
  111. }
  112. .empty {
  113. padding-top: 300rpx;
  114. font-size: 30rpx;
  115. text-align: center;
  116. color: #999999;
  117. }
  118. .empty .image {
  119. width: 414rpx;
  120. height: 214rpx;
  121. margin-bottom: 20rpx;
  122. }
  123. </style>