|
@ -4,17 +4,17 @@ new Vue({
|
|
|
data: {
|
|
|
sessionId:null,
|
|
|
sessionType:2,//1对1会话
|
|
|
curDoctorCode:JSON.parse(localStorage.getItem(httpRequest.agentName)).uid,
|
|
|
curDoctorCode:JSON.parse(window.localStorage.getItem('wlyyAgent')).uid,
|
|
|
curDoctorName:"",
|
|
|
otherCode: Request["otherCode"],//对方医生code
|
|
|
otherName: decodeURIComponent(Request["otherName"]) || "",//对方医生姓名
|
|
|
planDetailId:Request["planDetailId"],//项目id
|
|
|
members:[],
|
|
|
otherInfo:null,//对方的医生信息
|
|
|
consultData:null,
|
|
|
firstMsg:null,
|
|
|
page:1,
|
|
|
pagesize:10
|
|
|
pagesize:10,
|
|
|
count:0
|
|
|
},
|
|
|
mounted: function() {
|
|
|
this.createSession();
|
|
@ -59,8 +59,8 @@ new Vue({
|
|
|
sex: v.sex,
|
|
|
avatar: v.avatar,
|
|
|
role: v.role,
|
|
|
is_patient: v.is_patient,//0 医生,1 患者
|
|
|
last_fetch_time:v.last_fetch_time
|
|
|
is_patient: v.is_patient,//0 医生,1 患者
|
|
|
last_fetch_time:v.last_fetch_time
|
|
|
});
|
|
|
});
|
|
|
|
|
@ -155,7 +155,7 @@ new Vue({
|
|
|
scrollTo: 'bottom'
|
|
|
});
|
|
|
}else{
|
|
|
layer.msg(res.msg, {icon: 5})
|
|
|
layer.msg(res.msg, {icon: 5})
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@ -195,29 +195,25 @@ new Vue({
|
|
|
};
|
|
|
consultingAPI.sendMessage(vm.sessionId, {data: params}).then(function(res){
|
|
|
console.log(res);
|
|
|
var messages = res.messages[0];
|
|
|
var guidanceParams = {
|
|
|
messageId:messages.id,//消息id
|
|
|
content:messages.content,//聊天内容
|
|
|
planDetailId:vm.planDetailId //服务项目id
|
|
|
vm.count++;
|
|
|
if(vm.count==1 && JSON.parse(window.localStorage.getItem('wlyyAgent')).level=="1"){//level:1 专科医生 (只记录第一条数据)
|
|
|
var messages = res.messages[0];
|
|
|
var guidanceParams = {
|
|
|
messageId:messages.id,//消息id
|
|
|
content:messages.content,//聊天内容
|
|
|
planDetailId:vm.planDetailId,//服务项目id
|
|
|
contentType:messages.content_type//消息类型
|
|
|
}
|
|
|
debugger
|
|
|
consultingAPI.saveGuidanceMessage(guidanceParams).then(function(rs){
|
|
|
debugger
|
|
|
if(rs.status==200){
|
|
|
|
|
|
}else{
|
|
|
layer.msg(rs.msg, {icon: 5})
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
consultingAPI.saveGuidanceMessage(guidanceParams).then(function(rs){
|
|
|
if(rs.status==200){
|
|
|
|
|
|
}else{
|
|
|
layer.msg(rs.msg, {icon: 5})
|
|
|
}
|
|
|
})
|
|
|
// var html = "";
|
|
|
// for(var i=0; i<res.messages.length; i++){
|
|
|
// var reply = res.messages[i];
|
|
|
// console.log(reply);
|
|
|
// html += formatMsg(reply);
|
|
|
// }
|
|
|
// $("#talkBox").append(html);
|
|
|
// $("#talkBox").slimscroll({
|
|
|
// scrollTo: this.height
|
|
|
// });
|
|
|
});
|
|
|
},
|
|
|
connectSocket:function(){
|