index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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>暂无经验记录</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. loading: false,
  38. loadend: false,
  39. loadTitle: '加载更多', //提示语
  40. page: 1,
  41. limit: 20,
  42. expList: [],
  43. imgHost:HTTP_REQUEST_URL
  44. }
  45. },
  46. created() {
  47. this.getlevelList();
  48. },
  49. onShow() {
  50. uni.removeStorageSync('form_type_cart');
  51. },
  52. methods: {
  53. getlevelList: function() {
  54. let that = this
  55. if (this.loadend) return false;
  56. if (this.loading) return false;
  57. getlevelExpList({
  58. page: that.page,
  59. limit: that.limit
  60. }).then(res => {
  61. let list = res.data,
  62. loadend = list.length < that.limit;
  63. let expList = that.$util.SplitArray(list, that.expList);
  64. that.$set(that, 'expList', expList);
  65. that.loadend = loadend;
  66. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  67. that.page = that.page + 1;
  68. that.loading = false;
  69. }).catch(err => {
  70. that.loading = false;
  71. that.loadTitle = '加载更多';
  72. });
  73. }
  74. },
  75. onReachBottom: function() {
  76. this.getlevelList();
  77. }
  78. }
  79. </script>
  80. <style>
  81. page {
  82. background-color: #FFFFFF;
  83. }
  84. </style>
  85. <style lang="scss" scoped>
  86. .detailed {
  87. padding: 0 30rpx 0 30rpx;
  88. // margin-top: 15rpx;
  89. background-color: #fff;
  90. .list {
  91. // margin-top: 15rpx;
  92. .item {
  93. height: 122rpx;
  94. border-bottom: 1px solid #EEEEEE;
  95. .text {
  96. .name {
  97. font-size: 28rpx;
  98. color: #282828;
  99. }
  100. .data {
  101. color: #999;
  102. font-size: 24rpx;
  103. }
  104. }
  105. .num {
  106. font-size: 32rpx;
  107. color: #16AC57;
  108. }
  109. .on {
  110. color: #E93323;
  111. }
  112. }
  113. }
  114. }
  115. .empty {
  116. padding-top: 300rpx;
  117. font-size: 30rpx;
  118. text-align: center;
  119. color: #999999;
  120. }
  121. .empty .image {
  122. width: 414rpx;
  123. height: 214rpx;
  124. margin-bottom: 20rpx;
  125. }
  126. </style>