record.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view>
  3. <u-navbar title="获奖名单" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <view class="list">
  5. <view v-for="(item,index) in list" :key="index" class="list-view">
  6. <view class="award">
  7. <view class="award-avatar">
  8. <image :src="item.avatar" mode=""></image>
  9. </view>
  10. <view class="award-nickNames">
  11. <view class="nickName"><text>{{item.nickName}}</text>
  12. <view v-if="item.awardName == '一等奖'" class="awardName">
  13. <image src="../../static/activity/one.png" mode="">
  14. </image>
  15. <text style="color: #FFD225;">{{item.awardName}}</text>
  16. </view>
  17. <view v-else-if="item.awardName == '二等奖'" class="awardName">
  18. <image src="../../static/activity/two.png" mode="">
  19. </image>
  20. <text style="color: #94CBEC;">{{item.awardName}}</text>
  21. </view>
  22. <view v-else-if="item.awardName == '三等奖'" class="awardName">
  23. <image src="../../static/activity/three.png" mode=""></image>
  24. <text style="color: #F2B47A;">{{item.awardName}}</text>
  25. </view>
  26. </view>
  27. <view style="line-height: 46rpx; color: #666666;">中奖码:{{item.code}}</view>
  28. <view style="line-height: 46rpx; color: #666666;">{{item.prizeTitle}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import env from '../../config/env.js'
  37. import $http from '@/utils/request.js'
  38. export default {
  39. data() {
  40. return {
  41. list: [],
  42. marketingId: '',
  43. total: '',
  44. }
  45. },
  46. onLoad(opthios) {
  47. this.marketingId = opthios.id
  48. this.pageList()
  49. },
  50. methods: {
  51. pageList() {
  52. this.pageNum = 1
  53. this.list = []
  54. this.getList()
  55. },
  56. getList() {
  57. uni.showLoading({
  58. title: '加载中'
  59. });
  60. this.loading = true
  61. $http.post(`/api/v1/mp/user/marketing/hit/prize/list`, {
  62. marketingId: this.marketingId,
  63. }).then(res => {
  64. console.log(res);
  65. uni.hideLoading();
  66. this.loading = false
  67. if (res.code == 0) {
  68. res.rows.forEach(item => {
  69. let prizePicUrlArr = item.prizePicUrl.split(',')
  70. item.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
  71. item.avatar = env.filePublic + item.avatar + '?imageView2/2/w/170'
  72. })
  73. this.total = res.total
  74. this.list = this.list.concat(res.rows)
  75. }
  76. }).catch(() => {
  77. uni.hideLoading();
  78. this.loading = false
  79. })
  80. },
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .list {
  86. &-view {
  87. padding: 10rpx 20rpx;
  88. .award {
  89. border-radius: 22rpx;
  90. width: 100%;
  91. height: 108px;
  92. background-color: #fff;
  93. overflow: hidden;
  94. &-avatar {
  95. float: left;
  96. padding: 50rpx 32rpx;
  97. image {
  98. height: 100rpx;
  99. width: 100rpx;
  100. border-radius: 100rpx;
  101. }
  102. }
  103. &-nickNames {
  104. float: left;
  105. padding: 30rpx 0;
  106. .nickName {
  107. line-height: 60rpx;
  108. font-size: 30rpx;
  109. .awardName {
  110. display: inline-block;
  111. image {
  112. width: 40rpx;
  113. height: 36rpx;
  114. margin-left: 30rpx;
  115. vertical-align: -10%;
  116. }
  117. text {
  118. display: inline-block;
  119. font-size: 26rpx;
  120. line-height: 26rpx;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. // 设置ios刘海屏底部横线安全区域
  128. padding-bottom: constant(safe-area-inset-bottom);
  129. padding-bottom: env(safe-area-inset-bottom);
  130. }
  131. </style>