var Request = GetRequest(); var checktype=false; var loading = dialog({ contentType: 'load', skin: 'bk-popup', }); var iscrollState='';//判断滑动方向 (function() { mui.init({ pullRefresh : { container:'#wrapper', down : { height:50, auto: false, contentdown : "下拉可以刷新", contentover : "释放立即刷新", contentrefresh : "正在刷新...", callback: function(){ iscrollState='down' myVue.getList() myVue.isdown() } }, up : { height:50, contentinit: '', contentdown: '', contentrefresh : "正在加载...", contentnomore:'没有更多数据了', callback: function() { iscrollState='up' myVue.isup() } } } }) var myVue=new Vue({ el: "#app", data: { data:{}, dataList:[], length:1, cardlenght:0, id:"", queryList:{ month:"", healthNo:"" }, code:"", payTypeList:[{},{type:"weixin",Img:"../images/weixinzhifu_icon.png",text:"微信支付"},{type:"xianjin",Img:"../images/xianjichongzhi_icon.png",text:"现金支付"},{type:"yinlian",Img:"../images/yinlianzhifu_icon.png",text:"银联支付"},{type:"zhifubao",Img:"../images/zhifubaozhifu_icon.png",text:"支付宝支付"}], healthType:["","就诊卡缴费","住院缴费"], }, mounted: function() { var vm = this checkUserAgent(); vm.checkType() vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid vm.queryList.month=new Date().getFullYear()+"-"+(new Date().getMonth()+1) vm.eventClick() }, methods: { //获取就诊卡 getData:function(){ var vm=this loading.showModal(); sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show(); }, function(res){ if(res.status == 200){ if(res.data.length>0){ vm.cardlenght=res.data.length if(Request.id){ vm.data=res.data.filter(function(item){ return item.id==Request.id })[0] }else{ vm.data=res.data.filter(function(item){ return item.isDefault==1 })[0] if(!vm.data){ vm.data=res.data[0] } } vm.queryList.healthNo=vm.data.cardNo vm.getList() }else{ dialog({ content: "请先绑定就诊卡,再查看就诊缴费信息!", okValue: '确定', ok: function(){ window.location.href='../../payment/html/patientIDCards.html'; }, // cancelValue: '我再看看', // cancel: function(){} }).showModal() } }else{ loading.close(); dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, //获取列表数据 getList:function(){ var vm=this sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "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 vm.length=vm.dataList.length }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show(); } }) }, //跳转到订单结果页 gotoResult:function(seqNo){ window.location.href='../../payment/html/paymentResult.html?seqNo='+seqNo; }, //跳转切换就诊卡 changeCards:function(){ window.location.href='../../payment/html/changeCards.html?pre=paymentList'; }, //绑定事件-时间 eventClick:function(){ var vm=this $('.date-icon').mobiscroll({ preset: 'date', dateOrder: 'yymm', dateFormat: 'yy-mm', theme: 'ios', lang:'zh', minDate: new Date(2015,1), maxDate: new Date(), onSelect: function(valueText, inst){ if(vm.queryList.month!=valueText){ vm.queryList.month=valueText vm.getList() } }, }); }, //跳转我的就诊卡页面 gotoCards:function(){ window.location.href='../../payment/html/patientIDCards.html'; }, //判断是否验证登录通过 checkType:function(){ var vm=this var timer = setInterval(function(){ if(checktype){ clearInterval(timer); vm.getData() } },10); }, isdown:function(){ // setTimeout(function(){ mui('#wrapper').pullRefresh().endPulldownToRefresh(false); mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置 // },1000) }, isup:function(){ // setTimeout(function(){ mui('#wrapper').pullRefresh().endPullupToRefresh(true);//true表示没有更多数据了 // },1000) }, }, }) })() function queryInit(){ checktype=true }