activity_on_1.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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://admin-b.caimei365.com/userfiles/1/images/photo/2020/08/icon-alert%402x.png" mode="" @click.stop="handleClick"></image>
  5. <text class="iconfont icon-iconfontguanbi" @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',{});
  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,.5);
  71. z-index: 100000;
  72. image{
  73. width: 750rpx;
  74. height: 1372rpx;
  75. }
  76. }
  77. .tui-alert-show {
  78. top: 0;
  79. opacity: 1;
  80. animation:rundtop 0.5s;
  81. }
  82. .tui-alert-hide{
  83. top: 100%;
  84. opacity: 0;
  85. animation:rundbottom 0.8s;
  86. }
  87. .icon-iconfontguanbi{
  88. display: block;
  89. width: 100rpx;
  90. height: 100rpx;
  91. line-height: 100rpx;
  92. text-align: center;
  93. color: #FFFFFF;
  94. position: fixed;
  95. bottom: 13%;
  96. left: 50%;
  97. font-size: $font-size-48;
  98. font-weight: bold;
  99. margin-left: -50rpx;
  100. }
  101. .tui-alert-mask-show {
  102. visibility: visible;
  103. opacity: 1;
  104. }
  105. .tui-alert-btn {
  106. width: 100%;
  107. height: 90rpx;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. background-color: #fff;
  112. box-sizing: border-box;
  113. position: relative;
  114. font-size: 32rpx;
  115. line-height: 32rpx;
  116. }
  117. .tui-alert-btn-hover {
  118. background-color: #f7f7f7;
  119. }
  120. .tui-alert-btn::before {
  121. width: 100%;
  122. content: "";
  123. position: absolute;
  124. border-top: 1rpx solid #E0E0E0;
  125. -webkit-transform: scaleY(0.5);
  126. transform: scaleY(0.5);
  127. left: 0;
  128. top: 0;
  129. }
  130. @keyframes rundtop{
  131. 0%{top: 100%;opacity: 0;}
  132. 100%{top:0;opacity: 1;}
  133. }
  134. @keyframes rundbottom{
  135. 0%{top: 0;opacity: 1;}
  136. 100%{top:100%;opacity: 0;}
  137. }
  138. </style>