定位修改

This commit is contained in:
山兮 2024-04-17 09:45:00 +08:00
parent 96bde81921
commit 14e6a0d19d
2 changed files with 32 additions and 33 deletions

View File

@ -1,9 +1,9 @@
{
"name" : "登澜到家",
"appid" : "__UNI__B500DDB", //
"description" : "上门预约",
"versionName" : "1.0.7",
"versionCode" : 107,
"description" : "上门按摩服务",
"versionName" : "1.0.8",
"versionCode" : 108,
"transformPx" : false,
"uniStatistics" : {
"enable" : false //

View File

@ -7,8 +7,8 @@
<view class="flex-y-center c-base">
<i class="iconfont iconjuli mr-sm"></i>
<view class="map-text ellipsis">
<!-- {{location&&location.name ?location.name : isLoad ? '定位失败' : '定位中...'}} -->
{{location&&location.address ?location.address : isLoad ? '定位失败' : '定位中...'}}
{{location&&location.name ?location.name : isLoad ? '定位失败' : '定位中...'}}
<!-- {{location&&location.address ?location.address : isLoad ? '定位失败' : '定位中...'}} -->
</view>
<i class="iconfont icon-down"></i>
</view>
@ -229,44 +229,45 @@
title: '',
imageUrl: '',
path,
lng:'',
lat:''
}
},
methods: {
//
init(){
init() {
const _this = this;
uni.getLocation({
type: 'wgs84',
success: function (res) {
this.lng = res.longitude;
this.lat = res.latitude;
console.log(111,res);
const data = {
lng:res.longitude,
lat:res.latitude,
key:"ac07017e-6409-4aa4-88eb-6e252556d392"
}
success: function(res) {
uni.request({
url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=`+res.latitude+`&longitude=`+res.longitude,
data: {
text: 'uni.request'
},
header: {
'custom-header': 'hello' //
},
success: (res) => {
console.log(res.data.result.address);
url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` +
res.latitude + `&longitude=` + res.longitude,
data: {
text: 'uni.request'
},
header: {
'custom-header': 'hello' //
},
success: (res) => {
const index = res.data.result.address.indexOf("区")
console.log(222,index);
this.location.address = res.data.result.address.slice(index+1)
console.log("测试一下",res.data.result.address.slice(index+1));
}
let location = {
lng: res.data.result.ad_info.location.lng,
lat: res.data.result.ad_info.location.lat,
address: res.data.result.address,
city: '',
district: '',
name: res.data.result.address.slice(index + 1),
province: ''
}
_this.updateUserItem({
key: 'location',
val: location
})
}
});
}
});
},
...mapActions(['getConfigInfo', 'getUserInfo', 'getCityList', 'getServiceCoachList','getAddressList']),
...mapActions(['getConfigInfo', 'getUserInfo', 'getCityList', 'getServiceCoachList', 'getAddressList']),
...mapMutations(['updateUserItem', 'updateTechnicianItem']),
async initIndex(refresh = false) {
// #ifdef H5
@ -567,13 +568,11 @@
key: 'cityId',
val: city_id
})
console.log(333,param);
param = Object.assign({}, param, {
lng,
lat,
city_id
})
console.log(222,param);
let {
coach_format = 1