|
@@ -79,6 +79,7 @@ import { DynamicSize } from '../theme/ThemeTools';
|
|
|
import HorizontalScrollText from '../typography/HorizontalScrollText.vue';
|
|
import HorizontalScrollText from '../typography/HorizontalScrollText.vue';
|
|
|
import Text from '../basic/Text.vue';
|
|
import Text from '../basic/Text.vue';
|
|
|
import IconButton from '../basic/IconButton.vue';
|
|
import IconButton from '../basic/IconButton.vue';
|
|
|
|
|
+import { isTopLevelPage } from '../utils/PageAction';
|
|
|
|
|
|
|
|
export type NavBarButtonTypes = 'back'|'menu'|'search'|'setting'|'custom';
|
|
export type NavBarButtonTypes = 'back'|'menu'|'search'|'setting'|'custom';
|
|
|
|
|
|
|
@@ -204,7 +205,13 @@ const titleTextStyle = theme.useThemeStyle({
|
|
|
|
|
|
|
|
function handleButtonNavBack(button: NavBarButtonTypes, callback: () => void) {
|
|
function handleButtonNavBack(button: NavBarButtonTypes, callback: () => void) {
|
|
|
if (button === 'back') {
|
|
if (button === 'back') {
|
|
|
- uni.navigateBack();
|
|
|
|
|
|
|
+ if (isTopLevelPage()) {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: theme.getVar('AppHomePage', '/pages/index/index'),
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|