diff --git a/buyer/src/components/card/index.vue b/buyer/src/components/card/index.vue index 49a0698a..4db1316e 100644 --- a/buyer/src/components/card/index.vue +++ b/buyer/src/components/card/index.vue @@ -50,12 +50,21 @@ export default { type: null, default: null, }, + _ActiveTab: { + type: Number, + default: 0, + }, }, data() { return { - isActive: 0, + isActive: this._ActiveTab, }; }, + watch: { + _ActiveTab(val) { + this.isActive = val; + }, + }, methods: { callBack() { if (this._Src) { diff --git a/buyer/src/components/indexDecorate/modelList/Carousel.vue b/buyer/src/components/indexDecorate/modelList/Carousel.vue index 90013e92..3ad5a793 100644 --- a/buyer/src/components/indexDecorate/modelList/Carousel.vue +++ b/buyer/src/components/indexDecorate/modelList/Carousel.vue @@ -173,11 +173,30 @@ export default { carouselItemKey(item, index) { return item?.img || item?.url || `slide-${index}`; }, + resolveRoute(pathStr) { + if (!pathStr) return { path: "/" }; + const [path, search] = pathStr.split("?"); + if (!search) return { path }; + return { + path, + query: Object.fromEntries(new URLSearchParams(search)), + }; + }, // 快捷跳转中心 entryControl(val) { - console.log("val",val) - let url = this.$router.resolve(val.path); - window.open(url.href, '_blank'); + const location = this.resolveRoute(val.path); + if (location.path.startsWith("/home/") && !storage.getItem("userInfo")) { + this.$router.push({ + path: "/login", + query: { + rePath: location.path, + query: JSON.stringify(location.query || {}), + }, + }); + return; + } + const url = this.$router.resolve(location); + window.open(url.href, "_blank"); }, }, mounted() { diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 79d6d502..750404b4 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -10,7 +10,7 @@ {{ item.name }} -