使用腾讯地图,百度和高德不在使用

This commit is contained in:
邹宗楠
2024-07-31 11:09:07 +08:00
parent d6e1893671
commit 4cf9001c9a
20 changed files with 287 additions and 212 deletions

View File

@@ -2057,7 +2057,7 @@ func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string)
order.ConsigneeMobile2 = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Telephone, order.VendorOrgCode)
order.BuyerComment = jdsOrder.OrderRemark
if order.ConsigneeAddress != "" {
lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
lng, lat, _, _, _ := api.TencentMapAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
}
@@ -2384,16 +2384,16 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
}
}
//if cityCode != 0 {
lng, lat, _ = api.AutonaviAPI.GetCoordinateFromAddressByPage(order.ConsigneeAddress, cityCode)
//lng, lat, _ = api.AutonaviAPI.GetCoordinateFromAddressByPage(order.ConsigneeAddress, cityCode)
//} else {
lng2, lat2, _ = api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
if err == nil && lng != 0 && lat != 0 {
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
} else {
lng2, lat2, _, _, err = api.TencentMapAPI.GetCoordinateFromAddress(order.ConsigneeAddress, utils.Int2Str(cityCode))
if err == nil && lng2 != 0 && lat2 != 0 {
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng2)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat2)
}
} /* else {
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng2)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat2)
}*/
//}
distance := jxutils.EarthDistance(lng, lat, lng2, lat2)
if distance > 1 {