teamList.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="content">
  3. <empty v-if="list && list.length == 0"></empty>
  4. <view class="" style="background-color: #fff;">
  5. <view class="content-box" v-for="item in list">
  6. <view class="content-box-left">
  7. <view class="left-img"><image :src="item.avatar" mode=""></image></view>
  8. <view class="right-title">
  9. <!-- <view class="top">{{ item.nickname }}</view> -->
  10. <view class="bottom">ID:{{ item.uid }}</view>
  11. <view class="bottom " style="font-size: 24rpx;">昵称:{{ item.nickname }}</view>
  12. </view>
  13. </view>
  14. <view class="content-box-right">
  15. <view class="box-right">
  16. 参与金额:
  17. <span>{{ item.sells }}</span>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { myspread } from '@/api/user.js';
  26. import empty from '@/components/empty';
  27. import { mapState, mapMutations } from 'vuex';
  28. export default {
  29. components: {
  30. empty
  31. },
  32. data() {
  33. return {
  34. list: [],
  35. key: '',
  36. page: 1,
  37. limit: 20,
  38. loadingType: 'more'
  39. };
  40. },
  41. computed: {
  42. ...mapState(['wlgsbList'])
  43. },
  44. onLoad(opt) {
  45. this.key = opt.type * 1;
  46. },
  47. onShow() {
  48. this.loadData();
  49. },
  50. onReachBottom() {
  51. this.loadData();
  52. },
  53. onReady() {},
  54. methods: {
  55. ...mapMutations(['setSbList']),
  56. //获取收入支出信息
  57. async loadData(source) {
  58. let obj = this;
  59. if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  60. //防止重复加载
  61. return;
  62. }
  63. // 修改当前对象状态为加载中
  64. obj.loadingType = 'loading';
  65. myspread({ page: obj.page, limit: obj.limit, grade: obj.key }).then(({ data }) => {
  66. obj.list = obj.list.concat(data.list);
  67. console.log(obj.list);
  68. obj.page++;
  69. if (obj.limit == data.list.length) {
  70. //判断是否还有数据, 有改为 more, 没有改为noMore
  71. obj.loadingType = 'more';
  72. return;
  73. } else {
  74. //判断是否还有数据, 有改为 more, 没有改为noMore
  75. obj.loadingType = 'noMore';
  76. }
  77. });
  78. }
  79. }
  80. };
  81. </script>
  82. <style lang="scss">
  83. .content,
  84. page {
  85. height: auto;
  86. min-height: 100%;
  87. background: #111;
  88. }
  89. .content-box {
  90. display: flex;
  91. justify-content: space-between;
  92. align-items: center;
  93. // margin: 30rpx 0;
  94. background-color: #111;
  95. padding: 0 20rpx 10rpx;
  96. border-bottom: 1px solid #fff;
  97. .content-box-left {
  98. display: flex;
  99. .left-img {
  100. width: 100rpx;
  101. height: 100rpx;
  102. border-radius: 50%;
  103. overflow: hidden;
  104. image {
  105. width: 100%;
  106. height: 100%;
  107. }
  108. }
  109. .right-title {
  110. margin-left: 15rpx;
  111. display: flex;
  112. flex-direction: column;
  113. justify-content: space-around;
  114. .top {
  115. font-weight: 500;
  116. font-size: 30rpx;
  117. }
  118. .bottom {
  119. color: #fff;
  120. }
  121. }
  122. }
  123. .content-box-right {
  124. display: flex;
  125. flex-direction: column;
  126. width: 230rpx;
  127. color: #fff;
  128. .state {
  129. color: red;
  130. }
  131. span {
  132. color: #fff;
  133. font-size: 28rpx;
  134. }
  135. }
  136. }
  137. </style>