gjy 2 anos atrás
pai
commit
d9582ffc53
3 arquivos alterados com 88 adições e 109 exclusões
  1. 1 1
      components/data/data.js
  2. 86 78
      pages/goodSource/index.vue
  3. 1 30
      pages/order/confirmLoading.vue

+ 1 - 1
components/data/data.js

@@ -2523,7 +2523,7 @@ const address = [
 						"value": "210802"
 					},
 					{
-						"label": "西",
+						"label": "西",
 						"value": "210803"
 					},
 					{

+ 86 - 78
pages/goodSource/index.vue

@@ -224,12 +224,12 @@
 		},
 		onLoad() {
 			that = this
-			this.checkOpenGPSServiceByAndroidIOS()
+			// this.checkOpenGPSServiceByAndroidIOS()
 		},
 		onHide() {
 			this.isdblclick = 0
 		},
-		onShow() {
+		async onShow() {
 			if (this.scrollTop > 1200) {
 				uni.setTabBarItem({
 					index: 0,
@@ -245,21 +245,23 @@
 				selectedIconPath: 'static/images/common/dingdan@2x.png'
 			})
 			var that = this
-			// var photol=await permision.checkSystemEnableLocation()
-			// if (uni.getStorageSync('confirm_location')) {
-			// 	// that.get_localtion_permission()
-			// }
+			
 			//获取上一次点击起装卸地
 			if (uni.getStorageSync('fPlaceObj')) {
 				that.startPlace = uni.getStorageSync('fPlaceObj');
 			} else {
-				that.startPlace.selected = '北京'
-				uni.setStorageSync('fPlaceObj', {
-					fchoosearea: '全部',
-					fchoosecity: '市辖区',
-					fchooseprovince: '北京',
-					selected: '北京'
-				})
+				var photol=await permision.checkSystemEnableLocation()
+				if (uni.getStorageSync('confirm_location')||photol) {
+						this.getLngLat()
+				}else{
+					that.startPlace.selected = '北京'
+					uni.setStorageSync('fPlaceObj', {
+						fchoosearea: '全部',
+						fchoosecity: '市辖区',
+						fchooseprovince: '北京',
+						selected: '北京'
+					})
+				}
 			}
 			if (uni.getStorageSync('sPlaceObj')) {
 				that.endPlace = uni.getStorageSync('sPlaceObj');
@@ -352,10 +354,11 @@
 				if (photol == true) {
 					this.getLngLat()
 				} else {
-					that.$refs.uToast.show({
-						type: 'error',
-						message: "未获取定位权限!",
-					})
+					// that.$refs.uToast.show({
+					// 	type: 'error',
+					// 	message: "未获取定位权限!",
+					// })
+					this.checkOpenGPSServiceByAndroidIOS()
 				}
 			},
 			async getLngLat() {
@@ -406,63 +409,65 @@
 					var main = plus.android.runtimeMainActivity();
 					var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
 					if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) {
-						// uni.showModal({
-						// 	title: '提示',
-						// 	content: '请打开定位服务功能',
-						// 	// showCancel: false, // 不显示取消按钮
-						// 	success(res) {
-						// 		if (res.confirm) {
-						// 			uni.setStorageSync('confirm_location', 1)
-						// 			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 {
-						// 				uni.setStorageSync('fPlaceObj', {
-						// 					fchoosearea: '全部',
-						// 					fchoosecity: '市辖区',
-						// 					fchooseprovince: '北京',
-						// 					selected: '东城'
-						// 				})
-						// 				uni.setStorageSync('sPlaceObj', {
-						// 					schoosearea: '请选择区',
-						// 					schoosecity: '请选择市',
-						// 					schooseprovince: '全国',
-						// 					selected: '全国'
-						// 				})
-						// 				uni.setStorageSync('longitudeAndLatitude', '116.3972,39.9096')
-						// 			}
-						// 		} else {
-						// 			uni.setStorageSync('fPlaceObj', {
-						// 				fchoosearea: '全部',
-						// 				fchoosecity: '市辖区',
-						// 				fchooseprovince: '北京',
-						// 				selected: '东城'
-						// 			})
-						// 			uni.setStorageSync('sPlaceObj', {
-						// 				schoosearea: '请选择区',
-						// 				schoosecity: '请选择市',
-						// 				schooseprovince: '全国',
-						// 				selected: '全国'
-						// 			})
-						// 			uni.setStorageSync('longitudeAndLatitude', '116.3972,39.9096')
-						// 		}
-						// 	}
-						// });
-						uni.setStorageSync('fPlaceObj', {
-							fchoosearea: '全部',
-							fchoosecity: '市辖区',
-							fchooseprovince: '北京',
-							selected: '东城'
-						})
-						uni.setStorageSync('sPlaceObj', {
-							schoosearea: '请选择区',
-							schoosecity: '请选择市',
-							schooseprovince: '全国',
-							selected: '全国'
-						})
+						uni.showModal({
+							title: '提示',
+							content: '请打开定位服务功能',
+							// showCancel: false, // 不显示取消按钮
+							success(res) {
+								if (res.confirm) {
+									uni.setStorageSync('confirm_location', 1)
+									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服务页面
+										console.log()
+									} 
+									// else {
+									// 	uni.setStorageSync('fPlaceObj', {
+									// 		fchoosearea: '全部',
+									// 		fchoosecity: '市辖区',
+									// 		fchooseprovince: '北京',
+									// 		selected: '东城'
+									// 	})
+									// 	uni.setStorageSync('sPlaceObj', {
+									// 		schoosearea: '请选择区',
+									// 		schoosecity: '请选择市',
+									// 		schooseprovince: '全国',
+									// 		selected: '全国'
+									// 	})
+									// 	uni.setStorageSync('longitudeAndLatitude', '116.3972,39.9096')
+									// }
+								} else {
+									// uni.setStorageSync('fPlaceObj', {
+									// 	fchoosearea: '全部',
+									// 	fchoosecity: '市辖区',
+									// 	fchooseprovince: '北京',
+									// 	selected: '东城'
+									// })
+									// uni.setStorageSync('sPlaceObj', {
+									// 	schoosearea: '请选择区',
+									// 	schoosecity: '请选择市',
+									// 	schooseprovince: '全国',
+									// 	selected: '全国'
+									// })
+									// uni.setStorageSync('longitudeAndLatitude', '116.3972,39.9096')
+								}
+							}
+						});
+						// uni.setStorageSync('fPlaceObj', {
+						// 	fchoosearea: '全部',
+						// 	fchoosecity: '市辖区',
+						// 	fchooseprovince: '北京',
+						// 	selected: '东城'
+						// })
+						// uni.setStorageSync('sPlaceObj', {
+						// 	schoosearea: '请选择区',
+						// 	schoosecity: '请选择市',
+						// 	schooseprovince: '全国',
+						// 	selected: '全国'
+						// })
 						if (uni.getStorageSync('fPlaceObj')) {
 							that.startPlace = uni.getStorageSync('fPlaceObj');
 						}
@@ -957,11 +962,14 @@
 			async clickTab(val) {
 				console.log("val", val)
 				this.tabIndex = val.index
-				if (val == '按距离') {
-					var photol = await permision.checkSystemEnableLocation()
-					if (uni.getStorageSync('confirm_location')) {
+				if (val.name == '按距离') {
+					console.log(1)
+					// this.checkOpenGPSServiceByAndroidIOS()
+					// var photol = await permision.checkSystemEnableLocation()
+					// console.log("photol",photol)
+					// if (!photol) {
 						that.get_localtion_permission()
-					}
+					// }
 				} else {
 					this.upCallback({
 						size: 10,

+ 1 - 30
pages/order/confirmLoading.vue

@@ -368,7 +368,7 @@
 							this.detailData.transportationDuration = res.data.hyCarrierInfo.transportationDuration
 						}
 						// #ifdef APP-PLUS
-						// this.getLngLat();
+						this.getLngLat();
 						// #endif
 						this.$request.baseRequest('get', '/carrierInfo/getHyCarrierInfo', {
 							orderId: this.detailData.id,
@@ -830,26 +830,6 @@
 				});
 			},
 			confirmClick() {
-				//判断有没有定位权限  没有 不让提交
-				// this.getLngLat()
-				let _dw = this.$tx.calculateDistance()
-				if (_dw.latitude) {
-					that.detailData.hyCarrierInfo.longitudeLatitude = res.longitude + ',' + res
-						.latitude
-					that.detailData.hyCarrierInfo.loadingAreaLongitude = res.longitude;
-					that.detailData.hyCarrierInfo.loadingAreaLatitude = res.latitude;
-					that.detailData.hyCarrierInfo.sendCity = that.$helper.filterUrban(res.address.city)
-					that.localtion.city = that.$helper.filterUrban(res.address.city)
-					that.$set(that.detailData, 'loadingArea', that.$helper.filterUrban(res.address
-						.district))
-					that.$set(that.detailData, 'loadingCity', that.$helper.filterUrban(res.address
-						.city))
-					that.localtion.sendArea = that.$helper.filterUrban(res.address.district)
-					// .loadingCity = that.$helper.filterUrban(res.address.city)
-					that.detailData.loadingLongitude = res.longitude;
-					that.detailData.loadingLatitude = res.latitude;
-					that.$forceUpdate()
-					uni.removeStorageSync('contractdata')
 					var that = this
 					this.isShowAlert = false
 					//1暂存
@@ -894,15 +874,6 @@
 						this.start(data) //先调用管局start
 					}
 
-				} else {
-					that.$refs.uToast.show({
-						type: 'error',
-						message: "未获取定位权限!",
-					})
-
-					return
-				}
-
 			}
 		},
 	}