Merge branch 'light_v2'

This commit is contained in:
张成
2025-09-10 21:48:25 +08:00
12 changed files with 194 additions and 105 deletions

View File

@@ -871,12 +871,14 @@ function Index() {
const updateLocation = async () => {
try {
const location = await getCurrentLocation();
setCurrentLocation([location.latitude, location.longitude]);
await updateUserInfo({
latitude: location.latitude,
longitude: location.longitude,
});
const location = await getCurrentLocation()
setCurrentLocation([location.latitude, location.longitude])
// 使用 userStore 中的统一位置更新方法
await updateUserInfo({ latitude: location.latitude, longitude: location.longitude })
// 位置更新后,重新获取详情页数据(因为距离等信息可能发生变化)
await fetchDetail()
} catch (error) {
console.error("用户位置更新失败", error);
}