12.4更新

This commit is contained in:
zoujiandong
2023-12-04 14:49:14 +08:00
parent 63d7cb402d
commit 1e9ea2a70f
36 changed files with 1873 additions and 58 deletions
@@ -1,5 +1,5 @@
<block>
<view class="audio-message {{isMine?'my-audio':''}}">
<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
@@ -3,10 +3,42 @@
border-radius: 2px 10px 10px 10px;
border: 1px solid #D9D9D9;
}
.my-audio {
border-radius: 10px 2px 10px 10px;
background: rgba(0,110,255,0.10);
border: 1px solid rgba(0,110,255,0.30);
position: relative;
border-radius: 10px 10px 10px 10px;
background: rgb(212, 239, 241);
border: 1rpx solid #1ACAD3;
}
.my-audio::after{
content:'';
position: absolute;
top: 35rpx;
right: -19rpx;
transform: translate(-50%,-50%) rotate(-135deg);
width: 16rpx;
height: 16rpx;
background: rgb(212, 239, 241);
border: 1rpx solid #1ACAD3;
border-style: none none solid solid
}
.your-audio {
position: relative;
border-radius: 10px 10px 10px 10px;
background: rgb(255, 255, 255);
border: 1rpx solid #D8D8D8;
}
.your-audio::after{
content:'';
position: absolute;
top: 35rpx;
left: 0;
transform: translate(-50%,-50%) rotate(45deg);
width: 16rpx;
height: 16rpx;
background: rgb(255, 255, 255);
border: 1rpx solid #D8D8D8;
border-style: none none solid solid
}
.audio {
/*border-radius: 2px 10px 10px 10px;*/
@@ -206,6 +206,21 @@ Component({
}];
return renderDom;
}
//12:问诊表
if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.WENZHEN_FORM) {
let data = customMessage.data;
console.log(data)
const renderDom = [{
type: 'wenzhen_form',
order_inquiry_id:data.order_inquiry_id,
message_path:data.message_path,
case_patient_message_path:data.case_patient_message_path,
case_filled_fields:data.case_filled_fields,
case_not_fill_fields:data. case_not_fill_fields
}];
return renderDom;
}
} catch (error) {
}
// 客服咨询
@@ -296,9 +311,9 @@ Component({
})
}),
goSick(event){
const url=event.currentTarget.dataset.url;
console.log(url);
app.go(url);
// const url=event.currentTarget.dataset.url;
// console.log(url);
// app.go(url);
},
openLink(e) {
@@ -315,6 +330,15 @@ Component({
go(e){
let url = e.currentTarget.dataset.url;
app.go(url);
},
goList(event){
console.log(event);
const {ismine,params}=event.currentTarget.dataset;
console.log(params);
if(!ismine){
app.go('/Pages/yishi/sickform/index?params='+params)
}
// app.go(url);
}
},
});
@@ -126,6 +126,22 @@
</view>
<view wx:if="{{renderDom[0].type==='wenzhen_form'}}" class="wenzhen_form {{isMine?'my-custom':'your-custom'}}" bindtap="goList" data-ismine="{{isMine}}" data-params="{{isMine?renderDom[0].case_not_fill_fields:renderDom[0].case_filled_fields}}">
<view class="title" wx:if="{{renderDom[0].case_not_fill_fields}}">
<image src="../../../../../../static/images/yishi/tabbar_icon/wenzhenform.png" mode="" class="wzicon" />
<view class="name">问诊表</view>
</view>
<view class="title" wx:else>
<image src="../../../../../../static/images/yishi/tabbar_icon/wenzhenform.png" mode="" class="wzicon"/>
<view class="name">问诊表-已填写</view>
</view>
<view class="descform" wx:if="{{renderDom[0].case_not_fill_fields}}">
等待填写
</view>
<view class="descform" wx:else>
点击查看
</view>
</view>
</view>
@@ -362,4 +362,61 @@ color: rgba(0,0,0,0.45);
.sicklook .see{
font-size: 32rpx;
}
.wenzhen_form{
width: 60vw;
position: relative;
z-index:2;
border-radius: 10px 10px 10px 10px;
border: 1rpx solid #1ACAD3;
}
.wenzhen_form .title{
border-radius: 16rpx 16rpx 0 0;
padding:20rpx;
display: flex;
align-items: center;
font-size: 30rpx;
color: #FFFFFF;
background-color: #3CC7C0;
}
.wzicon{
margin-right: 10rpx;
width:42rpx;
height:46rpx;
}
.my-custom .wenzhen_form{
background: rgb(212, 239, 241);
}
.wenzhen_form .descform{
padding:15rpx 20rpx;
background-color: #ffff;
font-size: 28rpx;
color: #666666;
border-radius: 0 0 16rpx 16rpx;
}
.wenzhen_form.my-custom::after{
content:'';
position: absolute;
top: 35rpx;
right: -19rpx;
transform: translate(-50%,-50%) rotate(-135deg);
width: 16rpx;
height: 16rpx;
background: #3CC7C0;
border: 1rpx solid #1ACAD3;
/* background: rgb(255, 255, 255);
border: 1rpx solid #E7E7E7; */
border-style: none none solid solid;
}
.wenzhen_form.your-custom::after{
content:'';
position: absolute;
top: 35rpx;
left: 0;
transform: translate(-50%,-50%) rotate(45deg);
width: 16rpx;
height: 16rpx;
background: #3CC7C0;
border: 1rpx solid #1ACAD3;
border-style: none none solid solid
}
@@ -55,7 +55,12 @@ Component({
},
baseInfo: {
type: Object,
value: {}
value: {},
observer(newVal) {
this.setData({
family_id: newVal.family_id,
});
},
},
message_rounds:{
type: Number,
@@ -74,6 +79,7 @@ Component({
data: {
conversation: {},
message: '',
family_id:'',
extensionArea: false,
sendMessageBtn: false,
displayFlag: '',
@@ -113,26 +119,85 @@ Component({
lifetimes: {
attached() {
let _this = this;
// 加载声音录制管理器
this.recorderManager = wx.getRecorderManager();
this.recorderManager.onStop((res) => {
this.recorderManager.onStop(async(resData) => {
wx.hideLoading();
if (this.data.canSend) {
if (res.duration < 1000) {
if (resData.duration < 1000) {
wx.showToast({
title: '录音时间太短',
icon: 'none',
});
} else {
let {from}=this.data;
// res.tempFilePath 存储录音文件的临时路径
const message = wx.$TUIKit.createAudioMessage({
to: this.getToAccount(),
conversationType: this.data.conversation.type,
payload: {
file: res,
},
if(from){
await this.handlegetLastInquiry();
}
let conversationID = this.data.conversation.conversationID
let promise = wx.$TUIKit.getConversationProfile(conversationID);
promise.then((imResponse)=> {
// console.log("getConversationProfile 正在执行")
// 获取成功
// console.log(imResponse.data.conversation); // 会话资料
_this.setData({
conversation: imResponse.data.conversation
})
}).catch(function(imError) {
console.warn('getConversationProfile error:', imError); // 获取会话资料失败的相关信息
});
this.$sendTIMMessage(message);
Promise.all([promise]).then(res => {
// 获取最后一条消息
let last_message = this.data.conversation.lastMessage;
// console.log("last_message: ", last_message);
let cloudCustomData = "";
let cloudCustomDataJson = "";
if(last_message.cloudCustomData){
cloudCustomData = last_message.cloudCustomData;
}
if(cloudCustomData){
cloudCustomDataJson = JSON.parse(cloudCustomData);
}
let message_rounds = 0;
let patient_family_data = {};
patient_family_data.patient_name = this.data.baseInfo.patient_family_name;
patient_family_data.patient_sex = this.data.baseInfo.patient_family_sex;
patient_family_data.patient_age = this.data.baseInfo.patient_family_age;
if(cloudCustomDataJson){
message_rounds = cloudCustomDataJson.message_rounds;
}
let cach_message_rounds = this.data.message_rounds
message_rounds = cach_message_rounds>message_rounds?cach_message_rounds:message_rounds
const mycloudCustomData = JSON.stringify({
order_inquiry_id: this.data.order_inquiry_id,
inquiry_type: this.data.inquiry_type,
message_type: 0,
is_system: 0,
message_rounds: message_rounds,
patient_family_data: patient_family_data
});
const message = wx.$TUIKit.createAudioMessage({
to: this.getToAccount(),
conversationType: this.data.conversation.type,
payload: {
file: resData,
},
cloudCustomData:mycloudCustomData
});
_this.$sendTIMMessage(message);
}).catch(err=>{
console.log(err)
})
}
}
this.setData({
@@ -144,7 +209,6 @@ Component({
text: '按住说话',
});
});
let _this = this
wx.onNetworkStatusChange(function (res) {
// console.log("onNetworkStatusChange from wenzhen: ")
// console.log(res.isConnected)
@@ -222,6 +286,9 @@ Component({
text: '按住说话',
focus: false,
});
this.setData({
displayFlag: '',
});
},
// 长按录音
@@ -493,7 +560,8 @@ Component({
});
break;
case '10'://查看完整病历
app.go("/Pages/yishi/case/index?order_inquiry_id="+this.data.order_inquiry_id)
// app.go("/Pages/yishi/case/index?order_inquiry_id="+this.data.order_inquiry_id)
app.go("/Pages/yishi/patient_sick/index?order_inquiry_id="+this.data.order_inquiry_id+"&family_id="+this.data.family_id)
break;
case '11'://在线开方
let _this = this;
@@ -1073,6 +1141,9 @@ Component({
showChangYongYu(){
app.go("/Pages/yishi/quickreply/index?from=chat")
},
showWenZhenBiao(){
app.go("/Pages/yishi/write_sickform/index?order_inquiry_id="+this.data.order_inquiry_id)
},
},
});
@@ -4,7 +4,7 @@
<view class="TUI-commom-function-item" data-key="11" bindtap="handleCommonFunctions" wx:if="{{baseInfo.multi_point_status == 1 && baseInfo.inquiry_status==4 && baseInfo.multi_point_enable==1}}">在线开处方</view>
</view>
<view class="TUI-message-input">
<image class="TUI-icon" bindtap="switchAudio" wx:if="{{has_audio}}"
<image class="TUI-icon" bindtap="switchAudio"
src="{{isAudio ? '../../../../static/assets/keyboard.svg' : '../../../../static/assets/audio.svg'}}" />
<view wx:if="{{!isAudio || isEmoji}}" class="TUI-message-input-main {{ focus && 'TUI-message-input-main-focus'}}" >
<textarea focus="{{false}}" hold-keyboard id="mytextarea" class="TUI-message-input-area" adjust-position="{{false}}" cursor-spacing="0"
@@ -28,12 +28,14 @@
<view class="TUI-sendMessage-btn" wx:if="{{ has_emoji }}">
<image class="TUI-icon" bindtap="handleEmoji" src="../../../../static/assets/face-emoji.svg" />
</view>
<view wx:if="{{!sendMessageBtn}}" bindtap="handleExtensions" class="TUI-sendMessage-btn">
<view class="TUI-sendMessage-btn" wx:if="{{!isAudio || isEmoji}}">
<view wx:if="{{!sendMessageBtn}}" bindtap="handleExtensions" class="TUI-sendMessage-btn">
<image class="TUI-icon" src="{{static_host}}/applet/doctor/static/images/chat/tianjia.png" />
</view>
<view wx:else class="TUI-sendMessage-btn TUI-sendMessage-btn-input" bindtap="sendTextMessage">
发送
</view>
</view>
</view>
</view>
<view wx:if="{{displayFlag === 'emoji'}}" class="TUI-Emoji-area">
@@ -52,6 +54,10 @@
<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">
<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" bindtap="handleSendPicture">
<image class="TUI-Extension-icon" src="../../../../static/assets/take-photo.svg" />
<view class="TUI-Extension-slot-name">相机</view>
@@ -7,6 +7,7 @@
.TUI-message-input {
display: flex;
padding-bottom: 16rpx;
align-items: center;
background-color: #fff;
width: 95vw;
overflow: scroll;
@@ -355,7 +355,7 @@ Component({
let show_avatar = true;
if(type === "TIMCustomElem"){
const customMessage = JSON.parse(message.payload.data);
if(Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE && Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE_VERIFY && Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.SUGAR_CHECK){
if(Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE && Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE_VERIFY && Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.SUGAR_CHECK && Number(customMessage.message_type) != GDXZ_CUSTOM_MSEEAGE.WENZHEN_FORM){
show_avatar = false;
}
if(Number(customMessage.message_type) == GDXZ_CUSTOM_MSEEAGE.TRABECULA && refreshBaseInfo){
+1
View File
@@ -51,6 +51,7 @@ const constant = {
BANNER_MESSAGE: 8,//8 弹框消息
SUGAR_CHECK:10,//糖组检测
PATIENT_INFO:11,//患者信息
WENZHEN_FORM:12,//问诊表;
},
OPERATING_ENVIRONMENT: 'imWxTuikit'