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