activity.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <view class="tui-alert-class tui-alert-box" :class="[show?'tui-alert-show':'tui-alert-hide']" @touchmove.stop.prevent="discard">
  4. <image src="https://static.caimei365.com/app/img/icon/icon-coupon-alert@2x.png" mode="" @click.stop="handleClick"></image>
  5. <text class="iconfont icon-2guanbi" @click.stop="handleClickCancel"></text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name:"tuiAlert",
  12. props: {
  13. //控制显示
  14. show: {
  15. type: Boolean,
  16. default: false
  17. },
  18. //提示信息字体大小
  19. size: {
  20. type: Number,
  21. default: 30
  22. },
  23. //提示信息字体颜色
  24. color: {
  25. type: String,
  26. default: "#333"
  27. },
  28. //按钮字体颜色
  29. btnColor: {
  30. type: String,
  31. default: "#EB0909"
  32. },
  33. btnText:{
  34. type: String,
  35. default: ""
  36. },
  37. //点击遮罩 是否可关闭
  38. maskClosable: {
  39. type: Boolean,
  40. default: false
  41. }
  42. },
  43. methods: {
  44. handleClick(e) {
  45. console.log(e);
  46. if (!this.show) return;
  47. this.$emit('click',false);
  48. },
  49. handleClickCancel() {
  50. this.$emit('cancel',false);
  51. },
  52. discard(){
  53. //丢弃
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .tui-alert-box {
  60. width: 100%;
  61. height: 100%;
  62. display: flex;
  63. align-items: center;
  64. justify-content: center;
  65. flex-direction: column;
  66. position: fixed;
  67. left: 0;
  68. top: 100%;
  69. opacity: 0;
  70. background: rgba(0,0,0,.2);
  71. z-index: 99999;
  72. image{
  73. width: 580rpx;
  74. height: 802rpx;
  75. margin-top: 100rpx;
  76. }
  77. }
  78. .tui-alert-show {
  79. top: 0;
  80. opacity: 1;
  81. // animation:rundtop 0.5s;
  82. }
  83. .tui-alert-hide{
  84. top: 100%;
  85. opacity: 0;
  86. // animation:rundbottom 0.5s;
  87. }
  88. .icon-2guanbi{
  89. display: block;
  90. width: 100rpx;
  91. height: 100rpx;
  92. line-height: 100rpx;
  93. text-align: center;
  94. color: #FFFFFF;
  95. position: absolute;
  96. top: 25%;
  97. right: 4%;
  98. font-size: 52rpx;
  99. }
  100. .tui-alert-mask-show {
  101. visibility: visible;
  102. opacity: 1;
  103. }
  104. .tui-alert-btn {
  105. width: 100%;
  106. height: 90rpx;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. background-color: #fff;
  111. box-sizing: border-box;
  112. position: relative;
  113. font-size: 32rpx;
  114. line-height: 32rpx;
  115. }
  116. .tui-alert-btn-hover {
  117. background-color: #f7f7f7;
  118. }
  119. .tui-alert-btn::before {
  120. width: 100%;
  121. content: "";
  122. position: absolute;
  123. border-top: 1rpx solid #E0E0E0;
  124. -webkit-transform: scaleY(0.5);
  125. transform: scaleY(0.5);
  126. left: 0;
  127. top: 0;
  128. }
  129. @keyframes rundtop{
  130. 0%{top: 100%;opacity: 0;}
  131. 100%{top:0;opacity: 1;}
  132. }
  133. @keyframes rundbottom{
  134. 0%{top: 0;opacity: 1;}
  135. 100%{top:100%;opacity: 0;}
  136. }
  137. </style>