lotteryAleart.vue 2.5 KB

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