close.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. emit('confirmDialog');
  44. window.parent &&
  45. window.parent.postMessage(
  46. {
  47. type: 'exit',
  48. },
  49. '*',
  50. );
  51. };
  52. </script>
  53. <style scoped lang="scss">
  54. #dialog_index {
  55. width: 100vw;
  56. height: 100%;
  57. // background: rgba(0, 0, 0, 0.5);
  58. position: fixed;
  59. left: 0;
  60. top: 0;
  61. z-index: 100000;
  62. pointer-events: none;
  63. .created_dialog {
  64. pointer-events: auto;
  65. width: 8.64rem;
  66. // min-height: 5rem;
  67. // background: #ffffff;
  68. border-radius: 8px;
  69. position: absolute;
  70. left: 50%;
  71. top: 50%;
  72. transform: translate(-50%, -50%);
  73. border: 1px solid rgba(255, 255, 255, 0.1);
  74. border-radius: 4px;
  75. .blurBox {
  76. position: absolute;
  77. z-index: 1;
  78. top: 0;
  79. left: 0;
  80. width: 100%;
  81. height: 100%;
  82. background: rgba(0, 0, 0, 0.7);
  83. filter: blur(1px);
  84. }
  85. .content {
  86. position: relative;
  87. z-index: 2;
  88. top: 0;
  89. left: 0;
  90. width: 100%;
  91. height: 100%;
  92. }
  93. .dialog_title {
  94. width: 100%;
  95. height: 1.39rem;
  96. padding: 0 0.56rem;
  97. box-sizing: border-box;
  98. font-size: 0.39rem;
  99. color: #fff;
  100. line-height: 1.39rem;
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. white-space: nowrap;
  104. border-bottom-style: solid;
  105. border-bottom-width: 1px;
  106. border-bottom-color: rgba(255, 255, 255, 0.1);
  107. }
  108. .dialog_desc {
  109. font-size: 0.42rem;
  110. color: #fff;
  111. padding: 0.56rem 0;
  112. text-align: center;
  113. }
  114. .created_btn {
  115. width: 100%;
  116. height: 1.36rem;
  117. border-top-style: solid;
  118. border-top-width: 1px;
  119. border-top-color: rgba(255, 255, 255, 0.1);
  120. box-sizing: border-box;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. font-size: 0.39rem;
  125. > div {
  126. width: 50%;
  127. height: 1.36rem;
  128. text-align: center;
  129. line-height: 1.36rem;
  130. font-size: 0.39rem;
  131. box-sizing: border-box;
  132. &.end_cancel {
  133. color: #fff;
  134. border-right-style: solid;
  135. border-right-width: 1px;
  136. border-right-color: rgba(255, 255, 255, 0.1);
  137. }
  138. &.end_confirm {
  139. color: #ed5d18;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. </style>