From d6421a78a15d1caf32157e268b09ae2eb0ad988d Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Thu, 14 Dec 2023 13:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/yishi/myaccount/index.js | 2 +- .../TUIChat/components/MessageInput/index.js | 50 ++++++++++++++++--- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/Pages/yishi/myaccount/index.js b/Pages/yishi/myaccount/index.js index 48465c5..96c3dd4 100644 --- a/Pages/yishi/myaccount/index.js +++ b/Pages/yishi/myaccount/index.js @@ -119,7 +119,7 @@ Page({ balance_account: response.data.balance_account, amount_total_month: response.data.amount_total_month, doctor_today_inquiry_total:response.data.doctor_today_inquiry_total, - doctor_day_completed_amount_total:response.data.doctor_today_inquiry_total, + doctor_day_completed_amount_total:response.data.doctor_day_completed_amount_total, withdrawal_amount_month: response.data.withdrawal_amount_month, bill: response.data.bill, }) diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.js b/TUIKit/components/TUIChat/components/MessageInput/index.js index 0893ade..ba53d86 100644 --- a/TUIKit/components/TUIChat/components/MessageInput/index.js +++ b/TUIKit/components/TUIChat/components/MessageInput/index.js @@ -299,16 +299,52 @@ Component({ displayFlag: '', }); }, + openRecord(e,callback){ + let THIS=this; + return new Promise((resolve, reject) => { + wx.getSetting({ + success(res) { + if(!(res.authSetting['scope.record'])) { // 关闭订阅消息主按钮 + return wx.showModal({ + title: '提示', + content: '您已关闭麦克风权限,请点击“确认”按钮在设置中打开麦克风权限。', + success: function (res) { + if (res.confirm) { + wx.openSetting({ + success(res) { + + } + }); + } + }, + complete(){ + + } + }); + } else { // 开放订阅消息主按钮 + callback(e,THIS); + resolve() + } + }, + complete(){ + wx.hideLoading(); + } + }) + }) + }, // 长按录音 handleLongPress(e) { + this.openRecord(e,this.recording) + }, + recording(e,THIS){ wx.aegis.reportEvent({ name: 'messageType', ext1: 'messageType-audio', ext2: wx.$chat_reportType, ext3: wx.$chat_SDKAppID, }); - this.recorderManager.start({ + THIS.recorderManager.start({ duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟) sampleRate: 44100, // 采样率 numberOfChannels: 1, // 录音通道数 @@ -316,16 +352,16 @@ Component({ format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通 }); - this.timer=setInterval(()=>{ - if(this.data.recordtime>59){ - clearInterval(this.timer) + THIS.timer=setInterval(()=>{ + if(THIS.data.recordtime>59){ + clearInterval(THIS.timer) }; - this.setData({ - recordtime:this.data.recordtime+1 + THIS.setData({ + recordtime:THIS.data.recordtime+1 }); },1000) - this.setData({ + THIS.setData({ startPoint: e.touches[0], title: '正在录音', // isRecording : true,