|
@@ -168,22 +168,10 @@
|
|
|
driverName: "",
|
|
|
interval: "",
|
|
|
}],
|
|
|
- timer: ""
|
|
|
+ timer: null
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
- var isContains = true;//隐私权政策是否包含高德开平隐私权政策 true是包含
|
|
|
- var isShow = true;//隐私权政策是否弹窗展示告知用户 true是展示
|
|
|
- sdkwx.updatePrivacyShow(isContains, isShow);
|
|
|
-
|
|
|
- var isAgree = true;//隐私权政策是否取得用户同意 true是用户同意
|
|
|
- sdkwx.updatePrivacyAgree(isAgree);
|
|
|
- //检查定位权限
|
|
|
- sdkwx.checkLocationPermission(function(res){
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
-
|
|
|
let phoneType = uni.getSystemInfoSync().platform //判断手机类型
|
|
|
this.enterpriseSenderCode = config.def().enterpriseSenderCode
|
|
|
this.environment = config.def().environment
|
|
@@ -213,7 +201,6 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
if (uni.getStorageSync('contractdata')) {
|
|
|
-
|
|
|
this.id = uni.getStorageSync('contractdata').id
|
|
|
this.detailData.hyCarrierInfo.id = uni.getStorageSync('contractdata').carrierId
|
|
|
this.cyId = uni.getStorageSync('contractdata').carrierId
|
|
@@ -248,11 +235,9 @@
|
|
|
// var appSecurity = "24c593b7037347e08857a6ab05fd231b0509f5bb7cb741078f524f506ad32db8";//网络货运企业在省平台申请的接入安全码
|
|
|
// var enterpriseSenderCode = "23106960";//网络货运企业在省平台申请的企业发送代码
|
|
|
// var environment = "debug";//环境:“debug”接入测试环境,“release”接入正式环境。
|
|
|
-
|
|
|
+ console.log("appid:" + this.appId + "安全码:" + this.appSecurity + "发送代码:" + this.enterpriseSenderCode)
|
|
|
let that = this
|
|
|
sdkwx.auth(this.appId, this.appSecurity, this.enterpriseSenderCode, this.environment, function(res) {
|
|
|
- console.log("appid:" + that.appId + "安全码:" + that.appSecurity + "发送代码:" + that.enterpriseSenderCode+"测试环境"+that.environment)
|
|
|
- console.log(res)
|
|
|
if (res.type == "onSuccess") {
|
|
|
//成功
|
|
|
that.start()
|
|
@@ -275,31 +260,23 @@
|
|
|
console.log(this.detailData, "行政区划分")
|
|
|
this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo, //运单号
|
|
|
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)
|
|
|
|
|
|
//}],//运单信息列表,一辆车运单数最大支持数为 10
|
|
|
var remark = "测试"; //备注
|
|
|
let that = this
|
|
|
+ console.log("start this.shippingNoteInfos")
|
|
|
+ console.log(this.shippingNoteInfos)
|
|
|
sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
|
|
|
function(res) {
|
|
|
if (res.type == "onSuccess") {
|
|
@@ -311,10 +288,11 @@
|
|
|
if (shippingNoteInfos) {
|
|
|
let dateTtime = Number(shippingNoteInfos.interval + 1000)
|
|
|
console.log("开始定时", dateTtime)
|
|
|
- that.timer = setTimeout(() => {
|
|
|
- console.log("定时")
|
|
|
- that.send()
|
|
|
- }, dateTtime);
|
|
|
+ that.send()
|
|
|
+ // that.timer = setTimeout(() => {
|
|
|
+ // console.log("定时")
|
|
|
+ // that.send()
|
|
|
+ // }, dateTtime);
|
|
|
}
|
|
|
} else if (res.type == "onFailure") {
|
|
|
//失败
|
|
@@ -332,6 +310,8 @@
|
|
|
send() { //发送定位
|
|
|
var remark = ""; //备注
|
|
|
let that = this
|
|
|
+ console.log("send this.shippingNoteInfos")
|
|
|
+ console.log(this.shippingNoteInfos)
|
|
|
sdkwx.send(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
|
|
|
function(res) {
|
|
|
console.log('发送定位', res);
|