问诊表
This commit is contained in:
parent
41c265a4c2
commit
dd892964c9
@ -143,6 +143,8 @@ Component({
|
|||||||
title: ' ',
|
title: ' ',
|
||||||
notShow: false,
|
notShow: false,
|
||||||
isShow: true,
|
isShow: true,
|
||||||
|
timer:null,
|
||||||
|
recordtime:0,
|
||||||
commonFunction: [
|
commonFunction: [
|
||||||
{ name: '常用语', key: '0' },
|
{ name: '常用语', key: '0' },
|
||||||
{ name: '发送订单', key: '1' },
|
{ name: '发送订单', key: '1' },
|
||||||
@ -175,6 +177,13 @@ Component({
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// res.tempFilePath 存储录音文件的临时路径
|
// res.tempFilePath 存储录音文件的临时路径
|
||||||
|
if(res.duration >= 59000){
|
||||||
|
wx.showToast({
|
||||||
|
title: '录音时间不能超过60s',
|
||||||
|
duration:2000,
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
}
|
||||||
this.sendCallback();
|
this.sendCallback();
|
||||||
const message = wx.$TUIKit.createAudioMessage({
|
const message = wx.$TUIKit.createAudioMessage({
|
||||||
to: this.getToAccount(),
|
to: this.getToAccount(),
|
||||||
@ -266,24 +275,70 @@ Component({
|
|||||||
focus: false,
|
focus: false,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
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) {
|
handleLongPress(e) {
|
||||||
if(this.setMsgRound()){
|
this.openRecord(e,this.recording);
|
||||||
|
|
||||||
|
},
|
||||||
|
recording(e,THIS){
|
||||||
|
console.log(THIS);
|
||||||
|
if(THIS.setMsgRound()){
|
||||||
wx.aegis.reportEvent({
|
wx.aegis.reportEvent({
|
||||||
name: 'messageType',
|
name: 'messageType',
|
||||||
ext1: 'messageType-audio',
|
ext1: 'messageType-audio',
|
||||||
ext2: wx.$chat_reportType,
|
ext2: wx.$chat_reportType,
|
||||||
ext3: wx.$chat_SDKAppID,
|
ext3: wx.$chat_SDKAppID,
|
||||||
});
|
});
|
||||||
this.recorderManager.start({
|
THIS.recorderManager.start({
|
||||||
duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
|
duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
|
||||||
sampleRate: 44100, // 采样率
|
sampleRate: 44100, // 采样率
|
||||||
numberOfChannels: 1, // 录音通道数
|
numberOfChannels: 1, // 录音通道数
|
||||||
encodeBitRate: 192000, // 编码码率
|
encodeBitRate: 192000, // 编码码率
|
||||||
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通
|
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通
|
||||||
});
|
});
|
||||||
this.setData({
|
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],
|
startPoint: e.touches[0],
|
||||||
title: '正在录音',
|
title: '正在录音',
|
||||||
// isRecording : true,
|
// isRecording : true,
|
||||||
@ -296,7 +351,6 @@ Component({
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 录音时的手势上划移动距离对应文案变化
|
// 录音时的手势上划移动距离对应文案变化
|
||||||
handleTouchMove(e) {
|
handleTouchMove(e) {
|
||||||
if (this.data.isRecording) {
|
if (this.data.isRecording) {
|
||||||
@ -331,6 +385,7 @@ Component({
|
|||||||
});
|
});
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
this.recorderManager.stop();
|
this.recorderManager.stop();
|
||||||
|
clearInterval(this.timer)
|
||||||
},
|
},
|
||||||
// 选中表情消息
|
// 选中表情消息
|
||||||
handleEmoji() {
|
handleEmoji() {
|
||||||
@ -753,7 +808,7 @@ Component({
|
|||||||
cloudCustomData: JSON.stringify({
|
cloudCustomData: JSON.stringify({
|
||||||
order_inquiry_id:this.data.order_inquiry_id,
|
order_inquiry_id:this.data.order_inquiry_id,
|
||||||
inquiry_type:this.data.inquiry_type,
|
inquiry_type:this.data.inquiry_type,
|
||||||
message_rounds:this.data.msgData.msg_round+1,
|
message_rounds:this.data.msgData.msg_round,
|
||||||
patient_family_data:this.data.patient_family_data,
|
patient_family_data:this.data.patient_family_data,
|
||||||
is_system:0
|
is_system:0
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -95,6 +95,9 @@
|
|||||||
<view class="modal-loading">
|
<view class="modal-loading">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="recordtime">
|
||||||
|
00:{{recordtime<10?'0'+recordtime:recordtime}}
|
||||||
|
</view>
|
||||||
<view class="modal-title">
|
<view class="modal-title">
|
||||||
{{title}}
|
{{title}}
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -61,7 +61,13 @@
|
|||||||
.audio-main{
|
.audio-main{
|
||||||
padding:12rpx 10rpx;
|
padding:12rpx 10rpx;
|
||||||
}
|
}
|
||||||
|
.recordtime{
|
||||||
|
display: flex;
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
justify-content: center;
|
||||||
|
color:#fff;
|
||||||
|
}
|
||||||
.TUI-message-input-main-focus {
|
.TUI-message-input-main-focus {
|
||||||
|
|
||||||
max-height: 300rpx;
|
max-height: 300rpx;
|
||||||
@ -169,9 +175,9 @@
|
|||||||
|
|
||||||
.record-modal .wrapper {
|
.record-modal .wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 200rpx;
|
height: 140rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 10vw;
|
padding: 8vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-modal .wrapper .modal-loading {
|
.record-modal .wrapper .modal-loading {
|
||||||
|
|||||||
@ -245,9 +245,6 @@ Component({
|
|||||||
'msgData.msg_round':0,
|
'msgData.msg_round':0,
|
||||||
'msgData.msg_type':2
|
'msgData.msg_type':2
|
||||||
});
|
});
|
||||||
// if(cloudCustomData.order_inquiry_id!=this.data.order_inquiry_id){
|
|
||||||
// return false;
|
|
||||||
// };
|
|
||||||
this.triggerEvent("getMessageRounds",this.data.msgData);
|
this.triggerEvent("getMessageRounds",this.data.msgData);
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -86,6 +86,20 @@ Page({
|
|||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
handleIpt(e){
|
||||||
|
let key = e.target.dataset.id;
|
||||||
|
let obj="personInfo."+key;
|
||||||
|
if(key=='height' || key=="weight"){
|
||||||
|
this.setData({
|
||||||
|
[obj]:e.detail.value
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.setData({
|
||||||
|
[obj]: e.detail.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
handleSendFields(){
|
handleSendFields(){
|
||||||
const {order_inquiry_id,personInfo,list1,list2,marital_name,jobname,nationname}=this.data;
|
const {order_inquiry_id,personInfo,list1,list2,marital_name,jobname,nationname}=this.data;
|
||||||
console.log(personInfo)
|
console.log(personInfo)
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
{{filter.formatwenzhenList(list1,'height').NUMBER}}、身高(CM)
|
{{filter.formatwenzhenList(list1,'height').NUMBER}}、身高(CM)
|
||||||
</view>
|
</view>
|
||||||
<view class="iptbox">
|
<view class="iptbox">
|
||||||
<input type="text" value="{{personInfo.height}}" bindinput="handleIpt" data-id="name" placeholder="请输入身高" placeholder-class="placeholder" class="ipt" disabled="{{!showBtn}}" />
|
<input type="text" value="{{personInfo.height}}" bindinput="handleIpt" data-id="height" placeholder="请输入身高" placeholder-class="placeholder" class="ipt" disabled="{{!showBtn}}" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
{{filter.formatwenzhenList(list1,'weight').NUMBER}}、体重(KG)
|
{{filter.formatwenzhenList(list1,'weight').NUMBER}}、体重(KG)
|
||||||
</view>
|
</view>
|
||||||
<view class="iptbox">
|
<view class="iptbox">
|
||||||
<input type="text" value="{{personInfo.weight}}" bindinput="handleIpt" data-id="name" placeholder="请请输入体重" placeholder-class="placeholder" class="ipt" disabled="{{!showBtn}}" />
|
<input type="text" value="{{personInfo.weight}}" bindinput="handleIpt" data-id="weight" placeholder="请请输入体重" placeholder-class="placeholder" class="ipt" disabled="{{!showBtn}}" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user