定位修改
This commit is contained in:
parent
96bde81921
commit
14e6a0d19d
|
@ -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 //全局关闭
|
||||
|
|
|
@ -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,26 +229,18 @@
|
|||
title: '',
|
||||
imageUrl: '',
|
||||
path,
|
||||
lng:'',
|
||||
lat:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取当前定位
|
||||
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"
|
||||
}
|
||||
uni.request({
|
||||
url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=`+res.latitude+`&longitude=`+res.longitude,
|
||||
url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` +
|
||||
res.latitude + `&longitude=` + res.longitude,
|
||||
data: {
|
||||
text: 'uni.request'
|
||||
},
|
||||
|
@ -256,11 +248,20 @@
|
|||
'custom-header': 'hello' //自定义请求头信息
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res.data.result.address);
|
||||
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
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue