message-box.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!-- 消息提示组件 -->
  2. <template>
  3. <div class="msg-box-overlay" v-if="dialogVisible">
  4. <div class="content-wrapper">
  5. <div class="title">{{title}}</div>
  6. <div class="desc">{{content}}</div>
  7. <div class="btn-wrapper">
  8. <div class="btn cancel" @click="cancel">Not yet</div>
  9. <div class="btn confirm" @click="confirm">Deposit</div>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script setup>
  15. /* eslint-disable */
  16. import { ref, defineEmits, defineProps } from "vue";
  17. const props = defineProps({
  18. dialogVisible: {
  19. type: Boolean,
  20. default: false,
  21. },
  22. title: {
  23. type: String,
  24. default: ''
  25. },
  26. content: {
  27. type: String,
  28. default: ''
  29. },
  30. });
  31. const emits = defineEmits(["cancel", "confirm"]);
  32. const cancel = () => {
  33. emits("cancel", {});
  34. };
  35. const confirm = () => {
  36. emits("confirm", {});
  37. };
  38. </script>
  39. <style lang="scss" scoped>
  40. .msg-box-overlay {
  41. position: fixed;
  42. top: 0;
  43. right: 0;
  44. bottom: 0;
  45. left: 0;
  46. z-index: 1000;
  47. height: 100%;
  48. background-color: rgba(0, 0, 0, 0.5);
  49. overflow: auto;
  50. .content-wrapper {
  51. position: absolute;
  52. left: 50%;
  53. top: 50%;
  54. width: 375px;
  55. height: 220px;
  56. background: #FFFFFF;
  57. border-radius: 20px;
  58. padding: 20px;
  59. box-sizing: border-box;
  60. transform: translate(-50%, -50%);
  61. text-align: center;
  62. .title {
  63. font-weight: 600;
  64. font-size: 20px;
  65. margin-bottom: 13px;
  66. }
  67. .desc {
  68. height: 68px;
  69. font-weight: 400;
  70. font-size: 15px;
  71. margin-bottom: 25px;
  72. }
  73. .btn-wrapper {
  74. display: flex;
  75. align-items: center;
  76. justify-content: space-between;
  77. .btn {
  78. height: 46px;
  79. width: 163px;
  80. text-align: center;
  81. line-height: 46px;
  82. border-radius: 100px;
  83. border: 1px solid #1D9BF0;
  84. box-sizing: border-box;
  85. font-weight: 600;
  86. font-size: 16px;
  87. cursor: pointer;
  88. }
  89. .cancel {
  90. color: #1D9BF0;
  91. }
  92. .confirm {
  93. background: #1D9BF0;
  94. color: #fff;
  95. }
  96. }
  97. }
  98. }
  99. </style>