自定义title

This commit is contained in:
2025-10-17 10:11:36 +08:00
parent 54ac130e37
commit ac2c9571e7
22 changed files with 863 additions and 298 deletions

View File

@@ -1,3 +1,9 @@
export default definePageConfig({
navigationBarTitleText: '查找交易',
})
navigationBarTitleText: "查找交易",
navigationBarBackgroundColor: "#ffffff",
navigationBarTextStyle: "black",
backgroundColor: "#f5f5f5",
enablePullDownRefresh: false,
disableScroll: false,
navigationStyle: "custom",
});

View File

@@ -1,5 +1,4 @@
.listSearchContainer {
padding: 0 15px;
height: 100vh;
box-sizing: border-box;
@@ -10,6 +9,50 @@
color: transparent;
}
.custom-navbar {
height: 56px;
/* 通常与原生导航栏高度一致 */
display: flex;
align-items: center;
justify-content: center;
// background-color: #fff;
color: #000;
padding-top: 44px;
/* 适配状态栏 */
position: sticky;
top: 0;
z-index: 100;
background-color: #f5f5f5;
}
.detail-navigator {
height: 30px;
width: fit-content;
border-radius: 15px;
position: absolute;
left: 12px;
box-sizing: border-box;
display: flex;
align-items: center;
.detail-navigator-back {
height: 32px;
display: flex;
justify-content: center;
align-items: center;
font-family: PingFang SC;
font-weight: 600;
font-style: Semibold;
font-size: 20px;
letter-spacing: 0.38px;
& > .detail-navigator-back-icon {
width: 32px;
height: 32px;
}
}
}
.icon16 {
width: 16px;
height: 16px;
@@ -19,8 +62,7 @@
position: sticky;
top: -1px;
background-color: #fff;
width: calc(100vw - 28px);
padding: 5px 0;
padding: 5px 15px;
box-sizing: border-box;
}
@@ -43,7 +85,7 @@
}
.historySearch {
// padding-top: 50px;
padding: 0 15px;
}
.searchRight {
@@ -142,7 +184,7 @@
}
.transaction_list {
padding: 0 0 80px;
padding: 0 15px 80px;
// overflow-y: auto;
// &::-webkit-scrollbar {
@@ -238,4 +280,4 @@
padding: 20px 0 40px;
background: #fff;
}
}
}

View File

@@ -29,6 +29,10 @@ interface TransactionLoadParams {
}
const QueryTransactions = () => {
// 获取当前页面的配置
const currentPage = Taro.getCurrentInstance();
const pageConfig = currentPage.page?.config;
const pageTitle = pageConfig?.navigationBarTitleText;
const isInitialMount = useRef(true);
const [loading_transactions, set_loading_transactions] = useState(false);
const [transactions, setTransactions] = useState<Transaction[]>([]);
@@ -238,6 +242,23 @@ const QueryTransactions = () => {
return (
<>
<View className="listSearchContainer">
{/* 导航栏 */}
<View className="custom-navbar">
<View className="detail-navigator">
<View
className="detail-navigator-back"
onClick={() => {
Taro.navigateBack();
}}
>
<Image
className="detail-navigator-back-icon"
src={img.ICON_NAVIGATOR_BACK}
/>
<Text>{pageTitle}</Text>
</View>
</View>
</View>
{/* 搜索 */}
<View className="topSearchWrapper">
<View className="topSearch">