Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
anyremote-miniapp
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
wxl
anyremote-miniapp
Commits
98db7c48
Commit
98db7c48
authored
Apr 26, 2021
by
wxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
459e719d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
9 deletions
+7
-9
any-hooks/common/useSocket.ts
+1
-3
any-hooks/communication/useCallCenter.ts
+0
-0
any-hooks/communication/useChannelStore.ts
+0
-3
src/hooks/call/useCallerListener.ts
+5
-2
src/pages/meeting/invite.vue
+1
-1
No files found.
any-hooks/common/useSocket.ts
View file @
98db7c48
...
...
@@ -23,7 +23,6 @@ export function useSocket<S = any>() {
}
ws
.
addEventListener
(
'message'
,
event
=>
setMsg
(
event
.
data
));
ws
.
addEventListener
(
'open'
,
()
=>
{
console
.
log
(
'ws链接成功'
)
setStatus
(
'opening'
);
brokenTime
.
value
=
0
;
socketSettings
.
heartData
&&
startHeartConnect
();
...
...
@@ -44,13 +43,12 @@ export function useSocket<S = any>() {
const
limit
=
socketSettings
.
retryLimit
||
100
;
const
reconnect
=
()
=>
{
if
(
!
initUrl
)
return
;
console
.
log
(
'开始重连'
)
brokenTime
.
value
++
;
if
(
brokenTime
.
value
>
limit
)
{
ws
.
close
();
}
else
{
setStatus
(
'reconnect'
);
setTimeout
(
()
=>
connect
(
initUrl
),
brokenTime
.
value
*
1
000
);
setTimeout
(
()
=>
connect
(
initUrl
),
3
000
);
}
}
...
...
any-hooks/communication/useCallCenter.ts
View file @
98db7c48
any-hooks/communication/useChannelStore.ts
View file @
98db7c48
...
...
@@ -11,7 +11,6 @@ interface ChannelData {
export
function
useChannelStore
()
{
const
[
currentChannel
,
setChannel
]
=
useState
<
ChannelData
>
(
null
);
const
[
isInChannel
,
setInChannel
]
=
useState
(
false
);
const
[
channelMembers
,
setMembers
]
=
useState
<
string
[]
>
([]);
const
[
channelInfo
,
request
]
=
useRequest
<
ChannelData
>
(
'/getAgoraToken'
,
{
auto
:
false
});
const
{
currentMsg
}
=
useInjector
(
useNetSocketStore
);
...
...
@@ -37,7 +36,6 @@ export function useChannelStore() {
const
clearChannel
=
()
=>
{
setChannel
(
null
);
setInChannel
(
false
);
setMembers
([]);
}
watch
(
channelInfo
,
val
=>
{
...
...
@@ -58,7 +56,6 @@ export function useChannelStore() {
return
{
currentChannel
,
channelMembers
,
isEmpty
,
isInChannel
,
getTokenByChannel
,
...
...
src/hooks/call/useCallerListener.ts
View file @
98db7c48
import
{
navigateTo
,
redirectTo
,
setKeepScreenOn
,
showToast
}
from
"@tarojs/taro"
;
import
{
getCurrentInstance
,
navigateTo
,
redirectTo
,
setKeepScreenOn
,
showToast
}
from
"@tarojs/taro"
;
import
{
useCallCenter
}
from
"any-hooks/communication/useCallCenter"
;
import
{
onMounted
,
watch
}
from
"vue"
;
import
{
useInjector
}
from
"vue-vulcan"
;
...
...
@@ -40,6 +40,7 @@ export function useCallerListener() {
}
})
const
ins
=
getCurrentInstance
()
// 根据用户的呼叫状态变化,执行相应的页面跳转逻辑
watch
(
myCallState
,
(
state
,
prev
)
=>
{
switch
(
state
)
{
...
...
@@ -56,7 +57,9 @@ export function useCallerListener() {
})
break
;
case
'calling'
:
redirectTo
({
url
:
'/pages/meeting/index'
});
const
path
=
ins
.
router
.
path
;
// console.log('path', path)
path
!==
'/pages/meeting/index'
&&
redirectTo
({
url
:
'/pages/meeting/index'
});
break
;
}
})
...
...
src/pages/meeting/invite.vue
View file @
98db7c48
...
...
@@ -36,7 +36,7 @@ import { useCallCenter } from "any-hooks/communication/useCallCenter";
<view
class=
"role-name pd-2"
:class=
"
{hide: hideConfig[index]}" @tap="toggleHideByIndex(index)">
{{
key
}}
</view>
<view
class=
"white-box"
:style=
"
{display: hideConfig[index] ? 'none' : 'block'}">
<view
v-for=
"(item, i) in group"
:key=
"i"
>
<view
class=
"contact-item"
v-if=
"![authData.id
, caller?.id, target?.id
].includes(item?.id)"
>
<view
class=
"contact-item"
v-if=
"![authData.id].includes(item?.id)"
>
<image
class=
"avatar"
:src=
"item.avatar"
/>
<view
class=
"info"
>
<view>
{{
item
.
nickname
}}
</view>
...
...
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