|
@@ -84,7 +84,7 @@
|
|
|
<view class='s-flex'>
|
|
|
<view class="" style="margin:20rpx 0;">上传装车照片</view>
|
|
|
<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
|
|
|
- name="1" multiple='true' :maxCount="3"></u-upload>
|
|
|
+ name="1" :multiple='true' :maxCount="3"></u-upload>
|
|
|
</view>
|
|
|
<!-- <view class='s-flex'>
|
|
|
<view class="">上传装车磅单</view>
|
|
@@ -218,7 +218,9 @@
|
|
|
console.log(this.fileList1)
|
|
|
this.detailData.carNo = res.data.carNo
|
|
|
this.detailData.loadingDate = res.data.loadingDate
|
|
|
- this.detailData.loadingDate1=res.data.loadingDate.split(' ')[0]
|
|
|
+ if(res.data.loadingDate){
|
|
|
+ this.detailData.loadingDate1=res.data.loadingDate.split(' ')[0]
|
|
|
+ }
|
|
|
this.detailData.weight = res.data.loadingWeight
|
|
|
this.detailData.freight = res.data.estimatedFreight
|
|
|
}
|
|
@@ -270,7 +272,68 @@
|
|
|
this.carNumber = e.value
|
|
|
this.detailData.hyCarrierInfo.carNo = e.value //键盘输入值
|
|
|
},
|
|
|
+ checkOpenGPSServiceByAndroidIOS() {
|
|
|
+ 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);
|
|
|
+ console.log(mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER))
|
|
|
+ if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请打开定位服务功能',
|
|
|
+ // showCancel: false, // 不显示取消按钮
|
|
|
+ success(res) {
|
|
|
+ if(res.confirm){
|
|
|
+ if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
|
+
|
|
|
+ var Intent = plus.android.importClass('android.content.Intent');
|
|
|
+ var Settings = plus.android.importClass('android.provider.Settings');
|
|
|
+ var intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
|
|
+ main.startActivity(intent); // 打开系统设置GPS服务页面
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } 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) {
|
|
|
+ console.log("手机系统的定位已经打开");
|
|
|
+ } else {
|
|
|
+ console.log("手机系统的定位没有打开");
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请前往设置-隐私-定位服务打开定位服务功能',
|
|
|
+ // showCancel: false, // 不显示取消按钮
|
|
|
+ success(res) {
|
|
|
+ if(res.confirm){
|
|
|
+ var UIApplication = plus.ios.import("UIApplication");
|
|
|
+ var application2 = UIApplication.sharedApplication();
|
|
|
+ var NSURL2 = plus.ios.import("NSURL");
|
|
|
+ // var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
|
|
+ // var setting2 = NSURL2.URLWithString("App-Prefs:root=LOCATION_SERVICES");
|
|
|
+ // var setting2 = NSURL2.URLWithString("app-settings");
|
|
|
+ var setting2 = NSURL2.URLWithString("App-Prefs:root=Privacy&path=LOCATION");
|
|
|
+ // var setting2 = NSURL2.URLWithString("App-Prefs:root=Privacy&path=LOCATION_SERVICES");
|
|
|
+ application2.openURL(setting2);
|
|
|
+ plus.ios.deleteObject(setting2);
|
|
|
+ plus.ios.deleteObject(NSURL2);
|
|
|
+ plus.ios.deleteObject(application2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
getLngLat() {
|
|
|
+ this.checkOpenGPSServiceByAndroidIOS()
|
|
|
var that=this
|
|
|
uni.showLoading({
|
|
|
title: '获取定位中',
|
|
@@ -301,7 +364,6 @@
|
|
|
// });
|
|
|
// }
|
|
|
// );
|
|
|
- console.log(111111)
|
|
|
// console.log(that.detailData,111111)
|
|
|
uni.getLocation({
|
|
|
type: 'gcj02',
|
|
@@ -379,6 +441,7 @@
|
|
|
// 删除图片
|
|
|
deletePic(event) {
|
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
|
+ this.imgList.splice(event.index, 1)
|
|
|
},
|
|
|
// 新增图片
|
|
|
async afterRead(event) {
|
|
@@ -471,20 +534,20 @@
|
|
|
})
|
|
|
return true
|
|
|
}
|
|
|
- // if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendCity)) {
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // type: 'error',
|
|
|
- // message: "定位不能为空!",
|
|
|
- // })
|
|
|
- // return true
|
|
|
- // }
|
|
|
- // if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendArea)) {
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // type: 'error',
|
|
|
- // message: "定位不能为空!",
|
|
|
- // })
|
|
|
- // return true
|
|
|
- // }
|
|
|
+ if (uni.$u.test.isEmpty(this.detailData.loadingCity)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "定位不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.detailData.loadingArea)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "定位不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
|
|
|
if(this.imgList.length == 0){
|
|
|
this.$refs.uToast.show({
|
|
@@ -531,7 +594,7 @@
|
|
|
id:this.detailData.hyCarrierInfo.id
|
|
|
}
|
|
|
|
|
|
- console.log("查看id--------",this.detailData.hyCarrierInfo.id)
|
|
|
+ // console.log("查看id--------",this.detailData.hyCarrierInfo.id)
|
|
|
this.$request.baseRequest('post', '/carrierInfo/loadingAdd', data).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
uni.hideLoading()
|
|
@@ -558,8 +621,8 @@
|
|
|
// }
|
|
|
},
|
|
|
res => {
|
|
|
- console.log('====确认装车开启连续定位====');
|
|
|
- console.log(res)
|
|
|
+ // console.log('====确认装车开启连续定位====');
|
|
|
+ // console.log(res)
|
|
|
let _data = {
|
|
|
orderId: that.id,
|
|
|
longitude: res.longitude,
|
|
@@ -570,9 +633,9 @@
|
|
|
}
|
|
|
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)
|
|
|
+ // 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', {
|