添加聊天页面的来源,处理带接诊的问题
This commit is contained in:
@@ -2,7 +2,6 @@ import logger from '../../../../utils/logger';
|
||||
import constant from '../../../../utils/constant';
|
||||
import { API } from '../../../../../utils/network/api';
|
||||
import { requestSubscribeMessage } from '../../../../../utils/requestSubscribeUtil';
|
||||
|
||||
const api = new API()
|
||||
let app = getApp()
|
||||
// eslint-disable-next-line no-undef
|
||||
@@ -24,6 +23,15 @@ Component({
|
||||
type: String,
|
||||
value: {},
|
||||
},
|
||||
from:{
|
||||
type: String,
|
||||
value: '',
|
||||
observer(from) {
|
||||
this.setData({
|
||||
from: from,
|
||||
});
|
||||
}
|
||||
},
|
||||
inquiry_type: {
|
||||
type: String,
|
||||
value: {},
|
||||
@@ -358,9 +366,10 @@ Component({
|
||||
},
|
||||
|
||||
// 发送图片消息
|
||||
handleSendImageMessage(file) {
|
||||
async handleSendImageMessage(file) {
|
||||
|
||||
let networkstatus = this.data.networkstatus
|
||||
let {from}=this.data;
|
||||
// console.log("networkstatus: ", networkstatus)
|
||||
if(networkstatus === 'none'){
|
||||
wx.showToast({
|
||||
@@ -369,7 +378,9 @@ Component({
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(from){
|
||||
await this.handlegetLastInquiry();
|
||||
}
|
||||
let _this = this;
|
||||
let conversationID = this.data.conversation.conversationID
|
||||
let promise = wx.$TUIKit.getConversationProfile(conversationID);
|
||||
@@ -431,6 +442,7 @@ Component({
|
||||
this.$sendTIMMessage(message);
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 发送视频消息
|
||||
handleSendVideoMessage(file) {
|
||||
@@ -525,6 +537,53 @@ Component({
|
||||
this.setData({
|
||||
dialog_visible: false
|
||||
})
|
||||
},
|
||||
//获取问诊订单状态
|
||||
async getInquiryMessageBasic(order_inquiry_id) {
|
||||
// console.log("order_inquiry_id: ", this.data.order_inquiry_id);
|
||||
await api.getInquiryMessageBasic({order_inquiry_id:order_inquiry_id}).then(response => {
|
||||
let result=response.data;
|
||||
console.log(result.inquiry_status)
|
||||
if(result.inquiry_status==3){
|
||||
wx.showToast({
|
||||
title: '暂时不能发送消息',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}).then(res => {
|
||||
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
//获取最新问诊id;
|
||||
async handlegetLastInquiry(){
|
||||
let {baseInfo,order_inquiry_id}=this.data;
|
||||
const {data} =await api.getLastInquiry({
|
||||
patient_id:baseInfo.patient_id,
|
||||
doctor_id:baseInfo.doctor_id
|
||||
})
|
||||
if(data){
|
||||
if(data!=order_inquiry_id){
|
||||
const result=await api.getInquiryMessageBasic({order_inquiry_id:data});
|
||||
if(result.data.inquiry_status==3){
|
||||
wx.showToast({
|
||||
title: '暂时不能发送消息',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//this.getInquiryMessageBasic(data);
|
||||
}
|
||||
}
|
||||
// .then(data=>{
|
||||
|
||||
// let result=data.data;
|
||||
// console.log(result,order_inquiry_id)
|
||||
// if(result){
|
||||
// if(result!=order_inquiry_id){
|
||||
// this.getInquiryMessageBasic(result);
|
||||
// }
|
||||
// }
|
||||
|
||||
// })
|
||||
},
|
||||
confirmDialog(){
|
||||
// app.go("/Pages/yishi/zhiye_identity/index")
|
||||
@@ -679,9 +738,9 @@ Component({
|
||||
});
|
||||
},
|
||||
|
||||
sendTextMessage(msg, flag) {
|
||||
|
||||
async sendTextMessage(msg, flag) {
|
||||
let networkstatus = this.data.networkstatus
|
||||
let {from}=this.data;
|
||||
// console.log("networkstatus: ", networkstatus)
|
||||
if(networkstatus === 'none'){
|
||||
wx.showToast({
|
||||
@@ -690,7 +749,9 @@ Component({
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(from){
|
||||
await this.handlegetLastInquiry();
|
||||
};
|
||||
wx.aegis.reportEvent({
|
||||
name: 'messageType',
|
||||
ext1: 'messageType-text',
|
||||
@@ -748,7 +809,7 @@ Component({
|
||||
message_rounds: message_rounds,
|
||||
patient_family_data: patient_family_data
|
||||
});
|
||||
|
||||
|
||||
// console.log("mycloudCustomData: ", mycloudCustomData);
|
||||
// console.log("text: ", text);
|
||||
const message = wx.$TUIKit.createTextMessage({
|
||||
|
||||
@@ -40,6 +40,15 @@ Component({
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
from:{
|
||||
type: String,
|
||||
value: '',
|
||||
observer(from) {
|
||||
this.setData({
|
||||
from: from,
|
||||
});
|
||||
},
|
||||
},
|
||||
inquiry_type: {
|
||||
type: String,
|
||||
value: ''
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<view class="input-area" style="{{input_area_style}}" >
|
||||
<!-- wx:if="{{showChat}}" -->
|
||||
<view class="message-input" style="{{viewData.style}}" >
|
||||
<MessageInput bind:myhandleExtensions="myhandleExtensions" id="MessageInput" inquiry_type="{{inquiry_type}}" baseInfo="{{baseInfo}}" order_inquiry_id="{{order_inquiry_id}}" conversation="{{conversation}}" hasCallKit="{{hasCallKit}}" bind:sendMessage="sendMessage" bind:downKeysBoards="downKeysBoards" bind:pullKeysBoards="pullKeysBoards" bind:showMessageErrorImage="showMessageErrorImage"
|
||||
<MessageInput bind:myhandleExtensions="myhandleExtensions" id="MessageInput" inquiry_type="{{inquiry_type}}" baseInfo="{{baseInfo}}" order_inquiry_id="{{order_inquiry_id}}" conversation="{{conversation}}" from="{{from}}" hasCallKit="{{hasCallKit}}" bind:sendMessage="sendMessage" bind:downKeysBoards="downKeysBoards" bind:pullKeysBoards="pullKeysBoards" bind:showMessageErrorImage="showMessageErrorImage"
|
||||
bind:refreshMessageStatus="refreshMessageStatus"
|
||||
bind:inputBindLinechange="inputBindLinechange"
|
||||
bind:handleCall="handleCall" message_rounds="{{message_rounds}}"></MessageInput>
|
||||
|
||||
Reference in New Issue
Block a user