winningRecord.vue 2.2 KB

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