winningRecord.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="container">
  3. <view class="card" v-for="(item, index) in list" :key="index">
  4. <view class="row">
  5. <view class="left">
  6. <image class="photo" :src="item.userAvtar" mode="aspectFill"></image>
  7. <span class="name">{{ item.userName }}</span>
  8. </view>
  9. <view class="right text1">
  10. <span style="margin-right: 5px">{{ item.creatTime }}</span>
  11. <span>No.{{ item.id }}</span>
  12. </view>
  13. </view>
  14. <view class="row" style="margin-top: 10px">
  15. <view class="left">
  16. <image class="img" :src="item.prizeIcon" mode="aspectFill"></image>
  17. <span class="name">{{ item.prizeName }}</span>
  18. </view>
  19. <view class="right" style="font-size: 14px">{{ $selectDictLabel(rewardType, item.prizeType) }} × 1</view>
  20. </view>
  21. </view>
  22. <noData v-if="list.length == 0" />
  23. </view>
  24. </template>
  25. <script>
  26. import noData from '@/component/noData.vue'
  27. import { prizeUserListApi } from '@/api/drawCard.js'
  28. import { rewardType } from '@/utils/commonConfig.js'
  29. export default {
  30. components: {
  31. noData,
  32. },
  33. data() {
  34. return {
  35. rewardType: rewardType,
  36. list: [],
  37. }
  38. },
  39. onLoad(query) {
  40. console.log(query, 'query')
  41. if (query.raffleId) {
  42. this.raffleId = query.raffleId
  43. // 根据卡包id获取中奖记录
  44. this.getList()
  45. }
  46. },
  47. mounted() {},
  48. methods: {
  49. getList() {
  50. let params = {
  51. limit: 999,
  52. page: 1,
  53. raffleId: this.raffleId,
  54. }
  55. prizeUserListApi(params).then(res => {
  56. console.log(res, 'res中奖记录')
  57. this.list = res.data
  58. })
  59. },
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .container {
  65. background: #9ec8f9;
  66. overflow: auto;
  67. .card {
  68. margin: 10px 10px 0 10px;
  69. border-radius: 8px;
  70. background: #fff;
  71. padding: 10px;
  72. .row {
  73. display: flex;
  74. justify-content: space-between;
  75. align-items: center;
  76. .left {
  77. display: flex;
  78. align-items: center;
  79. .photo {
  80. margin-right: 5px;
  81. width: 30px;
  82. height: 30px;
  83. border-radius: 50%;
  84. }
  85. .name {
  86. font-size: 14px;
  87. font-weight: 600;
  88. }
  89. .img {
  90. width: 40px;
  91. height: 40px;
  92. border-radius: 2px;
  93. margin-right: 5px;
  94. }
  95. }
  96. .text1 {
  97. color: #666666;
  98. font-size: 12px;
  99. }
  100. }
  101. }
  102. }
  103. </style>