mui.plusReady(function() {
// mui(".c-list").on("tap", "li", function() {
// openWebview("my-doctor-advice-detail.html");
// });
//查询列表
clearHTML();
queryList();
});
function queryList() {
plus.nativeUI.showWaiting();
//拼请求内容
var params = {};
params.id = 0;
params.pagesize = 10;
//发送ajax请求
sendPost(server+"doctor/comments", params,queryListFailed, queryListSuccesss);
}
function queryListFailed(res) {
if (res && res.msg) {
plus.nativeUI.toast(res.msg);
} else {
plus.nativeUI.toast("数据加载失败");
}
plus.nativeUI.closeWaiting();
}
function queryListSuccesss(res) {
if (res.status == 200) {
//成功
showList(res.list);
} else {
//非200则为失败
queryListFailed(res);
}
plus.nativeUI.closeWaiting();
}
/**
* 清空tbody
*/
function clearHTML() {
$("#patient_evaluate").html("");
}
/**
* 显示查询结果
* @param {Object} list
*/
function showList(list) {
// clearHTML();
var _html = "";
for (var i = 0; i < list.length; i++) {
var data = list[i];
if (!data) {
continue;
}
_html+="
"
_html+= ""+data.name+"未分组"+data.czrq+"
"
_html+= ""
_html+= "疾病:咳"
_html+= ""
_html+= "态度:好"
_html+= "疗效:满意"
_html+= ""
_html+= "
"
_html+= ""
_html+= ""+data.content+""
_html+= "
"
_html+= ""
_html+= "
推荐+1"
_html+= "
"
_html+=""
}
$("#patient_evaluate").html(_html);
}
// $("#equ_list").on("click","li",function(){
// var attr_code = $(this).attr('attr_code');
// var attr_name = $(this).attr('attr_name');
// var attr_sn = $(this).attr('attr_sn');
//
// //获取现在有的设备类别以及名称
// var params = {}
// params.code = attr_code;
// var dev_list={};
//
// //发送ajax请求, 查询设备列表信息
// sendPost("patient/device/info", params, "json", "post", queryListFailed,device_info_Successs);
// function device_info_Successs(res){
// var category=res.data.category;
// var type_name='';
// //发送ajax请求, 查询设备类型
// sendPost("patient/device/category"," ", "json", "post", queryListFailed,device_type_Successs);
// function device_type_Successs(reso){
// dev_list=reso.list;
// for(var i=0;i' + content + ''
// html += '' + czrq.substring(0, 10) + '
';
//
// li.innerHTML = html;
// ul.appendChild(li);
//}
//添加数据添加监听
window.addEventListener("update_info", function(e) {
clearHTML();
//刷新列表
queryList();
});