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("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() { $("#doc_list").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; } if(data.photo==null || data.photo==""|| data.photo=="undefined"){ data.photo="../images/face.png"; } _html+="
" _html+= "