修改消息也图标

This commit is contained in:
张成
2025-11-16 20:06:22 +08:00
parent ad971796ba
commit eb10ba0a38
7 changed files with 115 additions and 55 deletions

View File

@@ -215,10 +215,26 @@ const ListPage = () => {
);
useEffect(() => {
getLocation();
fetchUserInfo();
// 分批异步执行初始化操作,避免阻塞首屏渲染
// 1. 立即执行:获取城市和二维码(轻量操作)
getCities();
getCityQrCode();
// 2. 延迟执行:获取用户信息(不阻塞渲染)
requestAnimationFrame(() => {
fetchUserInfo().catch((error) => {
console.error('获取用户信息失败:', error);
});
});
// 3. 延迟执行:获取位置信息(可能较慢,不阻塞首屏)
requestAnimationFrame(() => {
requestAnimationFrame(() => {
getLocation().catch((error) => {
console.error('获取位置信息失败:', error);
});
});
});
}, []);
// 监听数据变化,如果是第一页就恢复显示搜索框