record.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. <!-- 中奖 -->
  34. <u-popup :show="activityShow" mode="center" round="17" @close="close" :closeable="true" overlayOpacity="0.5" @touchmove.prevent.stop>
  35. <view class="choiceShow-wrap">
  36. <view style="width: 400rpx; height: 400rpx;line-height: 400rpx; text-align: center;">
  37. 恭喜你获得一等奖
  38. </view>
  39. <button @click="toPrize()">前往查看</button>
  40. <button @click="close()">关闭</button>
  41. </view>
  42. </u-popup>
  43. <!-- 未中奖 -->
  44. <u-popup :show="closeShow" mode="center" round="17" @close="close" :closeable="true" overlayOpacity="0.5" @touchmove.prevent.stop>
  45. <view class="choiceShow-wrap">
  46. <view style="width: 400rpx; height: 400rpx;line-height: 400rpx; text-align: center;">
  47. 很遗憾你未中奖
  48. <br>
  49. 欢迎继续参与其他抽奖,好运就在你身边
  50. </view>
  51. <button @click="close()">取消</button>
  52. </view>
  53. </u-popup>
  54. </view>
  55. </template>
  56. <script>
  57. import env from '../../config/env.js'
  58. import $http from '@/utils/request.js'
  59. export default {
  60. data() {
  61. return {
  62. list: [],
  63. marketingId: '',
  64. total: '',
  65. closeShow: false,
  66. activityShow: false,
  67. }
  68. },
  69. onLoad(opthios) {
  70. this.marketingId = opthios.id
  71. this.pageList()
  72. },
  73. methods: {
  74. pageList() {
  75. this.pageNum = 1
  76. this.list = []
  77. this.getList()
  78. },
  79. getList() {
  80. uni.showLoading({
  81. title: '加载中'
  82. });
  83. this.loading = true
  84. $http.post(`/api/v1/mp/user/marketing/hit/prize/list`, {
  85. marketingId: this.marketingId,
  86. }).then(res => {
  87. uni.hideLoading();
  88. this.loading = false
  89. if (res.code == 0) {
  90. res.rows.forEach(item => {
  91. let prizePicUrlArr = item.prizePicUrl.split(',')
  92. item.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
  93. item.avatar = env.filePublic + item.avatar + '?imageView2/2/w/170'
  94. })
  95. this.total = res.total
  96. this.list = this.list.concat(res.rows)
  97. }
  98. }).catch(() => {
  99. uni.hideLoading();
  100. this.loading = false
  101. })
  102. },
  103. toPrize() {
  104. uni.navigateTo({
  105. url:'/packagePrize/prize/index'
  106. })
  107. },
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .list {
  113. &-view {
  114. padding: 10rpx 20rpx;
  115. .award {
  116. border-radius: 22rpx;
  117. width: 100%;
  118. height: 108px;
  119. background-color: #fff;
  120. overflow: hidden;
  121. &-avatar {
  122. float: left;
  123. padding: 50rpx 32rpx;
  124. image {
  125. height: 100rpx;
  126. width: 100rpx;
  127. border-radius: 100rpx;
  128. }
  129. }
  130. &-nickNames {
  131. float: left;
  132. padding: 30rpx 0;
  133. .nickName {
  134. line-height: 60rpx;
  135. font-size: 30rpx;
  136. .awardName {
  137. display: inline-block;
  138. image {
  139. width: 40rpx;
  140. height: 36rpx;
  141. margin-left: 30rpx;
  142. vertical-align: -10%;
  143. }
  144. text {
  145. display: inline-block;
  146. font-size: 26rpx;
  147. line-height: 26rpx;
  148. }
  149. }
  150. }
  151. }
  152. }
  153. }
  154. // 设置ios刘海屏底部横线安全区域
  155. padding-bottom: constant(safe-area-inset-bottom);
  156. padding-bottom: env(safe-area-inset-bottom);
  157. }
  158. </style>