winningRecord.vue 2.3 KB

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