record.vue 4.7 KB

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