close.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div id="dialog_index">
  3. <div class="created_dialog">
  4. <div class="blurBox"></div>
  5. <div class="content">
  6. <div class="dialog_title">{{ props.title }}</div>
  7. <p class="dialog_desc">{{ props.desc }}</p>
  8. <div class="created_btn">
  9. <div class="end_cancel" @click="endLiveCancel">{{ t('base.cancel') }}</div>
  10. <div class="end_confirm" @click="endLiveConfirm">{{ t('base.endNow') }}</div>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. import browser from '/@/utils/browser';
  18. import { onMounted, watch, ref, computed } from 'vue';
  19. import { useI18n } from '/@/hooks/useI18n';
  20. const emit = defineEmits(['closeDialog', 'confirmDialog']);
  21. const { t } = useI18n();
  22. const role = ref(browser.urlHashValue('role'));
  23. const props = defineProps({
  24. title: {
  25. type: String,
  26. default: () => {
  27. const { t } = useI18n();
  28. return t('base.tips');
  29. },
  30. },
  31. desc: {
  32. type: String,
  33. default: () => {
  34. const { t } = useI18n();
  35. return t('base.endRoom');
  36. },
  37. },
  38. });
  39. const endLiveCancel = () => {
  40. emit('closeDialog');
  41. };
  42. const endLiveConfirm = () => {
  43. // socket.value.emit("disconnect");
  44. emit('confirmDialog');
  45. };
  46. </script>
  47. <style scoped lang="scss">
  48. #dialog_index {
  49. width: 100vw;
  50. height: 100%;
  51. // background: rgba(0, 0, 0, 0.5);
  52. position: fixed;
  53. left: 0;
  54. top: 0;
  55. z-index: 100000;
  56. pointer-events: none;
  57. .created_dialog {
  58. pointer-events: auto;
  59. width: 8.64rem;
  60. // min-height: 5rem;
  61. // background: #ffffff;
  62. border-radius: 8px;
  63. position: absolute;
  64. left: 50%;
  65. top: 50%;
  66. transform: translate(-50%, -50%);
  67. border: 1px solid rgba(255, 255, 255, 0.1);
  68. border-radius: 4px;
  69. .blurBox {
  70. position: absolute;
  71. z-index: 1;
  72. top: 0;
  73. left: 0;
  74. width: 100%;
  75. height: 100%;
  76. background: rgba(0, 0, 0, 0.7);
  77. filter: blur(1px);
  78. }
  79. .content {
  80. position: relative;
  81. z-index: 2;
  82. top: 0;
  83. left: 0;
  84. width: 100%;
  85. height: 100%;
  86. }
  87. .dialog_title {
  88. width: 100%;
  89. height: 1.39rem;
  90. padding: 0 0.56rem;
  91. box-sizing: border-box;
  92. font-size: 0.39rem;
  93. color: #fff;
  94. line-height: 1.39rem;
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. white-space: nowrap;
  98. border-bottom-style: solid;
  99. border-bottom-width: 1px;
  100. border-bottom-color: rgba(255, 255, 255, 0.1);
  101. }
  102. .dialog_desc {
  103. font-size: 0.42rem;
  104. color: #fff;
  105. padding: 0.56rem 0;
  106. text-align: center;
  107. }
  108. .created_btn {
  109. width: 100%;
  110. height: 1.36rem;
  111. border-top-style: solid;
  112. border-top-width: 1px;
  113. border-top-color: rgba(255, 255, 255, 0.1);
  114. box-sizing: border-box;
  115. display: flex;
  116. align-items: center;
  117. justify-content: center;
  118. font-size: 0.39rem;
  119. > div {
  120. width: 50%;
  121. height: 1.36rem;
  122. text-align: center;
  123. line-height: 1.36rem;
  124. font-size: 0.39rem;
  125. box-sizing: border-box;
  126. &.end_cancel {
  127. color: #fff;
  128. border-right-style: solid;
  129. border-right-width: 1px;
  130. border-right-color: rgba(255, 255, 255, 0.1);
  131. }
  132. &.end_confirm {
  133. color: #ed5d18;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. </style>