index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <!-- 抽奖结果弹窗 -->
  3. <view class="aleart" v-if="aleartStatus">
  4. <image src="../../../../static/images/poster-close.png" class="close" @click="posterImageClose"></image>
  5. <view class="title">
  6. {{aleartData.title}}
  7. </view>
  8. <view class="aleart-body">
  9. <image v-if="aleartData.img" class="goods-img" :src="aleartData.img" mode=""></image>
  10. <text class="msg">{{aleartData.msg}}</text>
  11. </view>
  12. <view class="btn" @click="posterImageClose()">
  13. {{aleartData.btn}}
  14. </view>
  15. <slot name="bottom"></slot>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. aleartData: {}
  23. }
  24. },
  25. props: {
  26. aleartType: {
  27. type: Number,
  28. default:0
  29. },
  30. alData: {
  31. type: Object,
  32. default:()=>{}
  33. },
  34. aleartStatus: {
  35. type: Boolean,
  36. default: false
  37. }
  38. },
  39. watch: {
  40. aleartType(type) {
  41. if (type === 1) {
  42. this.aleartData = {
  43. title: '暂无抽奖资格',
  44. msg: `1、您未关注公众号
  45. 2、您未获得VIP权限,获取VIP途径:
  46. (1)购买过打通版的用户可在会员群联系官方客服开通
  47. (2)官方小程序商城购买CRMEB打通版、企业版后自动开通`,
  48. btn: '我知道了'
  49. }
  50. } else if (type === 2) {
  51. this.aleartData = {
  52. title: '抽奖结果',
  53. img: this.alData.image,
  54. msg: this.alData.prompt,
  55. btn: '好的',
  56. type: this.alData.type
  57. }
  58. }
  59. },
  60. aleartStatus(status) {
  61. if (!status) {
  62. this.aleartData = {}
  63. }
  64. }
  65. },
  66. methods: {
  67. //隐藏弹窗
  68. posterImageClose(type) {
  69. this.$emit("close", false)
  70. },
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .aleart {
  76. width: 500rpx;
  77. // height: 714rpx;
  78. position: fixed;
  79. left: 50%;
  80. transform: translateX(-50%);
  81. z-index: 9999;
  82. top: 50%;
  83. margin-top: -357rpx;
  84. background-color: #fff;
  85. padding: 30rpx;
  86. border-radius: 12rpx;
  87. .title {
  88. font-size: 18px;
  89. color: #E82C27;
  90. font-weight: bold;
  91. text-align: center;
  92. padding-bottom: 10rpx;
  93. border-bottom: 1px solid rgba(#E82C27, 0.2);
  94. }
  95. .aleart-body {
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. flex-direction: column;
  100. padding: 60rpx 0;
  101. .goods-img {
  102. width: 150rpx;
  103. height: 150rpx;
  104. }
  105. .msg {
  106. font-size: 30rpx;
  107. color: #282828;
  108. }
  109. }
  110. .btn {
  111. width: 100%;
  112. padding: 15rpx 0;
  113. color: #fff;
  114. background: linear-gradient(90deg, #F34A46 0%, #FA9532 100%);
  115. border-radius: 20px;
  116. text-align: center;
  117. }
  118. .close {
  119. width: 46rpx;
  120. height: 75rpx;
  121. position: fixed;
  122. right: 0;
  123. top: -73rpx;
  124. display: block;
  125. }
  126. }
  127. </style>