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 data={ patientCode:vm.patient, teamCode:vm.teamCode, page:page, pagesize:10 } recordAPI.educationList(data).then(function(res){ if(res.status==200){ if(res.data.length>0){ //初始赋总数 if(page == 1){ vm.total = Math.ceil(res.data[0].totalData/10); } vm.list=res.data; $(".consultation-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); } })