|
@@ -57,6 +57,10 @@
|
|
{{detailData.loadingDate1?detailData.loadingDate1:'来自合同'}}
|
|
{{detailData.loadingDate1?detailData.loadingDate1:'来自合同'}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class='row-between'>
|
|
|
|
+ <view class="">装车毛重(吨)</view>
|
|
|
|
+ {{detailData.grossWeight ? detailData.grossWeight:"来自合同"}}
|
|
|
|
+ </view>
|
|
<view class='row-between'>
|
|
<view class='row-between'>
|
|
<view class="">装车净重(吨)</view>
|
|
<view class="">装车净重(吨)</view>
|
|
{{detailData.weight ? detailData.weight:"来自合同"}}
|
|
{{detailData.weight ? detailData.weight:"来自合同"}}
|
|
@@ -163,7 +167,7 @@
|
|
driverName: "",
|
|
driverName: "",
|
|
interval: "",
|
|
interval: "",
|
|
}],
|
|
}],
|
|
- timer:null
|
|
|
|
|
|
+ timer: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -248,66 +252,85 @@
|
|
},
|
|
},
|
|
start() { //开启定位
|
|
start() { //开启定位
|
|
//车牌号 //司机姓名 //备注 //运单信息列表
|
|
//车牌号 //司机姓名 //备注 //运单信息列表
|
|
- console.log(this.detailData,"行政区划分")
|
|
|
|
|
|
+ console.log(this.detailData, "行政区划分")
|
|
this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo, //运单号
|
|
this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo, //运单号
|
|
this.shippingNoteInfos[0].serialNumber = "0000", //分单号
|
|
this.shippingNoteInfos[0].serialNumber = "0000", //分单号
|
|
- this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData.publishTaskInfo.sendAdCode, //起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endCountrySubdivisionCode = this.detailData.publishTaskInfo.unsendAdCode, //到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].startLongitude = this.detailData.loadingLatitude, //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].startLatitude = this.detailData.loadingLatitude, //起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLongitude = this.detailData.publishTaskInfo.unsendLongitude, //到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLatitude = this.detailData.publishTaskInfo.unsendLatitude, //到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].startLocationText = this.detailData.sendCity, //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].endLocationText = this.detailData.unloadCity, //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
- this.shippingNoteInfos[0].vehicleNumber = this.detailData.carNumber, //车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
|
|
|
|
- this.shippingNoteInfos[0].driverName = this.detailData.driverName, //司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
|
|
|
|
|
|
+ this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData.publishTaskInfo
|
|
|
|
+ .sendAdCode, //起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endCountrySubdivisionCode = this.detailData.publishTaskInfo
|
|
|
|
+ .unsendAdCode, //到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLongitude = this.detailData
|
|
|
|
+ .loadingLatitude, //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLatitude = this.detailData
|
|
|
|
+ .loadingLatitude, //起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLongitude = this.detailData.publishTaskInfo
|
|
|
|
+ .unsendLongitude, //到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLatitude = this.detailData.publishTaskInfo
|
|
|
|
+ .unsendLatitude, //到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].startLocationText = this.detailData
|
|
|
|
+ .sendCity, //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].endLocationText = this.detailData
|
|
|
|
+ .unloadCity, //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
|
|
|
|
+ this.shippingNoteInfos[0].vehicleNumber = this.detailData
|
|
|
|
+ .carNumber, //车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
|
|
|
|
+ this.shippingNoteInfos[0].driverName = this.detailData
|
|
|
|
+ .driverName, //司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
|
|
this.shippingNoteInfos[0].interval = "5000" //请求时间间隔,SDK 回调返 回(单位 ms)
|
|
this.shippingNoteInfos[0].interval = "5000" //请求时间间隔,SDK 回调返 回(单位 ms)
|
|
-
|
|
|
|
|
|
+
|
|
//}],//运单信息列表,一辆车运单数最大支持数为 10
|
|
//}],//运单信息列表,一辆车运单数最大支持数为 10
|
|
- var remark = "测试";//备注
|
|
|
|
- let that = this
|
|
|
|
- sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName,remark, this.shippingNoteInfos, function(res) {
|
|
|
|
- if (res.type == "onSuccess") {
|
|
|
|
- //成功
|
|
|
|
- console.log("开启定位成功!!!")
|
|
|
|
- console.log(res)
|
|
|
|
- var shippingNoteInfos = res.data[0]; //运单信息列表
|
|
|
|
- console.log(shippingNoteInfos,"sdassss")
|
|
|
|
- if(shippingNoteInfos){
|
|
|
|
- let dateTtime = Number(shippingNoteInfos.interval+1000)
|
|
|
|
- console.log("开始定时",dateTtime)
|
|
|
|
|
|
+ var remark = "测试"; //备注
|
|
|
|
+ let that = this
|
|
|
|
+ sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
|
|
|
|
+ function(res) {
|
|
|
|
+ if (res.type == "onSuccess") {
|
|
|
|
+ //成功
|
|
|
|
+ console.log("开启定位成功!!!")
|
|
|
|
+ console.log(res)
|
|
|
|
+ var shippingNoteInfos = res.data[0]; //运单信息列表
|
|
|
|
+ console.log(shippingNoteInfos, "sdassss")
|
|
|
|
+ if (shippingNoteInfos) {
|
|
|
|
+ let dateTtime = Number(shippingNoteInfos.interval + 1000)
|
|
|
|
+ console.log("开始定时", dateTtime)
|
|
|
|
+ that.timer = setInterval(() => {
|
|
|
|
+ console.log("定时")
|
|
|
|
+ that.send()
|
|
|
|
+ }, dateTtime);
|
|
|
|
+ }
|
|
|
|
+ } else if (res.type == "onFailure") {
|
|
|
|
+ //失败
|
|
|
|
+ console.log("开启定位失败!!!")
|
|
|
|
+ console.log(res)
|
|
|
|
+ var errorCode = res.data.errorCode; //错误码
|
|
|
|
+ var errorMsg = res.data.errorMsg; //错误描述
|
|
that.timer = setInterval(() => {
|
|
that.timer = setInterval(() => {
|
|
console.log("定时")
|
|
console.log("定时")
|
|
that.send()
|
|
that.send()
|
|
- }, dateTtime);
|
|
|
|
|
|
+ }, 915204);
|
|
}
|
|
}
|
|
- } else if (res.type == "onFailure") {
|
|
|
|
- //失败
|
|
|
|
- console.log("开启定位失败!!!")
|
|
|
|
- console.log(res)
|
|
|
|
- var errorCode = res.data.errorCode; //错误码
|
|
|
|
- var errorMsg = res.data.errorMsg; //错误描述
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- send(){//发送定位
|
|
|
|
- var remark = "";//备注
|
|
|
|
|
|
+ send() { //发送定位
|
|
|
|
+ var remark = ""; //备注
|
|
let that = this
|
|
let that = this
|
|
- sdkwx.send(this.detailData.carNo, this.firstAuthentication.driverName,remark, this.shippingNoteInfos, function(res){
|
|
|
|
- console.log('发送定位',res);
|
|
|
|
- if (res.type == "onSuccess") {
|
|
|
|
- var shippingNoteInfos = res.data[0];//运单信息列表
|
|
|
|
- let dateTtime = Number(shippingNoteInfos.interval+1000)
|
|
|
|
- console.log("开始定时",dateTtime)
|
|
|
|
- that.timer = setInterval(() => {
|
|
|
|
- //TODO
|
|
|
|
- that.send()
|
|
|
|
- }, dateTtime);
|
|
|
|
- } else if (res.type == "onFailure"){
|
|
|
|
- var errorCode = res.data.errorCode;//错误码
|
|
|
|
- var errorMsg = res.data.errorMsg;//错误描述
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ sdkwx.send(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
|
|
|
|
+ function(res) {
|
|
|
|
+ console.log('发送定位', res);
|
|
|
|
+ if (res.type == "onSuccess") {
|
|
|
|
+ var shippingNoteInfos = res.data[0]; //运单信息列表
|
|
|
|
+ let dateTtime = Number(shippingNoteInfos.interval + 1000)
|
|
|
|
+ console.log("开始定时", dateTtime)
|
|
|
|
+ that.timer = setInterval(() => {
|
|
|
|
+ that.send()
|
|
|
|
+ }, dateTtime);
|
|
|
|
+ } else if (res.type == "onFailure") {
|
|
|
|
+ var errorCode = res.data.errorCode; //错误码
|
|
|
|
+ var errorMsg = res.data.errorMsg; //错误描述
|
|
|
|
+ that.timer = setInterval(() => {
|
|
|
|
+ console.log("定时")
|
|
|
|
+ that.send()
|
|
|
|
+ }, 915204); //15分钟
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
toSignContract() {
|
|
toSignContract() {
|
|
console.log(this.detailData)
|
|
console.log(this.detailData)
|
|
@@ -358,6 +381,7 @@
|
|
this.detailData.loadingDate1 = res.data.loadingDate.split(' ')[0]
|
|
this.detailData.loadingDate1 = res.data.loadingDate.split(' ')[0]
|
|
}
|
|
}
|
|
this.detailData.weight = res.data.loadingWeight
|
|
this.detailData.weight = res.data.loadingWeight
|
|
|
|
+ this.detailData.grossWeight = res.data.loadingGrossWeight
|
|
this.detailData.freight = res.data.estimatedFreight
|
|
this.detailData.freight = res.data.estimatedFreight
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -417,7 +441,7 @@
|
|
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
- title: '提示',
|
|
|
|
|
|
+ title: '提示',
|
|
content: '请打开定位服务功能',
|
|
content: '请打开定位服务功能',
|
|
// showCancel: false, // 不显示取消按钮
|
|
// showCancel: false, // 不显示取消按钮
|
|
success(res) {
|
|
success(res) {
|
|
@@ -435,7 +459,7 @@
|
|
} else if (system.platform === 'ios') {
|
|
} else if (system.platform === 'ios') {
|
|
// console.log("苹果");
|
|
// console.log("苹果");
|
|
var cllocationManger = plus.ios.import("CLLocationManager");
|
|
var cllocationManger = plus.ios.import("CLLocationManager");
|
|
- var enable = cllocationManger.locationServicesEnabled();
|
|
|
|
|
|
+ var enable = cllocationManger.locationServicesEnabled();
|
|
var status = cllocationManger.authorizationStatus();
|
|
var status = cllocationManger.authorizationStatus();
|
|
plus.ios.deleteObject(cllocationManger);
|
|
plus.ios.deleteObject(cllocationManger);
|
|
if (enable && status != 2) {
|
|
if (enable && status != 2) {
|
|
@@ -726,7 +750,7 @@
|
|
loadingLatitude: this.detailData.loadingLatitude,
|
|
loadingLatitude: this.detailData.loadingLatitude,
|
|
id: this.detailData.hyCarrierInfo.id
|
|
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 => {
|
|
this.$request.baseRequest('post', '/carrierInfo/loadingAdd', data).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -765,8 +789,8 @@
|
|
city: res.city,
|
|
city: res.city,
|
|
area: res.district
|
|
area: res.district
|
|
}
|
|
}
|
|
- if(this.shippingNoteInfos && this.shippingNoteInfos.length > 0){//更新持续定位经纬度
|
|
|
|
- for(let i= 0;i<this.shippingNoteInfos.length;i++){
|
|
|
|
|
|
+ if (this.shippingNoteInfos && this.shippingNoteInfos.length > 0) { //更新持续定位经纬度
|
|
|
|
+ for (let i = 0; i < this.shippingNoteInfos.length; i++) {
|
|
this.shippingNoteInfos[i].startLatitude = _data.latitude //纬度
|
|
this.shippingNoteInfos[i].startLatitude = _data.latitude //纬度
|
|
this.shippingNoteInfos[i].startLocationText = _data.city //起点
|
|
this.shippingNoteInfos[i].startLocationText = _data.city //起点
|
|
this.shippingNoteInfos[i].startLongitude = _data.longitude //经度
|
|
this.shippingNoteInfos[i].startLongitude = _data.longitude //经度
|