record.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. <!-- <tabbar3 custom-class="marginX14 marginB15 flex-align-between" :tabs="tabs" @change="clickTab"/> -->
  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 color-black marginL12 flex1">
  28. {{ item.nickname }}
  29. </view>
  30. <image
  31. :src="LEVEL_MAP[item.level].titleText"
  32. class="marginL20"
  33. style="width: 90rpx; height: 32rpx"
  34. />
  35. <view
  36. class="marginL20 font2 line-ellipsis"
  37. style="width: 30%;color:#FEC433;"
  38. >
  39. {{ item.name }}
  40. </view>
  41. <image :src="item.cover" class="image marginL20" />
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { LEVEL_MAP } from '@/utils/config'
  51. import resource from '@/utils/resource'
  52. import tabbar3 from '@/components/tabbar3'
  53. const Tabs = [
  54. { title: '全部', value: '' },
  55. { title: '超神款', value: 'A' },
  56. { title: '欧皇款', value: 'B' },
  57. { title: '隐藏款', value: 'C' },
  58. { title: '普通款', value: 'D' }
  59. ]
  60. export default {
  61. components: { tabbar3 },
  62. props: {
  63. poolId: [Number,String]
  64. },
  65. data() {
  66. return {
  67. resource,
  68. LEVEL_MAP,
  69. visible: false,
  70. lastId: null,
  71. data: [],
  72. refreshing: false,
  73. requesting: false,
  74. tabs: Tabs,
  75. tab: Tabs[0]
  76. }
  77. },
  78. computed: {
  79. wrapperWidth() {
  80. return (this.$store.state.systemInfo.screenHeight / 3) * 2 * 2
  81. }
  82. },
  83. methods: {
  84. show() {
  85. this.visible = true
  86. this.data = []
  87. this.refresh()
  88. },
  89. refresh() {
  90. if (this.requesting) return
  91. this.lastId = null
  92. this.refreshing = true
  93. this.getData()
  94. },
  95. loadMore() {
  96. if (this.requesting) return
  97. this.getData()
  98. },
  99. async getData() {
  100. this.requesting = true
  101. const res = await this.$service.award.buyRecord(
  102. this.poolId,
  103. this.lastId,
  104. this.tab.value
  105. )
  106. this.refreshing = false
  107. if (res && res.length > 0) {
  108. this.data = !!this.lastId ? this.data.concat(res) : res
  109. this.lastId = res[res.length - 1].id
  110. }
  111. this.requesting = false
  112. },
  113. clickTab(item) {
  114. this.tab = item
  115. this.refresh(true)
  116. },
  117. close() {
  118. this.visible = false
  119. this.$emit('close', false)
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .mask {
  126. position: absolute;
  127. left: 0;
  128. right: 0;
  129. top: 0;
  130. bottom: 0;
  131. }
  132. .wrapper {
  133. background: #fff;
  134. border-radius: 15px 15px 0px 0px !important;
  135. overflow: hidden;
  136. .title {
  137. text-align: center;
  138. font-size: 32rpx;
  139. font-family: Source Han Sans, Source Han Sans;
  140. font-weight: 700;
  141. color: #000000;
  142. padding: 44rpx 0 48rpx 0;
  143. position: relative;
  144. }
  145. .close {
  146. position: absolute;
  147. right: 0;
  148. width: 48rpx;
  149. height: 48rpx;
  150. background: #ebebeb;
  151. border-radius: 48rpx;
  152. color: #a2a2a2;
  153. top: 30rpx;
  154. line-height: 48rpx;
  155. }
  156. .item {
  157. padding: 0 16rpx 0 40rpx;
  158. margin: 0 28rpx 20rpx 28rpx;
  159. height: 116rpx;
  160. border-radius: 8rpx;
  161. background: #FFF7E3;
  162. .icon {
  163. width: 64rpx;
  164. height: 64rpx;
  165. border-radius: 50%;
  166. }
  167. .image {
  168. width: 48rpx;
  169. height: 48rpx;
  170. border-radius: 24rpx;
  171. background-color: #fff;
  172. }
  173. }
  174. }
  175. </style>