winningRecord.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. params: {},
  38. }
  39. },
  40. onLoad(query) {
  41. console.log(query, 'query')
  42. if (query.raffleId) {
  43. this.params = query
  44. // 根据卡包id获取中奖记录
  45. this.getList()
  46. }
  47. },
  48. mounted() {},
  49. methods: {
  50. getList() {
  51. let params = {
  52. limit: 999,
  53. page: 1,
  54. ...this.params,
  55. }
  56. prizeUserListApi(params).then(res => {
  57. console.log(res, 'res中奖记录')
  58. this.list = res.data
  59. })
  60. },
  61. },
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .container {
  66. background: #9ec8f9;
  67. overflow: auto;
  68. .card {
  69. margin: 10px 10px 0 10px;
  70. border-radius: 8px;
  71. background: #fff;
  72. padding: 10px;
  73. .row {
  74. display: flex;
  75. justify-content: space-between;
  76. align-items: center;
  77. .left {
  78. display: flex;
  79. align-items: center;
  80. .photo {
  81. margin-right: 5px;
  82. width: 30px;
  83. height: 30px;
  84. border-radius: 50%;
  85. }
  86. .name {
  87. font-size: 14px;
  88. font-weight: 600;
  89. }
  90. .img {
  91. width: 40px;
  92. height: 40px;
  93. border-radius: 2px;
  94. margin-right: 5px;
  95. }
  96. }
  97. .text1 {
  98. color: #666666;
  99. font-size: 12px;
  100. }
  101. }
  102. }
  103. }
  104. </style>