优化返回代码

This commit is contained in:
TOP糯米 2023-04-03 11:02:07 +08:00
parent 367fbe9c7c
commit 95719e57d9
1 changed files with 7 additions and 1 deletions

View File

@ -104,9 +104,15 @@ export default {
onClick() { onClick() {
if (this.customBtn) { if (this.customBtn) {
this.$emit("onClickBtn"); this.$emit("onClickBtn");
} else {
if (getCurrentPages().length < 2) {
uni.switchTab({
url: "/pages/index/index",
});
} else { } else {
uni.navigateBack({ delta: 1 }); uni.navigateBack({ delta: 1 });
} }
}
}, },
changeCity() { changeCity() {
console.log("修改城市"); console.log("修改城市");