From 73abcdf65086094ac2dac23c0ca86a0e9c747706 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 23 Feb 2022 16:25:36 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/qfqk-android

---
 pages/grabOrders/feedback.vue   |   16 ++++-
 pages/grabOrders/grabOrders.vue |   15 +++++
 manifest.json                   |   22 +++++-
 pages/grabOrders/map.vue        |   99 +++++++++++++++++++-------------
 store/websocket.js              |   10 ++
 5 files changed, 111 insertions(+), 51 deletions(-)

diff --git a/manifest.json b/manifest.json
index 1808e40..b19bbdf 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,6 +1,6 @@
 {
     "name" : "洪城义警",
-    "appid" : "__UNI__C5320D4",
+    "appid" : "__UNI__1A57486",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -23,7 +23,8 @@
         "modules" : {
             "VideoPlayer" : {},
             "LivePusher" : {},
-            "Geolocation" : {}
+            "Geolocation" : {},
+            "Maps" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -32,6 +33,10 @@
                 "permissions" : [
                     "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_MOCK_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.CAMERA\"/>",
@@ -54,10 +59,17 @@
             /* SDK配置 */
             "sdkConfigs" : {
                 "ad" : {},
-                "maps" : {},
+                "maps" : {
+                    "amap" : {
+                        "appkey_ios" : "143663af7c571b4d89fa1ec34506ca02",
+                        "appkey_android" : "143663af7c571b4d89fa1ec34506ca02"
+                    }
+                },
                 "geolocation" : {
-                    "system" : {
-                        "__platform__" : [ "ios", "android" ]
+                    "amap" : {
+                        "__platform__" : [ "android" ],
+                        "appkey_ios" : "143663af7c571b4d89fa1ec34506ca02",
+                        "appkey_android" : "143663af7c571b4d89fa1ec34506ca02"
                     }
                 }
             },
diff --git a/pages/grabOrders/feedback.vue b/pages/grabOrders/feedback.vue
index 83d7952..916f6f4 100644
--- a/pages/grabOrders/feedback.vue
+++ b/pages/grabOrders/feedback.vue
@@ -43,7 +43,7 @@
 			</view>
 			<view class="butb">
 				<!-- custom-style -->
-				<u-button class="submits" type="primary" @click="upData">我反馈</u-button>
+				<button class="submits" type="primary" @click="upData">我反馈</button>
 			</view>
 		</view>
 	</view>
@@ -63,6 +63,14 @@
 				videos: [],
 				data: {}
 			}
+		},
+		onBackPress(e) {
+			console.log("监听返回按钮事件1", e);
+			uni.redirectTo({
+				url: "/pages/grabOrders/grabOrders"
+			})
+			// 此处一定姚要return为true,否则页面不会返回到指定路径
+			return true;
 		},
 		methods: {
 			onLoad: function(option) {
@@ -87,7 +95,7 @@
 					//TODO handle the exception
 				}
 				// console.log(b);
-				console.log(b,"bbbbbbbb")
+				console.log(b, "bbbbbbbb")
 				this.data = b;
 			},
 			upData() {
@@ -378,7 +386,7 @@
 		// line-height: 86rpx;
 		box-sizing: border-box;
 		border-radius: 15rpx;
-		background-color: #103289;
+		background-color: #103289 !important;
 		color: #ffffff;
 
 		&::after {
@@ -397,7 +405,7 @@
 			color: #ffffff;
 		}
 	}
-	
+
 	// .main{
 	// 	border: 1px solid transparent;
 	// }
diff --git a/pages/grabOrders/grabOrders.vue b/pages/grabOrders/grabOrders.vue
index 48fddcc..6e47d83 100644
--- a/pages/grabOrders/grabOrders.vue
+++ b/pages/grabOrders/grabOrders.vue
@@ -62,6 +62,14 @@
 				useHeight: "100%",
 			};
 		},
+		onBackPress(e) {
+			console.log("监听返回按钮事件2", e);
+			uni.switchTab({
+				url: "/pages/home/home"
+			})
+			// 此处一定姚要return为true,否则页面不会返回到指定路径
+			return true;
+		},
 		watch: {
 			current() {
 				// console.log(this.current)
@@ -93,6 +101,10 @@
 			} else {
 				this.current = 1;
 				this.swiperCurrent = 1;
+			}
+			if (options.in) {
+				this.current = 0;
+				this.swiperCurrent = 0;
 			}
 			this.getGrabOrders(this.current);
 
@@ -302,6 +314,9 @@
 							that: that,
 							fn: () => {
 								that.getGrabOrders(that.current); //重获取数据
+								// setTimeout(() => {
+								// 	that.openOnce(item);
+								// }, 500)
 							}
 						}
 						that.$store.commit('useWebScoketApi', d);
diff --git a/pages/grabOrders/map.vue b/pages/grabOrders/map.vue
index a7fd69f..8dc5174 100644
--- a/pages/grabOrders/map.vue
+++ b/pages/grabOrders/map.vue
@@ -128,7 +128,7 @@
 					backgroundColor: "#FFF",
 				},
 				bye: true,
