diff --git a/src/api/config.ts b/src/api/config.ts index f79dfee..a23e931 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -12,4 +12,6 @@ export const financialMarketSave = async (data: Record): Promise => (await axios.post('/nakadai/nakadai/customsPass/batchDeletion', data)).data; export const listPass = async (data: Record): Promise => (await axios.post('/nakadai/nakadai/customsPass/checkpointList', data)).data; export const savePass = async (data: Record): Promise => (await axios.post('/nakadai/nakadai/customsPass/save', data)).data; -export const updatePass = async (data: Record[]): Promise => (await axios.post(`/nakadai/nakadai/customsPass/update`), data).data; +export const updatePass = async (data: Record[]): Promise => (await axios.post(`/nakadai/nakadai/customsPass/update`, data)).data; +export const checkPointListByStu = async (projectId: number, displayCollection?: number | string = ''): Promise => + (await axios.post(`/nakadai/nakadai/customsPass/checkPointListByStu?projectId=${projectId}&displayCollection=${displayCollection}`)).data; diff --git a/src/views/Home.vue b/src/views/Home.vue index 4c15dac..4776110 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -34,8 +34,8 @@ @click="selecLevel(item)"> LV.{{ i + 1 }}
-
第{{ numToChinese(item.customsPassName.split(' ')[0].replace('关卡', '')) }}关
-

{{ item.customsPassName.split(' ')[1] }}

+
第{{ numToChinese(i + 1) }}关
+

{{ item.customsPassName }}

import { ref, onMounted } from 'vue'; -import { checkPointList } from '@/api/judgment'; import { cancelCollection, collect } from '@/api/bank'; -import { listPass } from '@/api/config'; +import { checkPointListByStu } from '@/api/config'; import Panel from '@/components/Panel/index.vue'; import { useRouter, useRoute } from 'vue-router'; import { ElMessage } from 'element-plus'; @@ -86,9 +85,7 @@ const step = 150; // 关卡列表 const getLevel = async (only: any = '') => { if (only) collected.value = !collected.value; - const { data } = await listPass({ - platformId: 1, - }); + const { data } = await checkPointListByStu(+projectId, collected.value ? 1 : ''); levels.value = data; }; // 点击关卡回调 @@ -101,7 +98,7 @@ const collectItem = async (item: Record) => { await cancelCollection(item.favoriteId); } else { await collect({ - checkPointId: item.id, + checkPointId: item.checkpointId, projectId, }); } diff --git a/src/views/config/level/Index.vue b/src/views/config/level/Index.vue index 8b97224..6014138 100644 --- a/src/views/config/level/Index.vue +++ b/src/views/config/level/Index.vue @@ -18,7 +18,7 @@ alt="" class="icon" />
-