equip2.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <meta name="format-detection" content="telephone=no">
  9. <script>!function(){var e;e=function(e){return function(e,t){function i(){var t=r.getBoundingClientRect().width;t/m>540&&(t=540*m);var i=t/16;r.style.fontSize=i+"px",d.rem=e.rem=i}var a,n=e.document,r=n.documentElement,o=n.querySelector('meta[name="viewport"]'),l=n.querySelector('meta[name="flexible"]'),m=0,s=0,d=t.flexible||(t.flexible={});if(o){console.warn("将根据已有的meta标签来设置缩放比例");var c=o.getAttribute("content").match(/initial\-scale=([\d\.]+)/);c&&(s=parseFloat(c[1]),m=parseInt(1/s))}else if(l){var p=l.getAttribute("content");if(p){var u=p.match(/initial\-dpr=([\d\.]+)/),f=p.match(/maximum\-dpr=([\d\.]+)/);u&&(m=parseFloat(u[1]),s=parseFloat((1/m).toFixed(2))),f&&(m=parseFloat(f[1]),s=parseFloat((1/m).toFixed(2)))}}if(!m&&!s){var v=(e.navigator.appVersion.match(/android/gi),e.navigator.appVersion.match(/iphone/gi)),h=e.devicePixelRatio;m=v?h>=3&&(!m||m>=3)?3:h>=2&&(!m||m>=2)?2:1:1,s=1/m}if(r.setAttribute("data-dpr",m),!o)if(o=n.createElement("meta"),o.setAttribute("name","viewport"),o.setAttribute("content","initial-scale="+s+", maximum-scale="+s+", minimum-scale="+s+", user-scalable=no"),r.firstElementChild)r.firstElementChild.appendChild(o);else{var x=n.createElement("div");x.appendChild(o),n.write(x.innerHTML)}e.addEventListener("resize",function(){clearTimeout(a),a=setTimeout(i,300)},!1),e.addEventListener("pageshow",function(e){e.persisted&&(clearTimeout(a),a=setTimeout(i,300))},!1),"complete"===n.readyState?n.body.style.fontSize=12*m+"px":n.addEventListener("DOMContentLoaded",function(e){n.body.style.fontSize=12*m+"px"},!1),i(),d.dpr=e.dpr=m,d.refreshRem=i,d.rem2px=function(e){var t=parseFloat(e)*this.rem;return"string"==typeof e&&e.match(/rem$/)&&(t+="px"),t},d.px2rem=function(e){var t=parseFloat(e)/this.rem;return"string"==typeof e&&e.match(/px$/)&&(t+="rem"),t}}(window,window.lib||(window.lib={})),e}()}();
  10. </script>
  11. <link rel="stylesheet" type="text/css" href="../build/p/my/style.css">
  12. </head>
  13. <body>
  14. <div class="header">
  15. <ul class="nav clearfix">
  16. <li class="active"><a href="" title="">设备名称</a></li>
  17. </ul>
  18. <a href="index.html" class="back"></a>
  19. </div>
  20. <div class="container equip equip2">
  21. <div class="equip-top">
  22. <h3 class="title">喷灌机控制</h3>
  23. <div class="left">
  24. <img src="../img/equip21.jpg" />
  25. <div class="time">2015/12/12 18:22:30</div>
  26. <div class="role" id="J_role"></div>
  27. </div>
  28. </div>
  29. <div class="right clearfix">
  30. <div class="all-info open" id="J_allInfo">
  31. <div class="title">设备运行中</div>
  32. <div class="btn" id="J_close">关闭水泵</div>
  33. </div>
  34. <div class="item">
  35. <div class="num">12h 32m 18s</div>
  36. <div class="name">灌溉时长</div>
  37. </div>
  38. <div class="item">
  39. <div class="num">2</div>
  40. <div class="name">运转圈数</div>
  41. </div>
  42. <div class="item">
  43. <div class="num">顺时针</div>
  44. <div class="name">运转方向</div>
  45. </div>
  46. <div class="item">
  47. <div class="num">60%(走1m停2m)</div>
  48. <div class="name">运转速度</div>
  49. </div>
  50. <div class="item">
  51. <div class="num">20m/s</div>
  52. <div class="name">水流量</div>
  53. </div>
  54. <div class="item">
  55. <div class="num">60m³</div>
  56. <div class="name">本次总量</div>
  57. </div>
  58. <div class="item">
  59. <div class="num">30mpa</div>
  60. <div class="name">水压监测</div>
  61. </div>
  62. <div class="item">
  63. <div class="num">5mm</div>
  64. <div class="name">平均灌溉深度</div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="footer clearfix">
  69. <a href="" class="item active">设备控制</a>
  70. <a href="data.html" class="item">数据统计</a>
  71. <a href="log.html" class="item">设备记录</a>
  72. </div>
  73. <script type="text/javascript" src="../build/lib/zepto.min.js"></script>
  74. <script type="text/javascript">
  75. var timer = null;
  76. $('#J_allInfo').bind('click', function(){
  77. var allInfo = $('#J_allInfo');
  78. var title = allInfo.find('.title');
  79. var btn = allInfo.find('.btn');
  80. if (allInfo.hasClass('open')) {
  81. allInfo.removeClass('open');
  82. allInfo.addClass('close');
  83. title.html('设备故障');
  84. clearInterval(timer);
  85. btn.html('启动水泵');
  86. } else {
  87. allInfo.removeClass('close');
  88. allInfo.addClass('open');
  89. title.html('设备运行中');
  90. btn.html('关闭水泵');
  91. initRole();
  92. }
  93. });
  94. initRole();
  95. var pfx = (function() {
  96. var style = document.createElement('dummy').style,
  97. prefixes = ['Webkit','Moz','O','ms','Khtml'],
  98. memory = {};
  99. function _pfx(prop) {
  100. if(typeof memory[prop] === "undefined") {
  101. var ucProp = prop.charAt(0).toUpperCase()+prop.substr(1),
  102. props = [prop].concat(prefixes.map(function(prefix) {
  103. return prefix+ucProp;
  104. }));
  105. memory[prop] = null;
  106. for(var i in props) {
  107. if(style[props[i]] !== undefined) {
  108. memory[prop] = props[i];
  109. break;
  110. }
  111. }
  112. }
  113. return memory[prop];
  114. }
  115. return _pfx;
  116. })();
  117. function css(el, props) {
  118. for(var key in props) {
  119. var pkey = pfx(key);
  120. if(pkey !== null) el.style[pkey] = props[key];
  121. }
  122. return el;
  123. }
  124. var deg = 0;
  125. var obj = $('#J_role')[0];
  126. function initRole() {
  127. timer = setInterval(function(){
  128. deg += 1;
  129. css(obj,{'transform':'rotate('+deg+'deg)'});
  130. },10);
  131. }
  132. </script>
  133. </body>
  134. </html>