diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 3b99ebc..21fb700 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -25,11 +25,12 @@ import Logo1 from '@/assets/img/banner/logo1.png' import Logo from '@/assets/img/banner/logo.png' import LogoWhite from '@/assets/img/banner/logo3.png' -import { useSwiperStore, useCountStore } from '@/store' +import { useSwiperStore, useCountStore, useDetailStore } from '@/store' import { onMounted, ref, watch } from 'vue' import { storeToRefs } from 'pinia' const swiperStore = useSwiperStore() const countStore = useCountStore() +const detailStore = useDetailStore() const { activeIndex } = storeToRefs(swiperStore) const getActiveClass = index => { @@ -40,6 +41,7 @@ const getActiveClass = index => { } const scrollToPage = index => { + detailStore.changeRecruitDetail(false) // 让数字动 swiperStore.swiper.slideTo(index, 0, false) if (index == 3) { diff --git a/src/store/modules/detail.js b/src/store/modules/detail.js index 6f6c83d..d32f6c1 100644 --- a/src/store/modules/detail.js +++ b/src/store/modules/detail.js @@ -8,10 +8,14 @@ export const useDetailStore = defineStore({ example_id: '1', hardwareExampleId: '1', hardware_id: '1', + showRecruitDetail: false, } }, // actions actions: { + changeRecruitDetail(flag) { + this.showRecruitDetail = flag + }, updateHardwareId(hardware_id) { this.hardware_id = hardware_id }, diff --git a/src/views/Index/components/Recruit/index.vue b/src/views/Index/components/Recruit/index.vue index 49720c3..8c57273 100644 --- a/src/views/Index/components/Recruit/index.vue +++ b/src/views/Index/components/Recruit/index.vue @@ -27,7 +27,7 @@