From 6fcfc6ac30b67bcf081e5739364623ece7482909 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 22 Feb 2022 10:50:52 +0800
Subject: [PATCH] +地图功能流程完善

---
 App.vue |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/App.vue b/App.vue
index 5265f06..cb154b8 100644
--- a/App.vue
+++ b/App.vue
@@ -37,16 +37,61 @@
 				// console.log(this.socketValue);
 				let that = this;
 				if (that.socketValue.type === "start") {
-					// console.log("任务开启")
-					this.$store.commit("addTask", this.socketValue.rid);
+					// console.log("任务开启vuevueveu")
+					// this.$store.commit("addTask", this.socketValue.rid);
+					// uni.request({
+					// 	url: this.$store.state.piAPI + "taskqd/selectLi?id=" + this.socketValue.rid,
+					// 	method: "get",
+					// 	header: {
+					// 		"content-type": "application/x-www-form-urlencoded",
+					// 	},
+					// 	success(res) {
+					// let vals = res.data.data.records[0];
+					let that = this,
+						d = {
+							serid: uni.getStorageSync("ids") || that.$store.state.puserID,
+							type: 0,
+						};
+					uni.request({
+						url: this.$store.state.piAPI + "taskqd/selectLi",
+						method: "POST",
+						data: d,
+						header: {
+							"content-type": "application/x-www-form-urlencoded",
+						},
+						success(res) {
+							const data = res.data.data;
+							for (let k in data) {
+								if (data[k].id == that.socketValue.rid) {
+									let val = JSON.stringify({
+										...data[k],
+										butCT: "begin",
+										buttype: 0,
+										myid: d.serid,
+										appenUrl: that.$store.state.piAPI,
+										isOn: true
+									});
+									uni.navigateTo({
+										url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
+									});
+								} else {
+									continue;
+								}
+							}
+						},
+					});
+
 				} else if (that.socketValue.type === "stop") {
-					// console.log("任务结束")
-					this.$store.commit("stopTask", this.socketValue.rid);
+					// console.log("任务结束vuevueveu")
+					// this.$store.commit("stopTask", this.socketValue.rid);
 				}
 			}
 		},
 		mounted() {
-			this.$store.dispatch("connectws");
+			// console.log("登入状态", this.$store.state.loging)
+			// if (this.$store.state.loging) {
+			// 	this.$store.dispatch("connectws");
+			// }
 		},
 		onLaunch: function() { //初始化完成时触发(全局只触发一次)
 			console.log('第一次进入')

--
Gitblit v1.9.3