3.22 更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { TUIStore, StoreName, NAME } from "../index";
|
||||
import { TUICallKitServer } from "../TUICallService/index";
|
||||
|
||||
import { TUICallKitServer,TUIStore, StoreName, NAME } from "../index";
|
||||
|
||||
const {
|
||||
CALL_STATUS,
|
||||
CALL_ROLE,
|
||||
@@ -44,12 +45,15 @@ Component({
|
||||
});
|
||||
if(value=="calling"){
|
||||
TUICallKitServer.setLogLevel(0);
|
||||
console.log("呼叫者userId:"+this.data.callerUserInfo.userId)
|
||||
if(this.data.callerUserInfo.userId){
|
||||
let chat=TUICallKitServer.getTim();
|
||||
let promise=chat.getUserProfile({
|
||||
userIDList: [this.data.callerUserInfo.userId]
|
||||
});
|
||||
promise.then((imResponse)=> {
|
||||
console.log("呼叫者信息:");
|
||||
console.log(imResponse.data[0])
|
||||
this.setData({
|
||||
doctorInfo:imResponse.data[0]
|
||||
})
|
||||
@@ -196,6 +200,7 @@ Component({
|
||||
},
|
||||
async detached() {
|
||||
let that = this;
|
||||
TUICallKitServer.getTUICallEngineInstance().handleExceptionExit();
|
||||
TUIStore.unwatch(StoreName.CALL, {
|
||||
[CALL_STATUS]: this.handleCallStatusChange.bind(that),
|
||||
[IS_GROUP]: this.handleIsGroupChange.bind(that),
|
||||
|
||||
@@ -49,18 +49,20 @@ Component({
|
||||
moved(){
|
||||
//console.log('moved')
|
||||
},
|
||||
detached(){
|
||||
async detached(){
|
||||
//await TUICallKitServer.enableFloatWindow(true);
|
||||
//console.log('detached')
|
||||
this.reject();
|
||||
this.hangup()
|
||||
// this.reject();
|
||||
// this.hangup()
|
||||
}
|
||||
},
|
||||
pageLifetimes: {
|
||||
show() {
|
||||
|
||||
//TUICallKitServer.enableFloatWindow(true);
|
||||
},
|
||||
hide() {
|
||||
this.hangup()
|
||||
// this.reject();
|
||||
// this.hangup()
|
||||
|
||||
},
|
||||
},
|
||||
@@ -85,9 +87,11 @@ Component({
|
||||
await TUICallKitServer.accept();
|
||||
}),
|
||||
async hangup() {
|
||||
console.log("hangup")
|
||||
await TUICallKitServer.hangup();
|
||||
},
|
||||
async reject() {
|
||||
console.log("reject")
|
||||
await TUICallKitServer.reject();
|
||||
},
|
||||
async switchCamera() {
|
||||
|
||||
@@ -87,6 +87,7 @@ class CallManager {
|
||||
});
|
||||
}
|
||||
_handleCallStatusToCalling() {
|
||||
console.log('_isPageRedirected:'+this._isPageRedirected);
|
||||
if (this._isPageRedirected)
|
||||
return;
|
||||
this._targetPagePath = this.getRoute().route;
|
||||
@@ -103,6 +104,7 @@ class CallManager {
|
||||
});
|
||||
}
|
||||
_handleCallStatusToIdle() {
|
||||
console.log('idle__isPageRedirected:'+this._isPageRedirected);
|
||||
if (!this._isPageRedirected)
|
||||
return;
|
||||
if (this._targetPagePath === this.getRoute().route) {
|
||||
@@ -115,6 +117,8 @@ class CallManager {
|
||||
this._isPageRedirected = false;
|
||||
},
|
||||
fail: () => {
|
||||
// this._isPageRedirected = false;
|
||||
//wx.navigateBack();
|
||||
console.error(`${PREFIX} navigateBack fail!`);
|
||||
},
|
||||
complete: () => { },
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
//import { TUICallKitServer } from "../../TUICallService/index";
|
||||
Page({
|
||||
data: {},
|
||||
onShow() {},
|
||||
onHide(){
|
||||
//TUICallKitServer.getTUICallEngineInstance().handleExceptionExit();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user