modelAlert.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template name="alert">
  2. <view class="alert spec" :class="specClass">
  3. <view class="model-warp">
  4. <view class="model-alert">
  5. <view class="model-content">
  6. <view class="sm"><text>{{alertText}}</text></view>
  7. </view>
  8. <view class="alert-btn">
  9. <view class="btn btn-cancel" @click="hideConfirm">取消</view>
  10. <view class="btn btn-confirm" @click="btnConfirm(alertType)">确定</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default{
  18. name:'alert',
  19. props:['isShowDelModal','alertText','alertType'],
  20. data() {
  21. return{
  22. }
  23. },
  24. created() {
  25. },
  26. onLoad(){
  27. },
  28. methods:{
  29. hideConfirm(){
  30. this.$parent.isShowDelModal = false
  31. },
  32. //点击事件
  33. btnConfirm(type){
  34. this.$emit('btnConfirm',type)
  35. }
  36. },
  37. onShow(){
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. /*弹窗*/
  43. .model-warp.none{
  44. display: none;
  45. }
  46. .model-warp.show{
  47. display: block;
  48. }
  49. .model-warp{
  50. width: 100%;
  51. height: 100%;
  52. background: rgba(0,0,0,.5);
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. z-index: 8888;
  57. transition: all 0.4s;
  58. &.none{
  59. display: none;
  60. }
  61. &.show{
  62. display: block;
  63. }
  64. .model-alert{
  65. width: 518rpx;
  66. height: 316rpx;
  67. position: absolute;
  68. background: $bg-color;
  69. left: 0;
  70. right: 0;
  71. bottom: 0;
  72. top: 0;
  73. margin: auto;
  74. .alert-content{
  75. width: 466rpx;
  76. height: 152rpx;
  77. padding: 40rpx 26rpx;
  78. .t-h1,.t-p{
  79. font-size: $font-size-28;
  80. line-height: 40rpx;
  81. color: #333333;
  82. text-align:justify;
  83. padding: 10rpx;
  84. }
  85. .t-h1{
  86. border-bottom: 1px solid $border-color;
  87. }
  88. }
  89. .model-content{
  90. width: 466rpx;
  91. height: 152rpx;
  92. padding: 40rpx 26rpx;
  93. display: flex;
  94. flex-direction: column;
  95. align-items: center;
  96. .sm{
  97. display: flex;
  98. flex: 1;
  99. line-height: 152rpx;
  100. flex-direction: column;
  101. align-items: center;
  102. text-align: center;
  103. font-size: $font-size-28;
  104. color: #333333;
  105. }
  106. }
  107. .alert-btn{
  108. width: 100%;
  109. height: 88rpx;
  110. display: flex;
  111. .btn{
  112. flex: 1;
  113. line-height: 88rpx;
  114. font-size: $font-size-28;
  115. text-align: center;
  116. color: #FFFFFF;
  117. border-radius: 0;
  118. padding: 0;
  119. &.btn-cancel{
  120. background: $btn-cancel;
  121. }
  122. &.btn-confirm{
  123. background: $btn-confirm;
  124. }
  125. }
  126. }
  127. }
  128. }
  129. </style>