custom-warn.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="custom-warn" :class="showWarn && delayHide ? 'bg-in' : 'bg-out'">
  3. <view class="custom-warn-dialog" :class="showWarn && delayHide ? 'dialog-in' : 'dialog-out'">
  4. <text class="close cuIcon-close" @tap="close"></text>
  5. <image class="top" src="https://api.jiuweiyun.cn/public/uploads/icon/warn.png" mode=""></image>
  6. <view class="mid">
  7. <view class="title">违规处罚通知</view>
  8. <view class="text">用户&nbsp;<text style="color: #fa6342;">{{ nameList[Math.floor(Math.random() * 10)] }}</text>&nbsp;因私自盗用他人图片上传,严重影响争霸赛比赛秩序。现决定取消其参赛资格,且押金不予退还。</view>
  9. </view>
  10. <button hover-class="hover" class="bot" @tap="close">我知道了</button>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. delayHide: true, //开始 淡出 动画
  19. nameList: [
  20. '安稳随心',
  21. '夕颜若雪',
  22. '念之森蓝',
  23. '莫离ジ莫弃',
  24. '青墨断笺',
  25. '簡簡單單',
  26. '阡南陌北',
  27. '始終如1',
  28. '浅夏初雨',
  29. '一鹿有晗'
  30. ]
  31. }
  32. },
  33. computed: {
  34. showWarn () { //手机验证弹框显示状态
  35. return this.$store.state.showWarn
  36. }
  37. },
  38. methods: {
  39. close () { //关闭手机验证弹窗
  40. this.delayHide = false
  41. setTimeout(e => {
  42. this.$store.commit('HIDEWARN')
  43. this.delayHide = true
  44. }, 100)
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .custom-warn {
  51. position: fixed;
  52. left: 0;
  53. right: 0;
  54. top: 0;
  55. bottom: 0;
  56. background: rgba(0, 0, 0, .3);
  57. z-index: 2;
  58. .custom-warn-dialog {
  59. position: fixed;
  60. width: 576rpx;
  61. height: 706rpx;
  62. left: 50%;
  63. top: 50%;
  64. margin-left: -288rpx;
  65. margin-top: -353rpx;
  66. background: #FFFFFF;
  67. border-radius: 20rpx;
  68. overflow: hidden;
  69. display: flex;
  70. flex-direction: column;
  71. justify-content: space-between;
  72. .close {
  73. position: absolute;
  74. z-index: 2;
  75. top: 30rpx;
  76. right: 30rpx;
  77. font-size: 50rpx;
  78. color: rgba(255, 255, 255, .7);
  79. }
  80. .top {
  81. width: 100%;
  82. height: 340rpx;
  83. }
  84. .mid {
  85. box-sizing: border-box;
  86. padding: 0 60rpx;
  87. .title {
  88. font-size: 40rpx;
  89. margin-bottom: 30rpx;
  90. text-align: center;
  91. }
  92. .text {
  93. font-size: 26rpx;
  94. line-height: 42rpx;
  95. }
  96. }
  97. .bot {
  98. width: 100%;
  99. height: 96rpx;
  100. line-height: 96rpx;
  101. text-align: center;
  102. font-size: 32rpx;
  103. font-family: "Source Han Sans CN";
  104. font-weight: 400;
  105. color: rgba(250,99,66,1);
  106. border-radius: 0;
  107. &.hover {
  108. background:rgba(250, 99, 66, 1);
  109. color: #FFFFFF;
  110. }
  111. }
  112. }
  113. }
  114. @keyframes dialog-in {
  115. 0% {
  116. transform: scale(0, 0);
  117. }
  118. 100% {
  119. transform: scale(1, 1);
  120. }
  121. }
  122. @keyframes dialog-out {
  123. 0% {
  124. transform: scale(1, 1);
  125. }
  126. 100% {
  127. transform: scale(0, 0);
  128. }
  129. }
  130. @keyframes bg-in {
  131. 0% {
  132. background: rgba(0, 0, 0, 0)
  133. }
  134. 100% {
  135. background: rgba(0, 0, 0, .4)
  136. }
  137. }
  138. @keyframes bg-out {
  139. 0% {
  140. background: rgba(0, 0, 0, .4)
  141. }
  142. 100% {
  143. background: rgba(0, 0, 0, 0)
  144. }
  145. }
  146. .bg-in {
  147. animation: bg-in .2s;
  148. animation-fill-mode: forwards;
  149. }
  150. .bg-out {
  151. animation: bg-out .1s;
  152. animation-fill-mode: forwards;
  153. }
  154. .dialog-in {
  155. animation: dialog-in .2s;
  156. animation-fill-mode: forwards;
  157. }
  158. .dialog-out {
  159. animation: dialog-out .1s;
  160. animation-fill-mode: forwards;
  161. }
  162. </style>