|
@@ -43,8 +43,8 @@
|
|
appSecurity: "", //网络货运企业在省平台申请的接入安全码
|
|
appSecurity: "", //网络货运企业在省平台申请的接入安全码
|
|
enterpriseSenderCode: "", //网络货运企业在省平台申请的企业发送代码
|
|
enterpriseSenderCode: "", //网络货运企业在省平台申请的企业发送代码
|
|
environment: "", //环境:“debug”接入测试环境,“release”接入正式环境。
|
|
environment: "", //环境:“debug”接入测试环境,“release”接入正式环境。
|
|
- version: "" ,// 版本号
|
|
|
|
- id:""
|
|
|
|
|
|
+ version: "", // 版本号
|
|
|
|
+ id: ""
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -304,113 +304,119 @@
|
|
if (res1.data.length > 0) {
|
|
if (res1.data.length > 0) {
|
|
this.shippingNoteInfos[0].shippingNoteNumber = res1.data[0].orderNo //运单号
|
|
this.shippingNoteInfos[0].shippingNoteNumber = res1.data[0].orderNo //运单号
|
|
this.shippingNoteInfos[0].serialNumber = "0000" //分单号
|
|
this.shippingNoteInfos[0].serialNumber = "0000" //分单号
|
|
- this.shippingNoteInfos[0].startCountrySubdivisionCode = res1.data[0].sendAdCode //起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endCountrySubdivisionCode = res1.data[0].unsendAdCode //到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].startLongitude = res1.data[0].sendLongitude //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].startLatitude = res1.data[0].sendLatitude //起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLongitude = res1.data[0].unsendLongitude //到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLatitude = res1.data[0].unsendLatitude //到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].driverName = res1.data[0].driverName //司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
|
|
|
|
- this.shippingNoteInfos[0].vehicleNumber = res1.data[0].carNumber //车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
|
|
|
|
- this.shippingNoteInfos[0].startLocationText = res1.data[0].sendCity //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLocationText = res1.data[0].unloadCity //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
|
|
+ this.shippingNoteInfos[0].startCountrySubdivisionCode = res1.data[0]
|
|
|
|
+ .sendAdCode //起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endCountrySubdivisionCode = res1.data[0]
|
|
|
|
+ .unsendAdCode //到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLongitude = res1.data[0]
|
|
|
|
+ .sendLongitude //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLatitude = res1.data[0]
|
|
|
|
+ .sendLatitude //起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLongitude = res1.data[0]
|
|
|
|
+ .unsendLongitude //到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLatitude = res1.data[0]
|
|
|
|
+ .unsendLatitude //到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].driverName = res1.data[0]
|
|
|
|
+ .driverName //司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
|
|
|
|
+ this.shippingNoteInfos[0].vehicleNumber = res1.data[0]
|
|
|
|
+ .carNumber //车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLocationText = res1.data[0]
|
|
|
|
+ .sendCity //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLocationText = res1.data[0]
|
|
|
|
+ .unloadCity //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
this.shippingNoteInfos[0].interval = "5000"
|
|
this.shippingNoteInfos[0].interval = "5000"
|
|
console.log("查看参数", this.shippingNoteInfos)
|
|
console.log("查看参数", this.shippingNoteInfos)
|
|
// that.auth()
|
|
// that.auth()
|
|
- that.$helper.fUN_AmapLocation.start({
|
|
|
|
- // intervalTime: 1000 * 60,
|
|
|
|
- intervalTime: 60000,
|
|
|
|
- // 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)
|
|
|
|
- that.id = res1.data[0].id
|
|
|
|
- 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: that.id,
|
|
|
|
- // orderId: "cdae6ec34c2349768c490a9fefa03fb3",
|
|
|
|
- longitudeLatitude: JSON.stringify(uni.getStorageSync(
|
|
|
|
- 'mapGJ'))
|
|
|
|
- }).then(res => {
|
|
|
|
- uni.removeStorageSync('mapGJ');
|
|
|
|
- this.$helper.gjList = []
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.$u.toast(res.message);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
|
|
|
|
|
|
+ //判断有没有定位权限 有权限 定位 没权限不操作
|
|
|
|
+ let system = uni.getSystemInfoSync(); // 获取系统信息
|
|
|
|
+ if (system.platform === 'android') { // 判断平台
|
|
|
|
+ var context = plus.android.importClass("android.content.Context");
|
|
|
|
+ var locationManager = plus.android.importClass("android.location.LocationManager");
|
|
|
|
+ var main = plus.android.runtimeMainActivity();
|
|
|
|
+ var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
|
|
+ if (mainSvr) {
|
|
|
|
+ that.$helper.fUN_AmapLocation.start({
|
|
|
|
+ intervalTime: 60000,
|
|
|
|
+ isReport: false
|
|
|
|
+ },
|
|
|
|
+ res => {
|
|
|
|
+ that.id = res1.data[0].id
|
|
|
|
+ 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);
|
|
|
|
+ if (uni.getStorageSync('mapGJ').length > 100) {
|
|
|
|
+ this.$request.baseRequest('post',
|
|
|
|
+ '/hyOrderTravelPath/api/addInfo', {
|
|
|
|
+ orderId: that.id,
|
|
|
|
+ // orderId: "cdae6ec34c2349768c490a9fefa03fb3",
|
|
|
|
+ longitudeLatitude: JSON.stringify(uni
|
|
|
|
+ .getStorageSync(
|
|
|
|
+ 'mapGJ'))
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.removeStorageSync('mapGJ');
|
|
|
|
+ this.$helper.gjList = []
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ uni.$u.toast(res.message);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
- );
|
|
|
|
|
|
+ } else if (system.platform === 'ios') {
|
|
|
|
+ // console.log("苹果");
|
|
|
|
+ var cllocationManger = plus.ios.import("CLLocationManager");
|
|
|
|
+ var enable = cllocationManger.locationServicesEnabled();
|
|
|
|
+ var status = cllocationManger.authorizationStatus();
|
|
|
|
+ plus.ios.deleteObject(cllocationManger);
|
|
|
|
+ if (enable && status != 2) {
|
|
|
|
+ that.$helper.fUN_AmapLocation.start({
|
|
|
|
+ intervalTime: 60000,
|
|
|
|
+ isReport: false
|
|
|
|
+ },
|
|
|
|
+ res => {
|
|
|
|
+ that.id = res1.data[0].id
|
|
|
|
+ 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);
|
|
|
|
+ if (uni.getStorageSync('mapGJ').length > 100) {
|
|
|
|
+ this.$request.baseRequest('post',
|
|
|
|
+ '/hyOrderTravelPath/api/addInfo', {
|
|
|
|
+ orderId: that.id,
|
|
|
|
+ longitudeLatitude: JSON.stringify(uni
|
|
|
|
+ .getStorageSync(
|
|
|
|
+ 'mapGJ'))
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.removeStorageSync('mapGJ');
|
|
|
|
+ this.$helper.gjList = []
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ uni.$u.toast(res.message);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- // this.$helper.fUN_AmapLocation.stop({}, result => {
|
|
|
|
- // console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
|
|
|
|
- // this.$helper.fUN_AmapLocation.start(
|
|
|
|
- // {
|
|
|
|
- // intervalTime: 1000*60,
|
|
|
|
- // isReport: true,
|
|
|
|
- // reportInterval: 5,
|
|
|
|
- // 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('====确认装车开启连续定位====', JSON.stringify(res));
|
|
|
|
- // //判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
- // });
|
|
|
|
|
|
|
|
- // fUN_AmapLocation.permission({}, result => {
|
|
|
|
- // console.log('====fUN_AmapLocation定位====');
|
|
|
|
- // });
|
|
|
|
- // fUN_AmapLocation.hasLocationPermissions(function(result) {
|
|
|
|
- // console.log('====fUN_AmapLocation定位权限===='+ result)
|
|
|
|
- // });
|
|
|
|
- // startLocation与start均可
|
|
|
|
- // this.$helper.fUN_AmapLocation.start(
|
|
|
|
- // {
|
|
|
|
- // intervalTime: 1000*10,
|
|
|
|
- // isReport: false,
|
|
|
|
- // },
|
|
|
|
- // result => {
|
|
|
|
- // //见下方定位返回示例
|
|
|
|
- // console.log('====fUN_AmapLocation定位====', JSON.stringify(result));
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
- // let isOpenLocation= permision.checkSystemEnableLocation()
|
|
|
|
- // console.log("isOpenLocation",isOpenLocation)
|
|
|
|
- // this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
|
|
|
|
let type = uni.getSystemInfoSync().platform
|
|
let type = uni.getSystemInfoSync().platform
|
|
if (type == "android") {
|
|
if (type == "android") {
|
|
// appUpdate()
|
|
// appUpdate()
|
|
@@ -510,7 +516,7 @@
|
|
// var isContains = true;//隐私权政策是否包含高德开平隐私权政策 true是包含
|
|
// var isContains = true;//隐私权政策是否包含高德开平隐私权政策 true是包含
|
|
// var isShow = true;//隐私权政策是否弹窗展示告知用户 true是展示
|
|
// var isShow = true;//隐私权政策是否弹窗展示告知用户 true是展示
|
|
// sdkwx.updatePrivacyShow(isContains, isShow);
|
|
// sdkwx.updatePrivacyShow(isContains, isShow);
|
|
-
|
|
|
|
|
|
+
|
|
// var isAgree = true;//隐私权政策是否取得用户同意 true是用户同意
|
|
// var isAgree = true;//隐私权政策是否取得用户同意 true是用户同意
|
|
// sdkwx.updatePrivacyAgree(isAgree);
|
|
// sdkwx.updatePrivacyAgree(isAgree);
|
|
// //检查定位权限
|
|
// //检查定位权限
|