This commit is contained in:
zoujiandong
2024-01-12 09:38:24 +08:00
parent efb6a9aacf
commit 360c1bb977
301 changed files with 19221 additions and 986 deletions
@@ -35,7 +35,7 @@
<view class="custom-content-text">{{renderDom[0].text}}</view>
</view>
<view wx:if="{{renderDom[0].type ==='c2cCalling' || renderDom[0].type ==='groupCalling'}}" class="custom-message {{isMine?'my-custom':''}}" >
<view class="custom-content-text">{{renderDom[0].text}}</view>
<view class="custom-content-text">{{renderDom[0].text}}11</view>
</view>
<!-- <view wx:if="{{renderDom[0].type ==='notSupport'}}" class="message-body-span text-message" >
<view class="message-body-span-text">{{renderDom[0].text}}</view>
@@ -3,6 +3,7 @@ import constant from '../../../../utils/constant';
import { API } from '../../../../../utils/network/api';
import dayjs from '../../../../utils/dayjs';
import { requestSubscribeMessage } from '../../../../../utils/requestSubscribeUtil';
import { TUICallKitServer } from "../../../../../TUICallKit/TUICallService/index";
const api = new API()
let app = getApp()
// eslint-disable-next-line no-undef
@@ -59,6 +60,8 @@ Component({
value: {},
observer(newVal) {
this.setData({
baseInfo:newVal,
patient_user_id: newVal.patient_user_id,
family_id: newVal.family_id,
});
},
@@ -80,7 +83,9 @@ Component({
data: {
conversation: {},
message: '',
baseInfo:{},
family_id:'',
patient_user_id:'',
extensionArea: false,
sendMessageBtn: false,
displayFlag: '',
@@ -301,6 +306,22 @@ Component({
* 组件的方法列表
*/
methods: {
async call() {
let {baseInfo}=this.data;
await TUICallKitServer.call({
userID: this.data.patient_user_id,
type: 2,
timeout:0,
userData:JSON.stringify({
'is_system':0,
'test':'111111'
}),
});
await TUICallKitServer.setSelfInfo({ nickName:"夏侯惇22"});
console.log('1111111111111111111111')
},
// 获取消息列表来判断是否发送正在输入状态
getMessageList(conversation) {
wx.$TUIKit.getMessageList({
@@ -715,6 +736,10 @@ Component({
minDate:new Date().getTime(),
showTimepicker:true
})
break;
case '13':
this.call();
break;
default:
break;
}
@@ -1179,10 +1204,20 @@ Component({
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
let {baseInfo}=this.data;
const message = wx.$TUIKit.createCustomMessage({
to: this.getToAccount(),
conversationType: this.data.conversation.type,
payload: e.detail.payload,
cloudCustomData:JSON.stringify({
order_inquiry_id:baseInfo.order_inquiry_id,
inquiry_type: baseInfo.inquiry_type,
inquiry_mode:baseInfo.baseInfo.inquiry_mode,
message_type: 0,
is_system: 0,
message_rounds:0,
patient_family_data: baseInfo.patient_family_data
})
});
this.$sendTIMMessage(message);
this.setData({
@@ -3,6 +3,7 @@
<view class="TUI-commom-function-item" data-key="10" bindtap="handleCommonFunctions">查看完整病历</view>
<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 class="TUI-commom-function-item" data-key="12" bindtap="handleCommonFunctions" wx:if="{{baseInfo.multi_point_status == 1 && baseInfo.inquiry_status==4 && baseInfo.multi_point_enable==1}}">预约视频时间</view>
<view class="TUI-commom-function-item" data-key="13" 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"
@@ -29,6 +29,15 @@ Component({
type: String,
value: "",
},
baseInfo: {
type: Object,
value: {},
observer(newVal) {
this.setData({
baseInfo: newVal
});
},
},
unreadCount: {
type: Number,
value: '',
@@ -49,6 +58,7 @@ Component({
isLostsOfUnread: false,
unreadCount: '',
conversation: {}, // 当前会话
baseInfo:{},
messageList: [],
// 自己的 ID 用于区分历史消息中,哪部分是自己发出的
scrollView: '',
@@ -243,8 +253,44 @@ Component({
if(message.cloudCustomData){
cloudCustomData = message.cloudCustomData;
}
console.log("11111111111111111111111111")
console.log("cloudCustomData:"+cloudCustomData)
if(cloudCustomData){
cloudCustomDataJson = JSON.parse(cloudCustomData);
}else{
if(message.type=="TIMCustomElem"){
console.log("3333333333333333333");
// let {baseInfo}=this.data;
// const custommessage = wx.$TUIKit.createCustomMessage({
// to: this.getToAccount(),
// conversationType: this.data.conversation.type,
// payload:{
// cloudCustomData: JSON.stringify({
// order_inquiry_id:baseInfo.order_inquiry_id,
// inquiry_type: baseInfo.inquiry_type,
// inquiry_mode:baseInfo.baseInfo.inquiry_mode,
// message_type: 0,
// is_system: 0,
// message_rounds:0,
// patient_family_data: baseInfo.patient_family_data
// })
// },
// });
// wx.$TUIKit.sendMessage(custommessage).then(res=>{
// const firstSendMessage = wx.getStorageSync('isFirstSendMessage');
// if (firstSendMessage) {
// wx.aegis.reportEvent({
// name: 'sendMessage',
// ext1: 'sendMessage-success',
// ext2: 'imTuikitExternal',
// ext3: wx.$chat_SDKAppID,
// });
// }
// }).catch((error)=>{
// console.log(error)
// });
// console.log(444444);
}
}
let is_system = cloudCustomDataJson.is_system;
if(is_system != 1){//不是系统消息直接返回
@@ -273,6 +319,19 @@ Component({
this.showTextMessage()
}
},
getToAccount() {
if (!this.data.conversation || !this.data.conversation.conversationID) {
return '';
}
switch (this.data.conversation.type) {
case wx.$TUIKitTIM.TYPES.CONV_C2C:
return this.data.conversation.conversationID.replace(wx.$TUIKitTIM.TYPES.CONV_C2C, '');
case wx.$TUIKitTIM.TYPES.CONV_GROUP:
return this.data.conversation.conversationID.replace(wx.$TUIKitTIM.TYPES.CONV_GROUP, '');
default:
return this.data.conversation.conversationID;
}
},
showTextMessage() {
Message.info({
context: this,
+1
View File
@@ -48,6 +48,7 @@
<MessageList
bind:getInquiryMessageBasic="getInquiryMessageBasic"
bind:freshInfo="freshInfo"
baseInfo="{{baseInfo}}"
bind:refreshMessageRounds="refreshMessageRounds"
id="MessageList" conversation="{{conversation}}" unreadCount="{{unreadCount}}" bind:changeMemberCount="changeMemberCount" bind:resendMessage="resendMessage" bind:typing="typing" order_inquiry_id="{{order_inquiry_id}}"></MessageList>
</scroll-view>