去掉滚动折叠

This commit is contained in:
2025-11-29 22:52:05 +08:00
parent f4951c18f8
commit 7b0b78c9a0
8 changed files with 36 additions and 20 deletions

View File

@@ -8,19 +8,22 @@ interface IProps {
errorImg?: string; errorImg?: string;
btnText?: string; btnText?: string;
btnImg?: string; btnImg?: string;
height?: string wrapperHeight?: string;
width?: string;
height?: string;
} }
const ListLoadError = (props: IProps) => { const ListLoadError = (props: IProps) => {
const { reload, text, errorImg, btnText, btnImg, height = "unset" } = props; const { reload, text, errorImg, btnText, btnImg, wrapperHeight="", width = "", height = "" } = props;
const handleReload = () => { const handleReload = () => {
reload && typeof reload === "function" && reload(); reload && typeof reload === "function" && reload();
}; };
return ( return (
<View className={styles.listLoadError} style={{ height }}> <View className={styles.listLoadError} style={{height: wrapperHeight}}>
<Image <Image
className={styles.listLoadErrorImg} className={styles.listLoadErrorImg}
style={{ width, height }}
src={errorImg ? img[errorImg] : img.ICON_LIST_LOAD_ERROR} src={errorImg ? img[errorImg] : img.ICON_LIST_LOAD_ERROR}
/> />
{text && <Text className={styles.listLoadErrorText}>{text}</Text>} {text && <Text className={styles.listLoadErrorText}>{text}</Text>}

View File

@@ -50,6 +50,7 @@ export default {
ICON_LIST_LOAD_ERROR: require('@/static/list/icon-load-error.svg'), ICON_LIST_LOAD_ERROR: require('@/static/list/icon-load-error.svg'),
ICON_LIST_RELOAD: require('@/static/list/icon-reload.svg'), ICON_LIST_RELOAD: require('@/static/list/icon-reload.svg'),
ICON_LIST_EMPTY: require('@/static/emptyStatus/publish-empty.png'), ICON_LIST_EMPTY: require('@/static/emptyStatus/publish-empty.png'),
ICON_LIST_EMPTY_CARD: require('@/static/emptyStatus/publish-empty-card.png'),
ICON_LIST_SEARCH_SEARCH: require('@/static/search/icon-search.svg'), ICON_LIST_SEARCH_SEARCH: require('@/static/search/icon-search.svg'),
ICON_LIST_SEARCH_BACK: require('@/static/search/icon-back.svg'), ICON_LIST_SEARCH_BACK: require('@/static/search/icon-back.svg'),
ICON_LIST_SEARCH_CLEAR: require('@/static/search/icon-search-clear.svg'), ICON_LIST_SEARCH_CLEAR: require('@/static/search/icon-search-clear.svg'),

View File

@@ -29,6 +29,8 @@ const ListContainer = (props) => {
collapse = false, collapse = false,
defaultShowNum, defaultShowNum,
evaluateFlag, evaluateFlag,
listLoadErrorWrapperHeight,
listLoadErrorWidth,
listLoadErrorHeight, listLoadErrorHeight,
} = props; } = props;
const timerRef = useRef<NodeJS.Timeout | null>(null); const timerRef = useRef<NodeJS.Timeout | null>(null);
@@ -163,6 +165,8 @@ const ListContainer = (props) => {
btnText={btnText} btnText={btnText}
btnImg={btnImg} btnImg={btnImg}
text={emptyText || "暂无数据"} text={emptyText || "暂无数据"}
wrapperHeight={listLoadErrorWrapperHeight || ""}
width={listLoadErrorWidth || ""}
height={listLoadErrorHeight || ""} height={listLoadErrorHeight || ""}
/> />
); );

View File

@@ -34,7 +34,7 @@
// MyselfPageContent 组件使用的类名 // MyselfPageContent 组件使用的类名
.myselfPageContentMain { .myselfPageContentMain {
min-height: calc(100vh + 5px); // min-height: calc(100vh + 5px);
animation: backgroundGradient 0s ease-in-out forwards; animation: backgroundGradient 0s ease-in-out forwards;
z-index: 5; z-index: 5;
flex: 1; flex: 1;

View File

@@ -144,13 +144,13 @@ const MyselfPageContent: React.FC = () => {
setActiveTab(tab); setActiveTab(tab);
}; };
const handleScroll = (event: any) => { // const handleScroll = (event: any) => {
const scrollData = event.detail; // const scrollData = event.detail;
setCollapseProfile(scrollData.scrollTop > 1); // setCollapseProfile(scrollData.scrollTop > 1);
}; // };
return ( return (
<ScrollView scrollY className={styles.myselfPage} onScroll={handleScroll}> <ScrollView scrollY className={styles.myselfPage}>
<View <View
className={styles.myselfPageContentMain} className={styles.myselfPageContentMain}
style={{ paddingTop: `${totalHeight}px` }} style={{ paddingTop: `${totalHeight}px` }}
@@ -225,8 +225,8 @@ const MyselfPageContent: React.FC = () => {
recommendList={[]} recommendList={[]}
loading={loading} loading={loading}
error={null} error={null}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY_CARD"
emptyText="暂未发布球局" emptyText="还没有发布球局"
btnText="去发布" btnText="去发布"
btnImg="ICON_ADD" btnImg="ICON_ADD"
reload={goPublish} reload={goPublish}
@@ -234,7 +234,9 @@ const MyselfPageContent: React.FC = () => {
loadMoreMatches={() => {}} loadMoreMatches={() => {}}
collapse={true} collapse={true}
style={{ paddingBottom: 0, overflow: "hidden" }} style={{ paddingBottom: 0, overflow: "hidden" }}
listLoadErrorHeight="320px" listLoadErrorWrapperHeight="267px"
listLoadErrorWidth="100%"
listLoadErrorHeight="152px"
defaultShowNum={3} defaultShowNum={3}
/> />
</ScrollView> </ScrollView>
@@ -248,12 +250,14 @@ const MyselfPageContent: React.FC = () => {
recommendList={[]} recommendList={[]}
loading={loading} loading={loading}
error={null} error={null}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY_CARD"
isShowNoData={ended_game_records.length === 0} isShowNoData={ended_game_records.length === 0}
loadMoreMatches={() => {}} loadMoreMatches={() => {}}
collapse={true} collapse={true}
style={{ paddingBottom: "90px", overflow: "hidden" }} style={{ paddingBottom: "90px", overflow: "hidden" }}
listLoadErrorHeight="320px" listLoadErrorWrapperHeight="220px"
listLoadErrorWidth="100%"
listLoadErrorHeight="152px"
defaultShowNum={3} defaultShowNum={3}
/> />
</ScrollView> </ScrollView>

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -68,7 +68,7 @@
// 主要内容区域 // 主要内容区域
.other_main_content { .other_main_content {
min-height: calc(100vh + 5px); // min-height: calc(100vh + 5px);
position: relative; position: relative;
z-index: 5; z-index: 5;
flex: 1; flex: 1;

View File

@@ -237,7 +237,7 @@ const OtherUserPage: React.FC = () => {
// }; // };
return ( return (
<ScrollView scrollY className="other_user_page" onScroll={handleScroll}> <ScrollView scrollY className="other_user_page">
{/* <CustomNavbar> {/* <CustomNavbar>
<View className="navbar_content"> <View className="navbar_content">
<View className="navbar_back" onClick={() => Taro.navigateBack()}> <View className="navbar_back" onClick={() => Taro.navigateBack()}>
@@ -301,12 +301,14 @@ const OtherUserPage: React.FC = () => {
loading={loading} loading={loading}
error={null} error={null}
isShowNoData={game_records.length === 0} isShowNoData={game_records.length === 0}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY_CARD"
emptyText="暂无球局信息" emptyText="暂无球局信息"
loadMoreMatches={() => { }} loadMoreMatches={() => { }}
collapse={true} collapse={true}
style={{ paddingBottom: 0, overflow: "hidden" }} style={{ paddingBottom: 0, overflow: "hidden" }}
listLoadErrorHeight="320px" listLoadErrorWrapperHeight="267px"
listLoadErrorWidth="100%"
listLoadErrorHeight="152px"
defaultShowNum={3} defaultShowNum={3}
/> />
</ScrollView> </ScrollView>
@@ -342,12 +344,14 @@ const OtherUserPage: React.FC = () => {
loading={loading} loading={loading}
error={null} error={null}
isShowNoData={ended_game_records.length === 0} isShowNoData={ended_game_records.length === 0}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY_CARD"
emptyText="暂无球局信息" emptyText="暂无球局信息"
loadMoreMatches={() => { }} loadMoreMatches={() => { }}
collapse={true} collapse={true}
style={{ paddingBottom: "90px", overflow: "hidden" }} style={{ paddingBottom: "90px", overflow: "hidden" }}
listLoadErrorHeight="320px" listLoadErrorWrapperHeight="220px"
listLoadErrorWidth="100%"
listLoadErrorHeight="152px"
defaultShowNum={3} defaultShowNum={3}
/> />
</ScrollView> </ScrollView>