1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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 = '<li class="inp'+rowData.id+'" >'+
- '<div class="div-xuetangyi-img">'+
- '<img src="'+getImgUrl(rowData.photo)+'" ></div>'+
- '<div class="deviceTitle">'+rowData.name+'</div>'+
- '</li>';
- $(".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("加载设备型号列表失败!");
- }
- }
|