reprotManage_scd_detail.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
  8. <link href="../css/mui.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../css/reset.css" />
  10. <link rel="stylesheet" href="../css/iconfont.css" />
  11. <link href="../css/common.css" rel="stylesheet" />
  12. <style type="text/css">
  13. .iconfont {
  14. font-size: 35px;
  15. color: #3bb9e7;
  16. /*font-weight: bold;*/
  17. line-height: 80px;
  18. margin: 10px 10px 10px 20px;
  19. }
  20. .equipState {
  21. font-size: 18px;
  22. margin-top: 14px;
  23. color: #333;
  24. }
  25. @media(max-width: 400px) {
  26. .mui-col-sm-6 {
  27. width: 50%;
  28. }
  29. }
  30. #detial>div {
  31. border-bottom: 2px solid #eee;
  32. }
  33. .topBorder{
  34. border-top: 2px solid #eee;
  35. }
  36. #detial>div:nth-of-type(odd) {
  37. border-right: 2px solid #eee;
  38. }
  39. #detial .mui-navigate-right {
  40. line-height: 80px;
  41. }
  42. .clearfix:after {
  43. content: " ";
  44. display: block;
  45. clear: both;
  46. visibility: hidden;
  47. line-height: 0;
  48. height: 0;
  49. font-size: 0;
  50. }
  51. .clearfix{
  52. *zoom:1;
  53. }
  54. .fl{
  55. float: left;
  56. }
  57. body,.mui-content{
  58. background: #f0f0f0;
  59. }
  60. .mui-content{
  61. padding-bottom: 15px;
  62. }
  63. .msgTop{
  64. background: #24b2e7;
  65. background: url(../images/bluesky.jpg) no-repeat;
  66. background-size: 100% 120%;
  67. position: relative;
  68. height: 150px;
  69. }
  70. .currEquip{
  71. color: #fff;
  72. font-size: 14px;
  73. position: absolute;
  74. bottom: 15px;
  75. left: 35px;
  76. }
  77. .currEquipId{
  78. font-size: 18px;
  79. line-height: 34px;
  80. color: #fffac9;
  81. font-weight: 700;
  82. }
  83. .equipImg{
  84. position: absolute;
  85. right: 37px;
  86. bottom: 0px;
  87. }
  88. /*数据*/
  89. .headerTitle{
  90. float: left;
  91. }
  92. .equipVal{
  93. text-align: right;
  94. color: #a8a8a8;
  95. }
  96. .areaTitle{
  97. color: #424242;
  98. padding-left: 5px;
  99. border-left: 5px solid #f74c15;
  100. font-weight: bold;
  101. }
  102. /*查看详情*/
  103. .detialBox .fa{
  104. padding-right: 5px;
  105. color: #3bb9e7;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <header class="mui-bar mui-bar-nav">
  111. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  112. <h1 class="mui-title" id="title">杀虫灯数据详情</h1>
  113. <!--<a class="headRightIcon fa fa-search mui-pull-right" id="reloadEquip">查询</a>-->
  114. </header>
  115. <div class="mui-content">
  116. <div class="msgTop">
  117. <div class="currEquip">
  118. <div id="currEquipId" class="currEquipId"></div>
  119. <div id="equipName"></div>
  120. <div id="upl_time"></div>
  121. </div>
  122. <img class="equipImg" src="../images/scdequipImg.png" width="50" height="130"/>
  123. </div>
  124. <ul class="mui-table-view">
  125. <li class="mui-table-view-cell">
  126. <h1 class="areaTitle">设备状态</h1>
  127. </li>
  128. <li class="mui-table-view-cell">
  129. <label class="headerTitle">设备开关</label>
  130. <div class="equipVal" id="ds"></div>
  131. </li>
  132. <li class="mui-table-view-cell">
  133. <label class="headerTitle">工作状态</label>
  134. <div class="equipVal" id="ws"></div>
  135. </li>
  136. <li class="mui-table-view-cell">
  137. <label class="headerTitle">灯管状态</label>
  138. <div class="equipVal" id="tbs"></div>
  139. </li>
  140. <li class="mui-table-view-cell">
  141. <label class="headerTitle">雨控状态</label>
  142. <div class="equipVal" id="rps"></div>
  143. </li>
  144. <li class="mui-table-view-cell">
  145. <label class="headerTitle">光控状态</label>
  146. <div class="equipVal" id="lps"></div>
  147. </li>
  148. <li class="mui-table-view-cell">
  149. <label class="headerTitle">倾倒状态</label>
  150. <div class="equipVal" id="dps"></div>
  151. </li>
  152. <li class="mui-table-view-cell">
  153. <label class="headerTitle">定时(h)</label>
  154. <div class="equipVal" id="tt"></div>
  155. </li>
  156. </ul>
  157. <ul class="mui-table-view" style="margin-top: 12px;">
  158. <li class="mui-table-view-cell">
  159. <h1 class="areaTitle">设备数据</h1>
  160. </li>
  161. <li class="mui-table-view-cell">
  162. <label class="headerTitle">电击次数</label>
  163. <div class="equipVal" id="ct"></div>
  164. </li>
  165. <li class="mui-table-view-cell">
  166. <label class="headerTitle">湿度(%)</label>
  167. <div class="equipVal" id="ah"></div>
  168. </li>
  169. <li class="mui-table-view-cell">
  170. <label class="headerTitle">温度(℃)</label>
  171. <div class="equipVal" id="at"></div>
  172. </li>
  173. <li class="mui-table-view-cell">
  174. <label class="headerTitle">充电电压(V)</label>
  175. <div class="equipVal" id="cv"></div>
  176. </li>
  177. <li class="mui-table-view-cell">
  178. <label class="headerTitle">电池电压(V)</label>
  179. <div class="equipVal" id="bv"></div>
  180. </li>
  181. <li class="mui-table-view-cell">
  182. <label class="headerTitle">经度</label>
  183. <div class="equipVal" id="lng"></div>
  184. </li>
  185. <li class="mui-table-view-cell">
  186. <label class="headerTitle">纬度</label>
  187. <div class="equipVal" id="lat"></div>
  188. </li>
  189. </ul>
  190. <ul class="mui-table-view detialBox" style="margin-top: 12px;">
  191. <li class="mui-table-view-cell">
  192. <h1 class="areaTitle">详情操作</h1>
  193. </li>
  194. <li class="mui-table-view-cell" id="echartDetialBtn">
  195. <a class="mui-navigate-right">
  196. <i class="fa fa-bar-chart-o" aria-hidden="true"></i>
  197. 查看统计详情
  198. </a>
  199. </li>
  200. <li class="mui-table-view-cell" id="listDetialBtn">
  201. <a class="mui-navigate-right">
  202. <i class="fa fa-list" aria-hidden="true"></i>
  203. 查看列表详情
  204. </a>
  205. </li>
  206. <li class="mui-table-view-cell" id="reloadEquip">
  207. <a class="mui-navigate-right">
  208. <i class="fa fa-refresh" aria-hidden="true"></i>
  209. 查询最新状态
  210. </a>
  211. </li>
  212. </ul>
  213. </div>
  214. <script src="../js/mui.min.js"></script>
  215. <script src="../js/jquery-2.1.0.js"></script>
  216. <script src="../js/common.js"></script>
  217. <script type="text/javascript">
  218. var equipId;
  219. var equipName;
  220. mui.plusReady(function() {
  221. var self = plus.webview.currentWebview();
  222. equipId = self.equipId;
  223. $('#currEquipId').html('ID:'+equipId);
  224. requestData();
  225. document.getElementById('reloadEquip').addEventListener('tap',function(){
  226. var imei = [];
  227. imei.push(equipId)
  228. mui.ajax('http://120.27.222.26/scd_mqtt',{
  229. data:{
  230. 'sw': 'read',
  231. 'topicid': JSON.stringify(imei),
  232. 'kind': 'data'
  233. },
  234. dataType:'json',//服务器返回json格式数据
  235. type:'post',//HTTP请求类型
  236. timeout: 10000,//超时时间设置为10秒;
  237. beforeSend: function() {
  238. plus.nativeUI.showWaiting('请求中...');
  239. },
  240. complete: function() {
  241. setTimeout(function() {
  242. plus.nativeUI.closeWaiting();
  243. }, 4000);
  244. },
  245. success:function(data){
  246. setTimeout(function() {
  247. mui.toast('查询成功')
  248. window.location.reload();
  249. }, 4000);
  250. },
  251. error:function(xhr,type,errorThrown){
  252. mui.toast('查询失败')
  253. }
  254. });
  255. })
  256. //echart详情
  257. document.getElementById('echartDetialBtn').addEventListener('tap',function(){
  258. mui.openWindow({
  259. url:'scd_detail_echart.html',
  260. id:'scd_detail_echart',
  261. extras: {
  262. equipId: equipId
  263. }
  264. })
  265. })
  266. //list详情
  267. document.getElementById('listDetialBtn').addEventListener('tap',function(){
  268. mui.openWindow({
  269. url:'scd_detail_list.html',
  270. id:'scd_detail_list',
  271. extras: {
  272. equipId: equipId,
  273. equipName:equipName
  274. }
  275. })
  276. })
  277. })
  278. function requestData() {
  279. mui.ajax('http://120.27.222.26/app_reportmanage_unflod', {
  280. data: {
  281. 'etype': 'scd',
  282. 'equip_id': equipId,
  283. },
  284. dataType: 'json', //服务器返回json格式数据
  285. type: 'post', //HTTP请求类型
  286. timeout: 8000, //超时时间设置为10秒;
  287. beforeSend: function() {
  288. plus.nativeUI.showWaiting('请求中...');
  289. },
  290. complete: function() {
  291. plus.nativeUI.closeWaiting();
  292. },
  293. success: function(data) {
  294. var equip_name = data.equip_name;
  295. equipName = data.equip_name || '无';
  296. $('#equipName').html(equip_name);
  297. $('#upl_time').html(data.upl_time);
  298. var ds = data.ds == 0 ? '关':'开';
  299. $('#ds').html(ds);
  300. var stat = eval('(' + data.scd_data + ')');
  301. if (stat.ws == 0) ws = "待机";
  302. else if (stat.ws == 1) ws = "工作";
  303. else if (stat.ws == 2) ws = "充电";
  304. $('#ws').html(ws);
  305. var tbs = stat.tbs == 0 ? '正常':'保护';
  306. $('#tbs').html(tbs);
  307. var rps = stat.rps == 0 ? '正常':'保护';
  308. $('#rps').html(rps);
  309. var lps = stat.lps == 0 ? '夜晚':'白天';
  310. $('#lps').html(lps);
  311. var tps = stat.tps == 0 ? '正常':'保护';
  312. $('#tps').html(tps);
  313. var dps = stat.dps == 0 ? '正常':'保护';
  314. $('#dps').html(dps);
  315. var tt = '';
  316. if (stat.tt == 0) tt = "常亮";
  317. else tt = stat.tt;
  318. $('#tt').html(tt);
  319. $('#ct').html(stat.ct);
  320. $('#at').html(stat.at);
  321. $('#ah').html(stat.ah);
  322. $('#cv').html((stat.cv / 1000).toFixed(2));
  323. $('#bv').html((stat.bv / 1000).toFixed(2));
  324. if (stat.lng > 999) {
  325. var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
  326. var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
  327. } else {
  328. var lng = Number(stat.lng);
  329. var lat = Number(stat.lat);
  330. }
  331. $('#lng').html(lng.toFixed(4));
  332. $('#lat').html(lat.toFixed(4));
  333. },
  334. error: function(xhr, type, errorThrown) {
  335. $('#currEquipId').hide();
  336. $('.detialBox').hide();
  337. $('#reloadEquip').hide();
  338. mui.toast('数据请求失败');
  339. }
  340. })
  341. }
  342. </script>
  343. </body>
  344. </html>