var category_code = null; var patient = null; mui.init(); mui.plusReady(function() { plus.nativeUI.showWaiting(); self = plus.webview.currentWebview(); category_code = self.category_code; patient = self.patient; initPage(); }); function initPage(){ getDevices(); } function getDevices(){ var params = {}; params.category_code= category_code; sendGet("common/device/DeviceList",params,queryListFailed,queryListSuccess); } function queryListSuccess(res){ plus.nativeUI.closeWaiting(); if(res.status==200){ if(res.data&&res.data.length>0){ for(var i in res.data){ showList(res.data[i]); } }else{ mui.toast("无更多设备"); } }else{ queryListFailed(res); } } function showList(rowData){ var showDomLi = '
  • '+ '
    '+ '
    '+ '
    '+rowData.name+'
    '+ '
  • '; $(".c-list").append(showDomLi); $(".inp"+rowData.id+" div").click(function(){ var params = {}; params.deviceId = rowData.id; params.patient = patient; openWebviewExtras("edit-xuetangyi.html",params) }) } function queryListFailed(res) { plus.nativeUI.closeWaiting(); if (res && res.msg) { mui.toast(res.msg); } else { mui.toast("加载设备型号列表失败!"); } }