[仅供测试]重写navigateTo方法,解决微信小程序中超过10个页面栈时会出现的bug

This commit is contained in:
学习很差啦
2022-07-20 18:24:49 +08:00
parent cbd73ae638
commit 09485747a6
58 changed files with 472 additions and 421 deletions

View File

@@ -57,7 +57,7 @@ export default {
mounted() {},
methods: {
handleClick(item) {
uni.navigateTo({
this.$navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
},

View File

@@ -145,22 +145,22 @@ export default {
goToDetail(type) {
switch(type) {
case "SECKILL":
uni.navigateTo({
this.$navigateTo({
url: `/pages/promotion/seckill`,
});
break;
case "PINTUAN":
uni.navigateTo({
this.$navigateTo({
url: `/pages/promotion/joinGroup`,
});
break;
case "LIVE":
uni.navigateTo({
this.$navigateTo({
url: `/pages/promotion/lives`,
});
break;
case "KANJIA":
uni.navigateTo({
this.$navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;

View File

@@ -12,7 +12,7 @@ export default {
props: ["res"],
methods: {
handleSearch() {
uni.navigateTo({
this.$navigateTo({
url: "/pages/navigation/search/searchPage",
});
},

View File

@@ -127,10 +127,10 @@ export default {
this.pageData = JSON.parse(res.data.result.pageData);
}
});
},
// 是否有网络链接
isConnected(val){
val ? this.init() : ''
},
// 是否有网络链接
isConnected(val){
val ? this.init() : ''
},
/**
@@ -149,18 +149,18 @@ export default {
// WX_CODE 为小程序码
if (res.scanType == "WX_CODE") {
console.log(res);
uni.navigateTo({
this.$navigateTo({
url: `/${res.path}`,
});
} else {
config.scanAuthNavigation.forEach((src) => {
if (res.result.indexOf(src) != -1) {
uni.navigateTo({
this.$navigateTo({
url: `/${res.result.substring(src.length)}`,
});
} else {
setTimeout(() => {
uni.navigateTo({
this.$navigateTo({
url: "/pages/tabbar/home/web-view?src=" + path,
});
}, 100);