register_number.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Aisky-Sixth</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <!-- 新 Bootstrap4 核心 CSS 文件 -->
  8. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
  9. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  10. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  11. <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
  12. <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  13. <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  14. <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  15. <!--可用來建立使用者小圖示-->
  16. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  17. <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">-->
  18. <!--<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">-->
  19. <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>-->
  20. <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>-->
  21. <!--<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
  22. <style>
  23. body {
  24. margin:0;
  25. <!--background-color: #4d4d4d;-->
  26. }
  27. .navbar-dark .navbar-nav .nav-link {
  28. color: white;
  29. cursor: pointer;
  30. text-decoration:none;
  31. width: 110px;
  32. height: 46px;
  33. }
  34. .nav-top {
  35. line-height:40px;
  36. background-color: #C4C4C4;
  37. }
  38. .website_title{
  39. font-family: Roboto;
  40. font-style: normal;
  41. font-weight: normal;
  42. font-size: 30px;
  43. color: #000000;
  44. }
  45. .navbar-nav > li{
  46. float: none;
  47. display: inline-block;
  48. width: 110px;
  49. margin: 0 auto;
  50. text-align: center;
  51. }
  52. .navbar-nav > li a{
  53. font-size: 20px;
  54. }
  55. .main-page {
  56. margin-top: 200px;
  57. }
  58. .page-title {
  59. font-family: Roboto;
  60. font-style: normal;
  61. font-weight: bold;
  62. font-size: 36px;
  63. }
  64. .flex {
  65. display: flex;
  66. flex-direction: row;
  67. flex-wrap: wrap;
  68. justify-content: center;
  69. }
  70. .node {
  71. height: auto;
  72. border: 2px solid #E5E5E5;
  73. border-radius: 5px;
  74. margin-top:35px;
  75. }
  76. .node-opt {
  77. font-size: 21px;
  78. }
  79. ol {
  80. list-style-type: disc;
  81. font-size: 17px;
  82. }
  83. .set-link {
  84. display: inline-block;
  85. width: 350px;
  86. height: 100px;
  87. line-height: 100px;
  88. background: #008CBA;
  89. border: 1px solid #CFCFCF;
  90. box-sizing: border-box;
  91. color: #FFFFFF;
  92. border-radius: 10px;
  93. font-size: 36px;
  94. }
  95. .fa{
  96. display: inline-block;
  97. font: normal normal normal 14px/1 FontAwesome;
  98. font-size: inherit;
  99. text-rendering: auto;
  100. -webkit-font-smoothing: antialiased;
  101. }
  102. .fa-user-o:before{
  103. content: "\f2c0";
  104. }
  105. .abc {background:lightgreen;border:1px #000 solid;cursor:move;padding:10px 5px;}
  106. .draggable {min-width:50px;height:45px;display:inline-block;font-size:.9em;z-index:1;text-align:center;}
  107. @media(max-width:373px){
  108. .card {
  109. margin-right: 0px;
  110. }
  111. }
  112. @media(max-width:577px){
  113. }
  114. @media(min-width:576px){
  115. }
  116. @media(min-width:768px){
  117. .navbar-nav > li {
  118. margin-left: 0px;
  119. }
  120. .navbar-nav .li-block {
  121. display:none;
  122. }
  123. }
  124. @media(min-width:991px){
  125. .navbar-nav > li {
  126. margin-left: 20px;
  127. }
  128. .navbar-nav .li-block {
  129. display:none;
  130. }
  131. }
  132. @media(min-width:1200px){
  133. .navbar-nav > li {
  134. margin-left: 50px;
  135. }
  136. .navbar-nav .li-block {
  137. display: inline-block;
  138. width: 20px;
  139. }
  140. }
  141. @media(min-width:1400px){
  142. .navbar-nav .li-block {
  143. display: inline-block;
  144. width: 100px;
  145. }
  146. }
  147. @media(min-width:1689px) {
  148. .navbar-nav > li {
  149. margin-left: 50px;
  150. }
  151. .navbar-nav .li-block {
  152. display: inline-block;
  153. width: 450px;
  154. }
  155. }
  156. </style>
  157. <script>
  158. $(function(){
  159. var list = {{params.sort_L|tojson}};
  160. var list_div = document.getElementById('order-list');
  161. var sensor_list = "";
  162. $.each({{params.sensor_list|tojson}},function(index, obj){
  163. sensor_list += "if(obj == '" + obj.en_name + "'){Module('" + obj.ch_name + obj.version + "',monitor,'" + obj.en_name + "',i);};";
  164. });
  165. $.each(list, function(index, obj){
  166. var json = JSON.parse(obj);
  167. var div = document.createElement('div');
  168. var html = '';
  169. function Module(module, monitor, module_name, i){
  170. html += '<div class="col-6">';
  171. html += '<li>';
  172. html += '' + module;
  173. html += '</li>';
  174. html += '<input type="text" class="module-number" name="node' + i + '-' + monitor + '-' + module_name + '" placeholder="序號" style="width:170px;">';
  175. html += '</div>';
  176. };
  177. function TraverseModule(arr, monitor, i){
  178. $.each(arr, function(index, obj){
  179. <!--if(obj == 'airTem'){-->
  180. <!--Module('空氣溫度', monitor, 'airtem', i);-->
  181. <!--}else if(obj == 'airHum'){-->
  182. <!--Module('空氣濕度', monitor, 'airHum', i);-->
  183. <!--}else if(obj == 'dewPoint'){-->
  184. <!--Module('露點', monitor, 'dewPoint', i);-->
  185. <!--}else if(obj == 'sun'){-->
  186. <!--Module('日照', monitor, 'sun', i);-->
  187. <!--}else if(obj == 'soilHum'){-->
  188. <!--Module('土壤含水率', monitor, 'soilHum', i);-->
  189. <!--}else if(obj == 'soilTem'){-->
  190. <!--Module('土壤溫度', monitor, 'soilTem', i);-->
  191. <!--}else if(obj == 'soilEC'){-->
  192. <!--Module('土壤EC值', monitor, 'soilEC', i);-->
  193. <!--}else if(obj == 'windSpd'){-->
  194. <!--Module('風速', monitor, 'windSpd', i);-->
  195. <!--}else if(obj == 'windDin'){-->
  196. <!--Module('風向', monitor, 'windDin', i);-->
  197. <!--}else if(obj == 'rain'){-->
  198. <!--Module('降雨量', monitor, 'rain', i);-->
  199. <!--}else if(obj == 'atmosphere'){-->
  200. <!--Module('大氣壓', monitor, 'atmosphere', i);-->
  201. <!--};-->
  202. eval(sensor_list);
  203. });
  204. };
  205. var title_num = 1;
  206. html += '<h2 class="item-title text-center">' + '節點' + (index+1) + '</h2>';
  207. html += '<div class="row node-opt">';
  208. html += '<div class="col-1"></div>';
  209. html += '<div class="col-10">';
  210. if(json.weather){
  211. html += '<span>' + title_num + '.氣象站</span>';
  212. html += '<ol>';
  213. html += '<div class="row">';
  214. TraverseModule(json.weather, 'weather', (index+1));
  215. html += '<div class="col-6"></div>';
  216. html += '</div>';
  217. html += '</ol>';
  218. title_num ++;
  219. };
  220. if(json.irrigation){
  221. html += '<span>' + title_num + '.灌溉</span>';
  222. html += '<ol>';
  223. html += '<div class="row">';
  224. TraverseModule(json.irrigation, 'irrigation', (index+1));
  225. html += '<div class="col-6"></div>';
  226. html += '</div>';
  227. html += '</ol>';
  228. title_num ++;
  229. };
  230. if(json.water){
  231. html += '<span>' + title_num + '.水質</span>';
  232. html += '<ol>';
  233. html += '<div class="row">';
  234. TraverseModule(json.water, 'water', (index+1));
  235. html += '<div class="col-6"></div>';
  236. html += '</div>';
  237. html += '</ol>';
  238. };
  239. html += '</div>';
  240. html += '<div class="col-1"></div>';
  241. html += '</div>';
  242. div.innerHTML = html;
  243. div.setAttribute('class', 'node col-6');
  244. list_div.appendChild(div);
  245. });
  246. var register_form = document.getElementById('register_form');
  247. var loading = document.getElementById('loading');
  248. register_form.onsubmit = function(){
  249. loading.style.display = 'block';
  250. };
  251. });
  252. </script>
  253. </head>
  254. <body>
  255. <nav class="fixed-top">
  256. <nav class="navbar navbar-expand-md nav-top justify-content-center">
  257. <div>
  258. <span class="website_title">序號登記</span>
  259. </div>
  260. </nav>
  261. <nav class="navbar navbar-expand-md bg-dark navbar-dark nav-bottom">
  262. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
  263. <span class="navbar-toggler-icon"></span>
  264. </button>
  265. <div class="collapse navbar-collapse" id="collapsibleNavbar">
  266. <ul class="navbar-nav">
  267. <li class="nav-item">
  268. <a class="nav-link" href="/">序號登記</a>
  269. </li>
  270. <li class="nav-item">
  271. <a class="nav-link" href="#">排程設定</a>
  272. </li>
  273. <li class="nav-item">
  274. <a class="nav-link" href="#">報表輸出</a>
  275. </li>
  276. <li class="nav-item">
  277. <a class="nav-link" href="#">RMA</a>
  278. </li>
  279. <li class="nav-item">
  280. <a class="nav-link" href="#">故障紀錄</a>
  281. </li>
  282. <li class="nav-item">
  283. <a class="nav-link" href="#">求助</a>
  284. </li>
  285. <li class="li-block"></li>
  286. <li class="nav-item">
  287. <a class="nav-link" href="#"><i class="fa fa-user-o"></i> {{params.username}}</a>
  288. </li>
  289. <li class="nav-item">
  290. <a class="nav-link" href="/logout">Logout</a>
  291. </li>
  292. </ul>
  293. </div>
  294. </nav>
  295. </nav>
  296. <div class="main-page">
  297. <form id="register_form" method="post" action="/register_number" enctype="multipart/form-data">
  298. <div class="container">
  299. <div class="row">
  300. <div class="col flex" style="margin: auto; ">
  301. <div class="col-12" style="margin-top:30px;">
  302. <h1>Step1:</h1>
  303. </div>
  304. <div class="col-2"></div>
  305. <div class="col-10">
  306. <label style="color:black;font-size:20px;">Please choose one of the following two/下列兩項請擇一選擇</label>
  307. </div>
  308. <div class="col-2"></div>
  309. <div class="col-10">
  310. <label style="color:black;font-size:20px;">1. Please enter your location/請輸入案場地址:</label>
  311. <input type="text" name="location" style="width:300px;">
  312. </div>
  313. <div class="col-2"></div>
  314. <div class="col-10">
  315. <label style="color:black;font-size:20px;">2. Please select farm image/或請選擇農場圖片</label>
  316. </div>
  317. <div class="col-3"></div>
  318. <div class="col-9">
  319. <input type="file" style="margin:10px 150px 50px 80px;width:40%;color:white;background-color:red;" name="filename" id="filename" onchange="readURL(this);" accept="image/gif, image/jpeg, image/png">
  320. </div>
  321. <div class="col-12" style="background-color:black;height:2px;margin-bottom:20px;"></div>
  322. <div class="col-12" style="margin-top:30px;">
  323. <h1>Step2:</h1>
  324. </div>
  325. <div class="col-2"></div>
  326. <div class="col-10">
  327. <label style="color:black;font-size:20px;">Please check your order list/請確認您的購買清單</label>
  328. </div>
  329. <div class="col-2"></div>
  330. <div class="col-10">
  331. <label style="color:black;font-size:20px;">Please enter serial number and paste the sticker/輸入相對應的序號並貼上貼紙</label>
  332. </div>
  333. <div id="order-list" class="col-12 row"></div>
  334. <div class="col-12" style="background-color:black;height:2px;margin-bottom:20px;margin-top:50px;"></div>
  335. <div id="loading" class="col-12" style="color:red;display:none;text-align:center;">
  336. <h1>載入中,請稍後...</h1>
  337. <!--<img src="../static/img/loading.gif" style="height:200px;width:200px;">-->
  338. </div>
  339. <div class="col-xs-2 col-xs-offset-2">
  340. <input type="reset" class="btn btn-secondary" style="margin:0 20px;font-weight:bold;" data-dismiss="modal" value="Reset/重設">
  341. </div>
  342. <div class="col-xs-2 col-xs-offset-3">
  343. <input type="submit" class="btn btn-success" style="margin:0 20px;font-weight:bold;color:black;" data-toggle="modal" data-target="#123" value="Save changes/設定完成">
  344. </div>
  345. <div class="col-12" style="height:70px;"></div>
  346. </div>
  347. </div>
  348. </div>
  349. </form>
  350. </div>
  351. </body>
  352. </html>