Skip to content

Commit 4a46f5b

Browse files
committed
fix: 商城优化 #11
1 parent e652024 commit 4a46f5b

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

src/views/vip/mallNew.vue

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,14 @@ export default {
2727
},
2828
methods: {},
2929
created: function () {
30-
if (!User.isLogin()) {
31-
this.$message.error("请先登录");
32-
setTimeout(() => {
33-
User.toLogin();
34-
}, 1000);
35-
return;
30+
if (User.isLogin()) {
31+
this.$store.dispatch("mallNew/getAsset").catch((err) => {
32+
this.$message.error("获取资产失败");
33+
});
34+
this.$store.dispatch("mallNew/getCart").catch((err) => {
35+
this.$message.error("获取购物车失败");
36+
});
3637
}
37-
this.$store.dispatch("mallNew/getAsset").catch((err) => {
38-
this.$message.error("获取资产失败");
39-
});
40-
this.$store.dispatch("mallNew/getCart").catch((err) => {
41-
this.$message.error("获取购物车失败");
42-
});
4338
},
4439
};
4540
</script>

src/views/vip/mallNew/Index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ export default {
246246
},
247247
changeSelectItem(item) {
248248
if (item.id === this.selectItem?.id) return;
249-
// this.$router.replace({ params: { id: item.id } });
250-
this.getData(item);
249+
this.$router.push({ name: "mall_list_new_id", params: { id: item.id } });
251250
},
252251
handleResize() {
253252
const width = window.innerWidth < 1550 ? 5 : 10;

0 commit comments

Comments
 (0)