diff --git a/src/pages-sub/components/ActionSheet.vue b/src/pages-sub/components/ActionSheet.vue index 6295851..53fcf92 100644 --- a/src/pages-sub/components/ActionSheet.vue +++ b/src/pages-sub/components/ActionSheet.vue @@ -3,20 +3,22 @@ - - {{ title }} - - - - - - - - + @@ -25,6 +27,7 @@ defineProps<{ show: boolean title?: string + lazyRender?: boolean }>() const emit = defineEmits<{ @@ -44,7 +47,7 @@ const handleClose = () => { right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); - z-index: 999; + z-index: 9; opacity: 0; visibility: hidden; transition: all 0.3s ease; diff --git a/src/pages-sub/home/wishesList/CollegeMajor.vue b/src/pages-sub/home/wishesList/CollegeMajor.vue index 59c919e..955ea51 100644 --- a/src/pages-sub/home/wishesList/CollegeMajor.vue +++ b/src/pages-sub/home/wishesList/CollegeMajor.vue @@ -11,7 +11,7 @@ > {{ calcTypeName(major.type).text }} - {{ major.percentAge }}% + {{ major.percentAge || '0%' }} @@ -19,6 +19,7 @@ {{ major.major.replace(/(\r\n|\n|\r)/g, '') }} + {{ major.remark }} 代码{{ major.majorCode }} @@ -32,10 +33,10 @@ - 填报 + {{ checkActive(major) ? '已填报' : '填报' }} @@ -57,7 +58,10 @@ const props = defineProps<{ const handleClick = (major: any) => { let exitMajorUnList = userStore.userInfo.wishList.find((item) => item.unId === props.item.uId) - if (exitMajorUnList) { + let exitMajor = exitMajorUnList?.vItems.find((item) => item._pId === major.planId) + if (exitMajor) { + userStore.deleteWishListMajor({ unId: props.item.uId, _pId: major.planId }) + } else if (exitMajorUnList) { userStore.setWishListMajor({ val: { _pId: major.planId, @@ -89,6 +93,17 @@ const handleClick = (major: any) => { userStore.setWishListMajorWithUn(_major) } } + +const checkActive = (major: unknown) => { + const _major = major as { planId: string } + return userStore.userInfo.wishList.find((item) => { + if (item.unId !== props.item.uId) { + return false + } else if (item.vItems.find((vItem) => vItem._pId === _major.planId)) { + return true + } + }) +} diff --git a/src/pages-sub/home/wishesList/ScrollListItem.vue b/src/pages-sub/home/wishesList/ScrollListItem.vue index ee7847c..7980b8c 100644 --- a/src/pages-sub/home/wishesList/ScrollListItem.vue +++ b/src/pages-sub/home/wishesList/ScrollListItem.vue @@ -45,14 +45,16 @@ > 专业{{ item.items.length }} - 已填 1 + + 已填 {{ collegeMajorCount }} + - +