more.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="list">
  3. <view class="empty" v-if="active_list== undefined||active_list.length == 0">
  4. <u-empty text="暂无内容哦!" mode="list"> </u-empty>
  5. </view>
  6. <view class="list-item" v-for="(item,index) in active_list" :key='index'>
  7. <view class="img">
  8. <image :src="item.user ? item.user.headimg : '../../static/images/avater.jpg'" mode=""></image>
  9. </view>
  10. <view class="right">
  11. <text>{{item.user.name}}</text>
  12. <view class="label">
  13. <text class="sex">{{item.user.account}}</text>
  14. <!-- <text class="degree">{{item.degree}}</text> -->
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data(){
  23. return{
  24. active_list:[],
  25. page: 1,
  26. last: false
  27. }
  28. },
  29. onLoad(options) {
  30. let id=options.id
  31. this.getActiveList(id)
  32. },
  33. onReachBottom() {
  34. if (!this.last) {
  35. this.page++
  36. }
  37. this.getActiveList()
  38. },
  39. methods:{
  40. getActiveList(id){
  41. this.$u.get('/page/activities-sign-ups',{activity_id:id,page:this.page}).then(res=>{
  42. let data = res.data.data
  43. if (this.page > 1 && data.length == 0) {
  44. uni.showToast({
  45. title: '暂无更多',
  46. icon: 'none'
  47. })
  48. this.last = true
  49. } else {
  50. this.active_list = this.active_list.concat(data)
  51. }
  52. })
  53. },
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. page {
  59. background-color: #F9F9FB;
  60. }
  61. .list {
  62. padding: 15px;
  63. .empty{
  64. height: 90vh;
  65. }
  66. .list-item {
  67. padding: 12px 20px;
  68. border-radius: 10px;
  69. box-shadow: 0px 8px 12px rgba(12, 20, 61, 0.06);
  70. display: flex;
  71. align-items: center;
  72. margin-bottom: 10px;
  73. .img {
  74. width: 55px;
  75. height: 55px;
  76. border-radius: 50%;
  77. overflow: hidden;
  78. margin: 0 8px 0 20px;
  79. image {
  80. width: 55px;
  81. height: 55px;
  82. }
  83. }
  84. .right {
  85. text {
  86. font-size: 15px;
  87. font-family: Graphit;
  88. font-weight: 500;
  89. color: #282828;
  90. }
  91. .label {
  92. margin-top: 8px;
  93. text {
  94. display: inline-block;
  95. height: 18px;
  96. line-height: 18px;
  97. text-align: center;
  98. // background: #E7E2DD;
  99. border-radius: 9px;
  100. font-size: 12px;
  101. font-family: PingFang HK;
  102. font-weight: 400;
  103. color: #674023;
  104. margin-right: 8px;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. </style>