new Vue({ el: "#app", data: { records: [], historyrecords: [], recodestype: '101', historytype: '100', ishomeNull: false, ishistoryNull: false, }, mounted: function() { var vm = this vm.getlist(1, vm.recodestype) vm.getlist(1, vm.historytype) }, methods: { getlist: function(pageNo, types) { var vm = this var oauthInfo = JSON.parse(sessionStorage.getItem("oauthInfo")); var param = { type: types, appId: httpRequest.client_id, toUserId: oauthInfo.id, page: pageNo, size: 5, typeId: 7, } jiuzhenAPI.getRemind(param).then(function(res) { if(types == '101') { vm.records = res.detailModelList if(res.totalCount == 0) { vm.ishomeNull = true } else { vm.inithomePage(pageNo, res.totalPage, res.totalCount) } } else if(types == '100') { vm.historyrecords = res.detailModelList vm.historyrecords = res.detailModelList.map(function(v) { var content = JSON.parse(v.content); for(var i = 0; i < content.length; i++) { var aaa = content[i].code if(content[i].code == 'registerDate') { v.registerDate = content[i].value } else if(content[i].code == 'deptName') { v.deptName = content[i].value } else if(content[i].code == 'doctorName') { v.doctorName = content[i].value } else if(content[i].code == 'hospitalName') { v.hospitalName = content[i].value } } return v }) if(res.totalCount == 0) { vm.ishomeNull = true } else { vm.inithistoryPage(pageNo, res.totalPage, res.totalCount) } } }) }, inithomePage: function(pageNo, total, size) { var vm = this //分页初始化 $("#homepage").paging({ pageNo: pageNo, totalPage: total, totalSize: size, callback: function(num) { //回调的页数 vm.getlist(1, vm.recodestype) } }) }, inithistoryPage: function(pageNo, total, size) { var vm = this //分页初始化 $("#historypage").paging({ pageNo: pageNo, totalPage: total, totalSize: size, callback: function(num) { //回调的页数 vm.getlist(1, vm.historytype) } }) }, cancelbtn: function(orderid, thirdorderid) { mineJiuZhenDialogForm.cancelAppointment(orderid, thirdorderid) }, satisfactionbtn: function(id) { mineJiuZhenDialogForm.satisfaction(id) }, } });