123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>华力机电SIMANC</title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <!--标准mui.css-->
- <link rel="stylesheet" type="text/css" href="css/mui.min.css">
- <!--App自定义的css-->
- <link rel="stylesheet" type="text/css" href="css/app.css" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="css/style.css" />
- </head>
- <body style="background: url(img/bg.png) no-repeat 0px -0px;width:99%;">
- <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%;">
- <a style="color: #FFFFFF;font-size: 20px;">华力西曼克</a>
- </div>
- <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%;">
- <div class="mui-row">
- <div class="mui-col mui-col-xs-12">
- <div id="speed" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
- <img src="img/sd.png" style="margin-left: -80px;width: 13%;">
- </div>
- <div id="battery" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
- <img src="img/battery.png" style="margin-right: -80px;width: 23%;">
- </div>
- </div>
- <div class="mui-col mui-col-xs-12">
- <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: left;margin-left: 23px;">
- <div style="margin-left: -60px;margin-top: 15px;">
- <a style="color: #FFFFFF;font-size: 18px;">目标</a><br>
- </div>
- <div style="margin-left: -60px;margin-top: 10px;">
- <a style="color: #FFFFFF;font-size: 18px;">站点</a><br>
- </div>
- <div style="margin-left: 40px;margin-top: -40px;">
- <a style="color: #FFFFFF;font-size: 50px;">7</a><br>
- </div>
- </div>
- <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: right;margin-right: 20px;">
- <div style="margin-left: -60px;margin-top: 15px;">
- <a style="color: #FFFFFF;font-size: 18px;">顶升</a><br>
- </div>
- <div style="margin-left: -60px;margin-top: 10px;">
- <a style="color: #FFFFFF;font-size: 18px;">状态</a><br>
- </div>
- <div style="margin-left: 60px;margin-top: -55px;">
- <img src="img/ds.png" width="60%">
- </div>
- </div>
- </div>
- <br>
- <br>
- <div style="width: 94%;height: 50px;margin-top: 100px;margin-left: 20px;">
- <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>
- <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>
- <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>
- <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>
- </div>
- <div style="width: 87%;height: 30px;margin-left: 25px;background-color: #0b6d78;border-radius: 3px;"></div>
- <div class="mui-content-padded" style="background: url(img/btlist5_bg.png) no-repeat 10px 0;margin-top: 25px;width: 100%;height: auto;">
- <div class="mui-row">
- <div class="mui-col mui-col-xs-12" id="BtnList" style="padding-top:10px;overflow-y:auto;">
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="1" id="1" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">1</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="2" id="2" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">2</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="3" id="3" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">3</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="4" id="4" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">4</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="5" id="5" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">5</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="6" id="6" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">6</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="7" id="7" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">7</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="8" id="8" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">8</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="9" id="9" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">9</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="10" id="10" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">10</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="11" id="11" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">11</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" value="12" id="12" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">12</button>
- </div>
- </div>
- <div class="mui-col mui-col-xs-12" style="text-align: center;padding-bottom: 13px;">
- <div class="mui-col mui-col-xs-3" id="gomoving">
- <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="moving" style="border:1px solid #4a5a6a;">移动</button>
- </div>
- <div class="mui-col mui-col-xs-3" id="gostart">
- <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="start" style="border:1px solid #4a5a6a;">搬运</button>
- </div>
- <div class="mui-col mui-col-xs-3">
- <button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="cancel" style="border:1px solid #4a5a6a;">取消</button>
- </div>
- </div>
- </div>
- </div>
- <div style="height: 15px;width: 101%;background: url(img/bottom_bg.png) no-repeat -25px 0;"></div>
- </div>
- </div>
- </body>
- <script src="js/jquery.min.js"></script>
- <script src="js/mui.min.js"></script>
- <script type="text/javascript">
- var windowHeight = $(window).height(),
- $body = $("body");
- // $body.css("height", windowHeight); //重要代码
- $("body").on("touchstart", function(e) {
- e.preventDefault();
- startX = e.originalEvent.changedTouches[0].pageX,
- startY = e.originalEvent.changedTouches[0].pageY;
- });
- $("body").on("touchmove", function(e) {
- e.preventDefault();
- moveEndX = e.originalEvent.changedTouches[0].pageX,
- moveEndY = e.originalEvent.changedTouches[0].pageY,
- X = moveEndX - startX,
- Y = moveEndY - startY;
- if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
- window.location.href = "index.html"; //right
- }
- else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
- window.location.href = "remote.html"; //left
- }
- else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
- return //bottom
- }
- else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
- return //top
- }
- else{
- return
- }
- });
- $(function() {
- if (localStorage.getItem("ip") == "" || localStorage.getItem("ip") == null) {
- ip = "http://192.168.0.118:8899";
- }else{
- ip = "http://" + localStorage.getItem("ip") + ":8899";
- }
- if (localStorage.getItem("agvid") == "" || localStorage.getItem("agvid") == null) {
- agvid = 1;
- }else{
- agvid = parseInt(localStorage.getItem("agvid"))
- }
- if (localStorage.getItem("mapid") == "" || localStorage.getItem("mapid") == null) {
- mapid = "1";
- }else{
- mapid = localStorage.getItem("mapid")
- }
-
- $("#gostart").addClass("mui-hidden");
- $("#moving").attr("disabled", true);
- $("#start").attr("disabled", true);
- $("button[name]").on("touchstart", onSelectStation);
- })
- $("#11814").click(function() {
- var s = 1
- var d = 4
- var strone = {
- "t": "AddTsk",
- "id": agvid,
- "s": s,
- "d": d
- }
- var ss = JSON.stringify(strone)
- $.post(ip, ss);
- })
- $("#11841").click(function() {
- var s = 4
- var d = 1
- var strone = {
- "t": "AddTsk",
- "id": agvid,
- "s": s,
- "d": d
- }
- var ss = JSON.stringify(strone)
- $.post(ip, ss);
- })
- $("#200").click(function() {
- var s = 4
- var d = 1
- var strone = {
- "t": "AddTsk",
- "id": agvid,
- "s": s,
- "d": d
- }
- var ss = JSON.stringify(strone)
- $.post(ip, ss);
- })
- $("151").click(function() {
- var s = 1
- var d = 4
- var strone = {
- "t": "AddTsk",
- "id": agvid,
- "s": s,
- "d": d
- }
- var ss = JSON.stringify(strone)
- $.post(ip, ss);
- })
- function onSelectStation(evt) {
- var $this = $(this);
- if ($("div[id='BtnList']").is(':active')) {
- $this.removeClass('active');
- } else {
- $this.addClass('active');
- }
- if ($("div[id='BtnList']").find(".active").length == 1) {
- $("#moving").attr("disabled", false);
- $this.addClass('up');
- $("#start").removeAttr("disabled");
- $("#cancel").removeAttr("disabled");
- } else if ($("div[id='BtnList']").find(".active").length == 2) {
- $("#gomoving").addClass("mui-hidden");
- $("#gostart").removeClass("mui-hidden");
- $this.addClass('down');
- $('#start').attr("disabled", false);
- $("#handling").removeAttr("disabled");
- }
- if ($("div[id='BtnList']").find(".active").length >= 2) {
- $("button[name='Site']").css("pointer-events", "none")
- } else {
- $("button[name='Site']").css("pointer-events", "auto")
- }
- };
- function Reset(evt) {
- if ($("div[id='BtnList']").find(".active")) {
- $("#gostart").addClass("mui-hidden");
- $("#gomoving").removeClass("mui-hidden");
- $("button[name='Site']").removeClass('up');
- $("button[name='Site']").removeClass('down');
- $("button[name='Site']").removeClass('active');
- $("button[name='Site']").css("pointer-events", "auto");
- $('#start').attr("disabled", true);
- $('#cancel').attr("disabled", true);
- $('#moving').attr("disabled", true);
- }
- }
- //移动
- $("#moving").click(function() {
- var bt_value = [];
- $("div[id='BtnList']").find(".up").each(function(evt) {
- parseInt(bt_value.push($(this).val()));
- })
- Reset()
- });
- //搬运
- $("#start").click(function() {
- var bt_value = [];
- $("div[id='BtnList']").find(".up").each(function(evt) {
- bt_value.push($(this).val());
- });
- $("div[id='BtnList']").find(".down").each(function(evt) {
- bt_value.push($(this).val());
- });
- var strone = {
- "t": "AddTsk",
- "id": agvid,
- "s": parseInt(bt_value[0]),
- "d": parseInt(bt_value[1])
- }
- var ss = JSON.stringify(strone)
- $.post(ip, ss);
- Reset()
- });
- //取消
- $("#cancel").on("click", Reset);
- $("#details").click(function() {
- window.location.href = "details.html";
- })
- </script>
- </html>
|