$(function() { $(".c-lab-mor li").click(function() { $(".c-lab-mor li").removeClass("hit"); $(this).addClass("hit"); }); }); mui.plusReady(function() { queryList(); }); function queryList() { plus.nativeUI.showWaiting(); var params = {}; params.page = 1; params.pageSize = 10; sendPost("patient/followup/record", params, "json", "post", queryListFailed, queryListSuccess) } function queryListFailed(res) { if (res && res.msg) { plus.nativeUI.toast(res.msg); } else { plus.nativeUI.toast("随访数据加载失败"); } } function queryListSuccess(res) { if (res.status == 200) { //成功 showList(res.list); } else { //非200则为失败 queryListFailed(res); } plus.nativeUI.closeWaiting(); } /** * 显示查询结果 * @param {Object} list */ function showList(list) { for (var i = 0; i < list.length; i++) { var data = list[i]; if (!data) { continue; } addRow(data.doctor, data.hospital, data.dept, data.type, data.name, data.czrq, data.status); } } function addRow(doctor, hospital, dept, type, name, czrq, status) { var ul = document.querySelector("#item"); var li = document.createElement("li"); li.onclick = function(){ openWebview('image-followup.html'); }; var html = '
'; if (status == 0) { html += '未完成'; } else { html += '完成'; } if (type == 1) { //问卷随访 html += ' 问卷随访'; } else if (type == 2) { //图文随访 html += ' 图文随访'; } else { //电话随访 html += ' 电话随访'; } html += ''; html += '
'; html += '
'; html += '' + name + ' 随访时间:' + czrq; html += '
'; html += '
签约医生:' + doctor + ' (' + hospital + ' ' + dept + ')'; html += '
'; li.innerHTML = html; ul.appendChild(li); }