购物车增加登录判断
This commit is contained in:
parent
d2469e8496
commit
6b0bfcc41d
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue