From b7d730997c7c6ef8135e9fc917385a49373b51c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90?= Date: Thu, 27 Nov 2025 21:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=90=83=E5=B1=80=E8=AF=A6?= =?UTF-8?q?=E6=83=85=20=E5=9C=B0=E5=9B=BE=E5=AE=9A=E4=BD=8D=E6=8A=96?= =?UTF-8?q?=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/components/GameInfo/index.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/game_pages/detail/components/GameInfo/index.tsx b/src/game_pages/detail/components/GameInfo/index.tsx index fba6529..1d2075b 100644 --- a/src/game_pages/detail/components/GameInfo/index.tsx +++ b/src/game_pages/detail/components/GameInfo/index.tsx @@ -59,8 +59,10 @@ export default function GameInfo(props) { }; const [c_latitude, c_longitude] = currentLocation; + // 判断当前位置是否有效(不是初始值 [0, 0]) + const is_current_location_valid = c_latitude !== 0 && c_longitude !== 0; const distance = - latitude && longitude + latitude && longitude && is_current_location_valid ? calculateDistance(c_latitude, c_longitude, latitude, longitude) / 1000 : 0; @@ -183,8 +185,8 @@ export default function GameInfo(props) { {longitude && latitude && ( {}} // hide business msg