[仅供测试]重写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

@@ -111,8 +111,8 @@
预估到手价 <span>{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
</div>
<div style='margin-left: 20rpx;' v-if="!skuItem.checked && skuItem.errorMessage">
{{skuItem.errorMessage}}
<div style='margin-left: 20rpx;' v-if="!skuItem.checked && skuItem.errorMessage">
{{skuItem.errorMessage}}
</div>
</view>
</view>
@@ -343,7 +343,7 @@ export default {
* 跳转到店铺
*/
navigateToStore(val) {
uni.navigateTo({
this.$navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
@@ -352,7 +352,7 @@ export default {
* 跳转到优惠券
*/
navigateToConpon(val) {
uni.navigateTo({
this.$navigateTo({
url: "/pages/cart/coupon/couponCenter?storeId=" + val.storeId,
});
},
@@ -361,7 +361,7 @@ export default {
* 跳转到商品
*/
navigateToGoods(val) {
uni.navigateTo({
this.$navigateTo({
url:
"/pages/product/goods?id=" +
val.goodsSku.id +
@@ -437,7 +437,7 @@ export default {
* 跳转
*/
navigateTo(url) {
uni.navigateTo({
this.$navigateTo({
url,
});
},

View File

@@ -57,7 +57,7 @@ export default {
* 查询
*/
search() {
uni.navigateTo({
this.$navigateTo({
url: "/pages/navigation/search/searchPage",
});
},
@@ -90,7 +90,7 @@ export default {
},
navigateToList(sid, tid) {
uni.navigateTo({
this.$navigateTo({
url: `/pages/navigation/search/searchPage?category=${tid}`,
});
},

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);

View File

@@ -45,14 +45,14 @@ export default {
// },
methods: {
gotoLink() {
uni.navigateTo({
this.$navigateTo({
//点击跳转到浏览器
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920",
});
},
gotoB() {
uni.navigateTo({
this.$navigateTo({
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000",
});

View File

@@ -122,7 +122,7 @@ export default {
* navigator标签现在默认没有转场动画所以用view
*/
navigateTo(url) {
uni.navigateTo({
this.$navigateTo({
url,
});
},

View File

@@ -73,7 +73,7 @@
})
},
goDetail(item) {
uni.navigateTo({
this.$navigateTo({
url: '/pages/product/goods?id=' + item.content.id + "&goodsId=" +item.content.goodsId
})
},

View File

@@ -69,7 +69,7 @@ import { distribution } from "@/api/goods";
export default {
methods: {
navigateTo(url) {
uni.navigateTo({
this.$navigateTo({
url,
});
},
@@ -78,11 +78,11 @@ export default {
if (res.data.result) {
let type = res.data.result.distributionStatus;
if (type == "PASS") {
uni.navigateTo({
this.$navigateTo({
url: "/pages/mine/distribution/home",
});
} else if (type == "REFUSE") {
uni.navigateTo({
this.$navigateTo({
url: "/pages/mine/distribution/auth",
});
} else if (type == "RETREAT") {
@@ -106,7 +106,7 @@ export default {
});
} else {
// 没有资格申请 先去实名认证
uni.navigateTo({
this.$navigateTo({
url: "/pages/mine/distribution/auth",
});
}