' + doctor_name + '';
var sendErrDom = "";
if(!msg.beforeSend && msg.id && msg.id.indexOf('loc')==0){
sendErrDom = "
";
}
//设置已读标志
var yiduHtml1 = '
';
var yiduHtml2 = '
';
var yiduHtml3 = '
';
if(self.id=="p2dzixun" || self.id=="p2p" && !(!msg.beforeSend && msg.id && msg.id.indexOf('loc')==0)){//医生和患者对聊、医生和医生对聊,显示是否已读
//var ydText = "居民已读";
// TODO "居民已读" 临时改为 "已读"
var ydText = "已读";
if(!isPatient){//医生对聊
ydText = "已读";
}
if (!isSend) {
ydText = '';
}
if(docInfo.code == msg.sender_id) {
if(msg.timestamp<=lastFetchTime){
yiduHtml1 = '
'+ydText+'';//除了视频,文章
yiduHtml2 = '
'+ydText+'';//视频、文章
yiduHtml3 = '
'+ydText+'';//图片
}
}
}else{//团队群聊、求助群聊不显示是否已读
yiduHtml1 = '';
yiduHtml2 = '';
yiduHtml3 = '';
}
switch(typeMsg) {
case 0:
case 1://普通文本
case 6://开始咨询文本
case 8://求助文本
temp += '
'+ sendErrDom + yiduHtml1+'
' + matchUrl(contentMsg) + '';
break;
case 2://图片
case 9://求助图片
if(msg.local_src=="data:,")
contentMsg = msg.content;
else if(msg.local_src)
contentMsg = msg.local_src.indexOf('data:')==0? msg.local_src: plus.io.convertLocalFileSystemURL(msg.local_src);
else
contentMsg = msg.content;
var imgUrl = contentMsg;
if(imgUrl.indexOf("/storage") > -1){
//本地图片
imgUrl = imgUrl;
}else{
imgUrl = getImgUrl(contentMsg);
}
temp += '
'+ sendErrDom + '
'+yiduHtml3+'';
$('img.l-previmg[data-code="'+ msg.id +'"]').remove();
break;
case 3://语音
var rec = msg.local_src? JSON.parse(msg.local_src) : contentMsg? JSON.parse(contentMsg) : undefined;
if(rec){
var path = msg.local_src?msg.local_src:msg.content;
temp += "
"+ sendErrDom + yiduHtml1+"
"+
"" +
""+(rec? rec.times: "") +"\'\'"+
"
"+
"";
}
break;
case 4: //文章
temp += formatJyzd(contentMsg, sendErrDom,yiduHtml2, msg.timestamp);
// temp += '
' + matchUrl(contentMsg) + '';
break;
case 12: //视频
var videoInfo = msg.content.split(",");
var shichang = formatSeconds(videoInfo[2]);//时长
if(docInfo.code != msg.sender_id) {
temp += '
'+yiduHtml2+
''+
''+
''+
''+shichang+''+
' ';
}else{
temp += '
'+yiduHtml2+
''+
''+
''+
''+shichang+''+
' ';
}
break;
}
html += temp + '