From 7c0357b67d77a2345adb40ec89c582dab0e5062c Mon Sep 17 00:00:00 2001 From: xjs Date: Mon, 17 Mar 2025 18:02:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BD=93=E5=89=8D=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E5=86=99=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages-evaluation-sub/aiAutoFill/index.vue | 6 +- src/pages-sub/components/ActionSheet.vue | 2 +- .../components/collapse/Collapse.vue | 70 ++ .../components/dragSort/DragSort.vue | 754 ++++++++++++++++++ src/pages-sub/components/dragSort/useSort.ts | 3 + src/pages-sub/home/college/info.vue | 2 +- src/pages-sub/home/wishesList/HeaderTip.vue | 23 - .../home/wishesList/ScrollListItem.vue | 120 --- .../{ => components}/CollegeMajor.vue | 40 +- .../wishesList/{ => components}/DataTable.vue | 12 +- .../home/wishesList/components/HeaderTip.vue | 56 ++ .../wishesList/components/ScrollListItem.vue | 85 ++ .../components/ScrollListItemAction.vue | 62 ++ .../wishesList/components/SortCollege.vue | 107 +++ .../wishesList/{ => composable}/phaseLine.ts | 0 .../wishesList/composable/useWishesList.ts | 86 ++ src/pages-sub/home/wishesList/index.vue | 56 +- src/pages-sub/home/wishesList/useWisheList.ts | 44 - src/pages-sub/home/wishesList/wishesList.vue | 53 +- src/pages.json | 21 +- src/store/user.ts | 12 +- src/types/uni-pages.d.ts | 4 - 22 files changed, 1344 insertions(+), 274 deletions(-) create mode 100644 src/pages-sub/components/collapse/Collapse.vue create mode 100644 src/pages-sub/components/dragSort/DragSort.vue create mode 100644 src/pages-sub/components/dragSort/useSort.ts delete mode 100644 src/pages-sub/home/wishesList/HeaderTip.vue delete mode 100644 src/pages-sub/home/wishesList/ScrollListItem.vue rename src/pages-sub/home/wishesList/{ => components}/CollegeMajor.vue (74%) rename src/pages-sub/home/wishesList/{ => components}/DataTable.vue (92%) create mode 100644 src/pages-sub/home/wishesList/components/HeaderTip.vue create mode 100644 src/pages-sub/home/wishesList/components/ScrollListItem.vue create mode 100644 src/pages-sub/home/wishesList/components/ScrollListItemAction.vue create mode 100644 src/pages-sub/home/wishesList/components/SortCollege.vue rename src/pages-sub/home/wishesList/{ => composable}/phaseLine.ts (100%) create mode 100644 src/pages-sub/home/wishesList/composable/useWishesList.ts delete mode 100644 src/pages-sub/home/wishesList/useWisheList.ts diff --git a/src/pages-evaluation-sub/aiAutoFill/index.vue b/src/pages-evaluation-sub/aiAutoFill/index.vue index 8a419a9..8e243b1 100644 --- a/src/pages-evaluation-sub/aiAutoFill/index.vue +++ b/src/pages-evaluation-sub/aiAutoFill/index.vue @@ -7,7 +7,7 @@ } diff --git a/src/pages-sub/home/wishesList/useWisheList.ts b/src/pages-sub/home/wishesList/useWisheList.ts deleted file mode 100644 index 19088b4..0000000 --- a/src/pages-sub/home/wishesList/useWisheList.ts +++ /dev/null @@ -1,44 +0,0 @@ -export const calcTypeName = (type: number) => { - const style = { - 2: { - text: '冲', - color: '#EB5241', - bgColor: 'rgba(235,82,65,0.15)', - }, - 1: { - text: '稳', - color: '#FA8E23', - bgColor: 'rgba(250,142,35,0.15)', - }, - 0: { - text: '保', - color: '#15C496', - bgColor: 'rgba(21,196,150,0.15)', - }, - }[type] || { text: '保', color: '#15C496', bgColor: 'rgba(21,196,150,0.15)' } - - return { - text: style.text, - style: { - color: style.color, - backgroundColor: style.bgColor, - }, - } -} -export const coverTypeModel = (tModel: Record, total: number) => { - const TYPE_LABELS = { - c: '冲', - w: '稳', - b: '保', - } as const - - let _result = Object.entries(TYPE_LABELS).map(([key, label]) => ({ - name: `${label}(${tModel[key]})`, - value: key === 'b' ? '0' : key === 'w' ? '1' : '2', - })) - _result.unshift({ - name: `全部${total}`, - value: '-1', - }) - return _result -} diff --git a/src/pages-sub/home/wishesList/wishesList.vue b/src/pages-sub/home/wishesList/wishesList.vue index 261cfc8..3def87e 100644 --- a/src/pages-sub/home/wishesList/wishesList.vue +++ b/src/pages-sub/home/wishesList/wishesList.vue @@ -1,11 +1,58 @@ + +{ + style: { + navigationBarTitleText: '当前志愿表', + }, +} + + diff --git a/src/pages.json b/src/pages.json index 3a359b3..fc392a9 100644 --- a/src/pages.json +++ b/src/pages.json @@ -239,18 +239,6 @@ "navigationStyle": "custom" } }, - { - "path": "home/wishesList/CollegeMajor", - "type": "page" - }, - { - "path": "home/wishesList/DataTable", - "type": "page" - }, - { - "path": "home/wishesList/HeaderTip", - "type": "page" - }, { "path": "home/wishesList/index", "type": "page", @@ -258,13 +246,12 @@ "navigationBarTitleText": "我的志愿表" } }, - { - "path": "home/wishesList/ScrollListItem", - "type": "page" - }, { "path": "home/wishesList/wishesList", - "type": "page" + "type": "page", + "style": { + "navigationBarTitleText": "当前志愿表" + } } ] }, diff --git a/src/store/user.ts b/src/store/user.ts index f4a0bd1..f21efaf 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -118,9 +118,9 @@ export const useUserStore = defineStore( userInfo.value.batchName = val } - const setWishListMajor = ({ val, unId }: { val: any; unId: string }) => { + const setWishListMajor = ({ val, uId }: { val: any; uId: string }) => { try { - const targetItem = userInfo.value.wishList.find((item) => item.unId === unId) + const targetItem = userInfo.value.wishList.find((item) => item.uId === uId) if (!targetItem) { console.error('未找到对应的志愿清单项') return @@ -129,7 +129,7 @@ export const useUserStore = defineStore( userInfo.value = { ...userInfo.value, wishList: userInfo.value.wishList.map((item) => { - if (item.unId === unId) { + if (item.uId === uId) { return { ...item, vItems: [...item.vItems, { ...val, sort: item.vItems.length + 1 }], @@ -143,10 +143,10 @@ export const useUserStore = defineStore( } } - const deleteWishListMajor = ({ unId, _pId }: { unId: string; _pId: string }) => { + const deleteWishListMajor = ({ uId, planId }: { uId: string; planId: string }) => { userInfo.value.wishList = userInfo.value.wishList.map((item) => { - if (item.unId === unId) { - item.vItems = item.vItems.filter((vItem) => vItem._pId !== _pId) + if (item.uId === uId) { + item.vItems = item.vItems.filter((vItem) => vItem.planId !== planId) return item } return item diff --git a/src/types/uni-pages.d.ts b/src/types/uni-pages.d.ts index faa0af3..b5763b3 100644 --- a/src/types/uni-pages.d.ts +++ b/src/types/uni-pages.d.ts @@ -27,11 +27,7 @@ interface NavigateToOptions { "/pages-sub/home/news/index" | "/pages-sub/home/news/newsList" | "/pages-sub/home/schoolRank/index" | - "/pages-sub/home/wishesList/CollegeMajor" | - "/pages-sub/home/wishesList/DataTable" | - "/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" |