|
|
@@ -54,16 +54,12 @@ export const useSysXsbStore = defineStore('system-xsb', {
|
|
|
Apis.xsb.shopList({}).then((res) => {
|
|
|
this.xsbShopList = res.data
|
|
|
const { Location } = storeToRefs(useAddressStore())
|
|
|
- if (Location.value.latitude == null || Location.value.longitude == null) {
|
|
|
- useAddressStore().getLocation()
|
|
|
- return
|
|
|
- }
|
|
|
let minDistance = Infinity
|
|
|
for (const shop of res.data) {
|
|
|
if (shop.shopLat && shop.shopLng) {
|
|
|
const distance = this.getDistance(
|
|
|
- Location.value.latitude,
|
|
|
- Location.value.longitude,
|
|
|
+ Location.value.latitude || 113.264435,
|
|
|
+ Location.value.longitude || 23.129163,
|
|
|
Number(shop.shopLat),
|
|
|
Number(shop.shopLng),
|
|
|
)
|