diff --git a/src/api/examination.js b/src/api/examination.js
index df6f23f1..cb4f6734 100644
--- a/src/api/examination.js
+++ b/src/api/examination.js
@@ -72,4 +72,15 @@ export const queryPaperExamRankingList = (data) => {
data
});
};
-
\ No newline at end of file
+
+
+ // 反馈问题
+ export const saveTraQnsFeedback = (data) => {
+ return request({
+ url: base_url + '/traCrsPapers/saveTraQnsFeedback',
+ method: 'post',
+ toastErrors: true,
+ data
+ });
+ };
+
\ No newline at end of file
diff --git a/src/common/common.js b/src/common/common.js
index 7fd3b698..a2fdbb7d 100644
--- a/src/common/common.js
+++ b/src/common/common.js
@@ -21,7 +21,6 @@ function show(title, msg, showCancel = true, cancelText = '取消', confirmText
confirmText,
success: (res) => {
// 统一处理成功回调,解析为布尔值
- console.log('res.confirm', res.confirm);
resolve(!!res.confirm);
}
};
@@ -65,23 +64,23 @@ const hideLoading = () => uni.hideLoading()
// 防抖工具函数
function debounce(fn, wait = 300) {
- let isLocked = false; // 锁定状态标记
- return function(...args) {
- // 如果处于锁定状态,直接返回不执行
- if (isLocked) {
- return;
- }
- // 执行函数
- fn.apply(this, args);
-
- // 锁定,防止再次执行
- isLocked = true;
-
- // 等待指定时间后解锁
- setTimeout(() => {
- isLocked = false;
- }, wait);
- };
+ let isLocked = false; // 锁定状态标记
+ return function(...args) {
+ // 如果处于锁定状态,直接返回不执行
+ if (isLocked) {
+ return;
+ }
+ // 执行函数
+ fn.apply(this, args);
+
+ // 锁定,防止再次执行
+ isLocked = true;
+
+ // 等待指定时间后解锁
+ setTimeout(() => {
+ isLocked = false;
+ }, wait);
+ };
}
// 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。
@@ -174,23 +173,23 @@ export const getUserInfo = (key = '') => {
}
// 数字转换,把传入的秒转换为HH:mm:ss格式
export const formatSeconds = (seconds) => {
- // 处理非数字或负数情况
- if (typeof seconds !== 'number' || isNaN(seconds) || seconds < 0) {
- return '00:00:00';
- }
+ // 处理非数字或负数情况
+ if (typeof seconds !== 'number' || isNaN(seconds) || seconds < 0) {
+ return '00:00:00';
+ }
- // 计算小时、分钟和剩余秒数
- const hours = Math.floor(seconds / 3600);
- const minutes = Math.floor((seconds % 3600) / 60);
- const remainingSeconds = Math.floor(seconds % 60);
+ // 计算小时、分钟和剩余秒数
+ const hours = Math.floor(seconds / 3600);
+ const minutes = Math.floor((seconds % 3600) / 60);
+ const remainingSeconds = Math.floor(seconds % 60);
- // 补零函数:将数字转为两位数字符串
- const padZero = (num) => num.toString().padStart(2, '0');
+ // 补零函数:将数字转为两位数字符串
+ const padZero = (num) => num.toString().padStart(2, '0');
+
+ // 拼接成00:00:00格式
+ return `${padZero(hours)}:${padZero(minutes)}:${padZero(remainingSeconds)}`;
+};
- // 拼接成00:00:00格式
- return `${padZero(hours)}:${padZero(minutes)}:${padZero(remainingSeconds)}`;
- };
-
/**
* 判断当前运行平台是否匹配指定标识
* @param {string} flag - 平台标识:'IOS' 表示苹果iOS平台,'AND' 表示安卓平台
@@ -242,6 +241,41 @@ function isLogin() {
return !!getToken();
}
+// 封装键盘高度变化处理
+export function setupKeyboardHeightListener(updateCallback) {
+ // #ifndef APP-PLUS
+ return () => {};
+ // #endif
+ // #ifdef APP-PLUS
+ // 获取系统信息
+ const systemInfo = uni.getSystemInfoSync();
+ // 计算安全区域底部高度
+ const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
+
+ // 定义处理函数
+ const handleKeyboardHeightChange = (res) => {
+ let keyboardHeight = res.height;
+
+ // 仅在iOS端补偿安全区域高度
+ if (systemInfo.platform === 'ios') {
+ keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
+ }
+
+ // 通过回调函数更新外部的响应式变量
+ updateCallback(keyboardHeight);
+ };
+
+ // 监听键盘高度变化
+ uni.onKeyboardHeightChange(handleKeyboardHeightChange);
+
+ // 返回取消监听的函数,方便组件卸载时清理
+ return () => {
+ uni.offKeyboardHeightChange(handleKeyboardHeightChange);
+ };
+ // #endif
+
+}
+
export default {
getPageCache,
setPageCache,
diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue
index e2657e7c..d31e00aa 100644
--- a/src/components/examination/question.vue
+++ b/src/components/examination/question.vue
@@ -29,12 +29,10 @@
style="width: 100%; height: 100%"
>
- 文
+ 文
重答
完成
-
-
@@ -45,20 +43,6 @@
-
重答
完成
@@ -100,6 +84,10 @@
status: {
default: '',
type: String
+ },
+ isPreview: { // 是否是预览语音
+ default: false,
+ type: Boolean
}
});
@@ -151,9 +139,10 @@
console.log('点击播放');
audioStore.playAudio();
};
+ let unsubscribe = () =>{};
onMounted(() => {
// 2. 监听 Store 中 isPlaying 的变化,实时同步
- const unsubscribe = audioStore.$subscribe((mutation, state) => {
+ unsubscribe = audioStore.$subscribe((mutation, state) => {
isPlaying.value = state.isPlaying;
});
// 注册播放完成回调
@@ -185,6 +174,7 @@
audioStore.stopAudio();
// 2. 移除当前组件注册的回调(避免内存泄漏)
audioStore.removeCallbacks();
+
unsubscribe();
});
diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue
index a6c3f186..54525e9a 100644
--- a/src/components/examination/subject.vue
+++ b/src/components/examination/subject.vue
@@ -9,7 +9,7 @@
@@ -32,8 +32,9 @@
@@ -212,8 +213,8 @@
set: (val) => {}
});
- // 按钮
- const questionBuuttonClick = (type, submitObj) => {
+ // 语音播放组件小按钮
+ const questionButtonClick = (type, submitObj) => {
console.log('type', type, submitObj);
// 判断点击的是什么
if (type === 'complete') {
@@ -224,7 +225,7 @@
emit('subject_click', type, {
qnsTyp: props.item.qnsTyp,
qnsId: props.item.qnsId,
- answer: item_answer.value,
+ answer: submitObj,
answerItems: []
});
};
diff --git a/src/components/list-no-data/list-no-data.vue b/src/components/list-no-data/list-no-data.vue
index 637ba6e6..4a466fa4 100644
--- a/src/components/list-no-data/list-no-data.vue
+++ b/src/components/list-no-data/list-no-data.vue
@@ -1,12 +1,26 @@
-
-
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/src/pages/courseDetail/components/comment.vue b/src/pages/courseDetail/components/comment.vue
index 8843ba4b..856c052f 100644
--- a/src/pages/courseDetail/components/comment.vue
+++ b/src/pages/courseDetail/components/comment.vue
@@ -1,24 +1,33 @@
- 展开{{item.children?.length}}条回复
+ 展开{{ item.children?.length }}条回复
@@ -38,25 +47,27 @@
-
+
- {{childrenItem.userName}}
+ {{ childrenItem.userName }}
- {{childrenItem.rtnUName}}
-
+ {{ childrenItem.rtnUName }}
- {{childrenItem.bbsContent}}
-
-
+ {{ childrenItem.bbsContent }}
+
- {{childrenItem.bbsTm.substr(0,16)}}
- 回复
+ {{ childrenItem.bbsTm.substr(0, 16) }}
+
+ 回复
@@ -64,23 +75,26 @@
-
+
-
- 这里什么都没有
-
+ 这里什么都没有
\ No newline at end of file
+
diff --git a/src/pages/courseRecord/components/examRecordItem.vue b/src/pages/courseRecord/components/examRecordItem.vue
index 42300a53..a462cf5b 100644
--- a/src/pages/courseRecord/components/examRecordItem.vue
+++ b/src/pages/courseRecord/components/examRecordItem.vue
@@ -99,8 +99,9 @@
const click_list_item = (list_item) => {
const examLenTm = 666;
const papersName = item.value.examName;
+
common.navigateTo(
- `/pages/examination/result?execId=${list_item.execId}&examLenTm=${examLenTm}&papersName=${papersName}`
+ `/pages/examination/result?execId=${list_item.execId}&examLenTm=${examLenTm}&papersName=${papersName}&mode=record`
);
};
diff --git a/src/pages/courseRecord/components/studyRecordItem.vue b/src/pages/courseRecord/components/studyRecordItem.vue
index e14ee239..774c8c24 100644
--- a/src/pages/courseRecord/components/studyRecordItem.vue
+++ b/src/pages/courseRecord/components/studyRecordItem.vue
@@ -10,7 +10,7 @@
- {{ formatSeconds(item.stdyTm) || '' }}
+ {{ secondsToHours(item.stdyTm) }}h
学习时长
@@ -58,7 +58,6 @@
\ No newline at end of file
+
diff --git a/src/pages/examination/index.vue b/src/pages/examination/index.vue
index a0955579..4151f2f8 100644
--- a/src/pages/examination/index.vue
+++ b/src/pages/examination/index.vue
@@ -48,7 +48,6 @@
:clearResult="true"
v-model="item.my_answer"
>
- {{ item.my_answer }}
@@ -232,7 +231,7 @@
}
questionNumber.value = newNumber;
};
-
+
// 打开或者关闭弹出层
const openSheet = (status) => (status ? popupRef.value.open('bottom') : popupRef.value.close());
@@ -246,7 +245,7 @@
topicList[questionNumber.value]['mark'] = !topicList[questionNumber.value]['mark'];
} else if (type === 'feedback') {
console.log('feedbackRef.value', feedbackRef.value);
- feedbackRef.value.open();
+ feedbackRef.value.open(params.qnsId);
}
};
@@ -280,7 +279,6 @@
} else if (type === 'text') {
topic.value.es_status = '01';
topic.value.anserResult = submitObj; // 正确答案文字内容
- // submitProblemEssayQuestion({ anserResult: submitObj });
}
};
@@ -337,8 +335,6 @@
// 交卷按钮点击,打开交卷确认框
const hand_in_paper_button_click = () => {
console.log('点击交卷', paperData);
- // console.log('点击交卷topicList', topicList);
- // return;
// 判断是否完成所有题目
const completeList = topicList
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length : res.my_answer))
@@ -448,7 +444,6 @@
if (res.body.flagQuery === 'Y') {
// 需要查分
const examLenTm = 678;
-
common.redirectTo(
`/pages/examination/result?execId=${res.body.execId}&examLenTm=${examLenTm}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=${mode.value}&crsId=${paperData.crsId}`
);
diff --git a/src/pages/examination/result.vue b/src/pages/examination/result.vue
index e979871b..a9f17ee3 100644
--- a/src/pages/examination/result.vue
+++ b/src/pages/examination/result.vue
@@ -81,7 +81,7 @@
时长:{{ result.examLenTm }}
-
+
考试排行榜
@@ -245,7 +245,8 @@
result.execId = e.execId;
result.papersName = e.papersName;
result.examLenTm = e.examLenTm;
- result.mode = e.mode;
+ result.mode = e.mode || '';
+
result.papersId = e.papersId;
get_result();
});
diff --git a/src/pages/examinationRecord/components/examRecordItem.vue b/src/pages/examinationRecord/components/examRecordItem.vue
index 45d410c4..919000dd 100644
--- a/src/pages/examinationRecord/components/examRecordItem.vue
+++ b/src/pages/examinationRecord/components/examRecordItem.vue
@@ -102,7 +102,7 @@
const examLenTm = 666;
const papersName = item.value.examName;
common.navigateTo(
- `/pages/examination/result?execId=${list_item.execId}&examLenTm=${examLenTm}&papersName=${papersName}`
+ `/pages/examination/result?execId=${list_item.execId}&examLenTm=${examLenTm}&papersName=${papersName}&mode=record`
);
};
diff --git a/src/pages/practice/index.vue b/src/pages/practice/index.vue
index fc9db6e8..718df892 100644
--- a/src/pages/practice/index.vue
+++ b/src/pages/practice/index.vue
@@ -113,7 +113,7 @@
get: () => topicList[questionNumber.value],
set: (val) => (topicList[questionNumber.value] = val)
});
-
+
const showTouchBtn = computed(() => {
return topic.value?.qnsTyp === 'ES';
});
@@ -139,9 +139,10 @@
};
const subject_click = (type, params) => {
+
if (type === 'feedback') {
// 反馈
- feedbackRef.value.open();
+ feedbackRef.value.open(params.qnsId);
} else if (type === 'answer') {
//多选点击按钮答题
if (params.qnsTyp === 'MU') {
@@ -156,9 +157,13 @@
}
} else if (type === 'complete') {
// 问答题点击完成
+ // ossAddr
+ // anserResult 作答结果
+ // ossKey 对象存储
+ submitProblem(params.answer);
} else if (type === 'again') {
// 问答题点击重答
- // const topic = topicList[questionNumber.value];
+ topic.value.my_answer = {};
topic.value.isPreview = false;
topic.value.es_status = ''; // 取消转圈
}
@@ -175,127 +180,81 @@
qnsId: topic.value.qnsId,
...answer
})
- .then((res) => {
- common.hideLoading();
- const body = res.body;
- console.log('body', body);
+ .then(async (res) => {
topic.value.isPreview = true; // 不能在点击了,打开预览模式
- topic.value.clearResult = false; // 不清除正确答案了
- const traQnsInfoVo = body.traQnsInfoVo;
+ let traQnsInfoVo;
+ // 是问答题
+ console.log('是问答题', topic.value.qnsTyp);
+ if (topic.value.qnsTyp === 'ES') {
+ const result = await queryWithRetry(res.body.execLogId);
+ traQnsInfoVo = result.body.traQnsInfoVo;
+ } else {
+ traQnsInfoVo = res.body.traQnsInfoVo;
+ }
+ common.hideLoading();
+ topic.value.clearResult = false; // 不清除正确答案
topic.value.analyContent = traQnsInfoVo.analyContent; // 答案解析
- console.log('答题结果', traQnsInfoVo);
// 更新选项正确项目
topic.value.itemVos = traQnsInfoVo.itemVos; // 答案选项(todo应该不这样替换)
+
topic.value.anserResult = traQnsInfoVo.anserResult; // 正确答案字符串分割
const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
if (!addProblem()) {
// 返回false说明到了最后一题
console.log('最后一题');
+ if (topic.value.qnsTyp === 'ES') {
+ // 最后一题是问答题,暂时不动
+ }
}
// 自动切换下一题的条件
if (
judgeResultStatus && // 条件1.答题正确
- // ['JD', 'SN', 'MU'].includes(topic.qnsTyp) && // 条件2.单选多选判断(这里改成了单选多选判断专属,所有不用判断这一条了)
+ topic.value.qnsTyp !== 'ES' && // 问答题答对打答错都不切换
topicList.length < storageTopicList.value.length // 条件3.不是最后一题(暂定这样判断)
) {
questionNumber.value++;
- } else {
- console.log('为什么没自动跳转', judgeResultStatus);
- console.log(
- '22',
- topicList.length < storageTopicList.value.length,
- topicList.length,
- storageTopicList.value.length
- );
}
})
.catch(() => {
common.hideLoading();
});
};
+
// 问答题轮询结果方法
const queryWithRetry = (execLogId, maxRetries = 30) => {
// 递归终止条件:达到最大重试次数
if (maxRetries <= 0) {
return Promise.reject(new Error('超过最大重试次数,查询失败'));
}
-
- return queryCrsPracticeAnswerResult({ execLogId }).then((resl) => {
- const isWait = resl.body.isWait;
- if (isWait === 'N') {
- // 如果是Y,延迟2秒后重试,重试次数减1
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve(queryWithRetry(execLogId, maxRetries - 1));
- }, 2000);
- });
- } else {
- // 不是Y,直接返回结果
- return resl;
- }
- });
- };
-
- // 单题回答(问答题专属)
- const submitProblemEssayQuestion = (answer) => {
- const topic = topicList[questionNumber.value];
- const old_text = touchBtnRef.value?.clearinputText(); // 清除发送框数据
- console.log('答题内容', answer);
-
- console.log('答单题问答题专属', topic);
- practiceAnswer({
- exrId: paperData.exrId,
- ossKey: '',
- qnsId: topic.qnsId,
- ...answer
- })
+ return queryCrsPracticeAnswerResult({ execLogId })
.then((res) => {
- topic.isPreview = true; // 不能在点击了,打开预览模式
-
- // touchBtnRef.value.clearinputText()
- // topic.clearResult = false; // 不清除正确答案了
- // 使用方式
- queryWithRetry(res.body.execLogId)
- .then((result) => {
- console.log('查询成功', result);
- const body = result.body;
- const traQnsInfoVo = body.traQnsInfoVo;
- topic.analyContent = traQnsInfoVo?.analyContent || ''; // 答案解析
- topic.anserResult = traQnsInfoVo?.anserResult || answer.anserResult; // 正确答案文字内容
- const judgeResultStatus = traQnsInfoVo?.judgeResult === 'P'; // P为正确U为错误
- // 判断是语音回答还是文字回答, 通过是否存在语音地址判断 // todo 后续可能改成ossid判断
- if (answer.voicePath) {
- topic.es_status = '02';
- } else {
- // 纯文字
- topic.es_status = '01';
- }
-
- // 处理成功结果
- })
- .catch((error) => {
- console.log('查询失败', error);
- topic.isPreview = false;
- topic.es_status = ''; // 取消转圈
- touchBtnRef.value?.clearinputText(old_text); // 清除发送框数据
- // 处理失败情况
+ console.log('queryCrsPracticeAnswerResult', res.body);
+ const isWait = res.body.isWait;
+ if (isWait === 'Y') {
+ // 如果是Y,延迟2秒后重试,重试次数减1
+ return new Promise((resolve) => {
+ setTimeout(() => {
+ resolve(queryWithRetry(execLogId, maxRetries - 1));
+ }, 2000);
});
-
- // const traQnsInfoVo = body.traQnsInfoVo;
- // topic.analyContent = traQnsInfoVo.analyContent; // 答案解析
- // console.log('答题结果', traQnsInfoVo);
-
- // const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
-
- // if (!addProblem()) {
- // // 返回false说明到了最后一题
- // console.log('最后一题');
- // }
+ } else {
+ // 不是Y,直接返回结果
+ return res;
+ }
})
- .catch(() => {
- topic.es_status = ''; // 取消转圈
+ .catch((error) => {
+ // 对接口调用错误进行重试
+ if (maxRetries > 0) {
+ return new Promise((resolve) => {
+ setTimeout(() => {
+ resolve(queryWithRetry(execLogId, maxRetries - 1));
+ }, 2000);
+ });
+ }
+ return Promise.reject(error);
});
};
+
// 录音组件提交
const touchBtnSubmit = (type, submitObj) => {
const old_text = touchBtnRef.value?.clearinputText(); // 清除发送框数据
@@ -325,7 +284,6 @@
} else if (type === 'text') {
topic.value.es_status = '01';
topic.value.anserResult = submitObj; // 正确答案文字内容
- // submitProblemEssayQuestion({ anserResult: submitObj });
}
};
@@ -373,7 +331,7 @@
});
// #endif
});
-
+
const result_click = ({ key }) => {
console.log('res', key);
if (key === 'hand_in_paper') {
@@ -445,9 +403,7 @@
dialogRef.value.open();
};
// 执行交卷
- const hand_in_paper = () => {
-
- };
+ const hand_in_paper = () => {};
// 启动定时器
const startTimer = () => {
if (practiceTimeTimer) {
diff --git a/src/pages/preview/components/previewAiSparring.vue b/src/pages/preview/components/previewAiSparring.vue
index 29f83405..ee9c7ad0 100644
--- a/src/pages/preview/components/previewAiSparring.vue
+++ b/src/pages/preview/components/previewAiSparring.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/pages/preview/components/previewCourse.vue b/src/pages/preview/components/previewCourse.vue
index 01984a26..ec2abcf7 100644
--- a/src/pages/preview/components/previewCourse.vue
+++ b/src/pages/preview/components/previewCourse.vue
@@ -1,7 +1,7 @@
-
+
@@ -59,6 +59,10 @@
const scrolltolower = (item) => {
getData();
};
+ const item_click = (item) => {
+
+ };
+
defineExpose({
getData
});
diff --git a/src/pages/search/result.vue b/src/pages/search/result.vue
index 4fc9f487..070af948 100644
--- a/src/pages/search/result.vue
+++ b/src/pages/search/result.vue
@@ -6,7 +6,7 @@
diff --git a/src/pages/search/search.vue b/src/pages/search/search.vue
index 4e33ec9d..4e619af4 100644
--- a/src/pages/search/search.vue
+++ b/src/pages/search/search.vue
@@ -6,10 +6,20 @@
-
-
+
+
+
+
@@ -19,253 +29,121 @@
-
+
-
- 历史搜索
-
-
-
-
+ 历史搜索
+
+
-
- {{item}}
-
-
-
+
+ {{ item }}
-
-
-
-
-
-
-
-
- {{ item }}
-
+
+
+ 暂无任何搜索记录
-
\ No newline at end of file
+
diff --git a/src/pages/testingHall/components/content.vue b/src/pages/testingHall/components/content.vue
index 2fe2f844..6753dd4e 100644
--- a/src/pages/testingHall/components/content.vue
+++ b/src/pages/testingHall/components/content.vue
@@ -73,13 +73,10 @@
}
queryTraExamPapersPage(params)
.then((res) => {
- console.log('resresresresres', res);
total.value = res.total;
data_list.push(...res.body);
})
- .catch((res) => {
- console.log('谢谢谢谢谢谢', res);
- })
+ .catch((res) => {})
.finally(() => {
if (data_list.length >= total.value) {
status.value = 'nomore';
diff --git a/src/static/images/courseDetail/ASK.png b/src/static/images/courseDetail/ASK.png
new file mode 100644
index 00000000..3852178b
Binary files /dev/null and b/src/static/images/courseDetail/ASK.png differ
diff --git a/src/static/images/courseDetail/SUG.png b/src/static/images/courseDetail/SUG.png
new file mode 100644
index 00000000..6ecb5b03
Binary files /dev/null and b/src/static/images/courseDetail/SUG.png differ
diff --git a/src/static/images/search/no_search.png b/src/static/images/search/no_search.png
new file mode 100644
index 00000000..1273e383
Binary files /dev/null and b/src/static/images/search/no_search.png differ