new Vue({ el: '#app', data: { total:'',//总页数 currentPage:1,//当前页数 list:[],//列表集合 patient:null, teamCode:null }, methods:{ msgListView: function(page){ var vm=this; if(page){ vm.currentPage=page; var userAgent = JSON.parse(localStorage.getItem(httpRequest.agentName)) var data = { doctor: userAgent.uid, patient:vm.patient, teamCode:vm.teamCode, page:page, pagesize:10} recordAPI.followUpList(data).then(function(res){ if(res.status==200){ if(res.data.length>0){ vm.list=res.data; //初始赋总数 if(page == 1){ vm.total = Math.ceil(res.data[0].total/10); } $(".followup-list").animate({scrollTop:0},0);//滚回顶部 $(".slimScrollBar").css('top',0); }else{ top.toastr.info("没有更多内容了"); } }else{ top.toastr.error(res.msg); } }) } } }, mounted: function (){ this.patient = localStorage.getItem("severPatientCode"); this.teamCode = JSON.parse(localStorage.getItem("severPatientTeam")).id; this.msgListView(this.currentPage); }, })