优化页面跳转
This commit is contained in:
parent
94c2c65ee0
commit
700ee30bfb
|
@ -44,6 +44,7 @@ export default {
|
|||
headerHeight: 0,
|
||||
statusBarHeight: 0,
|
||||
bodyPaddingTop: 0,
|
||||
backType: "back",
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
@ -106,6 +107,10 @@ export default {
|
|||
if (this.showHeader) {
|
||||
this.bodyPaddingTop = safePaddingTop;
|
||||
}
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length < 2) {
|
||||
this.backType = "home";
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
@ -113,7 +118,13 @@ export default {
|
|||
if (this.customBtn) {
|
||||
this.$emit("onClickBtn");
|
||||
} else {
|
||||
uni.navigateBack({ delta: 1 });
|
||||
if (this.backType == "home") {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack({ delta: 1 });
|
||||
}
|
||||
}
|
||||
},
|
||||
// changeCity() {
|
||||
|
|
Loading…
Reference in New Issue