diff --git a/assets/icon11.png b/assets/icon11.png new file mode 100644 index 0000000..6b4c6e9 Binary files /dev/null and b/assets/icon11.png differ diff --git a/assets/icon12.png b/assets/icon12.png new file mode 100644 index 0000000..aa39108 Binary files /dev/null and b/assets/icon12.png differ diff --git a/assets/icon13.png b/assets/icon13.png new file mode 100644 index 0000000..ac24d7a Binary files /dev/null and b/assets/icon13.png differ diff --git a/assets/icon14.png b/assets/icon14.png new file mode 100644 index 0000000..495f010 Binary files /dev/null and b/assets/icon14.png differ diff --git a/pages/meeting/index.ts b/pages/meeting/index.ts index 4c1eaff..1a85f22 100644 --- a/pages/meeting/index.ts +++ b/pages/meeting/index.ts @@ -11,6 +11,7 @@ let reconnectTime = "" as any; let refreshTime = "" as any; let isAutoApplySpeakTime = "" as any; let isSpeakTime = "" as any; +let netWorkTime = "" as any; Page({ behaviors: [computedBehavior], data: { @@ -110,7 +111,8 @@ Page({ reconnecNumber: 0, setting: { voiceStimulation: true, //语音激励 - } + }, + network: -1 }, watch: { 'roomUserList.**': function (roomUserList) { @@ -350,9 +352,6 @@ Page({ } agora.destroy(() => { this.startReconnec() - reconnectTime = setInterval(() => { - this.startReconnec() - }, 3000) }) }, async startReconnec() { @@ -403,6 +402,9 @@ Page({ this.setData({ reconnecNumber: this.data.reconnecNumber + 1 }) + reconnectTime = setTimeout(() => { + this.startReconnec() + }, 3000) } } }, @@ -413,7 +415,7 @@ Page({ refreshTime = '' } if (reconnectTime) { - clearInterval(reconnectTime) + clearTimeout(reconnectTime) reconnectTime = '' } if (isAutoApplySpeakTime) { @@ -424,6 +426,10 @@ Page({ clearInterval(isSpeakTime) isSpeakTime = '' } + if (netWorkTime) { + clearTimeout(netWorkTime) + netWorkTime = '' + } }, // 显示聊天输入框 showInputPopup() { @@ -1047,6 +1053,33 @@ Page({ this.message('操作成功').success() } }, + measureSpeed() { + const startTime = Date.now(); + wx.request({ + url: 'https://meeting-api.23544.com/pc/room/checkout?roomNum=111111', + timeout: 10000, + header: { + 'content-type': 'application/json', + }, + success: res => { + const endTime = Date.now(); + const duration = endTime - startTime; + this.setData({ + network: Number((duration / 1000).toFixed(0)) + }) + }, + fail: res => { + this.setData({ + network: -1 + }) + }, + complete: res => { + netWorkTime = setTimeout(() => { + this.measureSpeed() + }, 3000); + } + }) + }, // 关闭弹窗 async closeDialog(e) { const { type } = e.currentTarget.dataset; diff --git a/pages/meeting/index.wxml b/pages/meeting/index.wxml index 52df5f5..4bc25ea 100644 --- a/pages/meeting/index.wxml +++ b/pages/meeting/index.wxml @@ -1,7 +1,11 @@ - + +