|
@@ -13,7 +13,7 @@
|
|
当前定位
|
|
当前定位
|
|
</view>
|
|
</view>
|
|
<view class="header2-content">
|
|
<view class="header2-content">
|
|
- <view class="left Medium">
|
|
|
|
|
|
+ <view class="left Medium" @click="selectPosition">
|
|
<u-icon name="arrow-down"></u-icon>
|
|
<u-icon name="arrow-down"></u-icon>
|
|
<view class="">{{address}}</view>
|
|
<view class="">{{address}}</view>
|
|
<view class="" v-if="isposition">{{text}}</view>
|
|
<view class="" v-if="isposition">{{text}}</view>
|
|
@@ -78,7 +78,8 @@
|
|
},
|
|
},
|
|
positionType: {
|
|
positionType: {
|
|
type: ""
|
|
type: ""
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ location:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
@@ -193,12 +194,15 @@
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
//拼接当前定位回显地址
|
|
//拼接当前定位回显地址
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
|
+ that.location = res
|
|
let _address = res.address
|
|
let _address = res.address
|
|
// that.city = _address.city
|
|
// that.city = _address.city
|
|
that.seach.longitude = res.longitude
|
|
that.seach.longitude = res.longitude
|
|
that.seach.latitude = res.latitude
|
|
that.seach.latitude = res.latitude
|
|
that.address = _address.province + _address.city + _address.district + _address
|
|
that.address = _address.province + _address.city + _address.district + _address
|
|
.poiName
|
|
.poiName
|
|
|
|
+ that.searchAddress(_address.poiName)
|
|
|
|
+ that.addressName = _address.poiName
|
|
console.log(that.address)
|
|
console.log(that.address)
|
|
// #endif
|
|
// #endif
|
|
},
|
|
},
|
|
@@ -221,6 +225,7 @@
|
|
console.log('当前位置的经度:' + res.longitude);
|
|
console.log('当前位置的经度:' + res.longitude);
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
|
+ that.location = res
|
|
let _address = res.address
|
|
let _address = res.address
|
|
that.city = _address.city
|
|
that.city = _address.city
|
|
that.seach.longitude = res.longitude
|
|
that.seach.longitude = res.longitude
|
|
@@ -228,6 +233,8 @@
|
|
that.address = _address.province + _address.city + _address
|
|
that.address = _address.province + _address.city + _address
|
|
.district +
|
|
.district +
|
|
_address.poiName
|
|
_address.poiName
|
|
|
|
+ that.searchAddress(_address.poiName)
|
|
|
|
+ that.addressName = _address.poiName
|
|
// #endif
|
|
// #endif
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -308,7 +315,7 @@
|
|
url: 'https://restapi.amap.com/v5/place/text',
|
|
url: 'https://restapi.amap.com/v5/place/text',
|
|
data: parameters,
|
|
data: parameters,
|
|
success: (res) => {
|
|
success: (res) => {
|
|
- console.log(res.data);
|
|
|
|
|
|
+ console.log("searchAddress",res.data);
|
|
this.searchList = res.data.pois
|
|
this.searchList = res.data.pois
|
|
this.getStringColorReplace(res.data.pois, val)
|
|
this.getStringColorReplace(res.data.pois, val)
|
|
}
|
|
}
|
|
@@ -320,6 +327,23 @@
|
|
url: "../selectCity/selectCity"
|
|
url: "../selectCity/selectCity"
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ selectPosition(){
|
|
|
|
+ // uni.setStorage({
|
|
|
|
+ // key: 'setPosition',
|
|
|
|
+ // data: this.location,
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // uni.setStorage({
|
|
|
|
+ // key: 'setLocaltion',
|
|
|
|
+ // data: this.location,
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // uni.navigateBack({
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ },
|
|
toHome(item) {
|
|
toHome(item) {
|
|
uni.setStorage({
|
|
uni.setStorage({
|
|
key: 'setPosition',
|
|
key: 'setPosition',
|