index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="red_packet" catchtouchmove="true">
  3. <image src="../../static/icon/red_packet_background.jpg" class="read_packet_background" />
  4. <view class="rule" @click="showRule">活动规则</view>
  5. <view class="get_content">
  6. <view class="custom_button"> 立即领取 </view>
  7. <text>点击领取后,红包将自动到账余额</text>
  8. </view>
  9. <uni-popup ref="lotteryRule" type="center">
  10. <view class="lottery_rule_box">
  11. <view class="lottery_rule_title">
  12. <text>活动规则</text>
  13. <view class="close_btn" @click="closeRule"> X </view>
  14. </view>
  15. <scroll-view class="lottery_rule_info" scroll-y="true">
  16. <rich-text nodes="lotteryInfo.rule" class="rich_text"></rich-text>
  17. </scroll-view>
  18. </view>
  19. </uni-popup>
  20. </view>
  21. </template>
  22. <script setup>
  23. import { ref } from "vue";
  24. const lotteryRule = ref();
  25. const closeRule = () => {
  26. lotteryRule.value.close();
  27. };
  28. const showRule = () => {
  29. lotteryRule.value.open("center");
  30. };
  31. </script>
  32. <style lang="less" scoped>
  33. .red_packet {
  34. width: 100vw;
  35. height: 100vh;
  36. position: relative;
  37. .read_packet_background {
  38. width: 100%;
  39. height: 100%;
  40. }
  41. .rule {
  42. position: absolute;
  43. right: 0;
  44. top: 26%;
  45. color: #846100;
  46. padding: 15rpx 35rpx;
  47. background-color: #ffedad;
  48. border-radius: 60rpx;
  49. text-align: center;
  50. font-size: 28rpx;
  51. }
  52. .get_content {
  53. position: absolute;
  54. bottom: 18%;
  55. width: 100%;
  56. display: flex;
  57. flex-direction: column;
  58. align-items: center;
  59. justify-content: center;
  60. > text {
  61. color: #fff;
  62. font-size: 26rpx;
  63. margin-top: 20rpx;
  64. }
  65. }
  66. .custom_button {
  67. display: inline-block;
  68. background-color: #fbe6a0;
  69. color: #9c6c11;
  70. font-size: 18px;
  71. padding: 6px 30px;
  72. border-radius: 8px;
  73. text-align: center;
  74. box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  75. border: 2px solid transparent;
  76. text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
  77. position: relative;
  78. &:before,
  79. &:after {
  80. content: "";
  81. position: absolute;
  82. width: 24px;
  83. height: 24px;
  84. background-color: #fbe6a0;
  85. border: 2px solid #fbe6a0;
  86. border-radius: 10rpx;
  87. top: 50%;
  88. transform: translateY(-50%);
  89. }
  90. &:before {
  91. left: -6px;
  92. }
  93. &:after {
  94. right: -6px;
  95. }
  96. }
  97. .lottery_rule_box {
  98. width: 500rpx;
  99. display: block;
  100. overflow: hidden;
  101. background-color: #fc335f;
  102. font-size: 26rpx;
  103. margin: 0 auto;
  104. line-height: 50rpx;
  105. border-radius: 10rpx;
  106. padding: 20rpx 25rpx 20rpx;
  107. .lottery_rule_title {
  108. color: #ffffff;
  109. height: 60rpx;
  110. font-size: 32rpx;
  111. line-height: 60rpx;
  112. text-align: center;
  113. margin-bottom: 10rpx;
  114. .close_btn {
  115. float: right;
  116. width: 40rpx;
  117. height: 40rpx;
  118. font-size: 24rpx;
  119. margin-top: 9rpx;
  120. line-height: 40rpx;
  121. border-radius: 50%;
  122. border: 1rpx solid #ffffff;
  123. }
  124. }
  125. .lottery_rule_info {
  126. display: block;
  127. height: 500rpx;
  128. font-size: 24rpx;
  129. line-height: 40rpx;
  130. border-radius: 10rpx;
  131. padding: 20rpx;
  132. box-sizing: border-box;
  133. background-color: #ffffff;
  134. .rich_text {
  135. white-space: break-spaces;
  136. }
  137. }
  138. }
  139. }
  140. </style>