<!--
* @Descripttion: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @version: April 2021 (version 1.56)
* @Author: ZhangKe
* @Date: 2022-11-12 17:02:03
* @LastEditors: ZhangKe
* @LastEditTime: 2022-11-12 17:44:12
* @FilePath: \dynamicBox\water.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="../css/common.css"/>
<style>
* {
margin: 0;
padding: 0;
}
body {
width: 120px;
height: 35px;
background:red;
}
div {
display: flex;
justify-content: space-around;
align-items: end;
width: 120px;
height: 35px;
margin: 10px 0 0 5px;
padding-left: 36px;
background: url(../image/orange.png) no-repeat left center;
background-size: 100% 100%;
border-radius: 10px;
font-weight: 900;
font-size: 16px;
line-height: 28px;
}
span {
color: var(--fontColor);
}
#name {
color: var(--fontColor2);
}
#num {
}
#unit {
color: var(--fontColor);
}
</style>
</head>
<body >
<div>
<span id="name">CO<sub>2</sub></span>
<span id="num">12</span>
<span id="unit">ppm</span>
</div>
<script src="../ak_config.js"></script>
<script>
var urlParams = new URLSearchParams(location.search);
var mid = urlParams.get('mid'); // mid 值
// 类型: 1.室内五合一 2.照度 3.水 4.预约机 5. 人流量
var type = urlParams.get('type');
console.log(mid);
console.log(type);
// 根据类型, 添加不同的 url 后缀地址
var behindUrl = null;
if (type == 1) { // 室内环境 五合一
behindUrl = '/mapobj-api-ftzw/TTZHJController/getSnhj';
$("#name").css('margin-bottom', '-7px');
$("div").css("background-image","url(../image/blue.png)");
ajax(); // 调用 ajax
} else if (type == 2) { //室内光照
behindUrl = '/mapobj-api-ftzw/TTZHJController/getSngz';
ajax(); // 调用 ajax
} else if (type == 3) {// 能耗水
behindUrl = '/mapobj-api-ftzw/TTZHJController/getNhs';
$("div").css('width', '224px');
$("div").css('padding-left', '68px');
ajax(); // 调用 ajax
} else if (type == 4) {// 取号机
behindUrl = '/mapobj-api-ftzw/TTZYYController/getyyqhj';
ajax(); // 调用 ajax
} else if (type == 5) { //流量
$("div").css("background-image","url(../image/red.png)");
var name = urlParams.get('name');
var rllNum = urlParams.get('rllNum');
$("#name").text("人流量:");
$("#num").text(rllNum == null ? '0' : rllNum);
$("#unit").text("人");
//behindUrl = '/mapobj-api-ftzw/TTZHKController/getrlt';
}
// window.setInterval(function () {
// ajax();
// }, test_time);
// 参考链接:
// http://127.0.0.1:8848/html/merge.html?mid=1F_hj_sn_001&type=1
// http://127.0.0.1:8848/html/merge.html?mid=1F_hj_gz_03&type=2
// http://127.0.0.1:8848/html/merge.html?mid=1F_hj_nhs_001&type=3
// http://127.0.0.1:8848/html/merge.html?mid=1F_hj_nhs_001&type=4
// http://127.0.0.1:8848/html/merge.html?mid=1F_yy_qhj_02_001&type=5
</script>
</body>
</html>