<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>医生直播间</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		
		<!-- js引用 -->
		<script src="../../js/config.js"></script>
		<script src="../../js/h5toapp.js"></script>
		<script src="../../js/h5to.js"></script>
		
		<!-- 组件js引用 -->
		<script src="../../js/mui.min.js"></script>
		<!-- 组件标准css引用 -->
		<link rel="stylesheet" href="../../css/mui.min.css">
		<!-- css引用 -->
		<link href="../../css/currency.css" rel="stylesheet">
		<link href="../../css/spinkit.css" rel="stylesheet">
		<link href="../../css/icon/iconfont.css" rel="stylesheet">
		<!-- 界面本身css引用 -->
		<link href="./liveroom.css" rel="stylesheet">
		
		<style type="text/css">
		    .mui-input-row .mui-input-clear~.mui-icon-clear {
				line-height: 27px;
				width: 30px;
				height: 17px;
				top: 16px;
				background: url(../../img/Delete%20Keyword.png) no-repeat;
			}
			.mui-icon-clear:before {
				content: '';
				/* background: url(../../img/Delete%20Keyword.png) no-repeat; */
			}
			
			input::-webkit-input-placeholder {
				color: #9393AA;
				-webkit-text-fill-color: #9393AA;
			}
		</style>
	</head>

	<body class="app_page">
		<div style="background-color:  #F9FAFC; height: 100vh; width: 100%; margin: 0; overflow: auto;">
			<div id="loading" class="example">
			  <div class="sk-plane loading_location"></div>
			</div>
			
			<div class="mui-content">
					
				<div style="margin: 16px; box-sizing: border-box;">
					<div class="mui-card">
						<div class="z_menu_btn_row" style="height: 135px;line-height: normal;">
							<div class="left_area">
								<img src="../../img/head.png" class="head_img" />
							</div>
							<div class="left_area" style="position: absolute;top: 16px;left: 132px;">
								<div>
								<div id="doctor_home_name" class="doctor_name"></div>
								<div id="doctor_home_profession" class="doctor_introduction"></div>
								<div id="doctor_home_hospital" class="doctor_introduction"></div>
								<div id="doctor_home_department" class="doctor_introduction"></div>
								<div class="doctor_introduction"><div style="float: left;">直播倒计时:</div><div class="countdown_txt">2:30:43</div></div>
								</div>
							</div>
							<div class="right_area">
								<div class="check_doctor_home" onclick="click_row(menurows[0])">查看医生主页</div>
							</div>
						</div>
						<div class="z_menu_btn_row" style="height: 56px;line-height: 28px;padding: 0;" onclick="click_remind()">
							<div class="remind_btn">
								<div id="remind_btn" class="remind_btn_txt"></div>
								<div class="remind_num">(已有<span id="people_num">211</span>人预约)</div>
							</div>
						</div>
					</div>
				</div>
					
					<div class="title_txt">直播主题:</div>
					<div class="introduction_txt">先天性心脏病心脏导管未闭怎么治疗</div>
					<div class="title_txt">直播主题:</div>
					<div class="introduction_txt">2020年10月22日 17:00</div>
					<div class="title_txt">往期直播:</div>
				<div style=" box-sizing: border-box;">
					<!-- <div class="mui-card" style="width: 157px;height: 262px;">
						<div class="z_menu_btn_row" style="height: 209px;line-height: normal;padding: 0;border: 0;background: url(../../img/head.png) no-repeat;background-size: 157px 209px;">
						<div class="live_head">
							<div class="left_area" style="margin-left: 6px;">
								<img src="../../img/组%201.png" style="margin: -5px 0;" />
								<span class="status_txt">直播中</span>
							</div>
							<div class="right_area" style="margin-right: 6px;">
								<img src="../../img/ic_account_active.png" style="margin: -2px 0;" />
								<span class="watched_num">1234</span>
							</div>
						</div>
						<div class="bt_txt">
							<span>#心脑血管疾病#</span>
						</div>
						</div>
						<div class="z_menu_btn_row" style="width: 157px;height: 53px;line-height: normal;padding: 0 8px;">
							<div style="margin-top: 8px;">
								<span class="doctor_name">陈维</span>
								<span class="doctor_introduction">主任医师</span>
							</div>
							<div>
								<span class="doctor_introduction">上海第十人民医院</span>
								<span class="doctor_introduction">心内科</span>
							</div>
						</div>
					</div> -->
					<div id="live_room"></div>
				</div>
						
				</div>
			</div>
		
		
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			//1. data
			var isRemind = false;
			
			var liveRoomInfo = [
				{id: "1", doctorName: "陈维", profession: "主任医师", hospital: "上海第十人民医院", department: "心内科", img: "../../img/head.png", roomName: "心脑血管疾病"},
				{id: "2", doctorName: "陈维", profession: "主任医师", hospital: "上海第十人民医院", department: "心内科", img: "../../img/head.png", roomName: "心脑血管疾病"},
				{id: "3", doctorName: "陈维", profession: "主任医师", hospital: "上海第十人民医院", department: "心内科", img: "../../img/head.png", roomName: "心脑血管疾病"},
				{id: "4", doctorName: "陈维", profession: "主任医师", hospital: "上海第十人民医院", department: "心内科", img: "../../img/head.png", roomName: "心脑血管疾病"},
				{id: "5", doctorName: "陈维", profession: "主任医师", hospital: "上海第十人民医院", department: "心内科", img: "../../img/head.png", roomName: "心脑血管疾病"}
			];
			
			var liveRoomInfoOBJ = {};
			
			var menurows = [
				{id: "1", name: "医生主页", path: "../home/doctorHome",_id: 1056},
				{id: "2", name: "详细信息", path: "./ysxx"},
				{id: "3", name: "门诊排班", path: "./mzpb"},
				{id: "4", name: "共享的随访量表", path: "./sflb"},
			];
			
			//2. function
			setRouteParams({userId: "1352141846545367042",params: {}});
			
			function initPage() {
				liveRoomInfoOBJ = {};
				liveRoomInfo.map(e=> {
					liveRoomInfoOBJ[e.id] = e;
				})
				
				document.getElementById('doctor_home_name').innerText = liveRoomInfo[0].doctorName;
				document.getElementById('doctor_home_profession').innerText = liveRoomInfo[0].profession;
				document.getElementById('doctor_home_hospital').innerText = liveRoomInfo[0].hospital;
				document.getElementById('doctor_home_department').innerText = liveRoomInfo[0].department;
				
				var live_room_list = document.getElementById('live_room');
				var live_room_data = "";
				for (var i = 0; i < liveRoomInfo.length; i++) {
					var live_room_data1 = 
					'<div class="mui-card" style="width: 43%;height: 262px;float: left;margin: 16px 3.5% 0;">'+
						'<div class="z_menu_btn_row" style="height: 209px;line-height: normal;padding: 0;border: 0;background: url('+liveRoomInfo[i].img+') no-repeat;background-size: 100% 209px;">'+
						'<div class="live_head">'+
							'<div class="left_area" style="margin-left: 6px;">'+
								'<img src="../../img/组%204.png" style="margin: -5px 0;margin-right: 3px;" />'+
								'<span class="status_txt">直播回放</span>'+
							'</div>'+
							'<div class="right_area" style="margin-right: 6px;">'+
								'<img src="../../img/ic_account_active.png" style="margin: -2px 0;" />'+
								'<span class="watched_num">1234</span>'+
							'</div>'+
						'</div>'+
						'<div class="bt_txt">'+
							'<span>#'+liveRoomInfo[i].roomName+'#</span>'+
						'</div>'+
						'</div>'+
						'<div class="z_menu_btn_row" style="width: 157px;height: 53px;line-height: normal;padding: 0 8px;">'+
							'<div style="margin-top: 8px;">'+
								'<span class="doctor_name">'+liveRoomInfo[i].doctorName+'</span>'+
								'<span class="doctor_introduction">'+liveRoomInfo[i].profession+'</span>'+
							'</div>'+
							'<div>'+
								'<span class="doctor_introduction" style="padding-right:5px;">'+liveRoomInfo[i].hospital+'</span>'+
								'<span class="doctor_introduction">'+liveRoomInfo[i].department+'</span>'+
							'</div>'+
						'</div>'+
					'</div>'
					live_room_data += live_room_data1;
				}
					live_room_list.innerHTML = live_room_data;
				if (isRemind) {
					document.getElementById('remind_btn').innerText = "预约成功,开播前提醒";
				}
				else {
					document.getElementById('remind_btn').innerText = "开播提醒";
				}
			}
			
			function click_row(row) {
				var pam = { 
					_id:row._id,
				    params:{
						userId: login_data.userId
					 }
				   };
				app_click("route",pam,callback);
			}
			
			function click_remind(){
				console.log(document.getElementById('remind_btn').innerText);
				if(document.getElementById('remind_btn').innerText == "开播提醒"){
					document.getElementById('remind_btn').innerText = "预约成功,开播前提醒";
					console.log(document.getElementById('remind_btn').innerText);
					document.getElementById('people_num').innerText ++;
					}else {
						document.getElementById('remind_btn').innerText = "开播提醒";
						document.getElementById('people_num').innerText --;
					}
			}
			function loadData() {

			}
			function doLoadData(){
				
			}			
			//3. run
			mui.ready(function() {
				onInitReady(function() {
					// setRightBtn("rightBtn", {_id: 3000}, callback);
					initPage();
					loadData();
				});
			})
		</script>
	</body>
</html>