Ver Fonte

添加按钮排序;打包胜代版西曼克

wcs há 5 anos atrás
pai
commit
356485765e
7 ficheiros alterados com 72 adições e 85 exclusões
  1. 63 75
      index.html
  2. 8 9
      manifest.json
  3. 0 0
      maps/1/map.json
  4. BIN
      maps/1/map.png
  5. BIN
      releases/agv-summoner.apk
  6. BIN
      releases/胜代-西曼克.apk
  7. 1 1
      settings.html

+ 63 - 75
index.html

@@ -54,57 +54,59 @@
 				<div class="mui-row">
 					<div class="mui-col mui-col-xs-12">
 						<span id="agvstatus" style="position: fixed;">·</span>
-						<div id="title" style="text-align: center;padding-bottom: 5px;background: url(img/title_bg.png) no-repeat 0 7px;background-size:100%;">
+						<div id="title" style="text-align: center;padding-bottom: 2px;background: url(img/title_bg.png) no-repeat 0 7px;background-size:100%;">
 							<a style="color: #FFFFFF;font-size: 20px;">华力西曼克</a>
 						</div>
 					</div>
-					<div class="mui-col mui-col-xs-12" style="height: 245px;text-align: center;background: url(img/top_bg.png) no-repeat 0 0;background-size:100%;">
-						<div class="mui-col mui-col-xs-12" style="padding-top: 10px;height: 30px;">
-							<div style=" width: 50%;float: left;">
-								<img id="speed" src="" style="margin-left: -80px;width: 13%;">
-							</div>
-							<div style=" width: 50%;float: left;">
-								<img id="battery" src="img/battery-100.png" style="margin-right: -80px;width: 23%;">
-							</div>
-						</div>
-						<div class="mui-col mui-col-xs-12">
-							<div id="tgts" 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 class="mui-col mui-col-xs-12" id="btt" style="min-height:480px;overflow-y:auto;max-height:480px">
+						<div class="mui-col mui-col-xs-12" style="height: 235px;text-align: center;background: url(img/top_bg2.png) no-repeat 0 0;background-size:100%;">
+							<div class="mui-col mui-col-xs-12" style="padding-top: 10px;height: 30px;">
+								<div style=" width: 50%;float: left;">
+									<img id="speed" src="" style="margin-left: -80px;width: 13%;">
 								</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: -35px;">
-									<a id="tgtstation" style="color: #FFFFFF;font-size: 50px;"></a><br>
+								<div style=" width: 50%;float: left;">
+									<img id="battery" src="img/battery-100.png" style="margin-right: -80px;width: 23%;">
 								</div>
 							</div>
-							<div id="jack" 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 class="mui-col mui-col-xs-12" style="margin-top: -5px;">
+								<div id="tgts" 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: -35px;">
+										<a id="tgtstation" style="color: #FFFFFF;font-size: 50px;"></a><br>
+									</div>
 								</div>
-								<div style="margin-left: 50px;margin-top: -53px;">
-									<img id="liftstatus" src="img/liftstatus.png" width="60%">
+								<div id="jack" 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: 50px;margin-top: -53px;">
+										<img id="liftstatus" src="img/liftstatus.png" width="60%">
+									</div>
 								</div>
 							</div>
+							<div class="mui-col mui-col-xs-12" style="height: 40px;padding-left: 15px;margin-top: -5px;">
+								<div id="stop" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">停止</div>
+								<div id="run" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
+								<div id="warning" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
+							</div>
+							<div class="mui-col mui-col-xs-12">
+								<div id="info" style="width: 89%;height: 35px;margin-left: 19px;color:#fff;font-size:15px;line-height: 30px;background-color: #0b6d78;border-radius: 3px;text-align: center;padding-left: 5px;"></div>
+							</div>
 						</div>
-						<div class="mui-col mui-col-xs-12" style="height: 40px;padding-left: 15px;">
-							<div id="stop" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">停止</div>
-							<div id="run" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
-							<div id="warning" style="width: 30%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
-						</div>
-						<div class="mui-col mui-col-xs-12">
-							<div id="info" style="width: 89%;height: 35px;margin-left: 19px;color:#fff;font-size:15px;line-height: 30px;background-color: #0b6d78;border-radius: 3px;text-align: center;padding-left: 5px;"></div>
+						<div class="mui-col mui-col-xs-12" style="margin-top: -5px;">
+							<div id="btlist" style="padding-left: 15px;height:190px">
 						</div>
 					</div>
