Skip to content

Commit

Permalink
Merge pull request #225 from eleliauk/main
Browse files Browse the repository at this point in the history
fix(bugs): 修复路由名+写了一个utils
  • Loading branch information
eleliauk authored Jan 5, 2025
2 parents 21aa2ef + 1d7307a commit 627c214
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/common/utils/Nav.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Taro from '@tarojs/taro';

export const Nav = (navPath: string) => {
return Taro.navigateTo({ url: navPath });
};
export const Back = () => {
return Taro.navigateBack();
};
export const Redirect = (redirectPath: string) => {
return Taro.reLaunch({ url: redirectPath });
};
2 changes: 1 addition & 1 deletion src/pages/evaluate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const Page: React.FC = () => {
const onLableClick = () => {
if (courseName == '只能评价自己学过的课程哦') {
void Taro.navigateTo({
url: '/pages/myclass/myclass',
url: '/pages/myclass/index',
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const COURSE_NAME_MAP = {
const Page: React.FC = () => {
const handleSearchToggle = () => {
void Taro.navigateTo({
url: '/pages/research/research',
url: '/pages/research/index',
});
};
const [refresherTriggered, setRefresherTriggered] = useState(false);
Expand Down
1 change: 1 addition & 0 deletions src/pages/myclass/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface CouresProps {
}

const Page: React.FC = () => {
//待优化点 别写死了
const [yearSelector] = useState<string[]>([
'2022-2023学年',
'2023-2024学年',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/research/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Page: React.FC = () => {
const handleSearchToggle = () => {
// setSpread(isSearchActive);
// Taro.navigateTo({
// url: '/pages/research/research',
// url: '/pages/research/index',
// });
setSpread(false);
};
Expand Down

0 comments on commit 627c214

Please sign in to comment.