|
@@ -57,9 +57,65 @@
|
|
|
}
|
|
|
})
|
|
|
// #ifdef APP-PLUS
|
|
|
-
|
|
|
- var that = this
|
|
|
+ var that=this
|
|
|
//判断该用户是否需要开启持续定位
|
|
|
+ if(uni.getStorageSync('userInfo')){
|
|
|
+ this.$request.baseRequest('get', '/orderInfo/getData', {
|
|
|
+ commonId:uni.getStorageSync('userInfo').id,
|
|
|
+ }).then(res1 => {
|
|
|
+ if(res1.data.length>0){
|
|
|
+ that.$helper.fUN_AmapLocation.start({
|
|
|
+ // intervalTime: 1000 * 60,
|
|
|
+ intervalTime: 5000,
|
|
|
+ // locationCacheEnable:true,
|
|
|
+ isReport: false
|
|
|
+ // url: 'http://192.168.0.66/fun/open/test_json.do',
|
|
|
+ // params: {
|
|
|
+ // a: 1,
|
|
|
+ // B: '测试',
|
|
|
+ // c: true
|
|
|
+ // },
|
|
|
+ // headers: {
|
|
|
+ // a: '123',
|
|
|
+ // B: 'abcd'
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ // console.log('====确认装车开启连续定位====');
|
|
|
+ // console.log(res)
|
|
|
+ let _data = {
|
|
|
+ orderId: res1.data[0].id,
|
|
|
+ longitude: res.longitude,
|
|
|
+ latitude: res.latitude,
|
|
|
+ province: res.province,
|
|
|
+ city: res.city,
|
|
|
+ area: res.district
|
|
|
+ }
|
|
|
+ this.$helper.gjList.push(_data)
|
|
|
+ uni.setStorageSync('mapGJ', this.$helper.gjList);
|
|
|
+ console.log('this.$helper.gjList')
|
|
|
+ console.log(this.$helper.gjList)
|
|
|
+ console.log("条数", uni.getStorageSync('mapGJ').length)
|
|
|
+ if (uni.getStorageSync('mapGJ').length > 100) {
|
|
|
+ console.log(JSON.stringify(uni.getStorageSync('mapGJ')) )
|
|
|
+ this.$request.baseRequest('post', '/hyOrderTravelPath/api/addInfo', {
|
|
|
+ orderId:"cdae6ec34c2349768c490a9fefa03fb3",
|
|
|
+ longitudeLatitude:JSON.stringify(uni.getStorageSync('mapGJ'))
|
|
|
+ }).then(res => {
|
|
|
+ uni.removeStorageSync('mapGJ');
|
|
|
+ this.$helper.gjList = []
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
// this.$helper.fUN_AmapLocation.stop({}, result => {
|
|
|
// console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
|
|
|
// this.$helper.fUN_AmapLocation.start(
|