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] +地图功能流程完善
---
store/lid/getPositionlid.js | 65 +++++
leafletMapOur/grabOrdersMap/js/vueMain.js | 123 ++++++++--
store/lid/geolocation.min.js | 99 +++++++++
store/positions.js | 17
pages/grabOrders/grabOrders.vue | 5
leafletMapOur/grabOrdersMap/js/getPosition.js | 147 +++++++++---
manifest.json | 10
pages/grabOrders/inPage/page0.vue | 19 +
store/lid/getPosition.js | 72 ++++++
store/websocket.js | 4
App.vue | 55 ++++
store/lid/websocketL.js | 6
12 files changed, 532 insertions(+), 90 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('第一次进入')
diff --git a/leafletMapOur/grabOrdersMap/js/getPosition.js b/leafletMapOur/grabOrdersMap/js/getPosition.js
index 7a4ac09..8746a6a 100644
--- a/leafletMapOur/grabOrdersMap/js/getPosition.js
+++ b/leafletMapOur/grabOrdersMap/js/getPosition.js
@@ -1,3 +1,4 @@
+
class $getPositions {
constructor(arg) {
this.id = arg.id || 0; //任务id
@@ -77,7 +78,7 @@
}
}
})
- }, 30000)
+ }, 3000)
}
overContinued() {
@@ -115,50 +116,114 @@
}
};
outit();
- let success = function(position) {
- // console.log(position);
- var lat = position.coords.longitude;//经度
- var lon = position.coords.latitude;//纬度
- // console.log("成功返回经纬度信息");
- // console.log(lon, lat, "成功");
- that.onceNowPosition = [lat, lon];
+ //qq定位
+ var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
+ var options = {
+ // timeout: 1000
+ };
+
+ function showPosition(position) {
+ let lat = position.lat; //
+ let lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
+ that.onceNowPosition = [lng, lat];
+ // console.log(that.onceNowPosition)
+ that.state = false;
+ ok = true;
+ outit();
+ }
+
+ function showErr(data) {
+ console.log(data)
+ that.onceNowPosition = data;
that.state = false;
ok = true;
outit();
};
- let error = function(error) {
- // console.log(error, "失败");
- let msg = "none";
- switch (error.code) {
- case error.PERMISSION_DENIED:
- msg = "User denied the request for Geolocation.";
- break;
- case error.POSITION_UNAVAILABLE:
- msg = "Location information is unavailable.";
- break;
- case error.TIMEOUT:
- msg = "The request to get user location timed out.";
- break;
- case error.UNKNOWN_ERROR:
- msg = "An unknown error occurred.";
- break;
- }
- that.onceNowPosition = msg;
- that.state = false;
- ok = false;
- outit();
- };
- let options = {
- enableHighAccuracy: true,
- // timeout: 5000,
- timeout: Infinity,
- maximumAge: 0,
- };
- this.getOnceSPosition = navigator.geolocation.getCurrentPosition(
- success,
- error,
- options
- );
+ geolocation.getLocation(showPosition, showErr, options);
+ // 高德定位
+ // console.log(AMap)
+ // AMap.plugin("AMap.Geolocation", function() {
+ // var geolocation = new AMap.Geolocation({
+ // // 是否使用高精度定位,默认:true
+ // enableHighAccuracy: true,
+ // // 设置定位超时时间,默认:无穷大
+ // timeout: 10000,
+ // // 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
+ // // buttonOffset: new AMap.Pixel(10, 20),
+ // // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
+ // // zoomToAccuracy: true,
+ // // 定位按钮的排放位置, RB表示右下
+ // // buttonPosition: "RB",
+ // });
+ // geolocation.getCurrentPosition();
+ // AMap.event.addListener(geolocation, "complete", onComplete);
+ // AMap.event.addListener(geolocation, "error", onError);
+
+ // function onComplete(data) {
+ // // data是具体的定位信息
+ // console.log(data);
+ // var lat = data.position.lat;
+ // var lon = data.position.lng;
+ // that.onceNowPosition = [lat, lon];
+ // that.state = false;
+ // ok = true;
+ // outit();
+ // }
+
+ // function onError(data) {
+ // // 定位出错
+ // console.log(data);
+ // that.onceNowPosition = data.message;
+ // that.state = false;
+ // ok = false;
+ // outit();
+ // }
+ // });
+ // return
+ // let success = function(position) {
+ // // console.log(position);
+ // var lat = position.coords.longitude; //经度
+ // var lon = position.coords.latitude; //纬度
+ // // console.log("成功返回经纬度信息");
+ // // console.log(lon, lat, "成功");
+ // that.onceNowPosition = [lat, lon];
+ // that.state = false;
+ // ok = true;
+ // outit();
+ // };
+ // let error = function(error) {
+ // // console.log(error, "失败");
+ // let msg = "none";
+ // switch (error.code) {
+ // case error.PERMISSION_DENIED:
+ // msg = "User denied the request for Geolocation.";
+ // break;
+ // case error.POSITION_UNAVAILABLE:
+ // msg = "Location information is unavailable.";
+ // break;
+ // case error.TIMEOUT:
+ // msg = "The request to get user location timed out.";
+ // break;
+ // case error.UNKNOWN_ERROR:
+ // msg = "An unknown error occurred.";
+ // break;
+ // }
+ // that.onceNowPosition = msg;
+ // that.state = false;
+ // ok = false;
+ // outit();
+ // };
+ // let options = {
+ // enableHighAccuracy: true,
+ // // timeout: 5000,
+ // timeout: Infinity,
+ // maximumAge: 0,
+ // };
+ // this.getOnceSPosition = navigator.geolocation.getCurrentPosition(
+ // success,
+ // error,
+ // options
+ // );
}
//结束获取
outInit() {
diff --git a/leafletMapOur/grabOrdersMap/js/vueMain.js b/leafletMapOur/grabOrdersMap/js/vueMain.js
index 7d797c9..f45a300 100644
--- a/leafletMapOur/grabOrdersMap/js/vueMain.js
+++ b/leafletMapOur/grabOrdersMap/js/vueMain.js
@@ -97,7 +97,10 @@
if (type != 1) {
if (that.data.butCT == "beginUp") {
// 反馈
- uni.navigateTo({
+ if(that.onPosition){
+ that.onPosition.overContinued();
+ }
+ uni.redirectTo({
url: '/pages/grabOrders/feedback?data=' + JSON.stringify(this.data) +
'&other="11111"'
});
@@ -142,6 +145,18 @@
let out = res.intlat;
if (typeof out != "string") {
that.addIcon([out[1], out[0]]);
+ //坐标输出
+ let d = {
+ uid: that.data.myid,
+ rid: rid,
+ jd: out[0],
+ wd: out[1],
+ }
+ // console.log(d)
+ axios.post(that.data.appenUrl + "trar/submit", d)
+ .then(res => {
+ // console.log('res=>', res);
+ })
} else {
console.log("获取定位失败")
}
@@ -193,34 +208,81 @@
},
beginCome() {
var data = {
- appenUrl: "http://192.168.0.108:83/",
- butCT: "begin",
- buttype: 0,
- captain: "我",
- city: "南昌市",
- content: "测试",
- district: "西湖区",
- id: 37,
- integral: "222",
- iscation: "1",
- jnum: 3,
- line: "LINESTRING(115.8995839881188 28.687205773173343,115.89391916267935 28.678966027079593,115.90404718391959 28.673644524394046,115.91211526863638 28.681369286356936)",
- num: 1,
- nums: 0,
- province: "江西省",
- publisher: "管理",
- raddress: null,
- rname: "测试1",
- rtype: "0",
- serid: "1123598821738675201,",
- team: "你,他,它",
- time: "2022-02-18 14:15:52",
- type: "2",
- url: "http://223.82.109.183:2081/zhba/upload/20220218/67f0c8bf3e7b5024c64133691f265072.ico",
- }
+ appenUrl: "http://192.168.0.108:83/",
+ butCT: "begin",
+ buttype: 0,
+ captain: "我",
+ city: "南昌市",
+ content: "测试",
+ district: "西湖区",
+ id: 37,
+ integral: "222",
+ iscation: "1",
+ jnum: 3,
+ line: "LINESTRING(115.8995839881188 28.687205773173343,115.89391916267935 28.678966027079593,115.90404718391959 28.673644524394046,115.91211526863638 28.681369286356936)",
+ num: 1,
+ nums: 0,
+ province: "江西省",
+ publisher: "管理",
+ raddress: null,
+ rname: "测试1",
+ rtype: "0",
+ serid: "1123598821738675201,",
+ team: "你,他,它",
+ time: "2022-02-18 14:15:52",
+ type: "2",
+ url: "http://223.82.109.183:2081/zhba/upload/20220218/67f0c8bf3e7b5024c64133691f265072.ico",
+ },
+ that = this;
//url解码
this.data = this.getQueryVariable('data') || data;
- console.log(this.data)
+ // console.log(this.data)
+ if (typeof this.data == "string") {
+ this.data = JSON.parse(this.data)
+ }
+ // console.log(this.data)
+ if (this.data.isOn) {
+ //队长开启任务
+ let rid = that.data.id;
+ that.onPosition = new $getPositions({
+ id: rid,
+ fn: function(res) {
+ // console.log(res);
+ // state.isOnTaskValue[id] = {
+ // id: id,
+ // intlat: res.intlat
+ // }
+ // state.changes = !state.changes;
+ // console.log(state.isOnTaskValue)
+ // $store.commit("setMsg", {
+ // id: id,
+ // intlat: res.intlat
+ // })
+ let out = res.intlat;
+ if (typeof out != "string") {
+ that.addIcon([out[1], out[0]]);
+ //坐标输出
+ let d = {
+ uid: that.data.myid,
+ rid: rid,
+ jd: out[0],
+ wd: out[1],
+ }
+ // console.log(d)
+ axios.post(that.data.appenUrl + "trar/submit", d)
+ .then(res => {
+ // console.log('res=>', res);
+ })
+ } else {
+ console.log("获取定位失败")
+ }
+ }
+ })
+ that.onPosition.continuedTime();
+ that.data.butCT = "beginUp";
+ that.data.rtype = '0';
+ that.data.type = "0";
+ }
if (typeof this.data.team === "string") {
this.data.team = this.data.team.split(',');
}
@@ -230,6 +292,7 @@
// return
this.map = this.beginMap(this.map, position); //创建并接受map
this.map.invalidateSize(true); //应用地图高度
+ console.log("完成数据")
},
changeDom(data) {
// console.log(data, 'changeDom');
@@ -707,7 +770,11 @@
//map适应任务详情高度
// console.log(document.getElementById("map"))
//因为按钮使用v-if所以在识别高度时候,but还没渲染所以手动添加 56px 不会变
- let UmainHeight = document.getElementById("Umain").clientHeight + 56;
+ console.log("应用数据")
+ let UmainHeight = document.getElementById("Umain").clientHeight;
+ if (this.data.iscation == "1") {
+ UmainHeight += 56;
+ }
let h = document.getElementById("mapVue").clientHeight;
this.checkDomHeight({
domName: "getElementById",
diff --git a/manifest.json b/manifest.json
index ebbaded..1808e40 100644
--- a/manifest.json
+++ b/manifest.json
@@ -22,7 +22,8 @@
/* 模块配置 */
"modules" : {
"VideoPlayer" : {},
- "LivePusher" : {}
+ "LivePusher" : {},
+ "Geolocation" : {}
},
/* 应用发布信息 */
"distribute" : {
@@ -53,7 +54,12 @@
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
- "maps" : {}
+ "maps" : {},
+ "geolocation" : {
+ "system" : {
+ "__platform__" : [ "ios", "android" ]
+ }
+ }
},
"icons" : {
"android" : {
diff --git a/pages/grabOrders/grabOrders.vue b/pages/grabOrders/grabOrders.vue
index 989597d..a23f2cf 100644
--- a/pages/grabOrders/grabOrders.vue
+++ b/pages/grabOrders/grabOrders.vue
@@ -8,8 +8,7 @@
<!-- @animationfinish="animationfinish" -->
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"
:style="{ height: 'calc(' + useHeight + ' - 40px)', width: '100%' }">
- <swiper-item v-for="(item, index) in list" :key="index"
- :style="{ height: useHeight, width: '100%' }">
+ <swiper-item v-for="(item, index) in list" :key="index" :style="{ height: useHeight, width: '100%' }">
<view class="swiper-item">
<scroll-view scroll-y :style="{ height: useHeight, width: '100%' }" @scrolltolower="onreachBottom">
<page0 :listData="leftdata" :swiperCurrent="0" v-if="item.name == '正在进行'" @openOnce="openOnce"
@@ -156,6 +155,7 @@
val["butCT"] = "over";
}
}
+ val["myid"] = uni.getStorageSync("ids") || this.$store.state.puserID;
console.log(val);
// return
uni.navigateTo({
@@ -297,6 +297,7 @@
rid: item.id,
serid: item.serid,
type: "start",
+ // data: JSON.stringify(item),
that: that,
fn: () => {
that.getGrabOrders(that.current); //重获取数据
diff --git a/pages/grabOrders/inPage/page0.vue b/pages/grabOrders/inPage/page0.vue
index 9e5e96b..597afcc 100644
--- a/pages/grabOrders/inPage/page0.vue
+++ b/pages/grabOrders/inPage/page0.vue
@@ -34,6 +34,9 @@
</view>
</view>
<u-divider>没有更多了</u-divider>
+ <view class="">
+ {{res}}
+ </view>
<br />
</view>
</template>
@@ -41,6 +44,22 @@
<script>
export default {
props: ["listData", "swiperCurrent"],
+ data() {
+ return {
+ res: ''
+ }
+ },
+ computed: {
+ changes() {
+ return this.$store.state.changes;
+ }
+ },
+ watch: {
+ changes() {
+ console.log(this.$store.state.isOnTaskValue)
+ this.res = this.$store.state.isOnTaskValue.intlat;
+ }
+ },
methods: {
openOnce(val) {
this.$emit("openOnce", val);
diff --git a/store/lid/geolocation.min.js b/store/lid/geolocation.min.js
new file mode 100644
index 0000000..0d12746
--- /dev/null
+++ b/store/lid/geolocation.min.js
@@ -0,0 +1,99 @@
+// console.log(Window)
+// window["qq"] = window["qq"] || {}, qq.maps = qq.maps || {}, window.soso || (window.soso = qq), soso.maps || (soso.maps =
+// qq
+// .maps), qq.maps.Geolocation = function() {
+// "use strict";
+// var e = [],
+// t = null,
+// o = 0,
+// n = "_geoIframe_" + Math.ceil(1e7 * Math.random()),
+// i = document.createElement("iframe"),
+// r = null,
+// s = null,
+// a = null,
+// c = null,
+// u = function(u, l) {
+// if (!u) return void alert("请输入key!");
+// if (!l) return void alert("请输入referer!");
+// var p = document.getElementById(n);
+// if (!p) {
+// i.setAttribute("id", n), i.setAttribute("allow", "geolocation");
+// var g = "https:";
+// i.setAttribute("src", g + "//apis.map.qq.com/tools/geolocation?key=" + u + "&referer=" + l), i
+// .setAttribute("style", "display: none; width: 100%; height: 30%"), document.body ? document.body
+// .appendChild(i) : document.write(i.outerHTML);
+// var m = this;
+// window.addEventListener("message", function(n) {
+// var i = n.data;
+// if (i && "geolocation" == i.module) {
+// if (clearTimeout(c), e.length > 0) {
+// var u = e.shift();
+// u.sucCb && u.sucCb(i)
+// }
+// o = 2, m.executeNextGeo(), t && t(i)
+// } else {
+// s = (new Date).getTime();
+// var l = s - r;
+// if (l >= a) {
+// if (e.length > 0 && "geo" === e[0].type) {
+// var u = e.shift(),
+// p = {
+// type: "fail",
+// code: 5,
+// message: "The request"
+// };
+// u.errCb && u.errCb(p)
+// }
+// clearTimeout(c), o = -1, m.executeNextGeo()
+// }
+// if (e.length > 0 && "ip" === e[0].type) {
+// var u = e.shift();
+// u.errCb && u.errCb(p)
+// }
+// }
+// }, !1)
+// }
+// };
+// return u.prototype.executeNextGeo = function() {
+// 1 !== o && e.length > 0 && (o = 1, e[0].geoprocess())
+// }, u.prototype.getLocation = function(t, n, i) {
+// if (i && i.timeout) {
+// var r = new RegExp("^[0-9]*$");
+// if (!r.test(i.timeout)) return void alert("timeout 请输入数字")
+// }
+// if (e.length > 10) throw new Error("geolocation queue must be lass than 10");
+// e.push({
+// sucCb: t,
+// errCb: n,
+// option: i,
+// geoprocess: this.getOnceLocation,
+// type: "geo"
+// }), 1 !== o && (o = 1, this.getOnceLocation())
+// }, u.prototype.getOnceLocation = function() {
+// var t = e[0] && e[0].option;
+// r = (new Date).getTime(), a = t && t.timeout ? +t.timeout : 1e4, clearTimeout(c), c = setTimeout(
+// function() {
+// if (e.length > 0) {
+// var t = e.shift();
+// t.errCb && t.errCb()
+// }
+// }, a), document.getElementById(n).contentWindow.postMessage("getLocation", "*")
+// }, u.prototype.getIpLocation = function(t, n) {
+// if (e.length > 10) throw new Error("geolocation queue mast be lass than 10");
+// e.push({
+// sucCb: t,
+// errCb: n,
+// geoprocess: this.getOnceIpLocation,
+// type: "ip"
+// }), 1 !== o && (o = 1, this.getOnceIpLocation())
+// }, u.prototype.getOnceIpLocation = function() {
+// document.getElementById(n).contentWindow.postMessage("getLocation.robust", "*")
+// }, u.prototype.watchPosition = function(e) {
+// t = e, document.getElementById(n).contentWindow.postMessage("watchPosition", "*")
+// }, u.prototype.clearWatch = function() {
+// t = null, document.getElementById(n).contentWindow.postMessage("clearWatch", "*")
+// }, u
+// }();
+
+// var b = 1;
+// export default b;
diff --git a/store/lid/getPosition.js b/store/lid/getPosition.js
index 6fc0442..c4608d9 100644
--- a/store/lid/getPosition.js
+++ b/store/lid/getPosition.js
@@ -1,3 +1,5 @@
+// import a from "./getPositionlid.js"
+// import b from "./geolocation.min.js"
class $getPositions {
constructor(arg) {
this.id = arg.id || 0; //任务id
@@ -77,7 +79,7 @@
}
}
})
- }, 30000)
+ }, 3000)
}
overContinued() {
@@ -115,10 +117,74 @@
}
};
outit();
+ //qq定位
+ // var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
+ // var options = {
+ // // timeout: 1000
+ // };
+
+ // function showPosition(position) {
+ // let lat = position.lat; //
+ // let lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
+ // that.onceNowPosition = [lng, lat];
+ // // console.log(that.onceNowPosition)
+ // that.state = false;
+ // ok = true;
+ // outit();
+ // }
+
+ // function showErr(data) {
+ // console.log(data)
+ // that.onceNowPosition = data;
+ // that.state = false;
+ // ok = true;
+ // outit();
+ // };
+ // geolocation.getLocation(showPosition, showErr, options);
+ // 高德定位
+ // console.log(AMap)
+ // AMap.plugin("AMap.Geolocation", function() {
+ // var geolocation = new AMap.Geolocation({
+ // // 是否使用高精度定位,默认:true
+ // enableHighAccuracy: true,
+ // // 设置定位超时时间,默认:无穷大
+ // timeout: 10000,
+ // // 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
+ // // buttonOffset: new AMap.Pixel(10, 20),
+ // // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
+ // // zoomToAccuracy: true,
+ // // 定位按钮的排放位置, RB表示右下
+ // // buttonPosition: "RB",
+ // });
+ // geolocation.getCurrentPosition();
+ // AMap.event.addListener(geolocation, "complete", onComplete);
+ // AMap.event.addListener(geolocation, "error", onError);
+
+ // function onComplete(data) {
+ // // data是具体的定位信息
+ // console.log(data);
+ // var lat = data.position.lat;
+ // var lon = data.position.lng;
+ // that.onceNowPosition = [lat, lon];
+ // that.state = false;
+ // ok = true;
+ // outit();
+ // }
+
+ // function onError(data) {
+ // // 定位出错
+ // console.log(data);
+ // that.onceNowPosition = data.message;
+ // that.state = false;
+ // ok = false;
+ // outit();
+ // }
+ // });
+ // return
let success = function(position) {
// console.log(position);
- var lat = position.coords.longitude;//经度
- var lon = position.coords.latitude;//纬度
+ var lat = position.coords.longitude; //经度
+ var lon = position.coords.latitude; //纬度
// console.log("成功返回经纬度信息");
// console.log(lon, lat, "成功");
that.onceNowPosition = [lat, lon];
diff --git a/store/lid/getPositionlid.js b/store/lid/getPositionlid.js
new file mode 100644
index 0000000..d0ed0d7
--- /dev/null
+++ b/store/lid/getPositionlid.js
@@ -0,0 +1,65 @@
+// console.log(Window)
+// window["qq"] = window["qq"] || {}
+// qq.maps = qq.maps || {}
+// window.soso || (window.soso = qq)
+// soso.maps || (soso.maps = qq.maps);
+// (function() {
+// function getScript(src) {
+// var protocol = (window.location.protocol == "https:") ? "https://" : "http://"
+// src = src && (src.indexOf("http://") === 0 || src.indexOf("https://") === 0) ? src : protocol + src
+// document.write('<' + 'script src="' + src + '"' + ' type="text/javascript"><' + '/script>')
+// }
+// qq.maps.__load = function(apiLoad) {
+// delete qq.maps.__load
+// apiLoad([
+// ["2.4.142", "T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", 0],
+// ["https://mapapi.qq.com/", "jsapi_v2/2/4/142/mods/",
+// "https://mapapi.qq.com/jsapi_v2/2/4/142/theme/", true
+// ],
+// [1, 18, 34.519469, 104.461761, 4],
+// [1645433081331, "https://pr.map.qq.com/pingd", "https://pr.map.qq.com/pingd"],
+// ["https://apis.map.qq.com/jsapi", "https://apikey.map.qq.com/mkey/index.php/mkey/check",
+// "https://sv.map.qq.com/xf", "https://sv.map.qq.com/boundinfo",
+// "https://sv.map.qq.com/rarp", "https://apis.map.qq.com/api/proxy/search",
+// "https://apis.map.qq.com/api/proxy/routes/", "https://confinfo.map.qq.com/confinfo",
+// "https://overseactrl.map.qq.com"
+// ],
+// [
+// [null, ["https://rt0.map.gtimg.com/tile", "https://rt1.map.gtimg.com/tile",
+// "https://rt2.map.gtimg.com/tile", "https://rt3.map.gtimg.com/tile"
+// ], "png", [256, 256], 3, 19, "114", true, false],
+// [null, ["https://m0.map.gtimg.com/hwap", "https://m1.map.gtimg.com/hwap",
+// "https://m2.map.gtimg.com/hwap", "https://m3.map.gtimg.com/hwap"
+// ], "png", [128, 128], 3, 18, "110", false, false],
+// [null, ["https://p0.map.gtimg.com/sateTiles", "https://p1.map.gtimg.com/sateTiles",
+// "https://p2.map.gtimg.com/sateTiles", "https://p3.map.gtimg.com/sateTiles"
+// ], "jpg", [256, 256], 1, 19, "101", false, false],
+// [null, ["https://rt0.map.gtimg.com/tile", "https://rt1.map.gtimg.com/tile",
+// "https://rt2.map.gtimg.com/tile", "https://rt3.map.gtimg.com/tile"
+// ], "png", [256, 256], 1, 19, "", false, false],
+// [null, ["https://sv0.map.qq.com/hlrender/", "https://sv1.map.qq.com/hlrender/",
+// "https://sv2.map.qq.com/hlrender/", "https://sv3.map.qq.com/hlrender/"
+// ], "png", [256, 256], 1, 19, "", false, false],
+// [null, ["https://rtt2.map.qq.com/rtt/", "https://rtt2a.map.qq.com/rtt/",
+// "https://rtt2b.map.qq.com/rtt/", "https://rtt2c.map.qq.com/rtt/"
+// ], "png", [256, 256], 1, 19, "", false, false], null, [
+// ["https://rt0.map.gtimg.com/vector/", "https://rt1.map.gtimg.com/vector/",
+// "https://rt2.map.gtimg.com/vector/", "https://rt3.map.gtimg.com/vector/"
+// ],
+// [256, 256], 3, 18, "114", ["https://rt0.map.gtimg.com/icons/",
+// "https://rt1.map.gtimg.com/icons/", "https://rt2.map.gtimg.com/icons/",
+// "https://rt3.map.gtimg.com/icons/"
+// ],
+// []
+// ], null
+// ],
+// ["https://s.map.qq.com/TPano/v1.1.2/TPano.js", "map.qq.com/", ""],
+// "{\"ver\":5,\"isup\":1,\"url\":\"https://mapstyle.qpic.cn/fileupdate/jsauto/style?id=30&version=5\"}"
+// ], loadScriptTime)
+// }
+// var loadScriptTime = (new Date).getTime()
+// getScript("https://mapapi.qq.com/jsapi_v2/2/4/142/main.js")
+
+// })()
+// var a = 1;
+// export default a;
diff --git a/store/lid/websocketL.js b/store/lid/websocketL.js
index 64a2ab7..3a9271b 100644
--- a/store/lid/websocketL.js
+++ b/store/lid/websocketL.js
@@ -21,6 +21,7 @@
}
Wst.prototype.$callBack = function(getValue, getState, getws, ids) {
+ // console.log("设置回调函数")
this.backValue = function(res) {
if (!getValue && !getState) {
console.log(res, "未设置msg返回函数");
@@ -39,6 +40,7 @@
};
Wst.prototype.$connect = function(Data) {
+ // console.log("开启")
this.ourControl = true;
let that = this;
this.Data = Data;
@@ -50,12 +52,14 @@
this.ws = uni.connectSocket({
url: that.url,
success(data) {
- // console.log(data, "websocket连接成功");
+ console.log(data, "websocket连接成功");
},
});
// console.log(that.url)
this.ws.onOpen((res) => {
// 注:只有连接正常打开中 ,才能正常成功发送消息
+ // console.log("发送登入消息 websocket")
+ // console.log(that.loginData)
that.ws.send({
data: JSON.stringify(that.loginData),
async success(res) {
diff --git a/store/positions.js b/store/positions.js
index b8cd667..31774ba 100644
--- a/store/positions.js
+++ b/store/positions.js
@@ -9,7 +9,8 @@
isBeginTask: {},
isOnTask: {},
isOnTaskValue: {},
- changes: true
+ changes: true,
+ i: 0
},
actions: {
// connectws({
@@ -28,15 +29,16 @@
id: id,
fn: function(res) {
// console.log(res);
- // state.isOnTaskValue[id] = {
- // id: id,
- // intlat: res.intlat
- // }
- // state.changes = !state.changes;
+ state.isOnTaskValue = {
+ id: id,
+ intlat: res.intlat,
+ i: state.i++
+ }
+ state.changes = !state.changes;
// console.log(state.isOnTaskValue)
$store.commit("setMsg", {
id: id,
- intlat: res.intlat
+ intlat: res.intlat,
})
}
})
@@ -87,6 +89,7 @@
serid = val.serid,
type = val.type,
that = val.that,
+ // data = val.data,
tips = (type, title) => {
that.$refs.uTips.show({
title: title,
diff --git a/store/websocket.js b/store/websocket.js
index 7812e91..d8c740b 100644
--- a/store/websocket.js
+++ b/store/websocket.js
@@ -38,7 +38,8 @@
var getws = function(res) { // 主体回调
commit("setSocket", res);
}
- let equipmentInformation = navigator.userAgent;
+ // console.log(webSockets.$callBack)
+ // let equipmentInformation = navigator.userAgent;
// var Data = {
// router: "share",
// res: {
@@ -65,6 +66,7 @@
// if (value.router == 'share/heartbeat') {
// return;
// }
+ console.log(value)
state.socketValue = value;
// console.log(value, 'websocket信息')
// } else { //异常数据返回
--
Gitblit v1.9.3