internet.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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/sd.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.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/ds.png" width="60%">
  51. </div>
  52. </div>
  53. </div>
  54. <br>
  55. <br>
  56. <div style="width: 94%;height: 50px;margin-top: 100px;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: 25px;width: 100%;height: auto;">
  64. <div class="mui-row">
  65. <div class="mui-col mui-col-xs-12" id="BtnList" style="padding-top:10px;overflow-y:auto;">
  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 class="mui-col mui-col-xs-3">
  91. <button type="button" value="9" id="9" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">9</button>
  92. </div>
  93. <div class="mui-col mui-col-xs-3">
  94. <button type="button" value="10" id="10" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">10</button>
  95. </div>
  96. <div class="mui-col mui-col-xs-3">
  97. <button type="button" value="11" id="11" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">11</button>
  98. </div>
  99. <div class="mui-col mui-col-xs-3">
  100. <button type="button" value="12" id="12" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">12</button>
  101. </div>
  102. </div>
  103. <div class="mui-col mui-col-xs-12" style="text-align: center;padding-bottom: 13px;">
  104. <div class="mui-col mui-col-xs-3" id="gomoving">
  105. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="moving" style="border:1px solid #4a5a6a;">移动</button>
  106. </div>
  107. <div class="mui-col mui-col-xs-3" id="gostart">
  108. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="start" style="border:1px solid #4a5a6a;">搬运</button>
  109. </div>
  110. <div class="mui-col mui-col-xs-3">
  111. <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="cancel" style="border:1px solid #4a5a6a;">取消</button>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div style="height: 15px;width: 101%;background: url(img/bottom_bg.png) no-repeat -25px 0;"></div>
  117. </div>
  118. </div>
  119. </body>
  120. <script src="js/jquery.min.js"></script>
  121. <script src="js/mui.min.js"></script>
  122. <script type="text/javascript">
  123. var windowHeight = $(window).height(),
  124. $body = $("body");
  125. // $body.css("height", windowHeight); //重要代码
  126. $("body").on("touchstart", function(e) {
  127. e.preventDefault();
  128. startX = e.originalEvent.changedTouches[0].pageX,
  129. startY = e.originalEvent.changedTouches[0].pageY;
  130. });
  131. $("body").on("touchmove", function(e) {
  132. e.preventDefault();
  133. moveEndX = e.originalEvent.changedTouches[0].pageX,
  134. moveEndY = e.originalEvent.changedTouches[0].pageY,
  135. X = moveEndX - startX,
  136. Y = moveEndY - startY;
  137.     if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
  138.      window.location.href = "index.html"; //right
  139.     }
  140.     else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
  141.        window.location.href = "remote.html"; //left
  142.     }
  143.     else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
  144.       return //bottom
  145.     }
  146.     else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
  147.       return //top
  148.     }
  149.     else{
  150.       return
  151.     }
  152. });
  153. $(function() {
  154. if (localStorage.getItem("ip") == "" || localStorage.getItem("ip") == null) {
  155. ip = "http://192.168.0.118:8899";
  156. }else{
  157. ip = "http://" + localStorage.getItem("ip") + ":8899";
  158. }
  159. if (localStorage.getItem("agvid") == "" || localStorage.getItem("agvid") == null) {
  160. agvid = 1;
  161. }else{
  162. agvid = parseInt(localStorage.getItem("agvid"))
  163. }
  164. if (localStorage.getItem("mapid") == "" || localStorage.getItem("mapid") == null) {
  165. mapid = "1";
  166. }else{
  167. mapid = localStorage.getItem("mapid")
  168. }
  169. $("#gostart").addClass("mui-hidden");
  170. $("#moving").attr("disabled", true);
  171. $("#start").attr("disabled", true);
  172. $("button[name]").on("touchstart", onSelectStation);
  173. })
  174. $("#11814").click(function() {
  175. var s = 1
  176. var d = 4
  177. var strone = {
  178. "t": "AddTsk",
  179. "id": agvid,
  180. "s": s,
  181. "d": d
  182. }
  183. var ss = JSON.stringify(strone)
  184. $.post(ip, ss);
  185. })
  186. $("#11841").click(function() {
  187. var s = 4
  188. var d = 1
  189. var strone = {
  190. "t": "AddTsk",
  191. "id": agvid,
  192. "s": s,
  193. "d": d
  194. }
  195. var ss = JSON.stringify(strone)
  196. $.post(ip, ss);
  197. })
  198. $("#200").click(function() {
  199. var s = 4
  200. var d = 1
  201. var strone = {
  202. "t": "AddTsk",
  203. "id": agvid,
  204. "s": s,
  205. "d": d
  206. }
  207. var ss = JSON.stringify(strone)
  208. $.post(ip, ss);
  209. })
  210. $("151").click(function() {
  211. var s = 1
  212. var d = 4
  213. var strone = {
  214. "t": "AddTsk",
  215. "id": agvid,
  216. "s": s,
  217. "d": d
  218. }
  219. var ss = JSON.stringify(strone)
  220. $.post(ip, ss);
  221. })
  222. function onSelectStation(evt) {
  223. var $this = $(this);
  224. if ($("div[id='BtnList']").is(':active')) {
  225. $this.removeClass('active');
  226. } else {
  227. $this.addClass('active');
  228. }
  229. if ($("div[id='BtnList']").find(".active").length == 1) {
  230. $("#moving").attr("disabled", false);
  231. $this.addClass('up');
  232. $("#start").removeAttr("disabled");
  233. $("#cancel").removeAttr("disabled");
  234. } else if ($("div[id='BtnList']").find(".active").length == 2) {
  235. $("#gomoving").addClass("mui-hidden");
  236. $("#gostart").removeClass("mui-hidden");
  237. $this.addClass('down');
  238. $('#start').attr("disabled", false);
  239. $("#handling").removeAttr("disabled");
  240. }
  241. if ($("div[id='BtnList']").find(".active").length >= 2) {
  242. $("button[name='Site']").css("pointer-events", "none")
  243. } else {
  244. $("button[name='Site']").css("pointer-events", "auto")
  245. }
  246. };
  247. function Reset(evt) {
  248. if ($("div[id='BtnList']").find(".active")) {
  249. $("#gostart").addClass("mui-hidden");
  250. $("#gomoving").removeClass("mui-hidden");
  251. $("button[name='Site']").removeClass('up');
  252. $("button[name='Site']").removeClass('down');
  253. $("button[name='Site']").removeClass('active');
  254. $("button[name='Site']").css("pointer-events", "auto");
  255. $('#start').attr("disabled", true);
  256. $('#cancel').attr("disabled", true);
  257. $('#moving').attr("disabled", true);
  258. }
  259. }
  260. //移动
  261. $("#moving").click(function() {
  262. var bt_value = [];
  263. $("div[id='BtnList']").find(".up").each(function(evt) {
  264. parseInt(bt_value.push($(this).val()));
  265. })
  266. Reset()
  267. });
  268. //搬运
  269. $("#start").click(function() {
  270. var bt_value = [];
  271. $("div[id='BtnList']").find(".up").each(function(evt) {
  272. bt_value.push($(this).val());
  273. });
  274. $("div[id='BtnList']").find(".down").each(function(evt) {
  275. bt_value.push($(this).val());
  276. });
  277. var strone = {
  278. "t": "AddTsk",
  279. "id": agvid,
  280. "s": parseInt(bt_value[0]),
  281. "d": parseInt(bt_value[1])
  282. }
  283. var ss = JSON.stringify(strone)
  284. $.post(ip, ss);
  285. Reset()
  286. });
  287. //取消
  288. $("#cancel").on("click", Reset);
  289. $("#details").click(function() {
  290. window.location.href = "details.html";
  291. })
  292. </script>
  293. </html>