internet.html 11 KB

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