This commit is contained in:
张成
2025-11-14 22:03:09 +08:00
parent 95e17d19f8
commit d6349d14e8
11 changed files with 1120 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import PublishMenu from "../PublishMenu";
export type currentPageType = "games" | "message" | "personal";
const GuideBar = (props) => {
const { currentPage, guideBarClassName, onPublishMenuVisibleChange } = props;
const { currentPage, guideBarClassName, onPublishMenuVisibleChange, onTabChange } = props;
const guideItems = [
{
@@ -34,7 +34,14 @@ const GuideBar = (props) => {
if (code === currentPage) {
return;
}
// 如果提供了 onTabChange 回调,优先使用(单页面模式)
if (onTabChange) {
onTabChange(code);
return;
}
// 否则使用路由跳转(兼容模式)
let url = `/pages/${code}/index`;
if (code === "personal") {
url = "/user_pages/myself/index";
@@ -48,7 +55,7 @@ const GuideBar = (props) => {
Taro.redirectTo({
url: url,
}).then(() => {
Taro.pageScrollTo({
(Taro as any).pageScrollTo({
scrollTop: 0,
duration: 300,
});