dy.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view class="dy">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="bigBox" v-for=" i in applyUserlist">
  5. <view class="imgblk">
  6. <image class="img" :src="i.avatar" mode="aspectFill"></image>
  7. </view>
  8. <view class="info">
  9. <view class="uname">
  10. <view class="nameTxt">
  11. {{i.username}}
  12. </view>
  13. <view class="sch">{{i.create_at}}</view>
  14. </view>
  15. <view class="sch1">{{i.schoolName}}</view>
  16. </view>
  17. </view>
  18. <view class="loading">
  19. <view v-if="newsLoading==1">数据加载中...</view>
  20. <view v-if="newsLoading==2">没有更多了~~</view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. navBarData: {
  29. title: '新增订阅',
  30. btn: 1
  31. },
  32. // 报名列表
  33. applyUserlist: [],
  34. // 活动id
  35. acId: '',
  36. // 触底加载动画提示
  37. newsLoading: 0, //0默认值 1加载中 2没有更多了
  38. currentPage: 1,
  39. };
  40. },
  41. methods: {
  42. // 获取报名用户
  43. getUsers() {
  44. let data = {
  45. oid: this.$store.state.user.openid, //用户id
  46. aid: this.acId,
  47. type: 2,
  48. page: this.currentPage, //下拉获取更多的备用字段
  49. }
  50. this.$request('/selectEnrollUser', 'get', data).then(res => {
  51. console.log(res);
  52. // this.applyUserlist = res[0]
  53. console.log('获取报名用户列表', res[0]);
  54. if (!res[0].length) {
  55. this.newsLoading = 2
  56. } else {
  57. this.newsLoading = 0
  58. }
  59. this.applyUserlist = [...this.applyUserlist, ...res[0]]
  60. })
  61. }
  62. },
  63. // 触底加载更多
  64. onReachBottom() {
  65. if (this.newsLoading == 2) {
  66. return
  67. }
  68. this.newsLoading = 1
  69. this.currentPage++
  70. setTimeout(() => {
  71. this.getUsers()
  72. }, 1500)
  73. },
  74. onLoad(e) {
  75. // console.log('接受参数',e);
  76. this.acId = e.acId
  77. this.getUsers()
  78. }
  79. };
  80. </script>
  81. <style lang="scss" scoped>
  82. .dy {}
  83. .bigBox {
  84. background-color: white;
  85. width: 750rpx;
  86. height: 136rpx;
  87. padding: 0rpx 30rpx;
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. .imgblk {
  92. height: 80rpx;
  93. display: flex;
  94. justify-content: center;
  95. align-items: center;
  96. // background-color: #888;
  97. .img {
  98. width: 72rpx;
  99. height: 72rpx;
  100. border-radius: 50%;
  101. }
  102. }
  103. .info {
  104. flex: 1;
  105. display: flex;
  106. flex-direction: column;
  107. height: 80rpx;
  108. justify-content: space-between;
  109. margin-left: 20rpx;
  110. // background-color: rebeccapurple;
  111. .uname {
  112. display: flex;
  113. justify-content: space-between;
  114. .nameTxt {
  115. font-size: 28rpx;
  116. color: rgba(0, 0, 0, 0.8);
  117. // line-height: 50%;
  118. }
  119. .sch {
  120. font-size: 24rpx;
  121. color: rgba(0, 0, 0, 0.6);
  122. }
  123. }
  124. .sch1 {
  125. // flex: 1;
  126. font-size: 24rpx;
  127. color: rgba(0, 0, 0, 0.6);
  128. }
  129. }
  130. }
  131. .loading {
  132. height: 50rpx;
  133. text-align: center;
  134. padding-top: 20rpx;
  135. padding-bottom: 100rpx;
  136. font-size: 26rpx;
  137. color: #888;
  138. line-height: 2em;
  139. }
  140. </style>