医生录音

This commit is contained in:
zoujiandong 2023-12-14 11:05:58 +08:00
parent 18aac9467a
commit c4d5df8782
8 changed files with 39 additions and 5 deletions

View File

@ -2,11 +2,11 @@
<view class="audio-message {{isMine?'my-audio':'your-audio'}}">
<!-- 默认状态 未播放 -->
<view class='audio' wx:if="{{!isPlay}}" bindtap='audioPlay' data-id="{{message.ID}}" >
<image class="image {{isMine?'my-image':''}}" src="../../../../../static/images/sendingaudio.png"/> {{renderDom[0].second}}s
<image class="image {{isMine?'my-image':''}}" src="{{isMine?'../../../../../static/images/play.png':'../../../../../static/images/playme.png'}}" /> {{renderDom[0].second}}s
</view>
<!-- 当前正在播放状态 -->
<view class='audio' wx:else data-value="{{message}}" bindtap='audioStop' data-id="{{message.ID}}" >
<image class="image {{isMine?'my-image':''}}" src="../../../../../static/images/sendingaudio.png"/> {{renderDom[0].second}}s
<image class="image {{isMine?'my-image':''}}" src="{{isMine?'../../../../../static/images/play.gif':'../../../../../static/images/playme.gif'}}" /> {{renderDom[0].second}}s
</view>
</view>
</block>

View File

@ -111,6 +111,8 @@ Component({
ChangYongYu: [],
dialog_visible: false,
sub_visible: false,
timer:null,
recordtime:0,
dialog_message: "在线开处方需先进行多点执业认证",
message_rounds: 0,
networkstatus: "wifi",
@ -131,6 +133,13 @@ Component({
icon: 'none',
});
} else {
if(resData.duration >= 59000){
wx.showToast({
title: '录音时间不能超过60s',
duration:2000,
icon: 'none',
});
}
let {from}=this.data;
// res.tempFilePath 存储录音文件的临时路径
if(from){
@ -306,6 +315,16 @@ Component({
encodeBitRate: 192000, // 编码码率
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台Android、iOS、微信小程序和Web互通
});
this.timer=setInterval(()=>{
if(this.data.recordtime>59){
clearInterval(this.timer)
};
this.setData({
recordtime:this.data.recordtime+1
});
},1000)
this.setData({
startPoint: e.touches[0],
title: '正在录音',
@ -352,6 +371,10 @@ Component({
});
wx.hideLoading();
this.recorderManager.stop();
clearInterval(this.timer);
this.setData({
recordtime:0
})
},
// 选中表情消息
handleEmoji() {

View File

@ -54,7 +54,7 @@
<image mode="widthFix" class="TUI-Extension-icon MY-TUI-Extension-icon" src="{{static_host}}/applet/doctor/static/images/chat/wenzi.png" />
<view class="TUI-Extension-slot-name MY-TUI-Extension-slot-name">常用语</view>
</view>
<view class="TUI-Extension-slot MY-TUI-Extension-slot" bindtap="showWenZhenBiao">
<view class="TUI-Extension-slot MY-TUI-Extension-slot" bindtap="showWenZhenBiao" wx:if="{{baseInfo.inquiry_status==4}}">
<image mode="widthFix" class="TUI-Extension-icon MY-TUI-Extension-icon" src="../../../../../static/images/yishi/tabbar_icon/wenzhenicon.png" />
<view class="TUI-Extension-slot-name MY-TUI-Extension-slot-name">问诊表</view>
</view>
@ -106,9 +106,13 @@
<view class="modal-loading">
</view>
</view>
<view class="recordtime">
00:{{recordtime<10?'0'+recordtime:recordtime}}
</view>
<view class="modal-title">
{{title}}
</view>
</view>
<t-dialog
visible="{{ dialog_visible }}"

View File

@ -146,9 +146,16 @@
}
.record-modal .wrapper {
display: flex;
height: 200rpx;
height: 140rpx;
box-sizing: border-box;
padding: 10vw;
padding: 8vw;
}
.recordtime{
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
justify-content: center;
color:#fff;
}
.record-modal .wrapper .modal-loading {
opacity: 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB