周六修改bug
This commit is contained in:
+4
-3
@@ -15,20 +15,21 @@ 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 = 'http://25.16.122.65:7001'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.21:9786'
|
||||
# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
# dev
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# sit
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
|
||||
# UAT
|
||||
# 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_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
|
||||
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
|
||||
# 张建成
|
||||
|
||||
@@ -3,3 +3,4 @@ ENV = 'production'
|
||||
|
||||
# base api
|
||||
VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.21:9786'
|
||||
+4
-4
@@ -45,10 +45,10 @@
|
||||
}
|
||||
|
||||
// 使用示例
|
||||
const browserInfo = getBrowserInfo();
|
||||
console.log(`浏览器: ${browserInfo.browser}`);
|
||||
console.log(`版本号: ${browserInfo.version}`);
|
||||
console.log(`完整用户代理: ${browserInfo.userAgent}`);
|
||||
// const browserInfo = getBrowserInfo();
|
||||
// console.log(`浏览器: ${browserInfo.browser}`);
|
||||
// console.log(`版本号: ${browserInfo.version}`);
|
||||
// console.log(`完整用户代理: ${browserInfo.userAgent}`);
|
||||
// console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ export const get_base_url = (url = '') => {
|
||||
// #ifdef H5
|
||||
if (url) {
|
||||
let _str = (url.split('/')[0] || url.split('/')[1])?.toUpperCase()
|
||||
return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
|
||||
return ENV[`VITE_APP_BASE_H5_API_Url_${_str}`] || ENV.VITE_APP_BASE_H5_API_Url || ENV
|
||||
.VITE_APP_BASE_API_Url
|
||||
} else {
|
||||
return ENV.VITE_APP_BASE_H5_API_Url || ENV.VITE_APP_BASE_API_Url
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
import { computed, unref, ref, toRefs, watch, onMounted, nextTick } from 'vue';
|
||||
import { onUnload } from '@dcloudio/uni-app';
|
||||
import { useAudioStore } from '@/store/audioStore';
|
||||
import {downloadFile} from '@/api/common.js'
|
||||
const props = defineProps({
|
||||
dataInfo: {
|
||||
default: () => ({}),
|
||||
@@ -210,11 +211,17 @@
|
||||
// 赋值显示
|
||||
voiceTime.value = displayTime + 's';
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.dataInfo.voicePath,
|
||||
(newVal) => {
|
||||
audioStore.setAudioSrc(newVal);
|
||||
if(newVal === '' && props.dataInfo.ossKey) { // 去下载oss内容
|
||||
console.log('去下载oss内容');
|
||||
downloadFile(props.dataInfo.ossKey).then(res => {
|
||||
audioStore.setAudioSrc(res.tempFilePath);
|
||||
})
|
||||
} else {
|
||||
audioStore.setAudioSrc(newVal);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
@@ -270,9 +270,11 @@
|
||||
// 点击答题
|
||||
const click_option = (analysisVo) => {
|
||||
if (props.isPreview || !props.clearResult) return;
|
||||
|
||||
// 无论什么类型如果表里已经有了,再次点击就是弹出
|
||||
if (item_answer.value.includes(analysisVo.itemId)) {
|
||||
item_answer.value = item_answer.value.filter((id) => id !== analysisVo.itemId);
|
||||
modelValue.value = item_answer.value;
|
||||
if (!['study'].includes(props.mode)) {
|
||||
muCheckbox('choose');
|
||||
}
|
||||
@@ -280,21 +282,25 @@
|
||||
// 单选
|
||||
// 单选插入,并且移除其他
|
||||
item_answer.value[0] = analysisVo.itemId;
|
||||
modelValue.value = item_answer.value;
|
||||
muCheckbox('choose');
|
||||
} else if (props.item.qnsTyp === 'MU') {
|
||||
// 多选题
|
||||
// 多选直接插入
|
||||
item_answer.value.push(analysisVo.itemId);
|
||||
modelValue.value = item_answer.value;
|
||||
if (!['study'].includes(props.mode)) {
|
||||
muCheckbox('choose');
|
||||
}
|
||||
|
||||
} else if (props.item.qnsTyp === 'JD') {
|
||||
// 判断题
|
||||
// 判断插入,并且移除其他
|
||||
item_answer.value = [analysisVo.itemId];
|
||||
modelValue.value = item_answer.value;
|
||||
muCheckbox('choose');
|
||||
}
|
||||
modelValue.value = item_answer.value;
|
||||
|
||||
};
|
||||
const muBtnClick = () => {
|
||||
if(item_answer.value.length === 0){
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
// 跳转到详情
|
||||
const click_list_item = (list_item) => {
|
||||
common.navigateTo(
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyBatch}&crsName=${item.value.crsName || ''}`
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyId}&crsName=${item.value.crsName || ''}`
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
+104
-30
@@ -52,7 +52,7 @@
|
||||
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" :refresher-threshold="0">
|
||||
<Subject
|
||||
:item="item"
|
||||
:mode="mode"
|
||||
mode="examination"
|
||||
@subject_click="subject_click"
|
||||
:clearResult="true"
|
||||
v-model="item.my_answer"
|
||||
@@ -155,7 +155,7 @@
|
||||
import Dialog from './components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import { getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
@@ -181,14 +181,15 @@
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const mode = 'examination'; // 考试 examination 练习practice
|
||||
let mode = ''; // 课程考试CRS,考试中心考试PAPERS
|
||||
const paperData = reactive({
|
||||
crsId: '', // 课程ID,通过课程id是否为空字符串判断这个试卷是课程考试还是考试中心考试
|
||||
execId: '', // 执行ID
|
||||
examId: '', // 考试ID
|
||||
papersId: '', // 试卷ID
|
||||
limitTm: 0, // 考试限制时间
|
||||
papersName: '' // 试卷名称
|
||||
papersName: '', // 试卷名称
|
||||
isCacheExam: '' // 是否是缓存试卷(继续答题试卷)
|
||||
}); // 试卷信息
|
||||
const topicList = reactive([]); // 问题列表
|
||||
const popup_input_bottom = ref('0px');
|
||||
@@ -266,7 +267,7 @@
|
||||
questionNumber.value = index;
|
||||
popupRef.value.close();
|
||||
};
|
||||
|
||||
|
||||
const subject_click = (type, params) => {
|
||||
if (type === 'mark') {
|
||||
topicList[questionNumber.value]['mark'] = !topicList[questionNumber.value]['mark'];
|
||||
@@ -277,15 +278,11 @@
|
||||
// 问答题点击重答
|
||||
topic.value.my_answer = {};
|
||||
topic.value.es_status = ''; // 取消转圈
|
||||
} else if (type === 'answer') {
|
||||
//多选点击按钮答题
|
||||
if (params.qnsTyp === 'MU') {
|
||||
hand_in_paper_cache()
|
||||
}
|
||||
hand_in_paper_cache();
|
||||
} else if (type === 'choose') {
|
||||
//单选判断点击选项答题
|
||||
if (['JD', 'SN'].includes(params.qnsTyp)) {
|
||||
hand_in_paper_cache()
|
||||
//单选判断点击选项答题,为了缓存,考试这里多选没按钮,也是按照一个选项一个选项的触发
|
||||
if (['JD', 'SN', 'MU'].includes(params.qnsTyp)) {
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -312,6 +309,7 @@
|
||||
ossAddr: _res.body.ossFileAddr,
|
||||
voicePath: voicePath
|
||||
};
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -324,14 +322,49 @@
|
||||
topic.value.my_answer = {
|
||||
anserResult: submitObj // 正确答案文字内容
|
||||
};
|
||||
hand_in_paper_cache();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let examinationAnswerCacheKey;
|
||||
const answerCacheList = ref({});
|
||||
const setAnswerCacheList = (value) => {
|
||||
console.log('触发变化', value);
|
||||
answerCacheList.value = value;
|
||||
common.setValue(examinationAnswerCacheKey, value);
|
||||
};
|
||||
// const answerCacheList = computed({
|
||||
// get() {
|
||||
// const cacheList = common.getValue(examinationAnswerCacheKey);
|
||||
// if (cacheList) return cacheList;
|
||||
// return {};
|
||||
// },
|
||||
// set(value) {
|
||||
// console.log('触发变化', value);
|
||||
// common.setValue(examinationAnswerCacheKey, value); // 补充键参数
|
||||
// }
|
||||
// });
|
||||
|
||||
// 添加试题答案缓存
|
||||
const addTopicAnswerCache = () => {
|
||||
|
||||
}
|
||||
|
||||
const my_answer = topic.value.my_answer;
|
||||
const qnsId = topic.value.qnsId;
|
||||
console.log('asdsadas', answerCacheList.value);
|
||||
const newCache = { ...answerCacheList.value };
|
||||
if(topic.value.qnsTyp === 'ES') { // 问答题特殊处理
|
||||
if('anserResult' in my_answer && my_answer.anserResult !== '') {
|
||||
newCache[qnsId] = {...my_answer, voicePath:''};
|
||||
} else {
|
||||
delete newCache[qnsId];
|
||||
}
|
||||
} else {
|
||||
newCache[qnsId] = my_answer;
|
||||
}
|
||||
|
||||
setAnswerCacheList(newCache);
|
||||
// answerCacheList.value = newCache;
|
||||
};
|
||||
|
||||
// 初始化时检查
|
||||
onLoad(() => {
|
||||
const examination = getPageCache('examination');
|
||||
@@ -347,20 +380,58 @@
|
||||
paperData.papersId = examination.papersId;
|
||||
paperData.limitTm = examination.limitTm;
|
||||
paperData.papersName = examination.papersName;
|
||||
// 获取上一次答题的缓存
|
||||
// const answerCacheList = common.getValue('')
|
||||
paperData.isCacheExam = examination.isCacheExam || 'N';
|
||||
mode = paperData.examId ? 'PAPERS' : 'CRS'; // 课程考试CRS,考试中心考试PAPERS
|
||||
// 设置缓存的键的名称
|
||||
const suffix = mode === 'PAPERS' ? paperData.examId : paperData.crsId;
|
||||
examinationAnswerCacheKey = 'examinationAnswerCache' + suffix;
|
||||
answerCacheList.value = common.getValue(examinationAnswerCacheKey) ?? {};
|
||||
console.log('刚进入', answerCacheList.value);
|
||||
topicList.push(
|
||||
...examination.qnsInfoVos.map((res) => ({
|
||||
...res,
|
||||
mark: false,
|
||||
my_answer: []
|
||||
}))
|
||||
...examination.qnsInfoVos.map((res) => {
|
||||
const es_status =
|
||||
paperData.isCacheExam === 'N'
|
||||
? ''
|
||||
: res.qnsId in answerCacheList.value
|
||||
? 'ossKey' in answerCacheList.value[res.qnsId]
|
||||
? '02'
|
||||
: '01'
|
||||
: '';
|
||||
const my_answer =
|
||||
paperData.isCacheExam === 'N'
|
||||
? []
|
||||
: res.qnsId in answerCacheList.value
|
||||
? answerCacheList.value[res.qnsId]
|
||||
: [];
|
||||
return {
|
||||
...res,
|
||||
mark: false,
|
||||
es_status: es_status,
|
||||
my_answer: my_answer
|
||||
};
|
||||
})
|
||||
);
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (paperData.isCacheExam === 'Y') {
|
||||
// 代表是缓存来的
|
||||
dialogRef.value.open({
|
||||
title: '中途退出考试,请继续答题',
|
||||
buttonList: [
|
||||
{
|
||||
key: 'revert',
|
||||
name: '继续答题',
|
||||
style: style_button_1
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
countDownRef.value.start();
|
||||
}, 500);
|
||||
@@ -489,16 +560,17 @@
|
||||
};
|
||||
// 提交当前所有填写了答案的题的缓存
|
||||
const hand_in_paper_cache = () => {
|
||||
// 获取当前题目
|
||||
addTopicAnswerCache();
|
||||
|
||||
const answerDtoList = getAnswerDtoList();
|
||||
commitPaperCache({
|
||||
examTyp: paperData.examId ? 'PAPERS' : 'CRS',
|
||||
papersId: paperData.papersId,
|
||||
examId: paperData.examId??'',
|
||||
examId: paperData.examId ?? '',
|
||||
execId: paperData.execId,
|
||||
answerDtoStr: JSON.stringify(answerDtoList)
|
||||
}).then((res) => {
|
||||
console.log('提交当前所有填写了答案的题的缓存222222', res);
|
||||
});
|
||||
}).then((res) => {});
|
||||
};
|
||||
// 执行交卷
|
||||
const hand_in_paper = (strs = '') => {
|
||||
@@ -514,7 +586,7 @@
|
||||
// 这里是考试中心考试
|
||||
func = commitPaperExam({
|
||||
papersId: paperData.papersId,
|
||||
examId: paperData.examId??'',
|
||||
examId: paperData.examId ?? '',
|
||||
execId: paperData.execId,
|
||||
examLenTm: examLenTm,
|
||||
answerDtoStr: JSON.stringify(answerDtoList)
|
||||
@@ -528,12 +600,14 @@
|
||||
});
|
||||
}
|
||||
func.then((res) => {
|
||||
// 交卷成功,清除缓存
|
||||
common.setValue(examinationAnswerCacheKey, null);
|
||||
// 考试完成事件
|
||||
uni.$emit('exam_completed');
|
||||
// 判断是否需要查分
|
||||
const flagQueryDetail = res.body.flagQueryDetail === '' ? res.body.flagQuery : res.body.flagQueryDetail;
|
||||
common.redirectTo(
|
||||
`/pages/examination/result?execId=${res.body.execId}&flagQuery=${res.body.flagQuery}&flagQueryDetail=${flagQueryDetail}&examLenTm=${examLenTm}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=${mode}&crsId=${paperData.crsId}`
|
||||
`/pages/examination/result?execId=${res.body.execId}&flagQuery=${res.body.flagQuery}&flagQueryDetail=${flagQueryDetail}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=examination&crsId=${paperData.crsId}`
|
||||
);
|
||||
})
|
||||
.catch((res) => {
|
||||
|
||||
@@ -728,7 +728,7 @@
|
||||
font-style: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
:deep(.uv-notice-bar) {
|
||||
padding: 9px 2px;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ export default {
|
||||
let _id = data?.fileId
|
||||
let fileUrl = base_url + '/traask/traFilePreview/' + _id
|
||||
this.showUrl = this.viewerUrl + '?url=' + fileUrl
|
||||
console.log(this.showUrl)
|
||||
this.showView = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user