index.vue 3.2 KB

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