From 23c8d096b12843c705bca2da4c9bc25b2739406b Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Wed, 23 Feb 2022 11:56:41 +0800
Subject: [PATCH] +安卓任务处理逻辑
---
pages/grabOrders/feedback.vue | 2 +-
pages/grabOrders/map.vue | 37 +++++++++++++++++++++++++++++--------
App.vue | 12 +++++++++++-
3 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/App.vue b/App.vue
index 4a87d6b..38daff1 100644
--- a/App.vue
+++ b/App.vue
@@ -34,7 +34,7 @@
},
watch: {
socketValue() {
- // console.log(this.socketValue);
+ console.log(this.socketValue);
let that = this;
if (that.socketValue.type === "start") {
// console.log("任务开启vuevueveu")
@@ -47,6 +47,7 @@
// },
// success(res) {
// let vals = res.data.data.records[0];
+ let types = uni.getSystemInfoSync().platform;
let that = this,
d = {
serid: uni.getStorageSync("ids") || that.$store.state.puserID,
@@ -72,6 +73,12 @@
appenUrl: that.$store.state.piAPI,
isOn: true
});
+ if(types == "android"){
+ uni.navigateTo({
+ url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
+ });
+ return
+ }
uni.redirectTo({
url: "/pages/grabOrders/map?data=" + JSON.stringify(val),
});
@@ -85,6 +92,9 @@
} else if (that.socketValue.type === "stop") {
// console.log("任务结束vuevueveu")
// this.$store.commit("stopTask", this.socketValue.rid);
+ // uni.reLaunch({
+ // url: "/pages/home/home"
+ // });
}
}
},
diff --git a/pages/grabOrders/feedback.vue b/pages/grabOrders/feedback.vue
index 83d7952..202ccd3 100644
--- a/pages/grabOrders/feedback.vue
+++ b/pages/grabOrders/feedback.vue
@@ -139,7 +139,7 @@
var time = setTimeout(() => {
clearTimeout(time);
time = null;
- uni.redirectTo({
+ uni.reLaunch({
url: './grabOrders?from="feedback"'
});
}, 1000)
diff --git a/pages/grabOrders/map.vue b/pages/grabOrders/map.vue
index af3e2f2..a7fd69f 100644
--- a/pages/grabOrders/map.vue
+++ b/pages/grabOrders/map.vue
@@ -128,6 +128,7 @@
backgroundColor: "#FFF",
},
bye: true,
+ types: '',//android?
}
},
methods: {
@@ -456,8 +457,22 @@
mypolylinesCom() {
return this.mypolylines.slice(0);
},
+ socketValue() {
+ return this.$store.state.socketValue;
+ }
},
watch: {
+ socketValue() {
+ console.log(this.socketValue)
+ if (this.socketValue.type === "stop") {
+ // console.log("任务结束vuevueveu")
+ // this.$store.commit("stopTask", this.socketValue.rid);
+ this.bye = true;
+ uni.redirectTo({
+ url: "/pages/grabOrders/grabOrders"
+ });
+ }
+ },
isOnTaskValue: {
handler(newName, oldName) {
// console.log("map", this.isOnTaskValue);
@@ -476,6 +491,10 @@
onReady() {
let that = this;
+ this.types = uni.getSystemInfoSync().platform;
+ // if (type == "android") {
+ // this.useHeight = "calc(100vh - 40px)";
+ // }
// window['hBackMsg'] = (val) => {
// // console.log(val)
// let d = {
@@ -741,14 +760,16 @@
longitude: +ins[0]
})
}
- this.mypolylines[0] = { //指定一系列坐标点,从数组第一项连线至最后一项
- points: ourline,
- color: "#FE0000", //线的颜色
- width: 4, //线的宽度
- dottedLine: false, //是否虚线
- arrowLine: false, //带箭头的线 开发者工具暂不支持该属性
- }
- console.log(this.mypolylines)
+ setTimeout(() => {
+ this.mypolylines[0] = { //指定一系列坐标点,从数组第一项连线至最后一项
+ points: ourline,
+ color: "#FE0000", //线的颜色
+ width: 4, //线的宽度
+ dottedLine: false, //是否虚线
+ arrowLine: false, //带箭头的线 开发者工具暂不支持该属性
+ }
+ console.log(this.mypolylines)
+ }, 1000)
this.showWindow();
// this.getLocationInfo(data);
if (data.butCT == "beginUp" && data.buttype == 0) {
--
Gitblit v1.9.3