lotteryAleart.vue 2.1 KB

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