lotteryPopup.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <u-popup :show="show && countdown" round="40rpx" @close="handleClose">
  3. <view class="prize-box" style="border-radius: 40rpx; height: fit-content">
  4. <image class="nav-img" src="/static/images/live/red_head.png" mode="widthFix" />
  5. <image class="bg-img" src="/static/images/live/red_bg.png" />
  6. <view class="prize-content">
  7. <view class="prize-mr20" style="display: flex; justify-content: flex-end">
  8. <view
  9. style="width: 80rpx; height: 80rpx; display: flex; justify-content: center; align-items: center"
  10. @click="handleClose"
  11. >
  12. <u-icon class="x-end" name="close" color="#fff" size="20"></u-icon>
  13. </view>
  14. </view>
  15. <view class="lottery-column">
  16. <image class="lottery-title-img" src="/static/images/live/red_title.png" />
  17. <view class="lottery-countdown">
  18. 开奖倒计时
  19. <view class="lottery-countdown-time">
  20. <view class="white-item">
  21. {{ countdown.hours || '00' }}
  22. </view>
  23. <view class="white-item">
  24. {{ countdown.minutes || '00' }}
  25. </view>
  26. <view class="white-item">
  27. {{ countdown.seconds || '00' }}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="item-group">
  32. <ThreeItemSwiper :products="products"></ThreeItemSwiper>
  33. </view>
  34. <view class="point-group" v-for="(item, index) in products" :key="index"></view>
  35. <view class="lottery-info-text">观看直播参与抽奖</view>
  36. <view class="button" @click="handleClaim">参与抽奖</view>
  37. </view>
  38. </view>
  39. </view>
  40. </u-popup>
  41. </template>
  42. <script>
  43. import ThreeItemSwiper from '@/pages_live/components/ThreeItemSwiper.vue';
  44. export default {
  45. name: "LotteryPopup",
  46. components: {
  47. ThreeItemSwiper
  48. },
  49. props: {
  50. // 控制弹窗显示/隐藏
  51. show: {
  52. type: Boolean,
  53. default: false
  54. },
  55. // 倒计时数据
  56. countdown: {
  57. type: Object,
  58. default: () => ({
  59. hours: '00',
  60. minutes: '00',
  61. seconds: '00'
  62. })
  63. },
  64. // 抽奖商品列表
  65. products: {
  66. type: Array,
  67. default: () => []
  68. }
  69. },
  70. methods: {
  71. // 关闭弹窗
  72. handleClose() {
  73. this.$emit('close');
  74. },
  75. // 参与抽奖
  76. handleClaim() {
  77. this.$emit('claim');
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped>
  83. .prize-box {
  84. position: relative;
  85. }
  86. .prize-mr20{
  87. margin-right: 20rpx;
  88. }
  89. .nav-img {
  90. width: 311rpx;
  91. position: absolute;
  92. top: -122rpx;
  93. left: 50%;
  94. transform: translateX(-50%);
  95. }
  96. .bg-img {
  97. position: absolute;
  98. top: 0;
  99. left: 0;
  100. width: 100%;
  101. height: 100%;
  102. z-index: 1;
  103. }
  104. .prize-content {
  105. position: relative;
  106. z-index: 2;
  107. padding: 24rpx 0 68rpx;
  108. }
  109. .lottery-column {
  110. display: flex;
  111. flex-direction: column;
  112. align-items: center;
  113. }
  114. .lottery-title-img {
  115. width: 446rpx;
  116. height: 80rpx;
  117. }
  118. .lottery-countdown {
  119. font-size: 24rpx;
  120. color: #fff;
  121. display: flex;
  122. align-items: center;
  123. margin-top: 30rpx;
  124. margin-bottom: 30rpx;
  125. }
  126. .lottery-countdown-time {
  127. display: flex;
  128. align-items: center;
  129. }
  130. .white-item {
  131. width: 40rpx;
  132. height: 40rpx;
  133. text-align: center;
  134. overflow: hidden;
  135. background: #ffffff;
  136. box-shadow: inset 0rpx 2rpx 8rpx 0rpx #ffebb2;
  137. border-radius: 8rpx;
  138. margin: 4rpx;
  139. font-weight: 600;
  140. font-size: 24rpx;
  141. color: #f85d22;
  142. line-height: 40rpx;
  143. }
  144. .item-group {
  145. width: 100%;
  146. }
  147. .point-group {
  148. margin: 20rpx 0 50rpx;
  149. display: flex;
  150. gap: 6rpx;
  151. }
  152. .lottery-info-text {
  153. color: #fff;
  154. font-size: 28rpx;
  155. }
  156. .button {
  157. margin-top: 30rpx;
  158. width: 520rpx;
  159. height: 88rpx;
  160. line-height: 88rpx;
  161. background: linear-gradient(180deg, #fff4d6 0%, #ffeb66 100%);
  162. box-shadow: 0rpx 10rpx 8rpx 4rpx rgba(246, 82, 25, 0.5);
  163. border-radius: 44rpx;
  164. font-weight: 500;
  165. font-size: 36rpx;
  166. color: #f4410b;
  167. text-align: center;
  168. }
  169. </style>