winRecord.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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>
  7. <view class="title">
  8. 中奖记录
  9. <view class="close" @click="close">
  10. <text class="cuIcon-close"></text>
  11. </view>
  12. </view>
  13. </view>
  14. <view v-if="data && data.length > 0">
  15. <scroll-view
  16. :style="{height: (wrapperWidth - 132) + 'rpx'}"
  17. :scroll-y="true"
  18. refresher-enabled
  19. refresher-default-style="white"
  20. @refresherrefresh="refresh"
  21. :refresher-triggered="refreshing"
  22. @scrolltolower="loadMore"
  23. >
  24. <view>
  25. <view v-for="(item, index) in data" class="item flex-align" :key="index">
  26. <image :src="item.avatar || resource.defaultAvatar" class="icon" />
  27. <view class="font2 marginL12 flex1">{{item.nickname}}</view>
  28. <view class="font2 marginL12 flex1">获得了</view>
  29. <view class="marginL20 font2 line-ellipsis" style="width: 30%">{{item.spu.name}}</view>
  30. <image :src="item.spu.cover" class="image marginL20" />
  31. </view>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. <empty v-else :top="150" />
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import resource from '@/utils/resource'
  42. import empty from '@/components/empty'
  43. export default {
  44. components: { empty },
  45. props: {
  46. poolId: Number
  47. },
  48. data() {
  49. return {
  50. resource,
  51. visible: false,
  52. data: [],
  53. refreshing: false,
  54. requesting: false,
  55. roomId: ''
  56. }
  57. },
  58. computed: {
  59. wrapperWidth() {
  60. return (this.$store.state.systemInfo.screenHeight / 3) * 2 * 2
  61. }
  62. },
  63. methods: {
  64. show(roomId) {
  65. this.visible = true
  66. this.data = []
  67. this.roomId = roomId
  68. this.refresh()
  69. },
  70. refresh() {
  71. if (this.requesting) return
  72. this.refreshing = true
  73. this.getData()
  74. },
  75. loadMore() {
  76. if (this.requesting) return
  77. this.getData()
  78. },
  79. async getData() {
  80. this.requesting = true
  81. const res = await this.$service.weal.winningTheLotteryRecord(this.roomId)
  82. this.refreshing = false
  83. if (res && res.length > 0) {
  84. this.data = res
  85. }
  86. this.requesting = false
  87. console.log(this.data);
  88. },
  89. close() {
  90. this.visible = false
  91. this.$emit('close', false)
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .mask {
  98. position: absolute;
  99. left: 0;
  100. right: 0;
  101. top: 0;
  102. bottom: 0;
  103. }
  104. .wrapper {
  105. border-radius: 15px 15px 0 0!important;
  106. .title {
  107. text-align: center;
  108. font-size: 32rpx;
  109. font-family: Source Han Sans, Source Han Sans;
  110. font-weight: 700;
  111. color: #000000;
  112. padding: 44rpx 0 48rpx 0;
  113. position: relative;
  114. }
  115. .close {
  116. position: absolute;
  117. right: 0;
  118. width: 48rpx;
  119. height: 48rpx;
  120. background: #ebebeb;
  121. border-radius: 48rpx;
  122. color: #a2a2a2;
  123. top: 30rpx;
  124. line-height: 48rpx;
  125. }
  126. .item {
  127. padding: 0 16rpx 0 40rpx;
  128. margin: 0 28rpx 20rpx 28rpx;
  129. height: 116rpx;
  130. border-radius: 8rpx;
  131. background: #FFF7E3;
  132. .icon {
  133. width: 64rpx;
  134. height: 64rpx;
  135. border-radius: 50%;
  136. }
  137. .image {
  138. width: 48rpx;
  139. height: 48rpx;
  140. border-radius: 24rpx;
  141. background-color: #fff;
  142. }
  143. }
  144. }
  145. </style>