This commit is contained in:
haomingming
2023-03-28 20:52:22 +08:00
parent 69df3bf6b3
commit 5ba50e4e61
58 changed files with 1122 additions and 347 deletions
@@ -63,8 +63,8 @@ Component({
notShow: false,
isShow: true,
commonFunction: [
{ name: '查看病例', key: '10' },
{ name: '开处方', key: '11' },
{ name: '查看完整病例', key: '10' },
{ name: '在线开处方', key: '11' },
],
displayServiceEvaluation: false,
showErrorImageFlag: 0,
@@ -296,12 +296,45 @@ Component({
// 发送图片消息
handleSendImageMessage(file) {
//获取最后一条消息
let message_length = this.data.messageList.length;
let last_message = {};
if(message_length > 0){
last_message = this.data.messageList[message_length - 1];
}
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 = "";
if(cloudCustomDataJson){
message_rounds = cloudCustomDataJson.message_rounds;
patient_family_data = cloudCustomDataJson.patient_family_data
}
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.createImageMessage({
to: this.getToAccount(),
conversationType: this.data.conversation.type,
payload: {
file,
},
cloudCustomData: mycloudCustomData,
onProgress: (percent) => {
message.percent = percent;
},
@@ -359,13 +392,31 @@ Component({
app.go("/Pages/yishi/case/index?order_inquiry_id="+this.data.order_inquiry_id)
break;
case '11'://在线开方
app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+this.data.order_inquiry_id)
let userID = wx.getStorageSync('user_id');
let multi_point_status = wx.getStorageSync(userID+'_multi_point_status');
if(multi_point_status == 1){
app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+this.data.order_inquiry_id)
}else{
this.setData({
dialog_visible: true
})
}
break;
default:
break;
}
},
cancelDialog(){
this.setData({
dialog_visible: false
})
},
confirmDialog(){
app.go("/Pages/yishi/zhiye_identity/index")
this.setData({
dialog_visible: false
})
},
handleSendOrder() {
this.setData({
displayOrderList: true,
@@ -504,21 +555,51 @@ Component({
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
//获取最后一条消息
let message_length = this.data.messageList.length;
let last_message = {};
if(message_length > 0){
last_message = this.data.messageList[message_length - 1];
}
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 = "";
if(cloudCustomDataJson){
message_rounds = cloudCustomDataJson.message_rounds;
patient_family_data = cloudCustomDataJson.patient_family_data
}
const to = this.getToAccount();
const text = flag ? msg : this.data.message;
const { FEAT_NATIVE_CODE } = constant;
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
});
console.log("mycloudCustomData: ", mycloudCustomData);
console.log("text: ", text);
const message = wx.$TUIKit.createTextMessage({
to,
conversationType: this.data.conversation.type,
payload: {
text,
},
cloudCustomData: JSON.stringify({
order_inquiry_id: this.data.order_inquiry_id,
inquiry_type: this.data.inquiry_type,
message_type: 0,
is_system: 0
}),
cloudCustomData: mycloudCustomData
});
this.setData({
message: '',
@@ -4,6 +4,7 @@
"Emoji": "../MessageElements/Emoji/index",
"CommonWords": "../MessagePrivate/CommonWords/index",
"OrderList": "../MessagePrivate/OrderList/index",
"ServiceEvaluation": "../MessagePrivate/ServiceEvaluation/index"
"ServiceEvaluation": "../MessagePrivate/ServiceEvaluation/index",
"t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
@@ -101,4 +101,15 @@
{{title}}
</view>
</view>
<t-dialog
visible="{{ dialog_visible }}"
title="温馨提示"
content="请您先多点执业认证"
>
<view slot="cancel-btn" class="dialog dialog_cancel_btn" bindtap="cancelDialog">
取消
</view>
<view slot="confirm-btn" class="dialog dialog_confirm_btn" bindtap="confirmDialog">
确定
</view>
</t-dialog>
@@ -1,40 +1,43 @@
.TUI-message-input-container {
background-color: #fff;
background-color: #fff;
width: 100vw;
z-index: 9999;
}
.TUI-message-input {
display: flex;
padding-bottom: 16rpx;
background-color: #fff;
width: 95vw;
overflow: scroll;
margin: 0 auto;
display: flex;
padding-bottom: 16rpx;
background-color: #fff;
width: 95vw;
overflow: scroll;
margin: 0 auto;
}
.TUI-commom-function {
background-color: blueviolet;
display: flex;
flex-wrap: nowrap;
width: 750rpx;
height: 106rpx;
background-color: #FFF;
align-items: center;
background-color: blueviolet;
display: flex;
flex-wrap: nowrap;
width: 95vw;
height: 106rpx;
background-color: #FFF;
align-items: center;
margin: 0 auto;
}
.TUI-commom-function-item {
background-color: brown;
display: flex;
width: 136rpx;
justify-content: center;
align-items: center;
font-size: 28rpx;
color: #3CC7C0;
height: 48rpx;
margin-left: 16rpx;
border-radius: 10rpx;
background-color: #fff;
border: 1px solid #3CC7C0;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
color: #3CC7C0;
height: 48rpx;
margin-left: 16rpx;
border-radius: 10rpx;
background-color: #fff;
border: 1px solid #3CC7C0;
padding: 0 20rpx;
}
.TUI-commom-function-item:first-child{
margin-left: 48rpx;
border: 1px solid #999;
color: #999;
}
.TUI-message-input-functions {
flex: 2;
@@ -63,7 +66,6 @@
}
.TUI-message-input-area {
width: 100%;
height: 100%;
max-height: 300rpx;
/* 最多显示10行 */
line-height: 30rpx;
@@ -185,4 +187,18 @@
background-color: #fff;
font-size: 30rpx;
color: #666666;
}
.dialog{
width: 50%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
}
.dialog_cancel_btn{
border-top: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
}
.dialog_confirm_btn{
border-top: 1px solid #E9E9E9;
color: #3CC7C0;
}
@@ -1,6 +1,8 @@
import dayjs from '../../../../utils/dayjs';
import logger from '../../../../utils/logger';
import constant from '../../../../utils/constant';
import { API } from './../../../../../utils/network/api'
const api = new API()
// eslint-disable-next-line no-undef
const app = getApp();
Component({
@@ -20,6 +22,10 @@ Component({
});
},
},
order_inquiry_id:{
type: String,
value: "",
},
unreadCount: {
type: Number,
value: '',
@@ -81,10 +87,13 @@ Component({
errorMessage: {},
errorMessageID: '',
typingMessage: {},
dialog_visible: false,
},
lifetimes: {
attached() {
},
ready() {
if (this.data.unreadCount > 12) {
@@ -112,6 +121,7 @@ Component({
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_READ_BY_PEER, this.$onMessageReadByPeer, this);
wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_REVOKED, this.$onMessageRevoked, this);
},
detached() {
@@ -123,6 +133,26 @@ Component({
},
methods: {
//结束问诊
putDoctorInquiryFinish() {
this.setData({
dialog_visible: true
})
},
cancelDialog(){
this.setData({
dialog_visible: false
})
},
confirmDialog(){
api.putDoctorInquiryFinish({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
console.log(response);
}).catch(errors => {console.error(errors);})
this.setData({
dialog_visible: false
})
},
// 刷新消息列表
refresh() {
if (this.data.isCompleted) {
@@ -12,6 +12,7 @@
"FaceMessage": "../MessageElements/FaceMessage/index",
"FileMessage": "../MessageElements/FileMessage/index",
"MergerMessage": "../MessageElements/MergerMessage/index",
"RevokeMessage": "../MessageElements/RevokeMessage/index"
"RevokeMessage": "../MessageElements/RevokeMessage/index",
"t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
@@ -1,14 +1,5 @@
<view class="container">
<view class="info" wx:if="{{ true }}">
<view class="left">
<view class="name">张三三</view>
<view class="age">男|30岁</view>
<view class="status">接诊中</view>
</view>
<view class="right">
<text class="right_txt">结束问诊</text>
</view>
</view>
<scroll-view class="message-list-container" scroll-y="true" scroll-into-view="{{jumpAim}}" refresher-enabled="{{true}}" bindrefresherrefresh="refresh" refresher-triggered="{{triggered}}" lower-threshold="200" bindscrolltolower="scrollHandler">
<view class="no-message" wx:if="{{isCompleted}}">没有更多啦</view>
<view class="t-message" wx:if="{{conversation.type !== '@TIM#SYSTEM'}}" wx:for="{{messageList}}" wx:key="index" data-index ='{{index}}' >
@@ -88,3 +79,16 @@
</view>
</view>
<wxs src = './concat.wxs' module = 'concat'/>
<t-dialog
visible="{{ dialog_visible }}"
title="温馨提示"
content="您确认结束问诊?"
>
<view slot="cancel-btn" class="dialog dialog_cancel_btn" bindtap="cancelDialog">
取消
</view>
<view slot="confirm-btn" class="dialog dialog_confirm_btn" bindtap="confirmDialog">
确定
</view>
</t-dialog>
@@ -4,8 +4,9 @@
background-color: #F4F4F4;
}
.message-list-container {
/* margin-top: 20rpx; */
width: 100%;
height: calc(100% - 120rpx);
height: calc(100%);
background-color: #F4F4F4;
}
.t-message-item {
@@ -13,7 +14,8 @@
padding: 14rpx 0;
}
.t-message{
position: relative
position: relative;
z-index: -9;
}
.t-recieve-message {
display: flex;
@@ -250,45 +252,17 @@
padding-left: 5px;
color: blue;
}
.info{
.dialog{
width: 50%;
text-align: center;
height: 100rpx;
background-color: #fff;
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
line-height: 100rpx;
}
.left{
display: flex;
justify-content: space-around;
align-items: center;
flex: 2;
.dialog_cancel_btn{
border-top: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
}
.right{
flex: 1;
text-align: right;
font-size: 28rpx;
color: #FFFFFF;
padding-right: 20rpx;
}
.right_txt{
background: #3CC7C0;
border-radius: 29rpx;
padding: 10rpx 20rpx;
}
.name{
font-size: 34rpx;
.dialog_confirm_btn{
border-top: 1px solid #E9E9E9;
color: #3CC7C0;
}
.age{
font-size: 34rpx;
color: #666666;
}
.status{
background: #FFF2E8;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
border-radius: 10rpx;
font-size: 24rpx;
color: #FA541C;
padding: 10rpx 20rpx;
}
+45 -3
View File
@@ -1,11 +1,14 @@
// TUIKit-WChat/Chat/index.js
import logger from '../../utils/logger';
import constant from '../../utils/constant';
import { API } from './../../../utils/network/api'
const api = new API()
// eslint-disable-next-line no-undef
const app = getApp();
const inputStyle = `
--padding: 25px
--padding: 0px;
z-index: 9999999;
`;
let newInputStyle = `
@@ -66,7 +69,31 @@ Component({
showTips: true,
});
}
let rect = null;
if (wx.getMenuButtonBoundingClientRect) {
rect = wx.getMenuButtonBoundingClientRect();
}
console.log("rect: ", rect)
wx.getSystemInfo({
success: (res) => {
const { statusBarHeight } = wx.getSystemInfoSync();
console.log("statusBarHeight: ", statusBarHeight);
console.log("${rect.height}px: ", `${rect.height}`);
let height = Number.parseInt(statusBarHeight) + Number.parseInt(`${rect.height}`) + 50;
this.setData({
navbar_height: height
})
},
fail: (err) => {
console.error('navbar 获取系统信息失败', err);
},
});
},
ready() {
this.getInquiryMessageBasic()
}
},
/**
* 组件的初始数据
@@ -95,16 +122,31 @@ Component({
showTips: false,
showGroupTips: false,
showAll: false,
navbarData: {
showCapsule: 2, //是否显示左上角图标 1表示显示 0表示不显示
title: '', //导航栏 中间的标题
},
baseInfo: {},
navbar_height: 0
},
/**
* 组件的方法列表
*/
methods: {
//获取问诊订单消息内页基础数据
getInquiryMessageBasic() {
console.log("order_inquiry_id: ", this.data.order_inquiry_id);
api.getInquiryMessageBasic({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
console.log(response);
this.setData({
baseInfo: response.data,
"navbarData.title": response.data.patient_name
})
}).catch(errors => {console.error(errors);})
},
init() {
console.warn("TUIChat js: init", this.data.conversationID)
wx.$TUIKit.setMessageRead({ conversationID: this.data.conversationID }).then(() => {
logger.log('| TUI-chat | setMessageRead | ok');
});
+4 -2
View File
@@ -3,6 +3,8 @@
"usingComponents": {
"MessageList": "./components/MessageList/index",
"MessageInput": "./components/MessageInput/index",
"TUIGroup": "../TUIGroup/index"
}
"TUIGroup": "../TUIGroup/index",
"te-nav-bar": "/commpents/te_navbar"
},
"disableScroll":true
}
+22 -7
View File
@@ -1,18 +1,30 @@
<!--TUIKit-WChat/Chat/index.wxml-->
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="container">
<view class="tui-navigatorbar">
<image class="tui-navigatorbar-back" bindtap="goBack" src="../../static/assets/ic_back_white.svg" />
<view class="info" wx:if="{{ true }}">
<view class="left">
<view class="name">{{baseInfo.patient_name}}</view>
<view class="age">{{baseInfo.patient_sex==1?'男':'女'}}{{baseInfo.patient_age}}岁</view>
<view class="status">{{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'已接诊':baseInfo.inquiry_status==5?'已完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}}</view>
</view>
<view class="right">
<text class="right_txt" bindtap="putDoctorInquiryFinish">结束问诊</text>
</view>
</view>
<!-- <view class="tui-navigatorbar">
<image class="tui-navigatorbar-back" bindtap="goBack" src="../../static/assets/ic_back_black.svg" />
<view class="conversation-title">{{conversationName}}</view>
</view>
<view class="list-box {{ showTips && 'list-box-notips'}} || {{ showGroupTips && 'list-box-group'}} || {{ showAll && 'list-box-group-notips'}} ">
<view wx:if="{{showTips}}" class="safetytips-box">
</view> -->
<view class="list-box {{ showTips && 'list-box-notips'}} || {{ showGroupTips && 'list-box-group'}} || {{ showAll && 'list-box-group-notips'}}" style="height: calc(100vh - 197rpx - 100rpx - {{navbar_height}}px);">
<!-- <view wx:if="{{showTips}}" class="safetytips-box"> -->
<!-- <view class="safetytips">
<text>【安全提示】本 APP 仅用于体验腾讯云即时通信 IM 产品功能,不可用于业务洽谈与拓展。请勿轻信汇款、中奖等涉及钱款等信息,勿轻易拨打陌生电话,谨防上当受骗。</text>
<span class="report" bindtap="handleReport">点此投诉</span>
</view> -->
</view>
<!-- </view> -->
<scroll-view class="message-list" bindtap="triggerClose">
<MessageList id="MessageList" conversation="{{conversation}}" unreadCount="{{unreadCount}}" bind:changeMemberCount="changeMemberCount" bind:resendMessage="resendMessage" bind:typing="typing"></MessageList>
<MessageList id="MessageList" conversation="{{conversation}}" unreadCount="{{unreadCount}}" bind:changeMemberCount="changeMemberCount" bind:resendMessage="resendMessage" bind:typing="typing" order_inquiry_id="{{order_inquiry_id}}"></MessageList>
</scroll-view>
</view>
<view class="group-profile">
@@ -24,4 +36,7 @@
bind:handleCall="handleCall" ></MessageInput>
</view>
</view>
<view style="height: 30px;position: fixed;bottom: 0;width: 100%;background-color: #fff;">
</view>
</view>
+54 -8
View File
@@ -1,7 +1,7 @@
.container {
width: 100vw;
/* height: 100vh; */
background-color: #dcaceb;
height: 100vh;
background-color: #F4F4F4;
}
.safetytips-box{
background: rgba(255, 149, 0, 0.1);
@@ -25,7 +25,7 @@
top: 0;
width: 750rpx;
height: 172rpx;
background-color: #bae46b;
background-color: #ffffff;
}
.tui-navigatorbar-back{
@@ -80,10 +80,9 @@
align-items: center;
}
.list-box {
position: absolute;
/* position: absolute; */
width: 100vw;
height: calc(100vh - 210px);
top: 172rpx;
/* position: fixed; */
}
.list-box-notips {
height: calc(100vh - 284px);
@@ -98,8 +97,10 @@
}
.input-area {
position: absolute;
bottom: 0;
}
bottom: 20px;
z-index: 999999;
/* height: 200rpx; */
}
.message-list {
width: 100%;
height: 100%;
@@ -110,6 +111,7 @@
width: 100%;
padding-bottom: var(--padding);
background-color: #ffffff;
z-index: 999999;
}
.calling {
position: fixed;
@@ -124,3 +126,47 @@
z-index: 8;
position: absolute;
}
.info{
/* position: relative; */
z-index: 9;
height: 100rpx;
background-color: rgb(255, 255, 255);
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
}
.left{
display: flex;
justify-content: space-around;
align-items: center;
flex: 2;
}
.right{
flex: 1;
text-align: right;
font-size: 28rpx;
color: #FFFFFF;
padding-right: 20rpx;
}
.right_txt{
background: #3CC7C0;
border-radius: 29rpx;
padding: 10rpx 20rpx;
}
.name{
font-size: 34rpx;
color: #3CC7C0;
}
.age{
font-size: 34rpx;
color: #666666;
}
.status{
background: #FFF2E8;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
border-radius: 10rpx;
font-size: 24rpx;
color: #FA541C;
padding: 10rpx 20rpx;
}