index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="custom-popup" v-if="visible" @touchmove.stop.prevent>
  3. <view class="popup-mask"></view>
  4. <view class="packet-dialog-container">
  5. <view class="dialog-body">
  6. <image src="/pages-sell/static/search/packet-dialog.png" class="dialog-bg" mode="widthFix"></image>
  7. <view class="content-overlay">
  8. <text class="dialog-title">{{ detail.couponName }}</text>
  9. <view class="amount-wrapper">
  10. <text class="amount-num">{{ detail.faceMoney }}</text>
  11. <text class="amount-unit">元</text>
  12. </view>
  13. <view class="condition-box">
  14. <text v-if="detail.thresholdMoney == 0">无门槛可用</text>
  15. <text v-else>满{{ detail.thresholdMoney }}可用 24小时有效</text>
  16. </view>
  17. <view class="btn-accept" @click="close">
  18. <text>开心收下</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="close-area" @click="close">
  23. <view class="close-icon-custom">×</view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'PacketDialog',
  31. props: {
  32. value: {
  33. type: Boolean,
  34. default: false
  35. }
  36. },
  37. data() {
  38. return {
  39. visible: false,
  40. detail: {
  41. couponName: '',
  42. faceMoney: 0,
  43. thresholdMoney: 0,
  44. }
  45. }
  46. },
  47. methods: {
  48. open(data) {
  49. this.visible = true;
  50. this.detail = data;
  51. },
  52. close() {
  53. this.visible = false;
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .custom-popup {
  60. position: fixed;
  61. top: 0;
  62. left: 0;
  63. right: 0;
  64. bottom: 0;
  65. z-index: 999;
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. transition: all 0.3s ease-in-out;
  70. .popup-mask {
  71. position: absolute;
  72. top: 0;
  73. left: 0;
  74. width: 100%;
  75. height: 100%;
  76. background: #000000;
  77. opacity: 0.7;
  78. }
  79. }
  80. .packet-dialog-container {
  81. position: relative;
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. z-index: 1000;
  86. .dialog-body {
  87. position: relative;
  88. width: 640rpx;
  89. // height is determined by image aspect ratio
  90. .dialog-bg {
  91. width: 100%;
  92. display: block;
  93. }
  94. .content-overlay {
  95. position: absolute;
  96. top: 0;
  97. left: 0;
  98. width: 100%;
  99. height: 100%;
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. padding-top: 120rpx;
  105. padding-left: 50rpx;
  106. .dialog-title {
  107. font-size: 38rpx;
  108. font-weight: bold;
  109. color: #B31700;
  110. margin-bottom: 20rpx;
  111. padding-top: 50rpx;
  112. }
  113. .amount-wrapper {
  114. display: flex;
  115. align-items: baseline;
  116. justify-content: center;
  117. margin-bottom: 20rpx;
  118. .amount-num {
  119. font-family: Arial;
  120. font-weight: bold;
  121. font-size: 80rpx;
  122. color: #B31700;
  123. background: linear-gradient(214deg, rgba(179, 23, 0, 0.69) 0%, rgba(255, 132, 0, 0.69) 100%);
  124. -webkit-background-clip: text;
  125. -webkit-text-fill-color: transparent;
  126. }
  127. .amount-unit {
  128. color: #B31700;
  129. font-size: 38rpx;
  130. font-weight: bold;
  131. margin-left: 4rpx;
  132. }
  133. }
  134. .condition-box {
  135. padding: 4rpx 20rpx;
  136. border-radius: 8rpx;
  137. text {
  138. font-size: 24rpx;
  139. color: #B31700;
  140. }
  141. }
  142. .btn-accept {
  143. width: 300rpx;
  144. height: 96rpx;
  145. background: linear-gradient(180deg, #FFF5D6 0%, #FFDFA8 100%);
  146. border-radius: 48rpx;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. box-shadow: 0 4rpx 10rpx rgba(179, 23, 0, 0.3);
  151. margin-top: 20rpx; // Adjust positioning
  152. text {
  153. color: #B31700;
  154. font-size: 32rpx;
  155. font-weight: bold;
  156. }
  157. }
  158. }
  159. }
  160. .close-area {
  161. position: absolute;
  162. top: 0rpx;
  163. right: 0;
  164. .close-icon-custom {
  165. width: 60rpx;
  166. height: 60rpx;
  167. border: 2rpx solid #fff;
  168. border-radius: 50%;
  169. color: #fff;
  170. font-size: 50rpx;
  171. line-height: 54rpx;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. padding-bottom: 6rpx; // Visual adjustment for 'x'
  176. }
  177. }
  178. }
  179. </style>