-					<div class="mui-col mui-col-xs-12" style="background: url(img/btlist6_bg.png) no-repeat 10px 0;margin-top: 5px;">
-						<div id="btlist" style="padding:5px 0 0 15px;min-height:190px;overflow-y:auto;max-height:190px">
-						</div>
 					</div>
-					<div class="mui-col mui-col-xs-12" style="text-align: center;margin: 22px 0 0 0;">
+					<div class="mui-col mui-col-xs-12" style="text-align:center;margin-top: 10px;">
 						<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>
@@ -115,9 +117,6 @@
 							<button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="cancel" style="border:1px solid #4a5a6a;">取消</button>
 						</div>
 					</div>
-					<div class="mui-col mui-col-xs-12" style="padding: 0;border-bottom:0px solid #525663;">
-						<div style="height: 25px;background: url(img/bottom_bg.png) no-repeat 0 10px;"></div>
-					</div>
 				</div>
 			</div>
 		</div>
@@ -146,7 +145,6 @@
 			} else {
 				mapid = localStorage.getItem("mapid")
 			}
-			//IDARR = localStorage.getItem(mapid+agvid+"_id_arr");
 			//获取按钮
 			createList();
 			//获取状态
@@ -183,21 +181,6 @@
 					return
 				}
 			});
-			//设置拖拽排序
-			// Sortable.create(document.getElementById('btlist'), {
-			// 	animation: 150, //动画参数
-			// 	// dropBubble:true,
-			// 	onUpdate: function(evt){ //拖拽完毕之后发生该事件
-			// 		var id_arr=[]
-			// 		for(var i=0, len=evt.from.children.length; i<len; i++){
-			// 			id_arr+=','+ evt.from.children[i].getAttribute('drag-id');
-			// 		}
-			// 		id_arr=id_arr.substr(1);
-			// 		//然后请求后台ajax 这样就完成了拖拽排序
-			// 		id_arr = id_arr.split(','); //["1", "4", "3", "2", "1", "11", "12"]
-			// 		localStorage.setItem(mapid+agvid+'_id_arr',JSON.stringify(id_arr));
-			// 	}
-			// });	
 		})
 		//按钮点击事件
 		function onSelectStation(evt) {
@@ -291,39 +274,44 @@
 		//填充按钮列表
 		function createList() {
 			$.get(url + "/map/getStations/" + mapid, function(data) {
+				IDARR = localStorage.getItem(mapid+agvid+"ARR");
 				trs = "";
-				var IDARR = ["100","101","102","103","104","105","106","107"]
-				if(IDARR == "" ||IDARR == null){
+				if(IDARR == "" ||IDARR == undefined){
+					ARRS = [];
 					for (i in data) {
 						if (data[i].Name != "" && data[i].Name != "rect") {
 							var ids = data[i].Id - (agvid * 100)
-							trs += '<div class="mui-col mui-col-xs-3" drag-id="'+data[i].Id+'">' +
-								'<button type="button" class="mui-btn mui-btn-royal mui-btn-block" name="stbtn" id="' + ids +
-								'" value="' + ids + '">' +
-								data[i].Name + '</button></div>'
+							ARRS.push(parseInt(data[i].Id));
+								trs += '<div class="mui-col mui-col-xs-3" drag-id="'+ids+'">' +
+									'<button type="button" class="mui-btn mui-btn-royal mui-btn-block" name="stbtn" id="' + ids +
+									'" value="' + ids + '">' +
+									data[i].Name + '</button></div>'
 						}
 					}
-				}else{
-					//id_arr = JSON.parse(IDARR);//["4","5","2","999","7","1","6","8","3"]
-					id_arr = IDARR;
-					for(x in id_arr){
+					ARR = ARRS.join(",");
+					localStorage.setItem(mapid + agvid + 'ARR', ARR);
+				} else {
+					arr = IDARR.split(",");// 在每个逗号(,)处进行分解。
+					var id_arr = arr.sort(function(a, b){return a - b});//按从小到大排序
+					for (x in id_arr) {
 						for (i in data) {
-							if((data[i].Id == id_arr[x]) && (data[i].Name !="") && (data[i].Name != "rect")){
+							if((data[i].Name != "") && data[i].Name != "rect"){
 								var ids = data[i].Id - (agvid * 100)
-								trs += '<div class="mui-col mui-col-xs-3" drag-id="'+data[i].Id+'">' +
-									'<button type="button" class="mui-btn mui-btn-royal mui-btn-block" name="stbtn" id="' + ids +
-									'" value="' + ids + '">' +
-									data[i].Name + '</button></div>'
+								if ((data[i].Id == id_arr[x])) {
+									trs += '<div class="mui-col mui-col-xs-3" drag-id="'+ids+'">' +
+										'<button type="button" class="mui-btn mui-btn-royal mui-btn-block" name="stbtn" id="' + ids +
+										'" value="' + ids + '">' +
+										data[i].Name + '</button></div>'
+								}
 							}
 						}
 					}
 				}
 				$btlist.append(trs);
 				//注册按钮点击事件click touchstart
-				$("button[name]").on("click", onSelectStation);
+				$("button[name]").on("touchstart", onSelectStation);
 			});
 		}
-
 		//新建ws连接,获取agv的状态
 		let ws;
 		function startLog() {
@@ -471,7 +459,7 @@
 						$("#info").text("前磁导脱线");
 					}
 					if (v == 32) {
-						$("#info").text("磁导脱线");
+						$("#info").text("磁导脱线");
 					}
 					if (v == 33) {
 						$("#info").text("左磁导脱线");

+ 8 - 9
manifest.json

@@ -1,12 +1,12 @@
 {
     "@platforms" : [ "android", "iPhone", "iPad" ],
-    "id" : "H5052C011", /*应用的标识*/
-    "name" : "agv-summoner", /*应用名称,程序桌面图标名称*/
+    "id" : "H500C32F5", /*应用的标识*/
+    "name" : "西曼克", /*应用名称,程序桌面图标名称*/
     "version" : {
-        "name" : "1.1", /*应用版本名称*/
+        "name" : "1.0", /*应用版本名称*/
         "code" : ""
     },
-    "description" : "网络版、服务器版合二为一,切换方便。", /*应用描述信息*/
+    "description" : "西曼克AGV手机控制终端。", /*应用描述信息*/
     "icons" : {
         "72" : "icon.png"
     },
@@ -105,7 +105,8 @@
                 "password" : "", /*iOS应用打包个人证书导入密码*/
                 "p12" : "", /*iOS应用打包个人证书,打包配置文件关联的个人证书*/
                 "devices" : "universal", /*iOS应用支持的设备类型,可取值iphone/ipad/universal*/
-                "frameworks" : [] /*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/
+                "frameworks" : [], /*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/
+                "idfa" : false
             },
             "google" : {
                 "packagename" : "", /*Android应用包名,如io.dcloud.HelloH5*/
@@ -119,8 +120,6 @@
                     "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
                     "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
@@ -129,7 +128,6 @@
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
@@ -230,5 +228,6 @@
         },
         "screenOrientation" : [ "portrait-primary" ]
     },
-    "fullscreen" : true
+    "fullscreen" : true,
+    "screenOrientation" : [ "portrait-primary" ]
 }

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
maps/1/map.json


BIN
maps/1/map.png


BIN
releases/agv-summoner.apk


BIN
releases/胜代-西曼克.apk


+ 1 - 1
settings.html

@@ -198,7 +198,7 @@
 					</div>
 					<div class="mui-button-row">
 						<button id="update" type="button" class="mui-btn mui-btn-success">应用更新</button>&nbsp;&nbsp;
-						<button id="default" type="button" class="mui-btn mui-btn-default">默认</button>&nbsp;&nbsp;
+						<button id="default" type="button" class="mui-btn mui-btn-default">默认</button>&nbsp;&nbsp;
 						<button id="confirm" type="button" class="mui-btn mui-btn-primary">确认</button>&nbsp;&nbsp;
 						<button id="cancel" type="button" class="mui-btn mui-btn-danger">取消</button>
 					</div>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff