index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <!-- 抽奖结果弹窗 -->
  3. <view class="aleart flex-col flex-center" v-if="aleartStatus" @touchmove.stop.prevent>
  4. <image :src="alData.image" class="w-180 h-180"></image>
  5. <view class="fs-34 font-red fw-500 lh-48rpx mt-24"
  6. :class="theme ? 'font-num' : 'font-red'"
  7. >{{alData.type > 1 ? '恭喜你获得' : alData.name}}</view>
  8. <view class="fs-26 text--w111-333 lh-36rpx mt-24">{{aleartData.msg}}</view>
  9. <view class="btn flex-center fs-28 text--w111-fff mt-32" @tap="posterImageClose"
  10. :class="theme ? 'bg-gradient1' : 'bg-red-g'"
  11. >{{alData.type > 1 ? '立即领取' : '我知道了'}}</view>
  12. <text class="close iconfont icon-ic_close1" @click="posterImageClose"></text>
  13. <slot name="bottom"></slot>
  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. default:0
  27. },
  28. alData: {
  29. type: Object,
  30. default:()=>{}
  31. },
  32. aleartStatus: {
  33. type: Boolean,
  34. default: false
  35. },
  36. theme:{
  37. type: Boolean,
  38. default: false
  39. }
  40. },
  41. watch: {
  42. aleartType(type) {
  43. if (type === 1) {
  44. this.aleartData = {
  45. title: '暂无抽奖资格',
  46. msg: `1、您未关注公众号
  47. 2、您未获得VIP权限,获取VIP途径:
  48. (1)购买过打通版的用户可在会员群联系官方客服开通
  49. (2)官方小程序商城购买人人益生打通版、企业版后自动开通`,
  50. btn: '我知道了'
  51. }
  52. } else if (type === 2) {
  53. this.aleartData = {
  54. title: '抽奖结果',
  55. img: this.alData.image,
  56. msg: this.alData.prompt,
  57. btn: '好的',
  58. type: this.alData.type
  59. }
  60. }
  61. },
  62. aleartStatus(status) {
  63. if (!status) {
  64. this.aleartData = {}
  65. }
  66. }
  67. },
  68. methods: {
  69. //隐藏弹窗
  70. posterImageClose(type) {
  71. this.$emit("close", false)
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .aleart {
  78. width: 480rpx;
  79. height: 544rpx;
  80. position: fixed;
  81. left: 50%;
  82. top: 50%;
  83. transform: translate(-50%,-50%);
  84. z-index: 9999;
  85. background-color: #fff;
  86. border-radius: 48rpx;
  87. background-image:url('../../static/alert_modal_bg.png');
  88. background-size:100%;
  89. background-repeat: no-repeat;
  90. }
  91. .aleart .close{
  92. position: absolute;
  93. left:50%;
  94. bottom:-100rpx;
  95. transform: translateX(-50%);
  96. color: #fff;
  97. font-size:50rpx;
  98. }
  99. .font-red{
  100. color: #e93323;
  101. }
  102. .btn{
  103. width: 280rpx;
  104. height: 80rpx;
  105. border-radius: 50rpx;
  106. color: #fff;
  107. }
  108. .bg-red-g{
  109. background: linear-gradient(90deg, #FF7931 0%, #E93323 100%);
  110. }
  111. </style>