dy.vue 3.1 KB

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