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 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -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 }}
+
-
+
@@ -65,7 +67,7 @@
已填
- 2
+ {{ majorCount }}
个
@@ -94,6 +96,7 @@ const userStore = useUserStore()
const props = defineProps({
item: Object,
+ majorCount: Number,
})
const show = ref(false)
@@ -104,6 +107,12 @@ const handleConfirm = () => {
const handleShow = () => {
show.value = true
}
+
+const collegeMajorCount = computed(() => {
+ return (
+ userStore.userInfo.wishList.find((item) => item.unId === props.item.uId)?.vItems.length || 0
+ )
+})
diff --git a/src/pages-sub/home/wishesList/useWisheList.ts b/src/pages-sub/home/wishesList/useWisheList.ts
index 796f7b2..19088b4 100644
--- a/src/pages-sub/home/wishesList/useWisheList.ts
+++ b/src/pages-sub/home/wishesList/useWisheList.ts
@@ -1,6 +1,6 @@
export const calcTypeName = (type: number) => {
const style = {
- 0: {
+ 2: {
text: '冲',
color: '#EB5241',
bgColor: 'rgba(235,82,65,0.15)',
@@ -10,7 +10,7 @@ export const calcTypeName = (type: number) => {
color: '#FA8E23',
bgColor: 'rgba(250,142,35,0.15)',
},
- 2: {
+ 0: {
text: '保',
color: '#15C496',
bgColor: 'rgba(21,196,150,0.15)',
diff --git a/src/pages-sub/home/wishesList/wishesList.vue b/src/pages-sub/home/wishesList/wishesList.vue
new file mode 100644
index 0000000..261cfc8
--- /dev/null
+++ b/src/pages-sub/home/wishesList/wishesList.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/src/pages.json b/src/pages.json
index 90d6d8c..3a359b3 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -261,6 +261,10 @@
{
"path": "home/wishesList/ScrollListItem",
"type": "page"
+ },
+ {
+ "path": "home/wishesList/wishesList",
+ "type": "page"
}
]
},
diff --git a/src/service/index/api.ts b/src/service/index/api.ts
index f2428b9..1662b3a 100644
--- a/src/service/index/api.ts
+++ b/src/service/index/api.ts
@@ -276,3 +276,7 @@ export const aiPreview = (params: {
export const getPlanProListByFilter = (params: AutoFillParams) => {
return http.post('/api/PlanPro/aiUniversity', params)
}
+
+export const getBatchBase = (params: { locationCode: string }) => {
+ return http.get('/api/busBatchBase/batch', params)
+}
diff --git a/src/store/user.ts b/src/store/user.ts
index b2fa106..f4a0bd1 100644
--- a/src/store/user.ts
+++ b/src/store/user.ts
@@ -143,6 +143,15 @@ export const useUserStore = defineStore(
}
}
+ const deleteWishListMajor = ({ unId, _pId }: { unId: string; _pId: string }) => {
+ userInfo.value.wishList = userInfo.value.wishList.map((item) => {
+ if (item.unId === unId) {
+ item.vItems = item.vItems.filter((vItem) => vItem._pId !== _pId)
+ return item
+ }
+ return item
+ })
+ }
const setWishListMajorWithUn = (val) => {
userInfo.value.wishList.push({ ...val, sort: userInfo.value.wishList.length + 1 })
}
@@ -181,6 +190,7 @@ export const useUserStore = defineStore(
clearWishList,
setWishListMajor,
setWishListMajorWithUn,
+ deleteWishListMajor,
}
},
{
diff --git a/src/types/uni-pages.d.ts b/src/types/uni-pages.d.ts
index 8910f36..faa0af3 100644
--- a/src/types/uni-pages.d.ts
+++ b/src/types/uni-pages.d.ts
@@ -32,6 +32,7 @@ interface NavigateToOptions {
"/pages-sub/home/wishesList/HeaderTip" |
"/pages-sub/home/wishesList/index" |
"/pages-sub/home/wishesList/ScrollListItem" |
+ "/pages-sub/home/wishesList/wishesList" |
"/login-sub/index" |
"/pages-evaluation-sub/index" |
"/pages-evaluation-sub/aiAutoFill/index" |