gjy 2 年之前
父节点
当前提交
645407b4f4
共有 3 个文件被更改,包括 55 次插入136 次删除
  1. 3 0
      pages/order/index.vue
  2. 22 0
      pages/release/release.vue
  3. 30 136
      pages/release/selectAddress.vue

+ 3 - 0
pages/order/index.vue

@@ -656,6 +656,9 @@
 	.content{
 		padding-bottom: 160px;
 	}
+	.ssx{
+		position:relative;top:3rpx;
+	}
 	.top-content {
 		background: url(../../static/images/order/bg.png) no-repeat;
 		background-size: cover;

+ 22 - 0
pages/release/release.vue

@@ -333,6 +333,28 @@
 			this.goToRecord()
 		},
 		onShow() {
+			if(uni.getStorageSync('addressInfo')){
+				console.log(uni.getStorageSync('addressInfo'))
+				if (uni.getStorageSync('addressInfo').type==0) {
+					this.dataObj.sendCity =uni.getStorageSync('addressInfo').city
+					this.dataObj.sendArea = uni.getStorageSync('addressInfo').area
+					this.dataObj.sendPrivate = uni.getStorageSync('addressInfo').province
+					this.dataObj.sendDetailedAddress = uni.getStorageSync('addressInfo').detailedAddress
+					this.dataObj.sendLongitude = uni.getStorageSync('addressInfo').longitude
+					this.dataObj.sendLatitude = uni.getStorageSync('addressInfo').latitude
+					this.dataObj.senderPhone = uni.getStorageSync('addressInfo').contactPhone
+					this.dataObj.sender = uni.getStorageSync('addressInfo').contacts
+				}else{
+					this.dataObj.unloadDetailedAddress = uni.getStorageSync('addressInfo').detailedAddress
+					this.dataObj.unloadCity = uni.getStorageSync('addressInfo').city
+					this.dataObj.unloadArea = uni.getStorageSync('addressInfo').area
+					this.dataObj.unloadPrivate = uni.getStorageSync('addressInfo').province
+					this.dataObj.unsendLongitude = uni.getStorageSync('addressInfo').longitude
+					this.dataObj.unsendLatitude = uni.getStorageSync('addressInfo').latitude
+					this.dataObj.receiver = uni.getStorageSync('addressInfo').contacts
+					this.dataObj.receiverPhone = uni.getStorageSync('addressInfo').contactPhone
+				} 
+			}
 			_this = this
 			// #ifdef APP-PLUS
 			// let _status = this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {

+ 30 - 136
pages/release/selectAddress.vue

@@ -260,149 +260,43 @@
 							console.log('当前位置的纬度:' + res.latitude);
 							uni.chooseLocation({
 								success: function(res) {
+									// var locationObj = that.$helper.formatLocation(res);
+									// console.log(locationObj)
 									console.log(res);
 									console.log('位置名称:' + res.name);
 									console.log('详细地址:' + res.address);
 									console.log('纬度:' + res.latitude);
 									console.log('经度:' + res.longitude);
-									var locationObj = that.$helper.formatLocation(res);
-									console.log(locationObj)
-									that.temporaryAddress.latitude = res.latitude
-									that.temporaryAddress.longitude = res.longitude
-									that.temporaryAddress.detailedAddress = locationObj.ADDRESS
-									that.temporaryAddress.province = locationObj.REGION_PROVINCE
-									that.temporaryAddress.city = locationObj.REGION_CITY
-									that.temporaryAddress.area = locationObj.REGION_COUNTRY
-									that.temporaryAddress.commonId = that.userInfo.id
-									that.configAddress(that.temporaryAddress)
+									let _address = that.$helper.formatLocation(res.address)
+									console.log('----------------------------')
+									console.log(_address,that.type)
+									var data={}
+									data.latitude = res.latitude
+									data.longitude = res.longitude
+									data.detailedAddress = _address.Village
+									data.province = _address.Province
+									data.city = _address.City
+									data.area = _address.Country
+									data.commonId = that.userInfo.id
+									data.type=that.type
+									uni.setStorageSync('addressInfo',data)
+									uni.$u.route('/pages/release/release');
+									// that.temporaryAddress.latitude = res.latitude
+									// that.temporaryAddress.longitude = res.longitude
+									// that.temporaryAddress.detailedAddress = locationObj.ADDRESS
+									// that.temporaryAddress.province = locationObj.REGION_PROVINCE
+									// that.temporaryAddress.city = locationObj.REGION_CITY
+									// that.temporaryAddress.area = locationObj.REGION_COUNTRY
+									// that.temporaryAddress.commonId = that.userInfo.id
+									// that.configAddress(that.temporaryAddress)
+									// that.$forceUpdate()
 								},
-								fail: function() {
-									console.log(2222222)
-								// 	uni.getSetting({
-								// 		success: function(res) {
-								// 			var statu = res.authSetting;
-								// 			if (!statu['scope.userLocation']) {
-								// 				uni.showModal({
-								// 					title: '是否授权当前位置',
-								// 					content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
-								// 					success: function(tip) {
-								// 						if (tip.confirm) {
-								// 							uni.openSetting({
-								// 								success: function(
-								// 									data
-								// 									) {
-								// 									if (data
-								// 										.authSetting[
-								// 											"scope.userLocation"
-								// 										] ===
-								// 										true
-								// 									) {
-								// 										uni.showToast({
-								// 											title: '授权成功',
-								// 											icon: 'success',
-								// 											duration: 1000
-								// 										})
-								// 										//授权成功之后,再调用chooseLocation选择地方
-								// 										uni.chooseLocation({
-								// 											success: function(
-								// 												res
-								// 											) {
-								// 												console
-								// 													.log(
-								// 														res
-								// 													);
-								// 												console
-								// 													.log(
-								// 														'位置名称:' +
-								// 														res
-								// 														.name
-								// 													);
-								// 												console
-								// 													.log(
-								// 														'详细地址:' +
-								// 														res
-								// 														.address
-								// 													);
-								// 												console
-								// 													.log(
-								// 														'纬度:' +
-								// 														res
-								// 														.latitude
-								// 													);
-								// 												console
-								// 													.log(
-								// 														'经度:' +
-								// 														res
-								// 														.longitude
-								// 													);
-								// 												var locationObj =
-								// 													that
-								// 													.$helper
-								// 													.formatLocation(
-								// 														res
-								// 													);
-								// 												console
-								// 													.log(
-								// 														locationObj
-								// 													)
-								// 												that.temporaryAddress
-								// 													.latitude =
-								// 													res
-								// 													.latitude
-								// 												that.temporaryAddress
-								// 													.longitude =
-								// 													res
-								// 													.longitude
-								// 												that.temporaryAddress
-								// 													.detailedAddress =
-								// 													locationObj
-								// 													.ADDRESS
-								// 												that.temporaryAddress
-								// 													.province =
-								// 													locationObj
-								// 													.REGION_PROVINCE
-								// 												that.temporaryAddress
-								// 													.city =
-								// 													locationObj
-								// 													.REGION_CITY
-								// 												that.temporaryAddress
-								// 													.area =
-								// 													locationObj
-								// 													.REGION_COUNTRY
-								// 												that.temporaryAddress
-								// 													.commonId =
-								// 													that
-								// 													.userInfo
-								// 													.id
-								// 												that.configAddress(
-								// 													that
-								// 													.temporaryAddress
-								// 												)
-								// 											},
-								// 										})
-								// 									} else {
-								// 										uni.showToast({
-								// 											title: '授权失败',
-								// 											icon: 'none',
-								// 											duration: 1000
-								// 										})
-								// 									}
-								// 								}
-								// 							})
-								// 						}
-								// 					}
-								// 				})
-								// 			}
-								// 		},
-								// 		fail: function(res) {
-								// 			uni.showToast({
-								// 				title: '调用授权窗口失败',
-								// 				icon: 'none',
-								// 				duration: 1000
-								// 			})
-								// 		}
-								// 	})
 								
+								fail(err) {
+									console.log(err)
+								},
+								complete(res1) {
+									console.log(res1)
 								}
 							});
 						}