settings.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SIMC 终端控制系统</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" href="css/mui.min.css">
  11. <!--App自定义的css-->
  12. <link rel="stylesheet" type="text/css" href="css/app.css" />
  13. <style>
  14. .mui-content-padded {
  15. padding: 2px 0;
  16. }
  17. .mui-row {
  18. font-size: 20px;
  19. }
  20. .mui-col-xs-3 {
  21. padding: 2px 2px;
  22. }
  23. .mui-content {
  24. padding: 10px 10px 0 10px;
  25. background-color: rgba(255, 255, 255, 0);
  26. }
  27. .mui-input-group {
  28. background-color: rgba(255, 255, 255, 0);
  29. color: #FFFFFF;
  30. }
  31. .mui-content-padded a {
  32. width: 50px;
  33. height: 50px;
  34. display: inline-block;
  35. text-align: center;
  36. background-color: #103543;
  37. border: 1px solid #FFF;
  38. border-radius: 25px;
  39. background-clip: padding-box;
  40. }
  41. .mui-content-padded a .mui-icon {
  42. margin-top: 12px;
  43. }
  44. </style>
  45. </head>
  46. <body style="background-image: url(img/bg.png);">
  47. <div id="title"
  48. 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%;">
  49. <a style="color: #FFFFFF;font-size: 20px;">森之洋</a>
  50. </div>
  51. <div class="mui-content">
  52. <div class="mui-content-padded" style="height:auto;min-height: 459px;">
  53. <form class="mui-input-group">
  54. <div class="mui-input-row">
  55. <label>IP地址</label>
  56. <input type="text" id="ip" placeholder="请填写IP地址" value="">
  57. </div>
  58. <div class="mui-input-row">
  59. <label>agvID</label>
  60. <input type="text" id="agvid" placeholder="请填写agvID" value="">
  61. </div>
  62. <div class="mui-input-row">
  63. <label>mapID</label>
  64. <input type="text" id="mapid" placeholder="请填写mapID" value="">
  65. </div>
  66. <div class="mui-input-row">
  67. <label onclick="tips()">工位</label>
  68. <input type="text" id="site" placeholder="请填写工位" value="">
  69. </div>
  70. <div class="mui-button-row">
  71. <button id="default" type="button" class="mui-btn mui-btn-default">默认值</button>&nbsp;&nbsp;
  72. <button id="confirm" type="button" class="mui-btn mui-btn-primary">确认</button>&nbsp;&nbsp;
  73. <button id="cancel" type="button" class="mui-btn mui-btn-danger">取消</button>
  74. </div>
  75. </form>
  76. </div>
  77. <div class="mui-content-padded">
  78. <div class="mui-row">
  79. <div class="mui-col mui-col-xs-12" style="text-align:center;">
  80. <a href="index.html">
  81. <span class="mui-icon mui-icon-arrowright" style="color: #fff;"></span>
  82. </a>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </body>
  88. <script src="js/jquery.min.js"></script>
  89. <script src="js/mui.min.js"></script>
  90. <script>
  91. $(function() {
  92. if (localStorage.getItem("ip") != "" || localStorage.getItem("ip") != null) {
  93. $("#ip").val(localStorage.getItem("ip"))
  94. }
  95. if (localStorage.getItem("agvid") != "" || localStorage.getItem("agvid") != null) {
  96. $("#agvid").val(localStorage.getItem("agvid"));
  97. }
  98. if (localStorage.getItem("mapid") != "" || localStorage.getItem("mapid") != null) {
  99. $("#mapid").val(localStorage.getItem("mapid"));
  100. }
  101. if (localStorage.getItem("site") != "" || localStorage.getItem("site") != null) {
  102. $("#site").val(localStorage.getItem("site"));
  103. }
  104. })
  105. function tips() {
  106. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位、缓存工位")
  107. }
  108. document.getElementById('site').onchange = function() {
  109. var site = $("#site").val();
  110. if (site !== "上下箱工位" && site !== "清扫工位" && site !== "下料工位" && site !== "缓存工位") {
  111. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位、缓存工位");
  112. $("#site").val("");
  113. }
  114. };
  115. $("#default").click(function() {
  116. if (localStorage.getItem("defaultip") == "" || localStorage.getItem("defaultip") == null) {
  117. defaultip = "192.168.111.240";
  118. } else {
  119. defaultip = localStorage.getItem("defaultip");
  120. }
  121. $("#ip").val(defaultip);
  122. $("#agvid").val("1");
  123. $("#mapid").val("2020032608412704");
  124. $("#site").val("上下箱工位");
  125. })
  126. $("#cancel").click(function() {
  127. window.location.href = "index.html";
  128. })
  129. $("#confirm").click(function() {
  130. var ip = $("#ip").val();
  131. var agvid = $("#agvid").val();
  132. var mapid = $("#mapid").val();
  133. var site = $("#site").val();
  134. if (site !== "上下箱工位" && site !== "清扫工位" && site !== "下料工位" && site !== "缓存工位") {
  135. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位、缓存工位");
  136. $("#site").val("");
  137. return
  138. }
  139. if (ip != "" && ip != null) {
  140. localStorage.setItem("ip", ip);
  141. localStorage.setItem("defaultip", ip);
  142. }
  143. if (agvid != "" && agvid != null) {
  144. localStorage.setItem("agvid", agvid);
  145. }
  146. if (mapid != "" && mapid != null) {
  147. localStorage.setItem("mapid", mapid);
  148. }
  149. if (site != "" && site != null) {
  150. localStorage.setItem("site", site);
  151. }
  152. if (site === "上下箱工位") {
  153. AcceptId = 1;
  154. }
  155. if (site === "清扫工位") {
  156. AcceptId = 2;
  157. }
  158. if (site === "下料工位") {
  159. AcceptId = 3;
  160. }
  161. if (site === "缓存工位") {
  162. AcceptId = 4;
  163. }
  164. localStorage.setItem("AcceptId", AcceptId);
  165. window.location.href = "index.html";
  166. })
  167. mui.init()
  168. </script>
  169. </html>