diff --git a/src/components/layout/layout.vue b/src/components/layout/layout.vue index 450caf5..c04daa8 100644 --- a/src/components/layout/layout.vue +++ b/src/components/layout/layout.vue @@ -105,7 +105,13 @@ export default { if (this.customBtn) { this.$emit("onClickBtn"); } else { - uni.navigateBack({ delta: 1 }); + if (getCurrentPages().length < 2) { + uni.switchTab({ + url: "/pages/index/index", + }); + } else { + uni.navigateBack({ delta: 1 }); + } } }, changeCity() {