internet.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>华力机电SIMANC</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <!--标准mui.css-->
  10. <link rel="stylesheet" type="text/css" href="css/mui.min.css">
  11. <!--App自定义的css-->
  12. <link rel="stylesheet" type="text/css" href="css/app.css" />
  13. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  14. <link rel="stylesheet" type="text/css" href="css/style.css" />
  15. </head>
  16. <body style="background: url(img/bg.png) no-repeat 0px -0px;width:99%;">
  17. <div id="title" style="height: 4%;text-align: center;padding-top: 10px;padding-bottom: 5px;background: url(img/title_bg.png) no-repeat 0 17px;background-size:100%;">
  18. <a style="color: #FFFFFF;font-size: 20px;">华力西曼克</a>
  19. </div>
  20. <div id="top" style="height: 30%;text-align: center;padding-top: 1px;background: url(img/top_bg.png) no-repeat 0 0px;background-size:100%;">
  21. <div class="mui-row">
  22. <div class="mui-col mui-col-xs-12">
  23. <div id="speed" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
  24. <img src="img/speed-high.png" style="margin-left: -80px;width: 13%;">
  25. </div>
  26. <div id="battery" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
  27. <img src="img/battery-100.png" style="margin-right: -80px;width: 23%;">
  28. </div>
  29. </div>
  30. <div class="mui-col mui-col-xs-12">
  31. <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: left;margin-left: 23px;">
  32. <div style="margin-left: -60px;margin-top: 15px;">
  33. <a style="color: #FFFFFF;font-size: 18px;">目标</a><br>
  34. </div>
  35. <div style="margin-left: -60px;margin-top: 10px;">
  36. <a style="color: #FFFFFF;font-size: 18px;">站点</a><br>
  37. </div>
  38. <div style="margin-left: 40px;margin-top: -40px;">
  39. <a style="color: #FFFFFF;font-size: 50px;">7</a><br>
  40. </div>
  41. </div>
  42. <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: right;margin-right: 20px;">
  43. <div style="margin-left: -60px;margin-top: 15px;">
  44. <a style="color: #FFFFFF;font-size: 18px;">顶升</a><br>
  45. </div>
  46. <div style="margin-left: -60px;margin-top: 10px;">
  47. <a style="color: #FFFFFF;font-size: 18px;">状态</a><br>
  48. </div>
  49. <div style="margin-left: 60px;margin-top: -55px;">
  50. <img src="img/liftstatus.png" width="60%">
  51. </div>
  52. </div>
  53. </div>
  54. <br>
  55. <br>
  56. <div style="width: 94%;height: 50px;margin-top: 95px;margin-left: 20px;">
  57. <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">停止</div>
  58. <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
  59. <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
  60. <div id="details" style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">详情</div>
  61. </div>
  62. <div style="width: 87%;height: 30px;margin-left: 25px;background-color: #0b6d78;border-radius: 3px;"></div>
  63. <div class="mui-content-padded" style="background: url(img/btlist5_bg.png) no-repeat 10px 0;margin-top: 15px;width: 100%;height: auto;">
  64. <div class="mui-row">
  65. <div class="mui-col mui-col-xs-12" id="BtnList" style="padding-top:10px;min-height:195px;overflow-y:auto;max-height:195px">
  66. <div class="mui-col mui-col-xs-3">
  67. <button type="button" value="1" id="1" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">1</button>
  68. </div>
  69. <div class="mui-col mui-col-xs-3">
  70. <button type="button" value="2" id="2" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">2</button>
  71. </div>
  72. <div class="mui-col mui-col-xs-3">
  73. <button type="button" value="3" id="3" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">3</button>
  74. </div>
  75. <div class="mui-col mui-col-xs-3">
  76. <button type="button" value="4" id="4" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">4</button>
  77. </div>
  78. <div class="mui-col mui-col-xs-3">
  79. <button type="button" value="5" id="5" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">5</button>
  80. </div>
  81. <div class="mui-col mui-col-xs-3">
  82. <button type="button" value="6" id="6" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">6</button>
  83. </div>
  84. <div class="mui-col mui-col-xs-3">
  85. <button type="button" value="7" id="7" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">7</button>
  86. </div>
  87. <div class="mui-col mui-col-xs-3">
  88. <button type="button" value="8" id="8" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">8</button>
  89. </div>
  90. </div>
  91. <div class="mui-col mui-col-xs-12" style="text-align: center;padding-bottom: 13px;">
  92. <div class="mui-col mui-col-xs-3" id="gomoving">
  93. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="moving" style="border:1px solid #4a5a6a;">移动</button>
  94. </div>
  95. <div class="mui-col mui-col-xs-3" id="gostart">
  96. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="start" style="border:1px solid #4a5a6a;">搬运</button>
  97. </div>
  98. <div class="mui-col mui-col-xs-3">
  99. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="cancel" style="border:1px solid #4a5a6a;">取消</button>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <div style="height: 15px;width: 101%;background: url(img/bottom_bg.png) no-repeat -25px 0;"></div>
  105. </div>
  106. </div>
  107. </body>
  108. <script src="js/jquery.min.js"></script>
  109. <script src="js/mui.min.js"></script>
  110. <script type="text/javascript">
  111. var windowHeight = $(window).height(),
  112. $body = $("body");
  113. // $body.css("height", windowHeight); //重要代码
  114. $("body").on("touchstart", function(e) {
  115. e.preventDefault();
  116. startX = e.originalEvent.changedTouches[0].pageX,
  117. startY = e.originalEvent.changedTouches[0].pageY;
  118. });
  119. $("body").on("touchmove", function(e) {
  120. e.preventDefault();
  121. moveEndX = e.originalEvent.changedTouches[0].pageX,
  122. moveEndY = e.originalEvent.changedTouches[0].pageY,
  123. X = moveEndX - startX,
  124. Y = moveEndY - startY;
  125.     if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
  126.      window.location.href = "index.html"; //right
  127.     }
  128.     else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
  129.        window.location.href = "remote.html"; //left
  130.     }
  131.     else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
  132.       return //bottom
  133.     }
  134.     else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
  135.       return //top
  136.     }
  137.     else{
  138.       return
  139.     }
  140. });
  141. $(function() {
  142. if (localStorage.getItem("ip") == "" || localStorage.getItem("ip") == null) {
  143. ip = "http://192.168.0.118:8899";
  144. }else{
  145. ip = "http://" + localStorage.getItem("ip") + ":8899";
  146. }
  147. if (localStorage.getItem("agvid") == "" || localStorage.getItem("agvid") == null) {
  148. agvid = 1;
  149. }else{
  150. agvid = parseInt(localStorage.getItem("agvid"))
  151. }
  152. if (localStorage.getItem("mapid") == "" || localStorage.getItem("mapid") == null) {
  153. mapid = "1";
  154. }else{
  155. mapid = localStorage.getItem("mapid")
  156. }
  157. $("#gostart").addClass("mui-hidden");
  158. $("#moving").attr("disabled", true);
  159. $("#start").attr("disabled", true);
  160. $('#cancel').attr("disabled", true);
  161. $("button[name]").on("touchstart", onSelectStation);
  162. })
  163. $("#11814").click(function() {
  164. var s = 1
  165. var d = 4
  166. var strone = {
  167. "t": "AddTsk",
  168. "id": agvid,
  169. "s": s,
  170. "d": d
  171. }
  172. var ss = JSON.stringify(strone)
  173. $.post(ip, ss);
  174. })
  175. $("#11841").click(function() {
  176. var s = 4
  177. var d = 1
  178. var strone = {
  179. "t": "AddTsk",
  180. "id": agvid,
  181. "s": s,
  182. "d": d
  183. }
  184. var ss = JSON.stringify(strone)
  185. $.post(ip, ss);
  186. })
  187. $("#200").click(function() {
  188. var s = 4
  189. var d = 1
  190. var strone = {
  191. "t": "AddTsk",
  192. "id": agvid,
  193. "s": s,
  194. "d": d
  195. }
  196. var ss = JSON.stringify(strone)
  197. $.post(ip, ss);
  198. })
  199. $("151").click(function() {
  200. var s = 1
  201. var d = 4
  202. var strone = {
  203. "t": "AddTsk",
  204. "id": agvid,
  205. "s": s,
  206. "d": d
  207. }
  208. var ss = JSON.stringify(strone)
  209. $.post(ip, ss);
  210. })
  211. function onSelectStation(evt) {
  212. var $this = $(this);
  213. if ($("div[id='BtnList']").is(':active')) {
  214. $this.removeClass('active');
  215. } else {
  216. $this.addClass('active');
  217. }
  218. if ($("div[id='BtnList']").find(".active").length == 1) {
  219. $("#moving").attr("disabled", false);
  220. $this.addClass('up');
  221. $("#start").removeAttr("disabled");
  222. $("#cancel").removeAttr("disabled");
  223. } else if ($("div[id='BtnList']").find(".active").length == 2) {
  224. $("#gomoving").addClass("mui-hidden");
  225. $("#gostart").removeClass("mui-hidden");
  226. $this.addClass('down');
  227. $('#start').attr("disabled", false);
  228. $("#handling").removeAttr("disabled");
  229. }
  230. if ($("div[id='BtnList']").find(".active").length >= 2) {
  231. $("button[name='Site']").css("pointer-events", "none")
  232. } else {
  233. $("button[name='Site']").css("pointer-events", "auto")
  234. }
  235. };
  236. function Reset(evt) {
  237. if ($("div[id='BtnList']").find(".active")) {
  238. $("#gostart").addClass("mui-hidden");
  239. $("#gomoving").removeClass("mui-hidden");
  240. $("button[name='Site']").removeClass('up');
  241. $("button[name='Site']").removeClass('down');
  242. $("button[name='Site']").removeClass('active');
  243. $("button[name='Site']").css("pointer-events", "auto");
  244. $('#start').attr("disabled", true);
  245. $('#cancel').attr("disabled", true);
  246. $('#moving').attr("disabled", true);
  247. }
  248. }
  249. //移动
  250. $("#moving").click(function() {
  251. var bt_value = [];
  252. $("div[id='BtnList']").find(".up").each(function(evt) {
  253. parseInt(bt_value.push($(this).val()));
  254. })
  255. Reset()
  256. });
  257. //搬运
  258. $("#start").click(function() {
  259. var bt_value = [];
  260. $("div[id='BtnList']").find(".up").each(function(evt) {
  261. bt_value.push($(this).val());
  262. });
  263. $("div[id='BtnList']").find(".down").each(function(evt) {
  264. bt_value.push($(this).val());
  265. });
  266. var strone = {
  267. "t": "AddTsk",
  268. "id": agvid,
  269. "s": parseInt(bt_value[0]),
  270. "d": parseInt(bt_value[1])
  271. }
  272. var ss = JSON.stringify(strone)
  273. $.post(ip, ss);
  274. Reset()
  275. });
  276. //取消
  277. $("#cancel").on("click", Reset);
  278. $("#details").click(function() {
  279. window.location.href = "details.html";
  280. })
  281. </script>
  282. </html>