lotteryAleart.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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: this.$t(`no_raffle`),
  40. msg: this.$t(`lottery_msg`),
  41. btn: this.$t(`i_see`)
  42. }
  43. } else if (type === 2) {
  44. this.aleartData = {
  45. title: this.$t(`lottery_result`),
  46. img: this.alData.image,
  47. msg: this.alData.prompt,
  48. btn: this.$t(`ok`),
  49. type: this.alData.type
  50. }
  51. }
  52. },
  53. aleartStatus(status) {
  54. if (!status) {
  55. this.aleartData = {}
  56. }
  57. }
  58. },
  59. methods: {
  60. //隐藏弹窗
  61. posterImageClose(type) {
  62. this.$emit("close", false)
  63. },
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .aleart {
  69. width: 500rpx;
  70. // height: 714rpx;
  71. position: fixed;
  72. left: 50%;
  73. transform: translateX(-50%);
  74. z-index: 9999;
  75. top: 50%;
  76. margin-top: -357rpx;
  77. background-color: #fff;
  78. padding: 30rpx;
  79. border-radius: 12rpx;
  80. .title {
  81. font-size: 18px;
  82. color: #E82C27;
  83. font-weight: bold;
  84. text-align: center;
  85. padding-bottom: 10rpx;
  86. border-bottom: 1px solid rgba(#E82C27, 0.2);
  87. }
  88. .aleart-body {
  89. display: flex;
  90. align-items: center;
  91. justify-content: center;
  92. flex-direction: column;
  93. padding: 60rpx 0;
  94. .goods-img {
  95. width: 150rpx;
  96. height: 150rpx;
  97. }
  98. .msg {
  99. font-size: 30rpx;
  100. color: #282828;
  101. }
  102. }
  103. .btn {
  104. width: 100%;
  105. padding: 15rpx 0;
  106. color: #fff;
  107. background: linear-gradient(90deg, #F34A46 0%, #FA9532 100%);
  108. border-radius: 20px;
  109. text-align: center;
  110. }
  111. .close {
  112. width: 46rpx;
  113. height: 75rpx;
  114. position: fixed;
  115. right: 0;
  116. top: -73rpx;
  117. display: block;
  118. }
  119. }
  120. </style>