Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qlintonger xeno
standalone-anyremote
Commits
b6b1b1cb
Commit
b6b1b1cb
authored
May 09, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 视频通话
parent
87d28029
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
src/App.vue
+27
-13
No files found.
src/App.vue
View file @
b6b1b1cb
...
...
@@ -19,33 +19,38 @@ import useUserStore from '@/store/user'
import
{
wsShouldOpen
}
from
'AnyR/states/coreState'
import
{
storeToRefs
}
from
'pinia'
import
{
userStates
}
from
'AnyR/states/wsStates'
import
{
CallState
}
from
"AnyR/constants/chatChannelRelated"
;
import
{
chatChannelState
}
from
"AnyR/states/chatChannelStates"
;
import
useContactsStore
from
"@/store/contacts"
;
import
{
useAnyR
}
from
"AnyR/index"
;
import
{
CallState
}
from
'AnyR/constants/chatChannelRelated'
import
{
chatChannelState
}
from
'AnyR/states/chatChannelStates'
import
useContactsStore
from
'@/store/contacts'
import
{
useAnyR
}
from
'AnyR/index'
const
contactsStore
=
useContactsStore
()
const
AnyR
=
useAnyR
()
;
const
AnyR
=
useAnyR
()
watch
(()
=>
chatChannelState
.
value
.
currentState
,
function
(
value
:
any
)
{
watch
(
()
=>
chatChannelState
.
value
.
currentState
,
function
(
value
:
any
)
{
if
(
value
===
CallState
.
idle
)
{
contactsStore
.
changeWait
(
false
)
router
.
replace
({
name
:
"Contacts"
name
:
'Contacts'
})
}
else
if
(
value
===
CallState
.
callIn
||
value
===
CallState
.
callOut
)
{
}
else
if
(
value
===
CallState
.
callIn
||
value
===
CallState
.
callOut
)
{
contactsStore
.
changeWait
(
true
)
}
else
{
if
(
AnyR
.
agora
)
{
contactsStore
.
changeWait
(
false
);
router
.
push
({
name
:
"VideoCall"
}).
then
(
function
()
{
contactsStore
.
changeWait
(
false
)
router
.
push
({
name
:
'VideoCall'
})
.
then
(
function
()
{
return
AnyR
.
agora
.
joinChatRoom
()
})
}
}
})
}
)
const
{
showLoading
,
loadText
}
=
storeToRefs
(
useAppStore
())
...
...
@@ -87,8 +92,17 @@ router.beforeEach(async (to, from, next) => {
if
(
to
.
name
==
'Login'
)
{
next
({
path
:
'./'
})
}
else
{
//视频通话页面
if
(
to
.
name
==
'VideoCall'
)
{
if
(
AnyR
.
agora
&&
chatChannelState
.
value
.
currentState
==
CallState
.
calling
)
{
next
()
}
else
{
next
({
path
:
'./'
})
}
}
else
{
next
()
}
}
}
else
{
//未登录
if
(
to
.
name
==
'Login'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment