var Request = GetRequest() var sessionId = null, patiCode = window.localStorage.getItem("severPatientCode"), patiName = null, consultCode = Request["consult"], kindType = Request["type"],//区分续方8或健康2 page = 1, members = []; var docInfo = JSON.parse(window.localStorage.getItem("severDocInfo")); $(function(){ recordAPI.getSessionId({consult:consultCode}).then(function(res){ if(res.status == 200){ var msg = JSON.parse(res.msg)[0]; sessionId = msg.session_id; } }).then(function(){ //获得会话参与人员 recordAPI.getMembers(sessionId).then(function(res){ members = res; getMessage(); }) }) function getMessage(){ var params = { page: 1, pagesize: 1000, consult:consultCode } recordAPI.getList(params).then(function(res){ var list = res.list.list if (list && list.length > 0) { var html = '', length = list.length; for (var j = length-1; j >= 0; j--) { var reply = JSON.parse(list[j]) if(reply.content_type!=4 && reply.content_type!=14){//跳过教育指导 html += formatMsg(reply); } } plyr.setup(); $("#talkBox").append(html); } }); } function formatMsg(reply){ var isSelf = (reply.sender_id == docInfo.code) ? true : false; var isSystem = reply.sender_id == 'system'; var html = ''; var typeMsg = reply.content_type; if(typeMsg == 7 || typeMsg == 10 || typeMsg == 13){ var content = reply.content; html = template('sys_msg_tmp', {content: content}); }else if(typeMsg == 5){ var con = JSON.parse(reply.content); if(reply.sender_id == docInfo.code){ html = '
已向'+ con.doctor_name +'医生求助
'; } }else{ //获取个人成员信息 var member; for(var i=0; i' }) }) })