预备开门页面及接口

This commit is contained in:
2021-12-20 00:47:02 +08:00
parent a73a5b34e2
commit edfddd7e17
18 changed files with 10903 additions and 2 deletions

55
web/openDoor.html Normal file
View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>开门</title>
<link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
<div class="myDiy">
<button id="myButton" type="button" class="button layui-btn-radius layui-btn layui-btn-lg layui-btn-normal">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</button>
</div>
</body>
<script src="layui/layui.js"></script>
<script src="layui/jquery-3.2.1.js"></script>
<script>
$('#myButton').click(function () {
$.get('/door/set.do?status=open', function (ret) {
if (ret === "1") {
let index = layer.load(2,{ shade: [0.45, '#57606f'] });
load(index)
}
})
})
function load(index) {
$.get("/door/status.do", function (ret) {
if(ret==="1"){
layer.close(index)
layer.msg("已开门")
}else {
load(index)
}
});
}
</script>
<style>
.myDiy {
width: 40%;
height: 300px;
margin-top: 35%;
margin-left: 35%;
}
.button {
width: 300px;
height: 300px;
font-size: 3em;
}
</style>
</html>