1
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "密谈IM",
|
"name" : "密谈IM",
|
||||||
"appid" : "__UNI__D40A151",
|
"appid" : "__UNI__BE00EFC",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.1.3",
|
"versionName" : "1.1.3",
|
||||||
"versionCode" : 112,
|
"versionCode" : 112,
|
||||||
|
|||||||
21
pages.json
21
pages.json
@@ -441,17 +441,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path" : "pages/room/room",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText": "Room",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle":"custom",
|
|
||||||
"gestureBack":"NO"
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
{
|
{
|
||||||
@@ -469,6 +458,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
{
|
||||||
|
"path" : "pages/room/room",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "Room",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle":"custom",
|
||||||
|
"gestureBack":"NO"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/adduser/index",
|
"path": "pages/adduser/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
1153
pages/room/room.nvue
1153
pages/room/room.nvue
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,11 @@ import {
|
|||||||
import * as CallLib from "@/uni_modules/RongCloud-CallWrapper/lib/index"
|
import * as CallLib from "@/uni_modules/RongCloud-CallWrapper/lib/index"
|
||||||
import RCIMIWEngine from '@/uni_modules/RongCloud-IMWrapper-V2/js_sdk/RCIMEngine'
|
import RCIMIWEngine from '@/uni_modules/RongCloud-IMWrapper-V2/js_sdk/RCIMEngine'
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js"
|
import permision from "@/js_sdk/wa-permission/permission.js"
|
||||||
import {reasonDeal,errorDeal,imCode} from '@/utils/code.js'
|
import {
|
||||||
|
reasonDeal,
|
||||||
|
errorDeal,
|
||||||
|
imCode
|
||||||
|
} from '@/utils/code.js'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
import {
|
import {
|
||||||
@@ -85,6 +89,7 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
|
|
||||||
/** 用户积分数 */
|
/** 用户积分数 */
|
||||||
const integralData = ref(0)
|
const integralData = ref(0)
|
||||||
|
// 融云
|
||||||
const imEngine = ref(null)
|
const imEngine = ref(null)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,7 +178,9 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
const options = {
|
const options = {
|
||||||
naviServer: ''
|
naviServer: ''
|
||||||
}
|
}
|
||||||
imEngine.value = await RCIMIWEngine.create(tencentUserSig.value.appKey, options)
|
if(!imEngine.value){
|
||||||
|
imEngine.value = await RCIMIWEngine.create(tencentUserSig.value.appKey, options)
|
||||||
|
}
|
||||||
imEngine.value.setOnConnectedListener((res) => {
|
imEngine.value.setOnConnectedListener((res) => {
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@@ -187,8 +194,6 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
CallLib.init({});
|
CallLib.init({});
|
||||||
onAllListeners()
|
onAllListeners()
|
||||||
console.log('call.init')
|
console.log('call.init')
|
||||||
// this.libPage = true;
|
|
||||||
// this.loginUserId = res.userId;
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.log('登录成功')
|
console.log('登录成功')
|
||||||
if (uni.getSystemInfoSync().platform === 'android') {
|
if (uni.getSystemInfoSync().platform === 'android') {
|
||||||
@@ -206,37 +211,53 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAllListeners(){
|
function onAllListeners() {
|
||||||
CallLib.onCallReceived(res => {
|
CallLib.onCallReceived(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
console.log(
|
console.log(
|
||||||
'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
|
'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
|
||||||
res.data.targetId
|
res.data.targetId
|
||||||
)
|
)
|
||||||
|
let session = res.data
|
||||||
|
// //呼入
|
||||||
|
uni.setStorageSync('room-parameters', {
|
||||||
|
callType: 'in',
|
||||||
|
mediaType: session.mediaType === 0 ? 'audio' : 'video'
|
||||||
|
});
|
||||||
|
//跳转.nvue
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/room/room'
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
CallLib.onCallConnected(res => {
|
CallLib.onCallConnected(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
console.log(
|
console.log(
|
||||||
'Engine:OnCallConnected=>' +
|
'Engine:OnCallConnected=>' +
|
||||||
'已建立通话通话接通时,通过回调 onCallConnected 通知当前 call 的详细信息',
|
'已建立通话通话接通时,通过回调 onCallConnected 通知当前 call 的详细信息',
|
||||||
res
|
res
|
||||||
)
|
)
|
||||||
|
})
|
||||||
|
CallLib.onRemoteUserInvited((res)=>{
|
||||||
|
console.log("Engine:OnRemoteUserInvited=>"+"通话中的某一个参与者,邀请好友加入通话 ,远端Id为=>", res.data.userId);
|
||||||
|
uni.$emit('OnCallConnected');
|
||||||
})
|
})
|
||||||
|
|
||||||
CallLib.onRemoteUserJoined(res => {
|
CallLib.onRemoteUserJoined(res => {
|
||||||
console.log(
|
console.log(
|
||||||
'Engine:OnRemoteUserJoined=>' +
|
'Engine:OnRemoteUserJoined=>' +
|
||||||
'主叫端拨出电话,被叫端收到请求后,加入通话,被叫端Id为=>',
|
'主叫端拨出电话,被叫端收到请求后,加入通话,被叫端Id为=>',
|
||||||
res.data.userId
|
res.data.userId
|
||||||
)
|
)
|
||||||
|
uni.$emit('OnCallConnected');
|
||||||
})
|
})
|
||||||
|
|
||||||
CallLib.onCallDisconnected(res => {
|
CallLib.onCallDisconnected(res => {
|
||||||
console.log(
|
console.log(
|
||||||
'Engine:OnCallDisconnected=>' + '挂断成功, 挂断原因=>',
|
'Engine:OnCallDisconnected=>' + '挂断成功, 挂断原因=>',
|
||||||
res.data.reason
|
res.data.reason
|
||||||
)
|
)
|
||||||
|
uni.$emit('OnCallDisconnected');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,6 +285,7 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
removeFriendList()
|
removeFriendList()
|
||||||
removeGroupList()
|
removeGroupList()
|
||||||
|
removeAllListeners()
|
||||||
await useLoginState().logout()
|
await useLoginState().logout()
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@@ -279,6 +301,31 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeAllListeners(){
|
||||||
|
CallLib.unInit();
|
||||||
|
//移除监听-接收到通话呼入
|
||||||
|
CallLib.removeCallReceivedListener();
|
||||||
|
// 移除监听-开始呼叫通话的回调
|
||||||
|
CallLib.removeCallOutgoingListener();
|
||||||
|
// 移除监听-通话已接通
|
||||||
|
CallLib.removeCallReceivedListener();
|
||||||
|
// 移除监听-通话已结束
|
||||||
|
CallLib.removeCallDisconnectedListener();
|
||||||
|
// 移除监听-对端用户正在振铃
|
||||||
|
CallLib.removeRemoteUserRingingListener();
|
||||||
|
// 移除监听-对端用户加入了通话
|
||||||
|
CallLib.removeRemoteUserJoinedListener();
|
||||||
|
// 移除监听-有用户被邀请加入通话
|
||||||
|
CallLib.removeRemoteUserInvited();
|
||||||
|
// 移除监听-对端用户挂断
|
||||||
|
CallLib.removeRemoteUserLeftListener();
|
||||||
|
// 移除监听-对端用户切换了媒体类型
|
||||||
|
CallLib.removeRemoteUserMediaTypeChangedListener();
|
||||||
|
// 移除监听-通话出现错误的回调
|
||||||
|
CallLib.removeErrorListener();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/** 清空所有用户缓存 */
|
/** 清空所有用户缓存 */
|
||||||
const clearAllUserInfo = async () => {
|
const clearAllUserInfo = async () => {
|
||||||
userInfo.value = null
|
userInfo.value = null
|
||||||
|
|||||||
Reference in New Issue
Block a user