var Request = GetRequest(); var checktype=false; (function() { myvue=new Vue({ el: "#app", data: { dataList:[], code:"", }, mounted:function(){ var vm = this checkUserAgent(); vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid vm.checkType() }, methods: { //获取列表数据 getData:function(){ var vm=this var loading = dialog({ contentType: 'load', skin: 'bk-popup' }); sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show(); }, function(res){ loading.close(); if(res.status == 200){ vm.dataList=res.data }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, //设置默认就诊卡 setDefault:function(id,isDefault){ var vm=this sendPost("/patient/card/defaultOpe", {id:id,isDefault:isDefault}, "json", "post",function(){ }, function(res){ if(res.status == 200){ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show(); vm.getData() }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, gotoPage:function(id){ if(Request.pre=="paymentList"){ //跳到缴费查询页面 window.location.href='../../payment/html/paymentList.html?id='+id; }else if(Request.pre=="waitingDoctorList"){ //跳到候诊查询页面 window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id; }else{ } }, //判断是否验证登录通过 checkType:function(){ var vm=this var timer = setInterval(function(){ if(checktype){ clearInterval(timer); vm.getData() } },10); }, }, }) })() function queryInit(){ checktype=true }