refactor(custom): 地图服务商更换
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -123,21 +123,36 @@ const getUserLocal = async () => {
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
// Taro.request({
|
||||
// url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=4EJBZ-TZXCV-IHUPX-UMI2L-MK3N3-37FSQ&get_poi=1`,
|
||||
// method: 'GET',
|
||||
// success: res => {
|
||||
// switch (res.data.status) {
|
||||
// case 121:
|
||||
// Taro.showToast({
|
||||
// title: res.data.message,
|
||||
// icon: 'none',
|
||||
// });
|
||||
// break;
|
||||
// default:
|
||||
// const data = res.data.result.address_component;
|
||||
// address.value = `${data.district}${data.street_number}`;
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
Taro.request({
|
||||
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=4EJBZ-TZXCV-IHUPX-UMI2L-MK3N3-37FSQ&get_poi=1`,
|
||||
url: `https://api.tianditu.gov.cn/geocoder?postStr={'lon':${res.longitude},'lat':${res.latitude},'ver':1}&type=geocode&tk=42db4f3dfd1a18d31e73ee90aa2ce054`,
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
switch (res.data.status) {
|
||||
case 121:
|
||||
Taro.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none',
|
||||
});
|
||||
break;
|
||||
default:
|
||||
const data = res.data.result.address_component;
|
||||
address.value = `${data.district}${data.street_number}`;
|
||||
break;
|
||||
const { msg, result } = res.data;
|
||||
if (msg === 'ok') {
|
||||
address.value = `${result.addressComponent.county}${result.addressComponent.town}${result.addressComponent.address}`;
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: msg,
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
spacing="1"
|
||||
active-color="rgba(252, 207, 10, 1)"
|
||||
v-model="mer_info.rate" />
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:10000</view>
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:1000+</view>
|
||||
<view class="text-[#9E9E9E] text-[25px]"
|
||||
>营业时间:{{ mer_info.week_start }}-{{ mer_info.week_end }}
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user