winningRecord.vue 2.6 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: 10rpx">{{ item.creatTime }}</span>
  11. <span>No.{{ item.id }}</span>
  12. </view>
  13. </view>
  14. <view class="row" style="margin-top: 20rpx">
  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: 28rpx">{{ $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-image: url(https://file.rongcyl.cn/festatic/bkm/imgv2/drawCard_box/bk.png);
  67. background-repeat: no-repeat;
  68. background-size: 100% 100%;
  69. background-color: #9ec8f9;
  70. overflow: auto;
  71. .card {
  72. margin: 20rpx 20rpx 0 20rpx;
  73. border-radius: 16rpx;
  74. background: #fff;
  75. padding: 20rpx;
  76. .row {
  77. display: flex;
  78. justify-content: space-between;
  79. align-items: center;
  80. .left {
  81. display: flex;
  82. align-items: center;
  83. .photo {
  84. margin-right: 10rpx;
  85. width: 60rpx;
  86. height: 60rpx;
  87. border-radius: 50%;
  88. }
  89. .name {
  90. font-size: 28rpx;
  91. font-weight: 600;
  92. }
  93. .img {
  94. width: 80rpx;
  95. height: 80rpx;
  96. border-radius: 4rpx;
  97. margin-right: 10rpx;
  98. }
  99. }
  100. .text1 {
  101. color: #666666;
  102. font-size: 24rpx;
  103. }
  104. }
  105. }
  106. }
  107. </style>