This commit is contained in:
张成
2025-12-03 18:26:28 +08:00
parent 828a090daa
commit 7699facccd
4 changed files with 37 additions and 27 deletions

View File

@@ -13,7 +13,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
// gap: 24px;
gap: 24px;
.tips {
display: flex;
@@ -56,7 +56,7 @@
// border-radius: 12px;
// border: 1px solid rgba(0, 0, 0, 0.06);
// background: lightgray 50% / cover no-repeat;
// box-shadow: 0 4px 36px 0 rgba(0, 0, 0, 0.16);
box-shadow: 0 4px 36px 0 rgba(0, 0, 0, 0.16);
}
.qrcodeTip {
@@ -67,7 +67,7 @@
font-style: normal;
font-weight: 400;
line-height: normal;
margin-top: -30px;
margin-top: 0px;
}
}
}
@@ -94,7 +94,7 @@
// background-color: #fafafa;
// 使用 margin-top 负值来控制可见性,保持元素高度不变,筛选项位置固定
transition: margin-top 0.25s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.2s ease-out;
opacity 0.2s ease-out;
padding: 10px 15px 10px 15px; // 统一边距上下10px 左右15px
box-sizing: border-box;
overflow: hidden;
@@ -190,5 +190,4 @@
.guideBarHighZIndex {
z-index: 900 !important; // 正常状态,保持较高层级
}
}

View File

@@ -114,7 +114,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
// 使用 ref 保存最新的状态值,避免依赖项变化导致函数重新创建
const showSearchBarRef = useRef(showSearchBar);
const isShowInputCustomerNavBarRef = useRef(isShowInputCustomerNavBar);
useEffect(() => {
showSearchBarRef.current = showSearchBar;
isShowInputCustomerNavBarRef.current = isShowInputCustomerNavBar;
@@ -124,7 +124,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
const handleScrollViewScroll = useCallback(
(e: any) => {
const currentScrollTop = e?.detail?.scrollTop || 0;
const lastScrollTop = lastScrollTopRef.current;
const currentTime = Date.now();
@@ -199,18 +199,11 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
getCities();
getCityQrCode();
getDistricts(); // 新增:获取行政区列表
// 2. 移除 fetchUserInfo 调用,因为父组件 main_pages/index.tsx 已经在授权成功后调用了
// 这里直接使用 store 中的用户信息即可
// 3. 延迟执行:获取位置信息(可能较慢,不阻塞首屏)
requestAnimationFrame(() => {
requestAnimationFrame(() => {
getLocation().catch((error) => {
console.error('获取位置信息失败:', error);
});
});
getLocation().catch((error) => {
console.error('获取位置信息失败:', error);
});
}, []);
useEffect(() => {
@@ -268,7 +261,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
} finally {
// 使用 requestAnimationFrame 替代 setTimeout(0),性能更好
requestAnimationFrame(() => {
setRefreshing(false);
setRefreshing(false);
});
}
};
@@ -305,7 +298,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
updateFilterOptions(params);
};
const handleSearchChange = () => {};
const handleSearchChange = () => { };
const handleDistanceOrQuickChange = (name, value) => {
updateDistanceQuickFilter({
@@ -354,6 +347,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
className={styles.qrcode}
src={item.qr_code_url}
mode="widthFix"
showMenuByLongpress
onClick={() => {
saveImage(item.qr_code_url);
}}
@@ -374,7 +368,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
// 判定是否显示"暂无球局"页面
// 条件:省份不是上海 或 (已加载完成且球局数量为0)
const shouldShowNoGames = province !== "上海" ;
const shouldShowNoGames = province !== "上海";
return (
<>
@@ -400,9 +394,8 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
)}
<View className={styles.fixedHeader}>
<View
className={`${styles.listTopSearchWrapper} ${
showSearchBar ? styles.show : styles.hide
}`}
className={`${styles.listTopSearchWrapper} ${showSearchBar ? styles.show : styles.hide
}`}
>
<SearchBar
handleFilterIcon={toggleShowPopup}
@@ -430,7 +423,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
</View>
</View>
<ScrollView refresherBackground="#FAFAFA"
<ScrollView refresherBackground="#FAFAFA"
ref={scrollViewRef}
scrollY
scrollTop={scrollTop}