settings.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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/mui.js"></script>
  89. <script src="js/jquery.min.js"></script>
  90. <script src="js/mui.min.js"></script>
  91. <script>
  92. $(function() {
  93. if (localStorage.getItem("ip") != "" || localStorage.getItem("ip") != null) {
  94. $("#ip").val(localStorage.getItem("ip"))
  95. }
  96. if (localStorage.getItem("agvid") != "" || localStorage.getItem("agvid") != null) {
  97. $("#agvid").val(localStorage.getItem("agvid"));
  98. }
  99. if (localStorage.getItem("mapid") != "" || localStorage.getItem("mapid") != null) {
  100. $("#mapid").val(localStorage.getItem("mapid"));
  101. }
  102. if (localStorage.getItem("site") != "" || localStorage.getItem("site") != null) {
  103. $("#site").val(localStorage.getItem("site"));
  104. }
  105. })
  106. function tips() {
  107. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位")
  108. }
  109. document.getElementById('site').onchange = function () {
  110. var site = $("#site").val();
  111. if(site !== "上下箱工位" &&site !== "清扫工位" &&site !== "下料工位"){
  112. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位");
  113. $("#site").val("");
  114. }
  115. };
  116. $("#default").click(function() {
  117. if (localStorage.getItem("defaultip") == "" || localStorage.getItem("defaultip") == null) {
  118. defaultip = "192.168.111.240";
  119. } else {
  120. defaultip = localStorage.getItem("defaultip");
  121. }
  122. $("#ip").val(defaultip);
  123. $("#agvid").val("1");
  124. $("#mapid").val("2020032608412704");
  125. $("#site").val("上下箱工位");
  126. })
  127. $("#cancel").click(function() {
  128. window.location.href = "index.html";
  129. })
  130. $("#confirm").click(function() {
  131. var ip = $("#ip").val();
  132. var agvid = $("#agvid").val();
  133. var mapid = $("#mapid").val();
  134. var site = $("#site").val();
  135. if(site !== "上下箱工位" &&site !== "清扫工位" &&site !== "下料工位"){
  136. mui.toast("工位只能填写上下箱工位、清扫工位、下料工位");
  137. $("#site").val("");
  138. return
  139. }
  140. if (ip != "" && ip != null) {
  141. localStorage.setItem("ip", ip);
  142. localStorage.setItem("defaultip", ip);
  143. }
  144. if (agvid != "" && agvid != null) {
  145. localStorage.setItem("agvid", agvid);
  146. }
  147. if (mapid != "" && mapid != null) {
  148. localStorage.setItem("mapid", mapid);
  149. }
  150. if (site != "" && site != null) {
  151. localStorage.setItem("site", site);
  152. }
  153. if (site === "上下箱工位") {
  154. AcceptId = 1;
  155. }
  156. if (site === "清扫工位") {
  157. AcceptId = 2;
  158. }
  159. if (site === "下料工位") {
  160. AcceptId = 3;
  161. }
  162. localStorage.setItem("AcceptId", AcceptId);
  163. window.location.href = "index.html";
  164. })
  165. mui.init()
  166. </script>
  167. </html>