修改用户授权调用位置和逻辑
This commit is contained in:
@@ -9,7 +9,6 @@ import { View, Image, Text, ScrollView } from "@tarojs/components";
|
||||
import ListContainer from "@/container/listContainer";
|
||||
import DistanceQuickFilter from "@/components/DistanceQuickFilter";
|
||||
import { updateUserLocation } from "@/services/userService";
|
||||
import { useUserActions } from "@/store/userStore";
|
||||
import { useDictionaryStore } from "@/store/dictionaryStore";
|
||||
import { saveImage, navigateTo } from "@/utils";
|
||||
|
||||
@@ -35,7 +34,6 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
|
||||
onFilterPopupVisibleChange,
|
||||
}) => {
|
||||
const store = useListStore() || {};
|
||||
const { fetchUserInfo } = useUserActions();
|
||||
const { statusNavbarHeightInfo, getCurrentLocationInfo } =
|
||||
useGlobalState() || {};
|
||||
const { totalHeight = 98 } = statusNavbarHeightInfo || {};
|
||||
@@ -196,12 +194,8 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
|
||||
getCities();
|
||||
getCityQrCode();
|
||||
|
||||
// 2. 延迟执行:获取用户信息(不阻塞渲染)
|
||||
requestAnimationFrame(() => {
|
||||
fetchUserInfo().catch((error) => {
|
||||
console.error('获取用户信息失败:', error);
|
||||
});
|
||||
});
|
||||
// 2. 移除 fetchUserInfo 调用,因为父组件 main_pages/index.tsx 已经在授权成功后调用了
|
||||
// 这里直接使用 store 中的用户信息即可
|
||||
|
||||
// 3. 延迟执行:获取位置信息(可能较慢,不阻塞首屏)
|
||||
requestAnimationFrame(() => {
|
||||
|
||||
Reference in New Issue
Block a user