people_record.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="cu-modal bottom-modal" :class="{ show: visible }">
  3. <view class="mask" @click="close"></view>
  4. <view class="wrapper cu-dialog">
  5. <view :style="{ height: wrapperWidth + 'rpx' }">
  6. <view class="paddingY20 flex-align-center relative">
  7. <view class="">邀请详情</view>
  8. <image :src="resource.icon_x" class="x" @click="close" />
  9. </view>
  10. <view v-if="data && data.length > 0">
  11. <scroll-view
  12. :style="{ height: wrapperWidth - 132 + 'rpx' }"
  13. :scroll-y="true"
  14. refresher-enabled
  15. refresher-default-style="white"
  16. @refresherrefresh="refresh"
  17. :refresher-triggered="refreshing"
  18. @scrolltolower="loadMore"
  19. >
  20. <view>
  21. <view
  22. v-for="(item, index) in data"
  23. class="item flex-align"
  24. :key="index"
  25. >
  26. <image :src="item.avatar || resource.defaultAvatar" class="icon" />
  27. <view class="font4 marginL10">
  28. {{ item.promotedNickName }}
  29. </view>
  30. <view class="flex1"></view>
  31. <view
  32. class="marginL40 font4"
  33. >
  34. {{ item.createTime }}
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. </view>
  40. <empty v-else :top="150" />
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import resource from '@/utils/resource'
  47. import empty from '@/components/empty'
  48. export default {
  49. components: { empty },
  50. data() {
  51. return {
  52. resource,
  53. visible: false,
  54. data: [],
  55. refreshing: false,
  56. requesting: false,
  57. current: 1,
  58. size: 20
  59. }
  60. },
  61. computed: {
  62. wrapperWidth() {
  63. return (this.$store.state.systemInfo.screenHeight / 3) * 2 * 2
  64. }
  65. },
  66. methods: {
  67. show() {
  68. this.visible = true
  69. this.data = []
  70. this.refresh()
  71. },
  72. refresh() {
  73. if (this.requesting) return
  74. this.current = 1
  75. this.refreshing = true
  76. this.data = []
  77. this.getData()
  78. },
  79. loadMore() {
  80. if (this.requesting) return
  81. if (this.data.length > 0 && this.data.length % this.size === 0) {
  82. this.current += 1
  83. this.getData()
  84. }
  85. },
  86. async getData() {
  87. this.requesting = true
  88. const res = await this.$service.wallet.getPullNewUserPeoples(this.current, this.size)
  89. this.refreshing = false
  90. if (res.records && res.records.length > 0) {
  91. this.data.push(...res.records)
  92. }
  93. this.requesting = false
  94. },
  95. close() {
  96. this.current = 1
  97. this.visible = false
  98. this.$emit('close', false)
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .mask {
  105. position: absolute;
  106. left: 0;
  107. right: 0;
  108. top: 0;
  109. bottom: 0;
  110. }
  111. .wrapper {
  112. background: #fff;
  113. border-radius: 20px 20px 0 0 !important;
  114. .title {
  115. width: 172rpx;
  116. height: 28rpx;
  117. }
  118. .x {
  119. position: absolute;
  120. right: 28rpx;
  121. top: 50%;
  122. margin-top: -16rpx;
  123. width: 32rpx;
  124. height: 32rpx;
  125. }
  126. .item {
  127. padding: 0 16rpx 0 40rpx;
  128. margin-right: 32rpx;
  129. height: 100rpx;
  130. .icon {
  131. width: 64rpx;
  132. height: 64rpx;
  133. border-radius: 32rpx;
  134. }
  135. .image {
  136. width: 84rpx;
  137. height: 84rpx;
  138. border-radius: 8rpx;
  139. }
  140. }
  141. }
  142. </style>