|
@@ -0,0 +1,190 @@
|
|
|
+<template>
|
|
|
+ <div id="dialog_index" v-if="ifBaseDialog">
|
|
|
+ <div class="created_dialog">
|
|
|
+ <div class="blurBox"></div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="dialog_title">{{ title }}</div>
|
|
|
+ <p class="dialog_desc">{{ desc }}</p>
|
|
|
+ <div class="created_btn">
|
|
|
+ <div class="end_cancel" @click="endLiveCancel">{{ closeTxt }}</div>
|
|
|
+ <div class="end_confirm" @click="endLiveConfirm">{{ okTxt }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ // import browser from '/@/utils/browser';
|
|
|
+ import {
|
|
|
+ onMounted,
|
|
|
+ watch,
|
|
|
+ defineProps,
|
|
|
+ defineEmits,
|
|
|
+ ref,
|
|
|
+ computed,
|
|
|
+ watchEffect,
|
|
|
+ unref,
|
|
|
+ } from 'vue';
|
|
|
+ import { useRtcStore } from '/@/store/modules/rtc';
|
|
|
+ const emit = defineEmits(['closeDialog', 'confirmDialog']);
|
|
|
+ const rtcStore = useRtcStore();
|
|
|
+
|
|
|
+ const baseDialog = computed(() => rtcStore.baseDialog);
|
|
|
+ const ifBaseDialog = computed(() => rtcStore.ifBaseDialog);
|
|
|
+ const title = ref('');
|
|
|
+ const desc = ref('');
|
|
|
+ const okTxt = ref('');
|
|
|
+ const closeTxt = ref('');
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => [baseDialog, ifBaseDialog],
|
|
|
+ (val) => {
|
|
|
+ console.log('hey', val);
|
|
|
+ title.value = unref(val[0]).title;
|
|
|
+ desc.value = unref(val[0]).desc;
|
|
|
+ okTxt.value = unref(val[0]).okTxt;
|
|
|
+ closeTxt.value = unref(val[0]).closeTxt;
|
|
|
+ },
|
|
|
+ { deep: true },
|
|
|
+ );
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => props,
|
|
|
+ (val) => {
|
|
|
+ console.log('hey', val);
|
|
|
+ title.value = props.title;
|
|
|
+ desc.value = props.desc;
|
|
|
+ okTxt.value = props.okTxt;
|
|
|
+ closeTxt.value = props.closeTxt;
|
|
|
+ },
|
|
|
+ { deep: true },
|
|
|
+ );
|
|
|
+
|
|
|
+ const props = defineProps({
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: '温馨提示',
|
|
|
+ },
|
|
|
+ desc: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+ okTxt: {
|
|
|
+ type: String,
|
|
|
+ default: '确定',
|
|
|
+ },
|
|
|
+ closeTxt: {
|
|
|
+ type: String,
|
|
|
+ default: '取消',
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ const endLiveCancel = () => {
|
|
|
+ emit('closeDialog');
|
|
|
+
|
|
|
+ rtcStore.hideBaseDialog();
|
|
|
+ };
|
|
|
+
|
|
|
+ const endLiveConfirm = () => {
|
|
|
+ // socket.value.emit("disconnect");
|
|
|
+ rtcStore.baseDiaLogCallback();
|
|
|
+ emit('confirmDialog');
|
|
|
+ rtcStore.hideBaseDialog();
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ #dialog_index {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100%;
|
|
|
+ // background: rgba(0, 0, 0, 0.5);
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ z-index: 100000;
|
|
|
+ pointer-events: none;
|
|
|
+ .created_dialog {
|
|
|
+ pointer-events: auto;
|
|
|
+ width: 8.64rem;
|
|
|
+ // min-height: 5rem;
|
|
|
+ // background: #ffffff;
|
|
|
+ border-radius: 8px;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
+ border-radius: 4px;
|
|
|
+ .blurBox {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 1;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: rgba(0, 0, 0, 0.7);
|
|
|
+ filter: blur(1px);
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .dialog_title {
|
|
|
+ width: 100%;
|
|
|
+ height: 1.39rem;
|
|
|
+ padding: 0 0.56rem;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: 0.39rem;
|
|
|
+ color: #fff;
|
|
|
+ line-height: 1.39rem;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-bottom-style: solid;
|
|
|
+ border-bottom-width: 1px;
|
|
|
+ border-bottom-color: rgba(255, 255, 255, 0.1);
|
|
|
+ }
|
|
|
+ .dialog_desc {
|
|
|
+ font-size: 0.42rem;
|
|
|
+ color: #fff;
|
|
|
+ padding: 0.56rem 0;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .created_btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 1.36rem;
|
|
|
+ border-top-style: solid;
|
|
|
+ border-top-width: 1px;
|
|
|
+ border-top-color: rgba(255, 255, 255, 0.1);
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 0.39rem;
|
|
|
+ > div {
|
|
|
+ width: 50%;
|
|
|
+ height: 1.36rem;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 1.36rem;
|
|
|
+ font-size: 0.39rem;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &.end_cancel {
|
|
|
+ color: #fff;
|
|
|
+ border-right-style: solid;
|
|
|
+ border-right-width: 1px;
|
|
|
+ border-right-color: rgba(255, 255, 255, 0.1);
|
|
|
+ }
|
|
|
+ &.end_confirm {
|
|
|
+ color: #ed5d18;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|