3.19
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { TUICallKitServer } from "../../../TUICallService/index";
|
||||
import {throttle} from "../../../utils/util"
|
||||
const PATH = '../../../static';
|
||||
Component({
|
||||
properties: {
|
||||
@@ -49,8 +50,9 @@ Component({
|
||||
//console.log('moved')
|
||||
},
|
||||
detached(){
|
||||
console.log('detached')
|
||||
this.reject()
|
||||
//console.log('detached')
|
||||
this.reject();
|
||||
this.hangup()
|
||||
}
|
||||
},
|
||||
pageLifetimes: {
|
||||
@@ -58,12 +60,9 @@ Component({
|
||||
|
||||
},
|
||||
hide() {
|
||||
|
||||
this.hangup()
|
||||
|
||||
},
|
||||
resize: function(size) {
|
||||
// 页面尺寸变化
|
||||
}
|
||||
},
|
||||
data:{
|
||||
IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`,
|
||||
@@ -80,13 +79,11 @@ Component({
|
||||
doctorInfo:{}
|
||||
},
|
||||
methods: {
|
||||
accept() {
|
||||
accept:throttle(async()=> {
|
||||
//延迟接听;
|
||||
setTimeout(async()=>{
|
||||
await TUICallKitServer.enableMuteMode(false);
|
||||
await TUICallKitServer.accept();
|
||||
},800)
|
||||
},
|
||||
}),
|
||||
async hangup() {
|
||||
await TUICallKitServer.hangup();
|
||||
},
|
||||
|
||||
@@ -66,8 +66,10 @@ export class CallManager {
|
||||
};
|
||||
|
||||
private _handleCallStatusToCalling() {
|
||||
console.log(this._isPageRedirected);
|
||||
if (this._isPageRedirected) return;
|
||||
this._targetPagePath = this.getRoute().route;
|
||||
console.log(`/${this._globalCallPagePath}`);
|
||||
// @ts-ignore
|
||||
wx.navigateTo({
|
||||
url: `/${this._globalCallPagePath}`,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
const throttle=function(fn,wait=1500){
|
||||
var flag = true;
|
||||
var timer = null;
|
||||
return function(){
|
||||
if(flag) {
|
||||
fn.apply(this,arguments);
|
||||
flag = false;
|
||||
timer = setTimeout(() => {
|
||||
flag = true
|
||||
},wait)
|
||||
}
|
||||
}
|
||||
}
|
||||
export {throttle}
|
||||
Reference in New Issue
Block a user