-				types: '',//android?
+				types: '', //android?
 			}
 		},
 		methods: {
@@ -174,24 +174,29 @@
 								// url: "http://2
 								// myid:111
 								//myName:222
-								that.ourData.rtype = 2;
-								that.ourData.type = 2;
-								that.ourData.buttype = 0;
-								that.ourData.butCT = "begin";
-								if (that.ourData.num == 0) {
-									that.ourData.iscation = "1";
-									that.ourData.serid += that.ourData.myid + ',';
-									that.ourData.captain = that.ourData.myName;
-								} else {
-									that.ourData.iscation = "0";
-									that.ourData.serid += that.ourData.myid + ',';
-									that.ourData.team += ',' + that.ourData.myid;
-								}
-								that.ourData.butCT = "begin";
+								// that.ourData.rtype = 2;
+								// that.ourData.type = 2;
+								// that.ourData.buttype = 0;
+								// that.ourData.butCT = "begin";
+								// if (that.ourData.num == 0) {
+								// 	that.ourData.iscation = "1";
+								// 	that.ourData.serid += that.ourData.myid + ',';
+								// 	that.ourData.captain = that.ourData.myName;
+								// } else {
+								// 	that.ourData.iscation = "0";
+								// 	that.ourData.serid += that.ourData.myid + ',';
+								// 	that.ourData.team += ',' + that.ourData.myid;
+								// }
+								// that.ourData.butCT = "begin";
 								uni.showToast({
 									title: res.data.msg,
 									duration: 2000,
 								});
+								setTimeout(function() {
+									uni.redirectTo({
+										url: "/pages/grabOrders/grabOrders?in=true"
+									})
+								}, 2200)
 							}
 						},
 						complete() {
@@ -238,22 +243,36 @@
 							type = 'start',
 							url = that.$store.state.piAPI + "taskqd/startTask?" +
 							`rid=${rid}&serid=${serid}&type=${type}`;
-						uni.request({
-							url: url,
-							method: "get",
-							// header: {
-							// 	"content-type": "application/json",
-							// },
-							success(res) {
-								// that.timeBegin(1);
-								// that.ourData.butCT = "beginUp";
-								// that.ourData.rtype = '0';
-								// that.ourData.type = "0";
-							},
-							complete() {
-								that.showIn = false;
+						// uni.request({
+						// 	url: url,
+						// 	method: "get",
+						// 	// header: {
+						// 	// 	"content-type": "application/json",
+						// 	// },
+						// 	success(res) {
+						// 		// that.timeBegin(1);
+						// 		// that.ourData.butCT = "beginUp";
+						// 		// that.ourData.rtype = '0';
+						// 		// that.ourData.type = "0";
+						// 	},
+						// 	complete() {
+						// 		that.showIn = false;
+						// 	}
+						// })
+						let d = {
+							rid:rid,
+							serid: serid,
+							type: type,
+							// data: JSON.stringify(item),
+							that: that,
+							fn: () => {
+								that.getGrabOrders(that.current); //重获取数据
+								// setTimeout(() => {
+								// 	that.openOnce(item);
+								// }, 500)
 							}
-						})
+						}
+						that.$store.commit('useWebScoketApi', d);
 						// axios.get(url).then((res) => {
 						// 	// console.log(res);
 
@@ -760,16 +779,16 @@
 					longitude: +ins[0]
 				})
 			}
-			setTimeout(() => {
-				this.mypolylines[0] = { //指定一系列坐标点,从数组第一项连线至最后一项
-					points: ourline,
-					color: "#FE0000", //线的颜色
-					width: 4, //线的宽度
-					dottedLine: false, //是否虚线
-					arrowLine: false, //带箭头的线 开发者工具暂不支持该属性
-				}
-				console.log(this.mypolylines)
-			}, 1000)
+			// setTimeout(() => {
+			this.mypolylines[0] = { //指定一系列坐标点,从数组第一项连线至最后一项
+				points: ourline,
+				color: "#FE0000", //线的颜色
+				width: 10, //线的宽度
+				dottedLine: false, //是否虚线
+				arrowLine: false, //带箭头的线 开发者工具暂不支持该属性
+			}
+			console.log(this.mypolylines)
+			// }, 1000)
 			this.showWindow();
 			// this.getLocationInfo(data);
 			if (data.butCT == "beginUp" && data.buttype == 0) {
diff --git a/store/websocket.js b/store/websocket.js
index e868231..3045f61 100644
--- a/store/websocket.js
+++ b/store/websocket.js
@@ -79,6 +79,10 @@
 						serid: uni.getStorageSync("ids") || $store.state.puserID,
 						type: 0,
 					};
+				let routes = getCurrentPages(); //获取当前页面栈
+				let curRoute = routes[routes.length - 1].route; //获取当前页面的路由
+				// console.log(curRoute)
+				// return
 				uni.request({
 					url: $store.state.piAPI + "taskqd/selectLi",
 					method: "POST",
@@ -101,9 +105,11 @@
 									isOn: true
 								});
 								console.log(val)
-								if (types == "android") {
+
+								if (types == "android", curRoute != "pages/grabOrders/map") {
 									uni.navigateTo({
-										url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
+										url: "/pages/grabOrders/map?data=" + JSON.stringify(
+											val),
 									});
 									return
 								}

--
Gitblit v1.9.3