settings.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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: 10px 0 10px 0;
  16. }
  17. .mui-col{
  18. padding-right: 4px;
  19. display: inline-block;
  20. padding: 2px 5px;
  21. }
  22. .item{
  23. margin: 5px 0;
  24. }
  25. .mui-row{
  26. padding: 4px 0;
  27. }
  28. .mui-col-xs-3{
  29. padding: 2px 2px;
  30. }
  31. .mui-col-xs-3 >input{
  32. height: 20px;
  33. margin-bottom: 0px;
  34. border: 1px solid #298890;
  35. background-color: rgba(255,255,255,0);
  36. }
  37. .mui-col-xs-2{
  38. text-align: right;
  39. }
  40. .mui-icon-undo{
  41. font-size: 40px;
  42. }
  43. </style>
  44. <style>
  45. .mui-btn-block{
  46. margin-bottom: 0;
  47. }
  48. .mui-content-padded{
  49. margin: 2px;
  50. }
  51. .mui-col{
  52. display: inline-block;
  53. padding: 2px;
  54. }
  55. /*滚动条样式*/
  56. ::-webkit-scrollbar {
  57. width: 0;
  58. background-color: #F5F5F5;
  59. }
  60. /*定义滚动条轨道 内阴影+圆角*/
  61. ::-webkit-scrollbar-track {
  62. background-color: #2e3342;
  63. }
  64. /*定义滑块 内阴影+圆角*/
  65. ::-webkit-scrollbar-thumb {
  66. background-color: #2e3342;
  67. }
  68. .mui-btn-royal{
  69. background-color: rgba(141, 157, 199, 0.5);
  70. border:1px solid rgba(141, 157, 199, 0.5)
  71. }
  72. .active {
  73. background-color: #d4d4d4;
  74. color:white;
  75. }
  76. .up{
  77. background: #0087c5 url(img/top.svg) no-repeat 50% 10%;
  78. }
  79. .down{
  80. background: #0087c5 url(img/bottom.svg) no-repeat 50% 10%;
  81. }
  82. .mui-plus .plus{
  83. display: inline;
  84. }
  85. .plus{
  86. display: none;
  87. }
  88. #topPopover {
  89. position: fixed;
  90. top: 16px;
  91. right: 6px;
  92. }
  93. #topPopover .mui-popover-arrow {
  94. left: auto;
  95. right: 6px;
  96. }
  97. p {
  98. text-indent: 22px;
  99. }
  100. span.mui-icon {
  101. font-size: 14px;
  102. color: #007aff;
  103. margin-left: -15px;
  104. padding-right: 10px;
  105. }
  106. .mui-popover {
  107. color:#fff;
  108. height: 260px;
  109. width: 130px;
  110. background-color: rgba(141, 157, 199, 0.9);
  111. }
  112. .mui-content {
  113. padding: 10px;
  114. }
  115. .mui-scroll-wrapper{
  116. background-color:transparent;
  117. }
  118. .mui-popover .mui-table-view{
  119. background-color: transparent;
  120. }
  121. .history tr{
  122. background-color: #ffffff;
  123. border-radius:5px 0 0 5px;
  124. }
  125. .history td:first-child{
  126. border-radius:5px 0 0 5px;
  127. }
  128. .history td:last-child{
  129. border-radius: 0 5px 5px 0;
  130. }
  131. .grid-task >div{
  132. display: grid;
  133. grid-template-columns: 60px 1fr 1fr 100px;
  134. grid-gap: 1px;
  135. }
  136. .grid-task >div>span{
  137. color: #fff;
  138. font-size: 15px;
  139. background-color: rgba(141, 157, 199, 0.5);
  140. padding:5px 5px 2px 10px;
  141. }
  142. .mui-bar{
  143. height:35px
  144. }
  145. .mui-bar-nav{
  146. top: 0;
  147. box-shadow: 0 1px 6px #2e3342;
  148. }
  149. .mui-title {
  150. line-height:35px
  151. }
  152. .mui-bar .mui-icon {
  153. padding-top:5px
  154. }
  155. .mui-bar-nav~.mui-content{
  156. padding-top: 30px;
  157. }
  158. .text-success{
  159. color:#27c24c
  160. }
  161. .mui-bar .mui-btn-link {
  162. line-height: 36px;
  163. }
  164. .mui-col-xs-3{
  165. width: 22%;
  166. }
  167. .mui-input-group{
  168. background-color: rgba(255, 255, 255, 0);
  169. color: #FFFFFF;
  170. }
  171. .mui-content{
  172. background-color: rgba(255, 255, 255, 0);
  173. }
  174. * { touch-action: none; }
  175. </style>
  176. </head>
  177. <body style="background-image: url(img/bg.png);">
  178. <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%;">
  179. <a style="color: #FFFFFF;font-size: 20px;">华力西曼克</a>
  180. </div>
  181. <div class="mui-content" style="height:auto;min-height: 525px;">
  182. <div class="mui-content-padded" style="margin: 5px;">
  183. <form class="mui-input-group">
  184. <div class="mui-input-row">
  185. <label>IP地址</label>
  186. <input type="text" id="ip" placeholder="请填写IP地址" value="">
  187. </div>
  188. <div class="mui-input-row">
  189. <label>agvID</label>
  190. <input type="text" id="agvid" placeholder="请填写agvID" value="">
  191. </div>
  192. <div class="mui-input-row">
  193. <label>mapID</label>
  194. <input type="text" id="mapid" placeholder="请填写mapID" value="">
  195. </div>
  196. <div class="mui-button-row">
  197. <button id="update" type="button" class="mui-btn mui-btn-success">应用更新</button>&nbsp;&nbsp;
  198. <button id="default" type="button" class="mui-btn mui-btn-default">默认值</button>&nbsp;&nbsp;
  199. <button id="confirm" type="button" class="mui-btn mui-btn-primary">确认</button>&nbsp;&nbsp;
  200. <button id="cancel" type="button" class="mui-btn mui-btn-danger">取消</button>
  201. </div>
  202. </form>
  203. </div>
  204. </div>
  205. <div id="stop" style="margin-top: 13px;height: 15px;background: url(img/bottom_bg.png) no-repeat -25px 0;"></div>
  206. </body>
  207. <script src="js/mui.js"></script>
  208. <script src="js/jquery.min.js"></script>
  209. <script src="js/mui.min.js"></script>
  210. <script>
  211. $(function() {
  212. if (localStorage.getItem("ip") != "" || localStorage.getItem("ip") != null) {
  213. $("#ip").val(localStorage.getItem("ip"))
  214. }
  215. if (localStorage.getItem("agvid") != "" || localStorage.getItem("agvid") != null) {
  216. $("#agvid").val(localStorage.getItem("agvid"));
  217. }
  218. if (localStorage.getItem("mapid") != "" || localStorage.getItem("mapid") != null) {
  219. $("#mapid").val(localStorage.getItem("mapid"));
  220. }
  221. })
  222. $("#default").click(function() {
  223. $("#ip").val("192.168.0.200");
  224. $("#agvid").val("1");
  225. $("#mapid").val("2020032608412704");
  226. })
  227. $("#cancel").click(function() {
  228. window.location.href = "index.html";
  229. })
  230. $("#confirm").click(function() {
  231. var ip = $("#ip").val();
  232. var agvid = $("#agvid").val();
  233. var mapid = $("#mapid").val();
  234. if (ip != "" && ip != null) {
  235. localStorage.setItem("ip", ip);
  236. }
  237. if (agvid != "" && agvid != null) {
  238. localStorage.setItem("agvid", agvid);
  239. }
  240. if (mapid != "" && mapid != null) {
  241. localStorage.setItem("mapid", mapid);
  242. }
  243. window.location.href = "index.html";
  244. })
  245. mui.init()
  246. $("#update").click(function() {
  247. dowload()
  248. })
  249. function dowload() {
  250. var options = {
  251. method: "GET"
  252. };
  253. dtask = plus.downloader.createDownload(
  254. "http://192.168.1.230:3000/wcs/agv-summoner/raw/master/releases/agv-summoner.apk", options);
  255. dtask.addEventListener("statechanged", function(task, status) {
  256. switch (task.state) {
  257. case 1: // 开始
  258. mui.toast("开始下载...")
  259. break;
  260. case 2: // 已连接到服务器
  261. mui.toast("连接到服务器...")
  262. break;
  263. case 3: // 已接收到数据
  264. //alert(task.downloadedSize) // 已下载文件大小
  265. //alert(task.totalSize) // 文件大小
  266. break;
  267. case 4: // 下载完成
  268. mui.toast("下载完成!")
  269. //console.log(task.totalSize)
  270. plus.io.resolveLocalFileSystemURL(task.filename, function(entry) {
  271. if (entry.isFile) {
  272. plus.runtime.install(entry.toLocalURL(), {}, function() {
  273. alert("安装成功")
  274. entry.remove();//删除文件
  275. }, function() {
  276. alert("安装失败")
  277. });
  278. } else {
  279. // 不存在
  280. alert("文件不存在")
  281. }
  282. //alert(entry.toLocalURL()+"") // 显示下载的文件存储绝对地址
  283. //console.log(entry.toLocalURL()) //绝对地址
  284. }, function(e) {});
  285. //alert(task.filename) // 显示下载好的文件名称
  286. //console.log("task.filename", task.filename)
  287. break;
  288. }
  289. });
  290. dtask.start();
  291. }
  292. </script>
  293. </html>