<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<meta name="referrer" content="no-referrer" />
		<title>服务记录</title>
		<link rel="shortcut icon" href="../../../favicon.ico">
		<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
		<link rel="stylesheet" href="../css/userInfo.css" />
	</head>

	<body>
		<div id="app" v-cloak>
			<div class="c-container flex-box">
				<div class="w-250">
					<div class="user-images">
						<img class="img-circle" :src="getImgurl(userInfo.photo)" />
					</div>
					<p class="user-name text-center">{{userInfo.name}}</p>
					<p class="c-999 f14 text-center">{{userInfo.sex==1?'男':'女'}} {{!userInfo.age?'<1':userInfo.age}}岁 {{userInfo.expensesStatus==1?"已缴费":(userInfo.expensesStatus==2?"已退费":(userInfo.expensesStatus==0?"未缴费":""))}}</p>
					<p class="text-center">
						<span class="mb-icon-round green" v-if="userInfo.disease==1 && userInfo.diseaseCondition==0">
							高
						</span>
						<span class="mb-icon-round green" v-if="userInfo.disease==2 && userInfo.diseaseCondition==0">
							糖
						</span>
						<span class="mb-icon-round green" v-if="(userInfo.disease=='1,2' || userInfo.disease=='2,1') && userInfo.diseaseCondition==0">
							高糖
						</span>
						<span class="mb-icon-round orange" v-if="userInfo.disease==1 && userInfo.diseaseCondition==1">
							高
						</span>
						<span class="mb-icon-round orange" v-if="userInfo.disease==2 && userInfo.diseaseCondition==1">
							糖
						</span>
						<span class="mb-icon-round orange" v-if="(userInfo.disease=='1,2' || userInfo.disease=='2,1') && userInfo.diseaseCondition==1">
							高糖
						</span>
						<span class="mb-icon-round red" v-if="userInfo.disease==1 && userInfo.diseaseCondition==2">
							高
						</span>
						<span class="mb-icon-round red" v-if="userInfo.disease==1 && userInfo.disease==2 && userInfo.diseaseCondition==2">
							糖
						</span>
						<span class="mb-icon-round red" v-if="(userInfo.disease=='1,2' || userInfo.disease=='2,1') && userInfo.diseaseCondition==2">
							高糖
						</span>
					</p>
					<p class="text-center">
						<span class="icon icon-wx" v-if="userInfo.openid"></span>
						<span class="icon icon-wx-gray" v-else></span>
						<span class="icon icon-xueyaji" v-if='userInfo.deviceType && userInfo.deviceType.indexOf("2") > -1'></span>
						<span class="icon icon-xueyaji-gray" v-else></span>
						<span class="icon icon-xuetangyi"v-if='userInfo.deviceType && userInfo.deviceType.indexOf("1") > -1'></span>
						<span class="icon icon-xuetangyi-gray" v-else></span>
					</p>
					<ul class="tool-list clearfix">
						<li><a href="#">健康档案</a></li>
						<li><a href="#">慢病档案</a></li>
						<li><a href="#">服务记录</a></li>
						<li><a href="#">家庭成员</a></li>
					</ul>
					<div class="mt80 text-center c-999">
						回复消息请前往PC端
					</div>
				</div>
				<div class="flex-box-item">
					<div class="panel panel-fff mb10">
						<div class="panel-heading">
							居民标签
						</div>
						<div class="panel-body">
							<div class="flex-box mb10">
								<span class="w-80">服务类型</span>
								<div class="flex-box-item">
									<ul class="label-list bgc-12b7f5">
										<li v-for="type in userInfo.serverTypes">{{type.server_type_name}}</li>
									</ul>
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-80">健康状况</span>
								<div class="flex-box-item">
									<ul class="label-list bgc-2DBE55">
										<li v-for="item in jkqk">{{item.labelName}}</li>
									</ul>
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-80">疾病类型</span>
								<div class="flex-box-item">
									<ul class="label-list bgc-ff3b30">
										<li v-for="item in jblx">{{item.labelName}}</li>
									</ul>
								</div>
							</div>
							<div class="flex-box">
								<span class="w-80">团队标签</span>
								<div class="flex-box-item">
									<ul class="label-list bgc-FF9630">
										<li v-for="item in tdbq">{{item.labelName}}</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
					
					<div class="panel panel-fff mb0">
						<div class="panel-heading">
							个人信息
						</div>
						<div class="panel-body">
							<div class="flex-box mb10">
								<span class="w-110 c-999">身份证号</span>
								<div class="flex-box-item">
									{{userInfo.idcard}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">医保卡号</span>
								<div class="flex-box-item">
									{{userInfo.ssc}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">手机号码</span>
								<div class="flex-box-item">
									{{userInfo.mobile}}
								</div>
							</div>
							<div class="flex-box">
								<span class="w-110 c-999">所属居委会</span>
								<div class="flex-box-item">
									{{userInfo.jtHospitalName}}
								</div>
							</div>
						</div>
					</div>
					<div class="panel panel-fff mb0" v-if="userInfo.jtDoctorName" style="border-top-width: 0;">
						<div class="panel-heading">
							家庭医生签约信息
						</div>
						<div class="panel-body">
							<div class="flex-box mb10">
								<span class="w-110 c-999">全科医生</span>
								<div class="flex-box-item">
									{{userInfo.jtDoctorName}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">健管事</span>
								<div class="flex-box-item">
									{{userInfo.jtDoctorHealthName}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">续费时间</span>
								<div class="flex-box-item">
									{{userInfo.expensesStatus==1?"已缴费":(userInfo.expensesStatus==2?"已退费":(userInfo.expensesStatus==0?"未缴费":""))}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">签约有效期</span>
								<div class="flex-box-item">
									{{userInfo.jtBeginDate+'~'+userInfo.jtEndDate}}
								</div>
							</div>
							<div class="flex-box mb10">
								<span class="w-110 c-999">政府补贴</span>
								<div class="flex-box-item">
									{{userInfo.expensesType=='01'?'无补贴':(userInfo.expensesType=='02'?'全部贴':(userInfo.expensesType=='03'?'补个人承担部分（20）':'补统筹基金（70）'))}}
								</div>
							</div>
							<div class="flex-box c-999">
								<span class="w-110">签约协议</span>
								<div class="flex-box-item">
									请前往PC查看
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="../../../js/vue.js"></script>
		<script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
		<script src="../../../js/util.js"></script>
		<script src="../../../api/http-request.js"></script>
		<script src="../../../js/underscore.js"></script>
		<script src="../../../api/temp-api.js"></script>
		<script type="text/javascript" src="../../../plugins/layer/layer.min.js" ></script>
		<script type="text/javascript">
			var httpData=GetRequest();
			(function(){
				new Vue({
					el:"#app",
					data:{
						patient:httpData['patient'],
						userInfo:{},
						jkqk:[],//健康情况
						jblx:[],//疾病标签
						tdbq:[],//团队标签
					},
					mounted: function(){
						if(!this.patient){
							layer.msg('未传入居民code（参数：patient）', {icon: 5})
						}else{							
							this.getPatient();
						}
					},
					methods: {
						getImgurl: function(url){
				   			return httpRequest.getImgUrl(url)
				   		},
						getPatient:function(){
							var vm=this;
							var data={
								patient:vm.patient
							}
							tempAPI.getPatient(data).then(function(res){
								if(res.status==200){
									res.data &&(vm.userInfo=res.data);
									console.log(vm.userInfo)
								}else{
									layer.msg(res.msg, {icon: 5})
								}
							})
							tempAPI.patientLabel(data).then(function(res){
								if(res.status==200){
									var data=res.data
									if(data.length){
										for(var i in data){
											var item=data[i]
											if(item.labelType==2){
												vm.jkqk.push(item)
											}else if(item.labelType==3){
												vm.jblx.push(item)
											}else if(item.labelType==4){
												vm.tdbq.push(item)
											}
										}
									}
								}else{
									layer.msg(res.msg, {icon: 5})
								}
							})
							var wlyyAgentForDoc=JSON.parse(localStorage.getItem(httpRequest.agentName));
							var uid=wlyyAgentForDoc.uid;
							tempAPI.getDoctorTeam(uid).then(function(res){
								console.log(res)
								if(res.status==200){
									var params={
										teamCode:res.data[0] && res.data[0].id
									}
//									tempAPI.allLabels(params).then(function(res1){
//										console.log(res1)
//									})
								}else{
									layer.msg(res.msg, {icon: 5})
								}
							})
							
							
						}
					}
				})
			})();
		</script>
	</body>
</html>