购物车增加登录判断

This commit is contained in:
TOP糯米 2023-04-07 14:18:48 +08:00
parent d2469e8496
commit 6b0bfcc41d
1 changed files with 10 additions and 0 deletions

View File

@ -58,6 +58,7 @@ import WidgetTips from "@/components/widgets/tips";
import WidgetCheckBox from "@/components/widgets/checkbox";
import WidgetCountModify from "@/components/widgets/count-modify";
import ServicePreviewItem from "@/components/service/preview-item";
import { mapGetters } from "vuex";
export default {
name: "order-cart",
data() {
@ -73,7 +74,16 @@ export default {
WidgetCountModify,
ServicePreviewItem,
},
computed: {
...mapGetters({
isLogin: "user/isLogin",
}),
},
onLoad() {
if (!this.isLogin) {
this.$store.commit("user/showLoginModal", true);
return;
}
this.list = [];
this.$models.cart.list().then((list) => {
list.forEach((item) => {