123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- var d = dialog({contentType:'load', skin:'bk-popup'});
- $(function(){
- var pageIndex = 1 ;
- var pageSize = 100;
- var keshilist = 0;
- var request = GetRequest();
- var hospitalId =request["hospitalId"];
- var scroller1 = new IScrollPullUpDown('wrapper4',{
- probeType:2,
- bounceTime: 250,
- bounceEasing: 'quadratic',
- mouseWheel:false,
- scrollbars:true,
- fadeScrollbars:true,
- click:true,
- interactiveScrollbars:false
- },null,null);
-
- initHosDept();
- //下拉刷新
- function pullDownAction(theScrollerTemp) {
- $(".pullDown").show();
- initHosDept();
- setTimeout(function () {
- $(".pullDown").hide();
- }, 1000);
- }
-
- //上拉加载数据
- function pullUpAction(theScrollerTemp) {
- if(keshilist%100==0){
- $(".pullUp").show();
- getHosDeptByHospital();
- }else{
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'无更多数据!',bottom:true}).show();
- }
- setTimeout(function () {
- $(".pullUp").hide();
- }, 1000);
- }
-
- $(".div-dept").on("click",".n-list",function(){
- var hid = $(this).attr("h-id");
- var deptId = $(this).attr("hdept-id");
- location.href = "select-doctor.html?hospitalId="+hid+"&deptId="+deptId;
- });
-
- function initHosDept(){
- var pageIndex = 1 ;
- var keshilist = 0;
- $(".div-dept").html("");
- getHosDeptByHospital();
- }
-
- function getHosDeptByHospital(){
- d.show();
- var data={};
- data.city = "350200";
- data.filter ="";
- data.hospitalId = hospitalId;
- data.pageIndex = pageIndex;
- data.pageSize = pageSize;
- sendPost('third/guahao/GetOrgDepList', data, 'json', 'post', getListFail, successFun);
- }
-
-
- function successFun(res){
- d.close();
- if(res.status==200){
- var dataList = res.data;
- if(dataList&&dataList.length>0){
- pageIndex = pageIndex+1;
- appendHopitalDept(dataList);
- keshilist = keshilist+dataList.length;
- }else{
- if(keshilist==0||keshilist.length==0){
- $(".div-no-info").show();
- }
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'无更多数据!',bottom:true}).show();
- }
- }else{
- getListFail(res);
- }
- }
-
- function getListFail(res){
- d.close();
- if (res && res.msg) {
- if((res.msg).indexOf("SOAP")>=0){
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:"医院接口访问异常,请刷新后重试!",bottom:true}).show();
- return false;
- }
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
- } else {
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败',bottom:true}).show();
- }
- }
-
-
- function appendHopitalDept(dataList){
- var deptHtml ="";
- for(var j in dataList){
- var data = dataList[j];
- deptHtml+='<div class="n-list c-border-b" h-id="'+data.hospitalId+'" hdept-id="'+data.id+'">'+
- '<div class="n-list-li n-list-link ptb12">'+
- '<div class="n-list-info">'+
- '<h4 class="c-323232 c-f16">'+data.name+'</h4>'+
- '</div>'+
- '<span class="list-icon arrow-right"></span>'+
- '</div>'+
- '</div>';
- }
- $(".div-dept").append(deptHtml);
- scroller1.myScroll.refresh();
- }
- });
|