Commit 00835b21 by pangchong

feat: 优化

parent ac29042a
<template> <template>
<div class="w-full h-full flex justify-center items-center flex-col absolute bg-theme-bg3 z-[999]"> <div class="w-full h-full flex justify-center items-center flex-col absolute bg-theme-bg3 z-[999]">
<global-avatar :avatar-size="124" :icon-size="32"></global-avatar> <global-avatar :avatar-size="124" :icon-size="32"></global-avatar>
<div class="text-4xl font-medium mt-8 mb-2 text-theme-text1">{{chattersName.join('、')}}</div> <div class="text-4xl font-medium mt-8 mb-2 text-theme-text1">{{ chattersName.join('、') }}</div>
<div v-if="chatChannelState.currentState === CallState.callIn" class="text-2xl font-medium mb-8 text-theme-text3">正在呼叫你...</div> <div class="text-2xl font-medium mb-8 text-theme-text3">{{ chatChannelState.currentState === CallState.callIn ? '正在呼叫你...' : '正在呼叫' }}</div>
<div v-else class="text-2xl font-medium mb-8 text-theme-text3">正在呼叫</div> <a-space :size="32">
<a-space :size="32"> <template v-if="chatChannelState.currentState === CallState.callIn">
<template v-if="chatChannelState.currentState === CallState.callIn"> <a-button shape="circle" status="success" type="primary" @click="acceptCall">
<a-button shape="circle" status="success" type="primary" @click="acceptCall"> <global-icon :size="32" color="var(--color-bg-white)" icon="phone-fill"></global-icon>
<global-icon :size="32" color="var(--color-bg-white)" icon="phone-fill"></global-icon> </a-button>
</a-button> <a-button shape="circle" status="danger" type="primary" @click="refuseCall">
<a-button shape="circle" status="danger" type="primary" @click="refuseCall"> <global-icon :size="32" color="var(--color-bg-white)" icon="phone-hangup"></global-icon>
<global-icon :size="32" color="var(--color-bg-white)" icon="phone-hangup"></global-icon> </a-button>
</a-button> </template>
</template> <template v-else>
<template v-else> <a-button shape="circle" status="danger" type="primary" @click="cancelCall">
<a-button shape="circle" status="danger" type="primary" @click="cancelCall"> <global-icon :size="32" color="var(--color-bg-white)" icon="phone-hangup"></global-icon>
<global-icon :size="32" color="var(--color-bg-white)" icon="phone-hangup"></global-icon> </a-button>
</a-button> </template>
</template> </a-space>
</a-space> </div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {useAnyR} from "AnyR/index"; import { useAnyR } from 'AnyR/index'
import {chatChannelState} from "AnyR/states/chatChannelStates"; import { chatChannelState } from 'AnyR/states/chatChannelStates'
import {CallState} from "AnyR/constants/chatChannelRelated"; import { CallState } from 'AnyR/constants/chatChannelRelated'
import {allOtherChattersIdSet} from "AnyR/states/chatChannelStates"; import { allOtherChattersIdSet } from 'AnyR/states/chatChannelStates'
import {userStates} from "AnyR/states/wsStates"; import { userStates } from 'AnyR/states/wsStates'
import {computed} from "vue"; import { computed } from 'vue'
const AnyR = useAnyR(); const AnyR = useAnyR()
const chattersName = computed(function () { const chattersName = computed(function () {
return allOtherChattersIdSet.value.map(function (a: any) { return allOtherChattersIdSet.value.map(function (a: any) {
// @ts-ignore // @ts-ignore
return userStates.value.onlineContacts.find((q: any) => q.fromID === a)?.fromName || '未知用户' return userStates.value.onlineContacts.find((q: any) => q.fromID === a)?.fromName || '未知用户'
}) })
}) })
function acceptCall() { function acceptCall() {
AnyR?.agora.acceptCurrentCall() AnyR?.agora.acceptCurrentCall()
} }
function refuseCall() { function refuseCall() {
AnyR?.agora.refuseCurrentCall() AnyR?.agora.refuseCurrentCall()
} }
function cancelCall() { function cancelCall() {
AnyR?.agora.cancelCurrentCall(); AnyR?.agora.cancelCurrentCall()
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.arco-btn { .arco-btn {
width: 64px; width: 64px;
height: 64px; height: 64px;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment