前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >一个简单的卡动车排队系统

一个简单的卡动车排队系统

作者头像
week
发布2018-08-27 09:38:44
2570
发布2018-08-27 09:38:44
举报
文章被收录于专栏:用户画像

一、效果图

二、代码

1、admin.html

代码语言:javascript
复制
<html>
<head>
<meta charset="UTF-8">
<title>卡丁车</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
   <script src="js/jquery.min.js"></script>
   <script src="js/bootstrap.min.js"></script>
   <style>
		.img-style{
			display: table-cell;
			vertical-align: middle;
			text-align: center;
			font-size:140px;
			background-color:#0B87F7;	
			height:22%;
			overflow:hidden;
		}
		.img-style img{
			 vertical-align:middle;
			 margin-left:30%;
			 margin-right:10%;
		}
		.text-style{
			display: table-cell;
			vertical-align: middle;
			text-align: center;
			font-size:140px;
			margin-left:5%;
			margin-right:5%;
			background-color:#0B87F7;	
			height:19%;
			overflow:hidden;
		}
		.row-margin{
			margin-top:2%;
		}
		.back-color{
			background-color:#0B87F7;
		}
   </style>
<SCRIPT LANGUAGE="JavaScript">
    function show(){
		var row0 = document.getElementById("row0").value;
        var row1 = document.getElementById("row1").value;
		var row2 = document.getElementById("row2").value;
		if(isNaN(row0)){
			alert("请输入数字");
			return;
		}
		if(isNaN(row1)){
			alert("请输入数字");
			return;
		}
		if(isNaN(row2)){
			alert("请输入数字");
			return;
		}
        location.href="kadingche.html?row0="+row0+"&row1="+row1+"&row2="+row2;
    }
</SCRIPT>
</head>
<body style="background-color:#191919;color:#FFF;">
<div class="row row-margin" style="margin-top:10%">
	<div class="col-lg-3 text-style">第<input type="text" id="row0"  style="width:30%"></span>组</div>
	<div class="col-lg-7 back-color">
	
			<div class="img-style">
				<img src="img/ongoing.png"></img>
			</div>
			<div class="text-style">
				驾驶进行中
			</div>
	</div>
</div>
<div class="row row-margin">
	<div class="col-lg-3 text-style">第<input type="text" id="row1"  style="width:30%"></span>组</div>
	<div class="col-lg-7 back-color">
		<div class="img-style">
			<img class="imgStyle" src="img/helmet.png"></img>
		</div>
		<div class="text-style">
			戴头盔准备
		</div>
	</div>
</div>

<div class="row row-margin">
	<div class="col-lg-3 text-style">第<input type="text" id="row2"  style="width:30%"></span>组</div>
	<div class="col-lg-7 back-color">
		<div class="img-style">
			<img class="imgStyle" src="img/waiting.png"></img>
		</div>
		<div class="text-style">
			排队等待中
		</div>
	</div>
</div>
<div style="bottom:0px;right:0px;position: fixed">
	<input type="button" class="btn btn-primary" value="保存" onclick="show()"/>
</div>
<body>
</html>

2.kadingche.html

代码语言:javascript
复制
<html>
<head>
<meta charset="UTF-8">
<title>卡丁车</title>
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<script src="js/jquery.min.js"></script>
   <script src="js/bootstrap.min.js"></script>
   <style>
		.img-style{
			display: table-cell;
			vertical-align: middle;
			text-align: center;
			font-size:140px;
			background-color:#0B87F7;	
			height:22%;
			overflow:hidden;
		}
		.img-style img{
			 vertical-align:middle;
			 margin-left:30%;
			 margin-right:10%;
		}
		.text-style{
			display: table-cell;
			vertical-align: middle;
			text-align: center;
			font-size:140px;
			margin-left:5%;
			margin-right:5%;
			background-color:#0B87F7;	
			height:19%;
			overflow:hidden;
		}
		.row-margin{
			margin-top:2%;
		}
		.back-color{
			background-color:#0B87F7;
		}
   </style>
</head>
<body style="background-color:#191919;color:#FFF;">
<div class="row row-margin" style="margin-top:10%">
	<div class="col-lg-3 text-style">第<span id="row0"  style="width:10%"></span>组</div>
	<div class="col-lg-7 back-color">
	
			<div class="img-style">
				<img src="img/ongoing.png"></img>
			</div>
			<div class="text-style">
				  驾    驶   中
			</div>
	</div>
</div>
<div class="row row-margin">
	<div class="col-lg-3 text-style">第<span id="row1"  style="width:10%"></span>组</div>
	<div class="col-lg-7 back-color">
		<div class="img-style">
			<img class="imgStyle" src="img/helmet.png"></img>
		</div>
		<div class="text-style">
			  戴头盔准备
		</div>
	</div>
</div>

<div class="row row-margin">
	<div class="col-lg-3 text-style">第<span id="row2"  style="width:10%"></span>组</div>
	<div class="col-lg-7 back-color">
		<div class="img-style">
			<img class="imgStyle" src="img/waiting.png"></img>
		</div>
		<div class="text-style">
			  等    候   中
		</div>
	</div>
</div>
<div style="bottom:0px;left:0px;position: fixed">
	<input type="button" class="btn btn-primary" value="上一轮" onclick="minus()"/>
</div>
<div style="bottom:0px;right:0px;position: fixed">
	<input type="button" class="btn btn-primary" value="下一轮" onclick="add()"/>
</div>
<body>
<SCRIPT LANGUAGE="JavaScript">
		function add(){
			var row0=document.getElementById("row0").innerHTML;
			var row0Value=eval(row0)+1;
			document.getElementById("row0").innerHTML=row0Value;

			var row1=document.getElementById("row1").innerHTML;
			var row1Value=eval(row1)+1;
			document.getElementById("row1").innerHTML=row1Value;

			var row2=document.getElementById("row2").innerHTML;
			var row2Value=eval(row2)+1;
			document.getElementById("row2").innerHTML=row2Value;
			
		}
		function minus(){
			var row0=document.getElementById("row0").innerHTML;
			var row0Value=eval(row0)-1;
			document.getElementById("row0").innerHTML=row0Value;

			var row1=document.getElementById("row1").innerHTML;
			var row1Value=eval(row1)-1;
			document.getElementById("row1").innerHTML=row1Value;

		
			var row2=document.getElementById("row2").innerHTML;
			var row2Value=eval(row2)-1;
			document.getElementById("row2").innerHTML=row2Value;
			
		}
		window.onload=function(){
				var value = window.location.href;
				if(value.lastIndexOf('?')=='-1'){
					document.getElementById("row0").innerHTML="1";
					document.getElementById("row1").innerHTML="2"
					document.getElementById("row2").innerHTML="3";
				}else{
					var arr = value.substring(value.lastIndexOf('?') + 1,value.length).split('&');
					if(arr.length!=0){
						for(var i = 0; i < arr.length; i++){
							var val=arr[i].split('=')[1];
							var id="row"+i;
							var elem=document.getElementById(id);
							elem.innerText = val;              
						}
					}
				}
		}
</SCRIPT>
</html>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016年05月26日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档