From 840dd36f7ebbc303b983630deb563a33e56ea644 Mon Sep 17 00:00:00 2001 From: xjs Date: Sat, 15 Mar 2025 17:37:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BF=97=E6=84=BF=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=AD=A6=E6=A0=A1=EF=BC=8C=E4=B8=93=E4=B8=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages-sub/components/ActionSheet.vue | 1 + src/pages-sub/components/CustomPickerView.vue | 3 +- src/pages-sub/home/components/FilterMenu.vue | 23 +- .../home/wishesList/CollegeMajor.vue | 106 ++++++++ src/pages-sub/home/wishesList/DataTable.vue | 90 ++++++- src/pages-sub/home/wishesList/HeaderTip.vue | 23 ++ .../home/wishesList/ScrollListItem.vue | 111 ++++++++ src/pages-sub/home/wishesList/index.vue | 253 +++++++----------- src/pages-sub/home/wishesList/useWisheList.ts | 44 +++ src/pages.json | 12 + src/store/user.ts | 38 +++ src/types/app-type.d.ts | 1 + src/types/uni-pages.d.ts | 3 + 13 files changed, 523 insertions(+), 185 deletions(-) create mode 100644 src/pages-sub/home/wishesList/CollegeMajor.vue create mode 100644 src/pages-sub/home/wishesList/HeaderTip.vue create mode 100644 src/pages-sub/home/wishesList/ScrollListItem.vue create mode 100644 src/pages-sub/home/wishesList/useWisheList.ts diff --git a/src/pages-sub/components/ActionSheet.vue b/src/pages-sub/components/ActionSheet.vue index fedf479..6295851 100644 --- a/src/pages-sub/components/ActionSheet.vue +++ b/src/pages-sub/components/ActionSheet.vue @@ -10,6 +10,7 @@ {{ title }} + diff --git a/src/pages-sub/components/CustomPickerView.vue b/src/pages-sub/components/CustomPickerView.vue index 5dcd260..6a590ef 100644 --- a/src/pages-sub/components/CustomPickerView.vue +++ b/src/pages-sub/components/CustomPickerView.vue @@ -30,7 +30,7 @@ + + diff --git a/src/pages-sub/home/wishesList/DataTable.vue b/src/pages-sub/home/wishesList/DataTable.vue index e01b4f2..cbdbd7f 100644 --- a/src/pages-sub/home/wishesList/DataTable.vue +++ b/src/pages-sub/home/wishesList/DataTable.vue @@ -1,27 +1,91 @@ - + diff --git a/src/pages-sub/home/wishesList/HeaderTip.vue b/src/pages-sub/home/wishesList/HeaderTip.vue new file mode 100644 index 0000000..20c6a6b --- /dev/null +++ b/src/pages-sub/home/wishesList/HeaderTip.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/pages-sub/home/wishesList/ScrollListItem.vue b/src/pages-sub/home/wishesList/ScrollListItem.vue new file mode 100644 index 0000000..ee7847c --- /dev/null +++ b/src/pages-sub/home/wishesList/ScrollListItem.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/pages-sub/home/wishesList/index.vue b/src/pages-sub/home/wishesList/index.vue index b91afec..4a38482 100644 --- a/src/pages-sub/home/wishesList/index.vue +++ b/src/pages-sub/home/wishesList/index.vue @@ -17,21 +17,7 @@ :auto-show-system-loading="true" > @@ -84,86 +67,28 @@ :id="`zp-id-${item.zp_index}`" :key="item.zp_index" v-for="(item, index) in schoolList" - @click="itemClick(item, item.zp_index)" > - - - - - {{ calcTypeName(item.type).text }} - - - {{ - Math.round( - item.items.reduce((a, b) => a + Number(b.percentAge.replace('%', '')), 0) / - item.items.length, - ) - }} - % - - - - - - {{ item.name }} - - {{ item.city }}·{{ item.educationCategory }} - - - - {{ item.features.slice(0, 3).join('/') }}/ - - 排名{{ item.rank }} - - - 代码{{ item.collegeCode }} - - {{ item.year }}计划{{ item.items.reduce((a, b) => a + b.planCount, 0) }}人 - - - - - - - 专业{{ item.items.length }} - - 已填 1 - - - - - - - - - - - - - - + - + + + @@ -181,44 +116,19 @@ import ActionSheet from '@/pages-sub/components/ActionSheet.vue' import Region from '@/pages-sub/home/components/Region.vue' import FilterMenu from '@/pages-sub/home/components/FilterMenu.vue' import Slider from '@/pages-sub/components/Slider.vue' +import CustomPickerView from '@/pages-sub/components/CustomPickerView.vue' +import { getBatchData } from '@/service/index/api' + +import ScrollListItem from './ScrollListItem.vue' +import HeaderTip from './HeaderTip.vue' + import { getPlanProListByFilter } from '@/service/index/api' -import WXXTable from '@/pages-sub/components/table/Table.vue' -import WXXTableCol from '@/pages-sub/components/table/TableCol.vue' -// import DataTable from './DataTable.vue' import { useUserStore } from '@/store/user' - -const columns = ref([ - { - label: '年份', - prop: 'year', - }, - { - label: '录取', - prop: 'planCount', - }, - { - label: '线差', - prop: 'lineDiff', - }, - { - label: '最低分', - prop: 'score', - }, - { - label: '最低位次', - prop: 'rankLine', - }, - { - label: '位次差', - prop: 'rankLine', - }, -]) +import { coverTypeModel } from './useWisheList' const userStore = useUserStore() -const sliderValue = ref([550, 590]) - const schoolList = ref([]) const paging = ref(null) const filterMenuRef = ref(null) @@ -226,91 +136,108 @@ const filterMenuRef = ref(null) const location = ref(userStore.userInfo.estimatedAchievement.provinceCode) const total = ref(0) +const typeModelList = ref([]) +const handleTypeModelChange = ({ item }) => { + collegeSearch.value.tModelValue = item.value + collegeSearch.value.tModel = item.name +} const queryList = (page: number, pageSize: number) => { getPlanProListByFilter({ pageIndex: page, pageSize: pageSize, - location: userStore.userInfo.estimatedAchievement.provinceCode, + location: location.value, p: userStore.userInfo.estimatedAchievement.sp, subjects: userStore.userInfo.estimatedAchievement.subjectGroup.split(','), score: +userStore.userInfo.estimatedAchievement.expectedScore, batchName: userStore.userInfo.batchName, + startscore: sliderValue.value[0], + endscore: sliderValue.value[1], + province: province.value, + nature: collegeSearch.value.nature, + feature: collegeSearch.value.feature, + majors: collegeSearch.value.majors, + keyword: searchValue.value, }).then((resp) => { if (resp.code === 200) { paging.value.complete((resp.result as { rows: any[] }).rows) total.value = (resp.result as { totalRows: number }).totalRows + typeModelList.value = coverTypeModel((resp.result as { tModel: any }).tModel, total.value) } }) } + const virtualListChange = (_vList) => { schoolList.value = _vList } const itemClick = (item, index) => { - uni.navigateTo({ url: `/pages-sub/home/college/info?collegeId=${item._id}` }) + uni.navigateTo({ url: `/pages-sub/home/college/info?collegeId=${item.uId}` }) } const collegeSearch = ref({ - nature: '', - feature: '', - majors: '', + nature: [], + feature: [], + majors: [], + tModel: '', + tModelValue: '-1', }) const show = ref(false) const actionTitle = ref('') +const actionType = ref(1) const handleConfirm = () => { show.value = false - if (actionTitle.value === '院校') { - filterMenuRef.value.handleConfirm() + if (actionType.value === 1) { + let _cur = filterMenuRef.value.handleConfirm() + collegeSearch.value.feature = _cur.chooseCollegeFeature + collegeSearch.value.nature = _cur.chooseNature + collegeSearch.value.majors = _cur.chooseMajors } + paging.value.reload() } const handleShow = (type: number) => { - actionTitle.value = type === 1 ? '院校' : '地域' + if (type === 1) { + actionTitle.value = '院校' + } else if (type === 2) { + actionTitle.value = '地域' + } + + actionType.value = type show.value = true } const searchValue = ref('') -const handleChange = () => { - console.log(searchValue.value) +const handleChange = (value: string) => { + searchValue.value = value + paging.value.reload() } +const province = ref([]) const handleRegionName = (val: string[]) => { - console.log(val) + province.value = val } +const sliderValue = ref([550, 590]) const handleSliderChange = (val) => { - console.log('滑块值变化:', val) + paging.value.reload() } -const calcTypeName = (type: number) => { - const style = { - 0: { - text: '冲', - color: '#EB5241', - bgColor: 'rgba(235,82,65,0.15)', - }, - 1: { - text: '稳', - color: '#FA8E23', - bgColor: 'rgba(250,142,35,0.15)', - }, - 2: { - 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, - }, - } -} +const score = ref(0) +onLoad(() => { + getBatchData(userStore.userInfo.batchDataUrl).then((resp) => { + if (resp.code === 200) { + const _batchData = resp.result as any[] + if (_batchData.length > 0) { + const _score = + _batchData[0].batches.find((item) => item.batch === userStore.userInfo.batchName) + ?.score || 0 + score.value = _score + } + } + }) +})