ccj 2 tahun lalu
induk
melakukan
a1a0660bd6

+ 64 - 0
common/helper.js

@@ -1,4 +1,6 @@
 import * as config from '../config'
+
+var sdkwx = uni.requireNativePlugin('Hdgq-LocSdkWX');
 const rolesList = []
 const gjList=[]
 const ossUploadUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/';
@@ -15,6 +17,66 @@ const imgTypeList = [{
 		name: '拍照',
 	}
 ]
+//定位sdk授权
+const sdkAuth = function(){
+	var enterpriseSenderCode = config.def().enterpriseSenderCode
+	var environment = config.def().environment
+	var appId = ''
+	var appSecurity = ''
+	let phoneType = uni.getSystemInfoSync().platform //判断手机类型
+	if (phoneType == "android") {
+		appId = config.def().androidAppId
+		appSecurity = config.def().androidAppSecurity
+	} else if (phoneType == "ios") {
+		appId = config.def().iosAppId
+		appSecurity = config.def().iosAppSecurity
+	}
+	console.log("appid:" + appId + "安全码:" + appSecurity + "发送代码:" + enterpriseSenderCode)
+	sdkwx.auth(appId, appSecurity, enterpriseSenderCode, environment, function(res) {
+		if (res.type == "onSuccess") {
+			//成功
+			
+			console.log("授权成功")
+			console.log(res)
+		} else if (res.type == "onFailure") {
+			//失败
+			var errorCode = res.data.errorCode; //错误码
+			var errorMsg = res.data.errorMsg; //错误描述
+			console.log("授权失败")
+			console.log(res)
+		}
+	});
+}
+//定位sdk开启
+const sdkStart = function(carNo,driverName,remark,shippingNoteInfos){
+	sdkwx.start(carNo, driverName, remark, 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.send()
+				}
+			} else if (res.type == "onFailure") {
+				//失败
+				console.log("开启定位失败!!!")
+				console.log(res)
+				var errorCode = res.data.errorCode; //错误码
+				var errorMsg = res.data.errorMsg; //错误描述
+				setTimeout(() => {
+					console.log("定时")
+					// that.send()
+				}, 915204);
+			}
+		});
+}
+
+
 // 当前日期是否超过今天(校验有效期)
 const periodOfValidity=function(year1,month1,day1){
 	let nowDate = new Date();
@@ -455,9 +517,11 @@ export default {
 	imgTypeList,
 	makeValidityPeriod,
 	periodOfValidity,
+	sdkAuth,
 	getProvinceAbbreviation,
 	filterUrban,
 	filterArea,
+	sdkStart,
 	fUN_AmapLocation,
 	changeTime,
 	gjList

+ 1 - 1
config/index.js

@@ -4,7 +4,7 @@ const dev = {
 	// baseUrlNew: 'https://apitest.eliangeyun.com',
 	// baseUrlNew: 'http://192.168.110.9:8099',
 	// baseUrlNew: 'http://192.168.110.82:8999',
-	// baseUrlNew: 'http://192.168.1.119:8999',
+	// baseUrlNew: 'http://192.168.110.67:8999',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false,
 	//部网络货运 持续定位

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "畅运通",
     "appid" : "__UNI__9C76CB6",
     "description" : "",
-    "versionName" : "1.1.5",
-    "versionCode" : 115,
+    "versionName" : "1.1.6",
+    "versionCode" : 116,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 51 - 24
pages/mine/index1.vue

@@ -13,27 +13,32 @@
 <script>
 	//插件对象
 	var sdkwx = uni.requireNativePlugin('Hdgq-LocSdkWX');
+	import * as config from '@/config/index.js'
 	export default {
 		data() {
 			return {
 				title: 'Hello',
-				vehicleNumber:"辽A77777",//车牌号
-				driverName:"尚师傅",//司机姓名
+				vehicleNumber:"辽HG6663",//车牌号
+				driverName:"孙亚洲",//司机姓名
 				remark:"测试",//备注
+				appId: "", //网络货运企业APP的唯一标识
+				appSecurity: "", //网络货运企业在省平台申请的接入安全码
+				enterpriseSenderCode: "", //网络货运企业在省平台申请的企业发送代码
+				environment: "debug", //环境:“debug”接入测试环境,“release”接入正式环境。
 				shippingNoteInfos:[{
-					shippingNoteNumber:"CY20221027199993",//运单号
-					serialNumber:"0000",//分单号
-					startCountrySubdivisionCode:"210804",//起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
-					endCountrySubdivisionCode:"210804",//到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
-					startLongitude:"122.17153",//起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					startLatitude:"40.266814",//起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					endLongitude:"122.146806",//到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					endLatitude:"40.261078",//到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					startLocationText:"营口市",//起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					endLocationText:"营口市",//到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-					vehicleNumber:"辽A12347",//车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
-					driverName:"尚师傅",//司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
-					interval:"5000"//请求时间间隔,SDK 回调返 回(单位 ms)				 
+					shippingNoteNumber:"CY20221028860111",
+					serialNumber:"0000",
+					startCountrySubdivisionCode:"210804",
+					endCountrySubdivisionCode:"210804",
+					startLongitude: "122.17153",
+					startLatitude:"40.266814",
+					endLongitude:"122.146806",
+					endLatitude: "40.261078",
+					startLocationText:"营口市",
+					endLocationText:"营口市",
+					vehicleNumber:"辽HG6663",
+					driverName:"孙亚洲",
+					interval:"5000" 
 				}],//运单信息列表,一辆车运单数最大支持数为 10
 				timer:""
 			}
@@ -60,12 +65,24 @@
 		},
 		methods: {
 			auth() { 
+				let phoneType = uni.getSystemInfoSync().platform //判断手机类型
+				this.enterpriseSenderCode = config.def().enterpriseSenderCode
+				this.environment = config.def().environment
+				if (phoneType == "android") {
+					this.appId = config.def().androidAppId
+					this.appSecurity = config.def().androidAppSecurity
+				} else if (phoneType == "ios") {
+					// this.appId = "uni.UNIDCD13AC"
+					// this.appSecurity = "b01e4805276646eeb25f0fad91de97a4f32e8c2c0e0d42e5b24cc4737e9f040f"
+					this.appId = config.def().iosAppId
+					this.appSecurity = config.def().iosAppSecurity
+				}
 				//授权
-				var appId = "uni.UNI9C76CB6";//网络货运企业APP的唯一标识
-				var appSecurity = "24c593b7037347e08857a6ab05fd231b0509f5bb7cb741078f524f506ad32db8";//网络货运企业在省平台申请的接入安全码
-				var enterpriseSenderCode = "23106960";//网络货运企业在省平台申请的企业发送代码
-				var environment = "debug";//环境:“debug”接入测试环境,“release”接入正式环境。
-				sdkwx.auth(appId, appSecurity, enterpriseSenderCode, environment, function(res) {
+				// var appId = "uni.UNI9C76CB6";//网络货运企业APP的唯一标识
+				// var appSecurity = "24c593b7037347e08857a6ab05fd231b0509f5bb7cb741078f524f506ad32db8";//网络货运企业在省平台申请的接入安全码
+				// var enterpriseSenderCode = "23106960";//网络货运企业在省平台申请的企业发送代码
+				// var environment = "debug";//环境:“debug”接入测试环境,“release”接入正式环境。
+				sdkwx.auth(this.appId, this.appSecurity, this.enterpriseSenderCode, this.environment, function(res) {
 					console.log(res);
 					if (res.type == "onSuccess") {
 						//成功
@@ -87,6 +104,16 @@
 				var driverName = this.driverName;//司机姓名
 				var remark = this.remark;//备注
 				var shippingNoteInfos = this.shippingNoteInfos;//运单信息列表
+				var startParam = uni.getStorageSync("sdkStartParam")
+				
+				console.log(startParam)
+				// if(startParam){
+				// 	this.$helper.sdkStart(startParam.carNo,startParam.driverName,startParam.remark,startParam.shippingNoteInfos)
+				// }
+				console.log("更换前",shippingNoteInfos)
+				shippingNoteInfos = startParam.shippingNoteInfos
+				shippingNoteInfos[0].shippingNoteNumber = 'CY20221028860222'
+				console.log("更换后",shippingNoteInfos)
 				sdkwx.start(vehicleNumber, driverName, remark, shippingNoteInfos, function(res){
 					console.log(res);
 					if (res.type == "onSuccess") {
@@ -98,10 +125,10 @@
 					if (shippingNoteInfos) {
 						let dateTtime = Number(shippingNoteInfos.interval + 1000)
 						console.log("开始定时", dateTtime)
-						that.timer = setTimeout(() => {
-							console.log("定时")
-							that.send()
-						}, dateTtime);
+						// that.timer = setTimeout(() => {
+						// 	console.log("定时")
+						// 	that.send()
+						// }, dateTtime);
 					}
 					} else if (res.type == "onFailure"){
 						//失败

+ 38 - 28
pages/order/confirmLoading.vue

@@ -191,10 +191,20 @@
 				this.getInfo()
 			}
 			console.log(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);
+			});
+			this.auth()
 			// this.detailData = JSON.parse(options.obj) ;
 			// console.log(this.detailData)
 			// CYHT20220317000001
-			//隐私合规接口,HBuildx3.3.3及其以后的版本需要调用合规检查
 		},
 		onHide() {
 			uni.removeStorageSync(
@@ -212,18 +222,13 @@
 			...mapState(['hasLogin', 'userInfo', "firstAuthentication"])
 		},
 		methods: {
-			
 			auth() { //授权
-				// var appId = "uni.UNI9C76CB6";//网络货运企业APP的唯一标识
-				// 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) {
 					if (res.type == "onSuccess") {
 						//成功
-						that.start()
+						
 						console.log("授权成功")
 						console.log(res)
 					} else if (res.type == "onFailure") {
@@ -246,26 +251,35 @@
 				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.publishTaskInfo.sendLongitude, //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-				this.shippingNoteInfos[0].startLatitude = this.detailData.publishTaskInfo.sendLatitude, //起点位置纬度,调用 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.publishTaskInfo.sendCity, //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
-				this.shippingNoteInfos[0].endLocationText = this.detailData.publishTaskInfo.unloadCity, //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
+				this.shippingNoteInfos[0].startLatitude =  this.detailData.publishTaskInfo.sendLatitude, //起点位置纬度,调用 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)
-				var shippingNoteInfos = this.shippingNoteInfos
-				sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName, remark, shippingNoteInfos,
+				var param = {}
+				param.carNo = this.detailData.carNo
+				param.driverName = this.firstAuthentication.driverName
+				param.remark = remark
+				param.shippingNoteInfos = this.shippingNoteInfos
+				// uni.setStorageSync("sdkStartParam",param)
+				// uni.setStorageSync("sdkStartParamOrderNum",this.detailData.orderNo)
+				// this.$helper.sdkStart(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos)
+				sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
 					function(res) {
-						var shippingNoteInfos = res.data[0]; //运单信息列表
 						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)
@@ -294,21 +308,16 @@
 				let that = this
 				console.log("send this.shippingNoteInfos")
 				console.log(this.shippingNoteInfos)
-				var shippingNoteInfos = this.shippingNoteInfos;
-				sdkwx.send(this.detailData.carNo, this.firstAuthentication.driverName, remark, shippingNoteInfos,
+				sdkwx.send(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
 					function(res) {
 						console.log('发送定位', res);
-						var shippingNoteInfos = res.data[0]; //运单信息列表
 						if (res.type == "onSuccess") {
-
-							if (shippingNoteInfos) {
-								let dateTime = Number(shippingNoteInfos.interval + 1000)
-								console.log("定时开始", dateTime)
-								that.timer = setTimeout(() => {
-									//TODO 
-									that.send()
-								}, dateTime);
-							}
+							var shippingNoteInfos = res.data[0]; //运单信息列表
+							let dateTtime = Number(shippingNoteInfos.interval + 1000)
+							console.log("开始定时", dateTtime)
+							that.timer = setTimeout(() => {
+								that.send()
+							}, dateTtime);
 						} else if (res.type == "onFailure") {
 							var errorCode = res.data.errorCode; //错误码
 							var errorMsg = res.data.errorMsg; //错误描述
@@ -746,7 +755,7 @@
 							if (this.detailData.statusFlag == 1) {
 								_title = '暂存成功!'
 							} else {
-								that.auth() //开始授权并开始定位
+								that.start() //开始授权并开始定位
 								_title = '提交成功!'
 							}
 							that.$helper.fUN_AmapLocation.start({
@@ -805,6 +814,7 @@
 									//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
 								}
 							);
+							
 							this.$refs.uToast.show({
 								type: 'success',
 								message: _title,

+ 1 - 1
pages/order/index.vue

@@ -401,7 +401,7 @@
 		
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop
-			console.log("页面滚动了", res.scrollTop)
+			// console.log("页面滚动了", res.scrollTop)
 			if (this.scrollTop > 1200) {
 				uni.setTabBarItem({
 					index: 2,

+ 7 - 7
pages/order/signContract.vue

@@ -565,14 +565,14 @@
 													url: res.data,
 													success: function(res) {
 														var filePath = res.tempFilePath;
-														uni.openDocument({
-															filePath: filePath,
-															showMenu: true,
-															success: function(res) {
+		// 												uni.openDocument({
+		// 													filePath: filePath,
+		// 													showMenu: true,
+		// 													success: function(res) {
 		
-																console.log('打开文档成功');
-															}
-														});
+		// 														console.log('打开文档成功');
+		// 													}
+		// 												});
 													}
 												});
 												if (that.contractCheck) { //提交

+ 1 - 1
util/request.js

@@ -6,7 +6,7 @@ const baseRequest = (method, url, data, header) => {
 	if (header) {
 		contentheader = header
 	}
-	console.log(uni.getStorageSync("shiro"))
+	// console.log(uni.getStorageSync("shiro"))
 	let userInfo = uni.getStorageSync('userInfo');
 	let baseDefaultOpts = {
 		url: baseUrl + url,