修改看到的一些问题

This commit is contained in:
lemon橪
2021-06-04 18:11:34 +08:00
parent fcb5d20ef1
commit 61273b78b9
21 changed files with 262 additions and 745 deletions

30
App.vue
View File

@@ -1,4 +1,5 @@
<script>
/**
* vuex管理登录状态具体可以参考官方登录模板示例
@@ -15,6 +16,35 @@ export default {
config,
};
},
/**
* 监听返回
*/
onBackPress(e) {
if (e.from == "backbutton") {
let routes = getCurrentPages();
let curRoute = routes[routes.length - 1].options;
routes.forEach((item) => {
if (
item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1
) {
uni.redirectTo({
url: item.route,
});
}
});
if (curRoute.addId) {
uni.reLaunch({
url: "/pages/tabbar/cart/cartList",
});
} else {
uni.navigateBack();
}
return true; //阻止默认返回行为
}
},
methods: {
...mapMutations(["login"]),
},