Browse Source

支付页面增加切换就诊卡方法

chenyue 6 years ago
parent
commit
25bc2f6f93

+ 1 - 1
html/payment/html/payment.html

@ -23,7 +23,7 @@
			<div class="bgc-fff c-f14 plr15 mt10">
				<div class="c-border-b  ptb10">
					<span class="c-333333">{{cardNo}}&nbsp;({{data.name}})&nbsp;</span>
					<span v-if="data.isDefault==1" class="c-4dcd70">默认</span>
					<span v-if="cardlenght>1" class="qiehuan-txt" @click="changeCards">切换</span>
					<span class="c-999" style="float: right;">余额:<span class="c-ff9526">¥&nbsp;{{surplusMoney}}元</span></span>						
				</div>	
				<div class="c-999 mt7">

+ 8 - 0
html/payment/js/changeCards.js

@ -28,6 +28,12 @@ var checktype=false;
			   		loading.close();
			        if(res.status == 200){ 
			        	vm.dataList=res.data
			        	if(Request.paytype==2){
			        		vm.dataList=res.data.filter(function(item){
			        			item.cardNo=item.inpCardNo
			        			return item.inpCardNo
			        		})
			        	}
			        }else{
			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
			        }
@ -51,6 +57,8 @@ var checktype=false;
					window.location.href='../../payment/html/paymentList.html?id='+id;
				}else if(Request.pre=="waitingDoctorList"){   //跳到候诊查询页面
					window.location.href='../../informationSearch/html/waitingDoctorList.html?id='+id;
				}else if(Request.pre=="payment"){   //跳到候诊查询页面
					window.location.href='../../payment/html/payment.html?id='+id+"&paytype="+Request.paytype;
				}else{
					
				}

+ 40 - 33
html/payment/js/payment.js

@ -16,6 +16,7 @@ var loading = dialog({
			surplusMoney:"",
			data:{},
			code:"",
			cardlenght:0,
		},
		mounted: function() {
			var vm = this
@ -29,32 +30,46 @@ var loading = dialog({
			//获取列表数据
			getData:function(){
				var vm=this
				if(Request.id){
					sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
				 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){										
				        		var data=res.data.filter(function(item){
			        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]
				        		if(!data){
				        			vm.backtoCards()  //当前用户无该就诊卡
				        		}else{
				        			vm.getCardInfo()
				        		}
				        	}else{
					 	  		vm.backtoCards() //当前用户无绑定就诊卡
				        	}
				        }else{
					 	  loading.close();
				          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
				        }
				    })	
				}else{
					vm.backtoCards() //未带参
				}					
				        		if(!vm.data){
			        				vm.data=res.data.filter(function(item){
					        			return item.isDefault==1
					        		})[0]
			        			}
							}else{								
				        		vm.data=res.data.filter(function(item){
				        			return item.isDefault==1
				        		})[0]
							}
							if(!vm.data){
			        			vm.data=res.data[0]
			        		}
			        		vm.cardId=vm.data.id
			        		vm.getCardInfo()
			        	}else{
			        		dialog({
					            content: "请先绑定就诊卡!", 
					            okValue: '确定',
					            ok: function(){
									window.location.href='../../payment/html/patientIDCards.html';
					            },
					        }).showModal()
			        	}
			        }else{
				 	  loading.close();
			          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
			        }
			    })				
			},
			//获取列表数据
			getCardInfo:function(){
@ -174,18 +189,6 @@ var loading = dialog({
			        }
			    })
			},
			backtoCards:function(){
				loading.close();
        		dialog({
		            content: "请重新选择待缴费就诊卡!", 
		            okValue: '确定',
		            ok: function(){
						window.location.href='../../payment/html/patientIDCards.html';
		            },
//						            cancelValue: '我再看看',
//						            cancel: function(){}
		        }).showModal()
			},
			//强制设定最多只能输入两位小数
			checkNumber:function(payMoney){
				var myreg=/^[0][0-9]{1}$/; 
@ -198,6 +201,10 @@ var loading = dialog({
		        	this.payMoney=20000
		        }
		    },
			//跳转切换就诊卡
			changeCards:function(){
				window.location.href='../../payment/html/changeCards.html?pre=payment&paytype='+Request.paytype;
			},
			//判断是否验证登录通过
			checkType:function(){
				var vm=this

+ 4 - 2
html/payment/js/paymentList.js

@ -121,6 +121,7 @@ var iscrollState='';//判断滑动方向
				sendPost("third/hy/pay/gerPayOrderList", vm.queryList, "json", "get",function(){
			   		loading.close();
			   		mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
					mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
			   		mui('#wrapper').pullRefresh().endPullupToRefresh(false);
			    	dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
			      }, function(res){
@ -143,9 +144,10 @@ var iscrollState='';//判断滑动方向
			        		}
			        	}
			        }else{
			            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();			          
		        		mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
			            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
				   		mui('#wrapper').pullRefresh().endPulldownToRefresh(false);
						mui('#wrapper').pullRefresh().enablePullupToRefresh();//重置
				   		mui('#wrapper').pullRefresh().endPullupToRefresh(false);
			        }
			    })
			},