Commit 98db7c48 by wxl

fix

parent 459e719d
...@@ -23,7 +23,6 @@ export function useSocket<S = any>() { ...@@ -23,7 +23,6 @@ export function useSocket<S = any>() {
} }
ws.addEventListener('message', event => setMsg(event.data)); ws.addEventListener('message', event => setMsg(event.data));
ws.addEventListener('open', () => { ws.addEventListener('open', () => {
console.log('ws链接成功')
setStatus('opening'); setStatus('opening');
brokenTime.value = 0; brokenTime.value = 0;
socketSettings.heartData && startHeartConnect(); socketSettings.heartData && startHeartConnect();
...@@ -44,13 +43,12 @@ export function useSocket<S = any>() { ...@@ -44,13 +43,12 @@ export function useSocket<S = any>() {
const limit = socketSettings.retryLimit || 100; const limit = socketSettings.retryLimit || 100;
const reconnect = () => { const reconnect = () => {
if(!initUrl) return; if(!initUrl) return;
console.log('开始重连')
brokenTime.value ++; brokenTime.value ++;
if(brokenTime.value > limit) { if(brokenTime.value > limit) {
ws.close(); ws.close();
} else { } else {
setStatus('reconnect'); setStatus('reconnect');
setTimeout( () => connect(initUrl), brokenTime.value*1000 ); setTimeout( () => connect(initUrl), 3000 );
} }
} }
......
...@@ -11,7 +11,6 @@ interface ChannelData { ...@@ -11,7 +11,6 @@ interface ChannelData {
export function useChannelStore() { export function useChannelStore() {
const [currentChannel, setChannel] = useState<ChannelData>(null); const [currentChannel, setChannel] = useState<ChannelData>(null);
const [isInChannel, setInChannel] = useState(false); const [isInChannel, setInChannel] = useState(false);
const [channelMembers, setMembers] = useState<string[]>([]);
const [channelInfo, request] = useRequest<ChannelData>('/getAgoraToken', {auto: false}); const [channelInfo, request] = useRequest<ChannelData>('/getAgoraToken', {auto: false});
const { currentMsg } = useInjector(useNetSocketStore); const { currentMsg } = useInjector(useNetSocketStore);
...@@ -37,7 +36,6 @@ export function useChannelStore() { ...@@ -37,7 +36,6 @@ export function useChannelStore() {
const clearChannel = () => { const clearChannel = () => {
setChannel(null); setChannel(null);
setInChannel(false); setInChannel(false);
setMembers([]);
} }
watch(channelInfo, val => { watch(channelInfo, val => {
...@@ -58,7 +56,6 @@ export function useChannelStore() { ...@@ -58,7 +56,6 @@ export function useChannelStore() {
return { return {
currentChannel, currentChannel,
channelMembers,
isEmpty, isEmpty,
isInChannel, isInChannel,
getTokenByChannel, getTokenByChannel,
......
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 { useCallCenter } from "any-hooks/communication/useCallCenter";
import { onMounted, watch } from "vue"; import { onMounted, watch } from "vue";
import { useInjector } from "vue-vulcan"; import { useInjector } from "vue-vulcan";
...@@ -40,6 +40,7 @@ export function useCallerListener() { ...@@ -40,6 +40,7 @@ export function useCallerListener() {
} }
}) })
const ins = getCurrentInstance()
// 根据用户的呼叫状态变化,执行相应的页面跳转逻辑 // 根据用户的呼叫状态变化,执行相应的页面跳转逻辑
watch(myCallState, (state, prev) => { watch(myCallState, (state, prev) => {
switch(state) { switch(state) {
...@@ -56,7 +57,9 @@ export function useCallerListener() { ...@@ -56,7 +57,9 @@ export function useCallerListener() {
}) })
break; break;
case 'calling': 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; break;
} }
}) })
......
...@@ -36,7 +36,7 @@ import { useCallCenter } from "any-hooks/communication/useCallCenter"; ...@@ -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="role-name pd-2" :class="{hide: hideConfig[index]}" @tap="toggleHideByIndex(index)">{{key}}</view>
<view class="white-box" :style="{display: hideConfig[index] ? 'none' : 'block'}"> <view class="white-box" :style="{display: hideConfig[index] ? 'none' : 'block'}">
<view v-for="(item, i) in group" :key="i" > <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" /> <image class="avatar" :src="item.avatar" />
<view class="info"> <view class="info">
<view>{{item.nickname}}</view> <view>{{item.nickname}}</view>
......
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