lotteryPopup.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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/red_head.png" mode="widthFix" />
  5. <image class="bg-img" src="/static/images/red_bg.png" />
  6. <view class="prize-content">
  7. <view class="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="column align-center">
  16. <image class="w446 h80" src="/static/images/red_title.png" />
  17. <view class="fs24 colorf x-f mt30 mb30">
  18. 开奖倒计时
  19. <view class="x-f">
  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="colorf fs28">观看直播参与抽奖</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_course/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. .nav-img {
  87. width: 311rpx;
  88. position: absolute;
  89. top: -122rpx;
  90. left: 50%;
  91. transform: translateX(-50%);
  92. }
  93. .bg-img {
  94. position: absolute;
  95. top: 0;
  96. left: 0;
  97. width: 100%;
  98. height: 100%;
  99. z-index: 1;
  100. }
  101. .prize-content {
  102. position: relative;
  103. z-index: 2;
  104. padding: 24rpx 0 68rpx;
  105. }
  106. .white-item {
  107. width: 40rpx;
  108. height: 40rpx;
  109. text-align: center;
  110. overflow: hidden;
  111. background: #ffffff;
  112. box-shadow: inset 0rpx 2rpx 8rpx 0rpx #ffebb2;
  113. border-radius: 8rpx;
  114. margin: 4rpx;
  115. font-weight: 600;
  116. font-size: 24rpx;
  117. color: #f85d22;
  118. line-height: 40rpx;
  119. }
  120. .item-group {
  121. width: 100%;
  122. }
  123. .point-group {
  124. margin: 20rpx 0 50rpx;
  125. display: flex;
  126. gap: 6rpx;
  127. }
  128. .button {
  129. margin-top: 30rpx;
  130. width: 520rpx;
  131. height: 88rpx;
  132. line-height: 88rpx;
  133. background: linear-gradient(180deg, #fff4d6 0%, #ffeb66 100%);
  134. box-shadow: 0rpx 10rpx 8rpx 4rpx rgba(246, 82, 25, 0.5);
  135. border-radius: 44rpx;
  136. font-weight: 500;
  137. font-size: 36rpx;
  138. color: #f4410b;
  139. text-align: center;
  140. }
  141. /* 工具类样式 */
  142. /* .column {
  143. display: flex;
  144. flex-direction: column;
  145. }
  146. .align-center {
  147. align-items: center;
  148. }
  149. .x-f {
  150. display: flex;
  151. align-items: center;
  152. }
  153. .colorf {
  154. color: #ffffff;
  155. }
  156. .fs24 {
  157. font-size: 24rpx;
  158. }
  159. .fs28 {
  160. font-size: 28rpx;
  161. }
  162. .mt30 {
  163. margin-top: 30rpx;
  164. }
  165. .mb30 {
  166. margin-bottom: 30rpx;
  167. }
  168. .w446 {
  169. width: 446rpx;
  170. }
  171. .h80 {
  172. height: 80rpx;
  173. }
  174. .mr20 {
  175. margin-right: 20rpx;
  176. }
  177. .x-end {
  178. display: flex;
  179. justify-content: flex-end;
  180. } */
  181. </style>