mui.init(); var docInfo = null; var pageIndex = 1; var pageSize = 10; var scroller1; mui.plusReady(function(){ var self = plus.webview.currentWebview(); docInfo = JSON.parse(plus.storage.getItem("docInfo")); queryInit(); }) function queryInit(){ plus.nativeUI.showWaiting(); initData(); bindEvents(); function bindEvents(){ $(".c-list").on("click","li",function(event){ var parentLi = $(this).closest("li"); var id = parentLi.attr("data-id"); openWebviewExtras("detail-appointment.html",{dataId:id}); }); $(".btntrue").bind("click",function(){ openWebview("../../search/html/xuanzejumin_one.html",{origin:'wdyy'}); }) scroller1 = $("#wrapper2").initScroll( { pullDownAction: function(){ location.reload(); },pullUpAction: function() { getMyAppo(); } } ); } function initData(){ $(".c-list").html(""); pageIndex = 1; getMyAppo(); } function getMyAppo(){ var data={}; data.doctor = docInfo.code; data.pageIndex = pageIndex; data.pageSize = pageSize; sendPost('third/guahao/GetDoctorReservationList', data, getListFail, successFun); } function successFun(res){ plus.nativeUI.closeWaiting(); if(res.status==200){ updatePullUpText(scroller1,res.data); if(res.data&&res.data.length>0){ pageIndex=pageIndex+1; appendMyAppo(res.data); }else{ if(pageIndex==1){ $(".main").hide(); $(".div-no-info").show(); }else{ mui.toast("无更多数据"); } } if(res.data.length < pageSize){ $(".pullUp").hide(); }else{ $(".pullUp").show(); } scroller1.refresh(); }else{ getListFail(res); } } function getListFail(res){ plus.nativeUI.closeWaiting(); if (res && res.msg) { mui.toast(res.msg); } else { mui.toast("加载失败!"); } } function appendMyAppo(dataList){ var appoHtml =""; for(var j in dataList){ var data = dataList[j]; appoHtml+='