diff --git a/.env.development b/.env.development index 40bc1365..b4bbb8aa 100644 --- a/.env.development +++ b/.env.development @@ -15,7 +15,7 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # h5专用地址 -VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' +VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002' # VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002' # dev @@ -27,8 +27,8 @@ VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' # 任东 -VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601' -VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' +#VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601' +#VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' # VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604' # 张建成 diff --git a/src/api/examination.js b/src/api/examination.js index 0e683358..1f4ee2d3 100644 --- a/src/api/examination.js +++ b/src/api/examination.js @@ -33,6 +33,7 @@ export const queryPaperExamScore = (data) => { }; // ↑↑↑↑↑↑↑↑↑考试中心考试↑↑↑↑↑↑↑ + // ↓↓↓↓↓↓↓↓↓课程考试↓↓↓↓↓↓↓↓ export const startExamByCrs = (data) => { @@ -83,4 +84,17 @@ export const queryPaperExamRankingList = (data) => { data }); }; - \ No newline at end of file + + +// 考试过程中提交结果,后端用来缓存(考试中心考试和课程考试共用这个缓存接口) + export const commitPaperCache = (data) => { + return request({ + url: base_url + '/traExamPapers/commitPaperCache', + method: 'post', + toastErrors: true, + data + }); + }; + + + \ No newline at end of file diff --git a/src/api/wrongQuestionRecord.js b/src/api/wrongQuestionRecord.js index 6a51dcbd..305c8f3e 100644 --- a/src/api/wrongQuestionRecord.js +++ b/src/api/wrongQuestionRecord.js @@ -40,4 +40,15 @@ export const queryMistakesAnswerByMisId = (data) => { toastErrors: false, data }); -}; \ No newline at end of file +}; + +// 根据ID查题 +export const queryMistakesCorrectByMisId = (data) => { + return request({ + url: base_url + '/traMistakesCollection/queryMistakesCorrectByMisId', + method: 'post', + toastErrors: false, + data + }); +}; + diff --git a/src/pages/courseDetail/index.vue b/src/pages/courseDetail/index.vue index 850831fc..1a20ef05 100644 --- a/src/pages/courseDetail/index.vue +++ b/src/pages/courseDetail/index.vue @@ -17,7 +17,7 @@ - {{ form.crsName || '' }} + {{form.crsName}} @@ -75,19 +75,15 @@ > - - - - @@ -381,7 +377,9 @@ padding-top: 36rpx; padding-left: 42rpx; padding-bottom: 24rpx; - min-height: 158rpx; + + // overflow: hidden; + justify-content: space-between; } @@ -390,6 +388,7 @@ color: #333333; font-weight: 600; margin-bottom: 20rpx; + min-height: 36rpx; } .title-icon { diff --git a/src/pages/courseRecord/components/examRecordItem.vue b/src/pages/courseRecord/components/examRecordItem.vue index 522958c6..9ccd6920 100644 --- a/src/pages/courseRecord/components/examRecordItem.vue +++ b/src/pages/courseRecord/components/examRecordItem.vue @@ -19,7 +19,7 @@ {{ item.examCnt || 0 }} @@ -60,7 +61,7 @@ import { computed, ref, reactive } from 'vue'; import common from '@/common/common'; import { queryCrsExamHisByExamId } from '@/api/courseRecord.js'; - const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据 + import { useItemList } from '../useItemList.js'; const props = defineProps({ item: { type: Object, @@ -68,33 +69,9 @@ } }); const item = computed(() => props.item); - const data_list = reactive([]); - const total = ref(-1); - const show_list_state = ref(false); - const list_div_height = computed(() => { - if (!show_list_state.value) { - return '0'; - } else if (status.value === 'loading') { - return '100rpx'; - } else { - return data_list.length * 136 + 'rpx'; - } - }); - - // 点击获取考试详情 - const show_list_click = () => { - show_list_state.value = !show_list_state.value; - if (total.value === -1) { - //加载数据 - status.value = 'loading'; - data_list.length = 0; - queryCrsExamHisByExamId({ examId: item.value.examId }).then((res) => { - data_list.push(...res.body); - total.value = data_list.length; - status.value = 'loadmore'; - }); - } - }; + const fetchFunction = (params) => queryCrsExamHisByExamId({ examId: item.value.examId, ...params }); + const { status, data_list, show_list_state, list_div_height, show_list_click, getData } = useItemList(fetchFunction); + // 跳转到详情 const click_list_item = (list_item) => { const papersName = item.value.examName; @@ -247,7 +224,7 @@ /* 添加过渡动画,包含延迟效果 */ transition: transform 0.2s ease; } - .click_text_icon_action{ + .click_text_icon_action { transform: rotate(90deg); } } diff --git a/src/pages/courseRecord/components/practiceRecordItem.vue b/src/pages/courseRecord/components/practiceRecordItem.vue index ef84054e..cea6b05e 100644 --- a/src/pages/courseRecord/components/practiceRecordItem.vue +++ b/src/pages/courseRecord/components/practiceRecordItem.vue @@ -47,9 +47,10 @@ @@ -60,7 +61,8 @@ import { computed, ref, reactive } from 'vue'; import common from '@/common/common'; import { queryPracticeHis } from '@/api/courseRecord.js'; - const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据 + import { useItemList, formatDuration } from '../useItemList.js'; + const props = defineProps({ item: { type: Object, @@ -68,60 +70,15 @@ } }); const item = computed(() => props.item); - const data_list = reactive([]); - const total = ref(-1); - - const show_list_state = ref(false); - const list_div_height = computed(() => { - if (!show_list_state.value) { - return '0'; - } else if (status.value === 'loading') { - return '100rpx'; - } else { - return data_list.length * 136 + 'rpx'; - } - }); - - // 点击获取详情 - const show_list_click = () => { - show_list_state.value = !show_list_state.value; - if (total.value === -1) { - //加载数据 - status.value = 'loading'; - data_list.length = 0; - queryPracticeHis({ crsId: item.value.crsId }).then((res) => { - data_list.push(...res.body); - total.value = data_list.length; - status.value = 'loadmore'; - }); - } - }; + + const fetchFunction = (params) => queryPracticeHis({ crsId: item.value.crsId, ...params }); + const { status, data_list, show_list_state, list_div_height, show_list_click, getData } = useItemList(fetchFunction); // 跳转到详情 const click_list_item = (list_item) => { common.navigateTo(`/pages/courseRecord/coursePracticeRecordDetail?exrId=${list_item.exrId}`); }; - // 计算两个标准时间的时间差值 - const formatDuration = (startTm, endTm) => { - if(endTm === null || startTm === null) return "00:00:00"; - // 解析时间字符串为时间戳(毫秒) - const startTime = new Date(startTm).getTime(); - const endTime = new Date(endTm).getTime(); - - // 计算时间差(秒),确保为正数 - const seconds = Math.abs(Math.floor((endTime - startTime) / 1000)); - // 计算时、分、秒 - const hours = Math.floor(seconds / 3600); - const minutes = Math.floor((seconds % 3600) / 60); - const remainingSeconds = seconds % 60; - - // 补零格式化函数(统一处理所有单位) - const formatNumber = (num) => num.toString().padStart(2, '0'); - - // 小时、分钟、秒均保持两位数格式 - return `${formatNumber(hours)}:${formatNumber(minutes)}:${formatNumber(remainingSeconds)}`; - };