提交错题本
This commit is contained in:
+2
-5
@@ -6,7 +6,6 @@ export const startPracticeByCrs = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traCrsPractice/startPracticeByCrs',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -16,17 +15,16 @@ export const practiceAnswer = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traCrsPractice/practiceAnswer',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// 3.课程练习状态变更
|
||||
export const practiceCommit = (data) => {
|
||||
export const practiceCommit = (data, suppressErrors=true) => {
|
||||
return request({
|
||||
url: base_url + '/traCrsPractice/practiceCommit',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
suppressErrors: suppressErrors,
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -36,7 +34,6 @@ export const queryPracticeRecordByExrId = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traCrsPractice/queryPracticeRecordByExrId',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
+5
-6
@@ -61,8 +61,8 @@ export default function request({
|
||||
data,
|
||||
meta,
|
||||
isStream,
|
||||
suppressErrors,
|
||||
toastErrors,
|
||||
suppressErrors = false,
|
||||
toastErrors = true,
|
||||
header = {},
|
||||
timeout = 6000,
|
||||
baseUrl = ''
|
||||
@@ -97,10 +97,9 @@ export default function request({
|
||||
const res = response.data
|
||||
if (res?.rtnCode === '0000') {
|
||||
return resolve(res)
|
||||
} else {
|
||||
if (toastErrors) {
|
||||
common.msg(res?.message)
|
||||
}
|
||||
} else if (toastErrors) {
|
||||
// common.msg(res?.message)
|
||||
|
||||
}
|
||||
//到这里下面全是异常的处理
|
||||
if (suppressErrors) { // 静默的接口,报错也不处理,因为下面有公共处理
|
||||
|
||||
@@ -20,3 +20,24 @@ export const mistakesCorrect = (data) => {
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 错题本id集合
|
||||
export const queryTraMistakesCollection = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traMistakesCollection/queryTraMistakesCollection',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// 根据ID查题
|
||||
export const queryMistakesAnswerByMisId = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traMistakesCollection/queryMistakesAnswerByMisId ',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
+3
-18
@@ -58,26 +58,11 @@ export const lockIcon = (color: string) : string => {
|
||||
};
|
||||
|
||||
|
||||
// 学习时长
|
||||
export const studyDurationIcon = (color: string='#62A1FF') : string => {
|
||||
// 练习退出图标
|
||||
export const practiceExitIcon = () : string => {
|
||||
const svgXml = `
|
||||
<svg t="1755844236249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6935" width="64" height="64"><path d="M512 64.8C265 64.8 64.8 265.1 64.8 512c0 247 200.3 447.2 447.2 447.2 247 0 447.2-200.3 447.2-447.2C959.3 265 759 64.8 512 64.8z m177.1 546.4H465.5c-20.5 0-37.2-16.7-37.2-37.2V307.1c0-20.5 16.7-37.2 37.2-37.2s37.2 16.7 37.2 37.2v229.6H689c20.4 0 37.3 16.8 37.3 37.3 0 20.5-16.7 37.2-37.2 37.2z" fill="${color}" p-id="6936"></path></svg>
|
||||
<svg t="1756432094912" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7026" width="32" height="32"><path d="M833.633836 551.096437 481.955218 551.096437c-16.207124 0-29.359678-13.019525-29.359678-29.322839 0-16.188704 13.057387-29.321816 29.359678-29.321816l359.371834 0-74.718749-74.719772c-11.435447-11.414981-11.473309-29.894867 0.057305-41.424458 11.453866-11.453866 30.124088-11.340279 41.407062-0.038886l109.329011 109.310591c5.555529 1.069355 10.881838 3.703345 15.196097 8.018627 6.681166 6.681166 9.468652 15.691377 8.399297 24.319895 1.069355 8.630564-1.718131 17.640776-8.399297 24.321942-4.314259 4.315282-9.640568 6.987135-15.196097 8.018627l-109.329011 109.309568c-11.281951 11.30037-29.953196 11.413957-41.407062-0.039909-11.530614-11.530614-11.491729-30.009478-0.057305-41.423435L833.633836 551.096437zM745.933425 238.32392l0-97.704253c0-43.2572-35.029818-78.230736-78.230736-78.230736l-508.36931 0c-43.181475 0-78.230736 35.011398-78.230736 78.230736l0 742.759641c0 43.256176 35.011398 78.230736 78.230736 78.230736l508.36931 0c43.181475 0 78.230736-35.050284 78.230736-78.230736l0-97.704253c0-16.188704-13.134135-29.321816-29.341259-29.321816-16.208147 0-29.341259 13.133112-29.341259 29.321816l0 78.230736c0 21.571295-17.600867 39.059598-38.925544 39.059598l-469.635123 0c-21.49557 0-38.943964-17.450441-38.943964-39.059598l0-703.852516c0-21.533432 17.600867-39.019689 38.943964-39.019689l469.635123 0c21.515013 0 38.925544 17.410532 38.925544 39.019689l0 78.269621c0 16.187681 13.133112 29.321816 29.341259 29.321816C732.79929 267.645736 745.933425 254.511601 745.933425 238.32392z" fill="#ffffff" p-id="7027"></path></svg>
|
||||
`.trim();
|
||||
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
|
||||
};
|
||||
|
||||
// 学习次数
|
||||
export const studyFrequencyIcon = (color: string='#62A1FF') : string => {
|
||||
const svgXml = `
|
||||
<svg t="1755844236249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6935" width="64" height="64"><path d="M512 64.8C265 64.8 64.8 265.1 64.8 512c0 247 200.3 447.2 447.2 447.2 247 0 447.2-200.3 447.2-447.2C959.3 265 759 64.8 512 64.8z m177.1 546.4H465.5c-20.5 0-37.2-16.7-37.2-37.2V307.1c0-20.5 16.7-37.2 37.2-37.2s37.2 16.7 37.2 37.2v229.6H689c20.4 0 37.3 16.8 37.3 37.3 0 20.5-16.7 37.2-37.2 37.2z" fill="${color}" p-id="6936"></path></svg>
|
||||
`.trim();
|
||||
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
|
||||
};
|
||||
|
||||
// 学习时间
|
||||
export const studyTimeIcon = (color: string='#958DFF') : string => {
|
||||
const svgXml = `
|
||||
<svg t="1755844179673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6630" width="64" height="64"><path d="M329.7792 282.7776c-17.2032 0-31.1808-13.9264-31.1808-31.1808V144.9472c0-17.2032 13.9264-31.1808 31.1808-31.1808 17.2032 0 31.1808 13.9264 31.1808 31.1808v106.6496c0 17.2544-13.9776 31.1808-31.1808 31.1808zM710.2976 282.7776c-17.2032 0-31.1808-13.9264-31.1808-31.1808V144.9472c0-17.2032 13.9264-31.1808 31.1808-31.1808 17.2032 0 31.1808 13.9264 31.1808 31.1808v106.6496c0 17.2544-13.9776 31.1808-31.1808 31.1808z" fill="${color}" p-id="6631"></path><path d="M800.0512 179.7632v59.4944c0 50.0224-40.5504 90.5728-90.5728 90.5728s-90.5728-40.5504-90.5728-90.5728V174.1824H420.608v65.0752c0 50.0224-40.5504 90.5728-90.5728 90.5728S239.4624 289.28 239.4624 239.2576V178.3808c-72.4992 16.64-126.6176 81.5104-126.6176 159.0784V727.04c0 90.1632 73.1136 163.2768 163.2768 163.2768H757.76c90.1632 0 163.2768-73.1136 163.2768-163.2768V337.4592c0-75.52-51.3024-139.0592-120.9856-157.696z m-204.4928 517.376h-286.72c-18.176 0-32.9216-14.7456-32.9216-32.9216s14.7456-32.9216 32.9216-32.9216h286.72c18.176 0 32.9216 14.7456 32.9216 32.9216s-14.7456 32.9216-32.9216 32.9216z m140.5952-166.7072H308.8384c-18.176 0-32.9216-14.7456-32.9216-32.9216s14.7456-32.9216 32.9216-32.9216h427.3152c18.176 0 32.9216 14.7456 32.9216 32.9216s-14.7456 32.9216-32.9216 32.9216z" fill="${color}" p-id="6632" data-spm-anchor-id="a313x.manage_type_myprojects.0.i0.46df3a81DkdazW" class=""></path></svg>
|
||||
`.trim();
|
||||
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`;
|
||||
};
|
||||
@@ -3,20 +3,25 @@
|
||||
<view class="line">
|
||||
<text class="tr">维度评分:</text>
|
||||
<text class="td">{{ dimension_all_score }}</text>
|
||||
|
||||
<view class="td_success_error_img">
|
||||
<image :src="select_status_icon" class="img"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line" v-for="item in evalSettingVos">
|
||||
<text class="tr">{{ item.gradeDimens }}:</text>
|
||||
<text class="td">{{ item.anlyGrade }}</text>
|
||||
<view class="your_answer" v-if="item.dimensCode==='01'">
|
||||
<view class="your_answer" v-if="item.dimensCode === '01'">
|
||||
<rich-text :nodes="highlightedText" class="content" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick, computed, toRaw, watch } from 'vue';
|
||||
import { optionErrorIcon, optionSuccessIcon } from '@/common/imgSvg';
|
||||
|
||||
const emit = defineEmits(['click_option']);
|
||||
const props = defineProps({
|
||||
value: {
|
||||
@@ -37,27 +42,30 @@
|
||||
});
|
||||
const evalSettingVos = computed(() => props.value.evalSettingVos);
|
||||
const status = computed(() => (props.judgeResult ? 'success' : 'error'));
|
||||
const keywords = computed(() => {
|
||||
if (!props.value.relKeyword) return [];
|
||||
return props.value.relKeyword.split(',').map(key => key.trim());
|
||||
const select_status_icon = computed(() => {
|
||||
if (props.judgeResult) {
|
||||
return optionSuccessIcon('#15B859');
|
||||
} else {
|
||||
return optionErrorIcon();
|
||||
}
|
||||
});
|
||||
|
||||
const keywords = computed(() => {
|
||||
if (!props.value.relKeyword) return [];
|
||||
return props.value.relKeyword.split(',').map((key) => key.trim());
|
||||
});
|
||||
|
||||
const highlightedText = computed(() => {
|
||||
// 如果没有关键词,直接返回原文本
|
||||
if (!keywords.value.length) return props.answerText;
|
||||
// 构建正则表达式,匹配所有关键词(不区分大小写)
|
||||
// 对关键词进行转义,避免特殊字符影响正则
|
||||
const escapedKeywords = keywords.value.map(keyword =>
|
||||
keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||
);
|
||||
|
||||
// 创建正则表达式,g表示全局匹配,i表示不区分大小写
|
||||
const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi');
|
||||
|
||||
// 替换匹配到的关键词,用span包裹并添加高亮样式
|
||||
return props.answerText.replace(regex, (match) =>
|
||||
`<span class="highlight">${match}</span>`
|
||||
);
|
||||
// 如果没有关键词,直接返回原文本
|
||||
if (!keywords.value.length) return '你的答案:' + props.answerText;
|
||||
// 构建正则表达式,匹配所有关键词(不区分大小写)
|
||||
// 对关键词进行转义,避免特殊字符影响正则
|
||||
const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
||||
|
||||
// 创建正则表达式,g表示全局匹配,i表示不区分大小写
|
||||
const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi');
|
||||
|
||||
// 替换匹配到的关键词,用span包裹并添加高亮样式
|
||||
return '你的答案:' + props.answerText.replace(regex, (match) => `<span class="highlight">${match}</span>`);
|
||||
});
|
||||
const dimension_all_score = computed(() => {
|
||||
return (
|
||||
@@ -77,7 +85,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.success {
|
||||
background-color: #e7f8ed;
|
||||
.td {
|
||||
@@ -96,12 +103,12 @@
|
||||
color: #f5212d;
|
||||
}
|
||||
}
|
||||
.your_answer{
|
||||
.your_answer {
|
||||
:deep(.highlight) {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.analysis_div {
|
||||
margin-top: 30rpx;
|
||||
|
||||
@@ -109,6 +116,7 @@
|
||||
padding: 22rpx 15rpx 15rpx 34rpx;
|
||||
.line {
|
||||
margin: 12rpx 0;
|
||||
position: relative;
|
||||
}
|
||||
.tr {
|
||||
font-weight: 600;
|
||||
@@ -119,13 +127,23 @@
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.your_answer{
|
||||
.your_answer {
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
line-height: 46rpx;
|
||||
text-align: left;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.td_success_error_img {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
.img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -32,10 +32,18 @@
|
||||
</view>
|
||||
<view class="text-btn" v-if="!textShow" @click.stop="translateVoice()">文</view>
|
||||
<view class="fl1"></view>
|
||||
<view v-show="!props.isPreview && props.button_again_show" class="btns-cont-button-text" @click.stop="buutton_click('again')">
|
||||
<view
|
||||
v-show="!props.isPreview && props.button_again_show"
|
||||
class="btns-cont-button-text"
|
||||
@click.stop="buutton_click('again')"
|
||||
>
|
||||
重答
|
||||
</view>
|
||||
<view v-show="!props.isPreview && props.button_complete_show" class="btns-cont-button-text" @click.stop="buutton_click('complete')">
|
||||
<view
|
||||
v-show="!props.isPreview && props.button_complete_show"
|
||||
class="btns-cont-button-text"
|
||||
@click.stop="buutton_click('complete')"
|
||||
>
|
||||
完成
|
||||
</view>
|
||||
</view>
|
||||
@@ -49,8 +57,16 @@
|
||||
</view>
|
||||
<view class="btns-cont" v-show="!props.isPreview">
|
||||
<view class="fl1"></view>
|
||||
<view v-if="props.button_again_show" class="btns-cont-button-text" @click.stop="buutton_click('again')">重答</view>
|
||||
<view v-if="props.button_complete_show" class="btns-cont-button-text" @click.stop="buutton_click('complete')">完成</view>
|
||||
<view v-if="props.button_again_show" class="btns-cont-button-text" @click.stop="buutton_click('again')">
|
||||
重答
|
||||
</view>
|
||||
<view
|
||||
v-if="props.button_complete_show"
|
||||
class="btns-cont-button-text"
|
||||
@click.stop="buutton_click('complete')"
|
||||
>
|
||||
完成
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="talking-info talking-info-loading" v-else-if="status === '00'">
|
||||
@@ -62,7 +78,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, unref, ref, toRefs, watch, onMounted } from 'vue';
|
||||
import { computed, unref, ref, toRefs, watch, onMounted, nextTick } from 'vue';
|
||||
import { onUnload } from '@dcloudio/uni-app';
|
||||
import { useAudioStore } from '@/store/audioStore';
|
||||
const props = defineProps({
|
||||
@@ -105,9 +121,8 @@
|
||||
// 是否显示重答按钮
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
}
|
||||
});
|
||||
console.log('props.isPreview', props.isPreview);
|
||||
const audioStore = useAudioStore();
|
||||
const { dataInfo } = toRefs(props);
|
||||
const status = computed(() => props.status);
|
||||
@@ -126,6 +141,11 @@
|
||||
|
||||
// 按钮点击
|
||||
const buutton_click = (type) => {
|
||||
if (type === 'again') {
|
||||
nextTick(() => {
|
||||
textShow.value = true;
|
||||
});
|
||||
}
|
||||
emit('buutton_click', type, props.dataInfo);
|
||||
};
|
||||
|
||||
|
||||
@@ -16,16 +16,28 @@
|
||||
<image :src="feedbackIcon()" class="img" @click="feedback_click()"></image>
|
||||
</view>
|
||||
<template v-if="['mistake'].includes(props.mode)">
|
||||
<view class="right_text" @click="toggleExpand()">展开</view>
|
||||
<uv-icon class="arrow-icon" name="arrow-right" color="#0066FF"></uv-icon>
|
||||
<view class="expand_button_div" @click="toggleExpand()">
|
||||
<!-- <view class="right_text">{{animationState?'收起':'展开'}}</view> -->
|
||||
|
||||
<view class="toggle-container">
|
||||
<view class="toggle-text" :class="{ active: !animationState }">展开</view>
|
||||
<view class="toggle-text" :class="{ active: animationState }">收起</view>
|
||||
</view>
|
||||
|
||||
<uv-icon
|
||||
class="click_text_icon"
|
||||
name="arrow-right"
|
||||
:class="{ click_text_icon_action: animationState }"
|
||||
color="#0066FF"
|
||||
></uv-icon>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="question_text">
|
||||
{{ subject_data.qnsContent }}
|
||||
</view>
|
||||
|
||||
<view :style="props.mode === 'mistake' ? animationStyle : {}" class="collapse-wrapper" ref="wrapperRef">
|
||||
<view :style="{ height: animationHeight }" :class="{ collapse_wrapper: props.mode === 'mistake' }" ref="wrapperRef">
|
||||
<view class="collapse-content" ref="contentRef">
|
||||
<view class="option_div">
|
||||
<template v-if="qnsTyp === 'ES'">
|
||||
@@ -95,7 +107,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick, computed, getCurrentInstance } from 'vue';
|
||||
import { ref, reactive, onMounted, nextTick, computed, getCurrentInstance, watch } from 'vue';
|
||||
import radioSubjectItem from './radio-subject-item.vue';
|
||||
import esAnalysis from './es-analysis.vue';
|
||||
import questionVue from './question.vue';
|
||||
@@ -149,11 +161,10 @@
|
||||
const wrapperRef = ref(null);
|
||||
const contentRef = ref(null);
|
||||
const judgeResultStatus = computed(() => props.item.judgeResult === 'P');
|
||||
const animationStyle = ref({
|
||||
height: '0px',
|
||||
overflow: 'hidden',
|
||||
transition: 'height 0.3s ease-in-out'
|
||||
});
|
||||
|
||||
// 不是错题本就默认不折叠,错题本默认折叠
|
||||
const animationState = ref(props.mode !== 'mistake' ? true : false);
|
||||
const animationHeight = ref(props.mode !== 'mistake' ? '' : '0px');
|
||||
|
||||
const modelValue = computed({
|
||||
get: () => props.modelValue,
|
||||
@@ -172,14 +183,21 @@
|
||||
|
||||
// 切换展开/折叠状态(兼容H5和App)
|
||||
const toggleExpand = async () => {
|
||||
console.log('切换展开/折叠状态');
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query
|
||||
.select('.collapse-content')
|
||||
.boundingClientRect((rect) => {
|
||||
console.log('rect', rect);
|
||||
})
|
||||
.exec();
|
||||
console.log('切换展开/折叠状态', animationHeight.value, animationState.value);
|
||||
if (!animationState.value) {
|
||||
animationState.value = true;
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query
|
||||
.select('.collapse-content')
|
||||
.boundingClientRect((rect) => {
|
||||
animationHeight.value = `${rect.height}px`;
|
||||
console.log('rect', rect);
|
||||
})
|
||||
.exec();
|
||||
} else {
|
||||
animationState.value = false;
|
||||
animationHeight.value = '0px';
|
||||
}
|
||||
};
|
||||
const queryRect = () => {
|
||||
// 组件内部一般用this.$uvGetRect,对外的为getRect,二者功能一致,名称不同
|
||||
@@ -204,6 +222,7 @@
|
||||
const anserResultArray = props.item.anserResult.split(',');
|
||||
return subject_data.value.itemVos.filter((res) => anserResultArray.includes(res.itemId)).map((res) => res.itemNo);
|
||||
});
|
||||
|
||||
// 判断选项是否完全正确
|
||||
const right_or_wrong_class = computed(
|
||||
() =>
|
||||
@@ -285,16 +304,54 @@
|
||||
answerItems: subject_data.value.itemVos.filter((t) => item_answer.value.includes(t.itemId))
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化动画
|
||||
onMounted(() => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.collapse-wrapper {
|
||||
// overflow: hidden; /* 关键:隐藏超出部分 */
|
||||
.expand_button_div {
|
||||
/* 相对定位,让两个文本重叠 */
|
||||
// display: inline-block;
|
||||
// cursor: pointer;
|
||||
}
|
||||
.toggle-container {
|
||||
position: relative;
|
||||
height: 42rpx;
|
||||
width: 60rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
.toggle-text {
|
||||
/* 绝对定位使文本重叠 */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* 初始状态:非激活文本透明且轻微下移 */
|
||||
opacity: 0;
|
||||
// transform: translateY(15rpx);
|
||||
/* 添加过渡动画 */
|
||||
transition: all 0.2s ease-out;
|
||||
/* 确保文本占据空间一致 */
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 激活状态:文本可见且位置正常 */
|
||||
.toggle-text.active {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
z-index: 1; /* 确保激活文本在上方 */
|
||||
}
|
||||
|
||||
.collapse_wrapper {
|
||||
overflow: hidden; /* 关键:隐藏超出部分 */
|
||||
// height: 0; /* 初始高度为0 */
|
||||
// transition: height 0.3s ease-in-out;
|
||||
transition: height 0.3s ease-out;
|
||||
}
|
||||
.click_text_icon_action {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
.click_text_icon {
|
||||
transition: transform 0.3s ease-out;
|
||||
}
|
||||
|
||||
.mark_and_feedback_div {
|
||||
@@ -310,6 +367,13 @@
|
||||
padding: 4rpx;
|
||||
}
|
||||
}
|
||||
.expand_button_div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 90rpx;
|
||||
|
||||
justify-content: space-between;
|
||||
}
|
||||
.option_div {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
@@ -190,6 +190,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wrongQuestionRecord/correct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "错题本做题页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/examination/index",
|
||||
"style": {
|
||||
@@ -280,6 +289,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wrongQuestionRecord/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "答题本答题完成结果页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/practice/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "练习完成结果页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/course/index",
|
||||
"style": {
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { queryTraCrsBbsInfoByCrsId, replyTraCrsBbsInfo, qryChildTraCrsBbsInfo } from '@/api/courseDetail.js';
|
||||
import common from '@/common/common.js';
|
||||
import {setupKeyboardHeightListener} from '@/common/common.js';
|
||||
import { get_base_url } from '@/api/request.js';
|
||||
|
||||
const popup = ref(null);
|
||||
@@ -144,23 +145,14 @@
|
||||
imgId: String
|
||||
});
|
||||
const click_reply = (item, parentBbsId, index) => {
|
||||
|
||||
popup.value.open('bottom');
|
||||
reply_data.placeholder = '回复 ' + item.userName + ':';
|
||||
reply_data.parentBbsId = parentBbsId;
|
||||
reply_data.bbsId = item.bbsId;
|
||||
reply_data.index = index;
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
// 安全区域底部到屏幕底部的高度(即底部安全区域高度)
|
||||
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
|
||||
nextTick(() => {
|
||||
uni.onKeyboardHeightChange((res) => {
|
||||
let keyboardHeight = res.height;
|
||||
// 仅在iOS端补偿安全区域高度
|
||||
if (systemInfo.platform === 'ios') {
|
||||
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
|
||||
}
|
||||
popup_input_bottom.value = `${keyboardHeight}px`;
|
||||
});
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
});
|
||||
};
|
||||
const reply_send = async () => {
|
||||
|
||||
@@ -12,14 +12,16 @@
|
||||
</view>
|
||||
<view class="info-middle font_pf">
|
||||
<view class="fz-30 fw-400 mb-8">更新日期</view>
|
||||
<view class="fz-30 fw-400">{{ (modelValue.mtTime || '').substr(0,16) }}</view>
|
||||
<view class="fz-30 fw-400">{{ (modelValue.mtTime || '').substr(0, 16) }}</view>
|
||||
</view>
|
||||
<view class="info-bottom">
|
||||
<view class="bottom-left">
|
||||
<view class="mb-64">
|
||||
<view class="fz-30 font_pf fw-400 mb-18">标签</view>
|
||||
<view class="label" v-if="modelValue.tagCataList">
|
||||
<text class="label-item font_pf" v-for="item in modelValue.tagCataList" :key="item.tagId">{{ item.tagName }}</text>
|
||||
<text class="label-item font_pf" v-for="item in modelValue.tagCataList" :key="item.tagId">
|
||||
{{ item.tagName }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mb-64">
|
||||
@@ -31,22 +33,35 @@
|
||||
<view class="fz-30 font_pf fw-400">{{ modelValue.belgOrgName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-right">
|
||||
<image src="/src/static/images/courseDetail/ditu.png" class="right-img" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mb-64">
|
||||
<view class="fz-30 font_pf fw-400 mb-4">课程核心</view>
|
||||
<view class="examination_core">
|
||||
{{ modelValue.crsCore }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import common from '@/common/common';
|
||||
const props = defineProps({
|
||||
modelValue:Object
|
||||
})
|
||||
|
||||
modelValue: Object
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.examination_core{
|
||||
padding: 0 15rpx 0 0;
|
||||
line-height: 50rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.course-info {
|
||||
box-sizing: border-box;
|
||||
// width: 100%;
|
||||
@@ -115,4 +130,4 @@
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</view>
|
||||
<view
|
||||
class="num-item examination"
|
||||
@click="common.navigateTo('/pages/examRanking/index?crsId=' + crsId)"
|
||||
@click="common.navigateTo(`/pages/examRanking/index?crsId=${crsId}`)"
|
||||
>
|
||||
<image
|
||||
class="title-icon"
|
||||
@@ -51,24 +51,17 @@
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view class="fl1"></view>
|
||||
<view class="num-item" @click="collect_click(form.collectId)">
|
||||
<image
|
||||
v-if="form.collectId"
|
||||
class="collect-icon"
|
||||
src="/src/static/images/courseDetail/out_collect.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<image
|
||||
v-else
|
||||
class="collect-icon"
|
||||
src="/src/static/images/courseDetail/in_collect.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</view>
|
||||
<view class="num-item" @click="collect_click(form.collectId)">
|
||||
<image
|
||||
class="collect-icon"
|
||||
:src="form.collectId ? collectedImg : notCollectedImg"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body-box">
|
||||
<uv-sticky :customNavHeight="statusBarHeight" id="tabsDiv" class="sticky">
|
||||
<uv-sticky :customNavHeight="statusBarHeight" class="sticky">
|
||||
<view class="body-tab">
|
||||
<uv-tabs
|
||||
class="font_pf"
|
||||
@@ -99,24 +92,21 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="btn-box btn-box-height font_pf">
|
||||
<template v-if="[0, 1].includes(tabAct)">
|
||||
<template v-if="[0, 1].includes(tabAct)" >
|
||||
<uv-button
|
||||
type="primary"
|
||||
@click="
|
||||
common.navigateTo(
|
||||
'/pages/course/study?crsNum=' + form.crsNum + '&crsId=' + crsId + '&imgId=' + form.imgId
|
||||
)
|
||||
"
|
||||
@click="common.navigateTo(`/pages/course/study?crsId=${crsId}&isPreview=${isPreview}&imgId=${form.imgId}`)"
|
||||
>
|
||||
去学习
|
||||
</uv-button>
|
||||
<uv-button type="primary" @click="goto_practice()">去练习</uv-button>
|
||||
<uv-button type="primary" @click="goto_examination()">去考试</uv-button>
|
||||
<uv-button type="primary" :disabled="isPreview === 'preview'" @click="goto_practice()">去练习</uv-button>
|
||||
<uv-button type="primary" :disabled="isPreview === 'preview'" @click="goto_examination()">去考试</uv-button>
|
||||
</template>
|
||||
<template v-if="tabAct == 2">
|
||||
<template v-if="tabAct === 2">
|
||||
<uv-button
|
||||
type="primary"
|
||||
class="send_evaluate"
|
||||
:disabled="isPreview === 'preview'"
|
||||
@click="common.navigateTo('/pages/courseDetail/submit?crsId=' + crsId + '&imgId=' + form.imgId)"
|
||||
>
|
||||
发布评价
|
||||
@@ -138,16 +128,17 @@
|
||||
import introduceVue from './components/introduce.vue';
|
||||
import knowledge from './components/knowledge.vue';
|
||||
import comment from './components/comment.vue';
|
||||
import collectedImg from '@/static/images/courseDetail/out_collect.png';
|
||||
import notCollectedImg from '@/static/images/courseDetail/in_collect.png';
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
// tab栏
|
||||
const tabList = ref([{ name: '课程介绍' }, { name: '知识点' }, { name: '评价' }]);
|
||||
|
||||
const test = ref(false);
|
||||
const commentRef = ref(null);
|
||||
const tabsDiv = ref(null);
|
||||
const form = ref({});
|
||||
const crsId = ref('');
|
||||
const collectId = ref(''); // 记录初始的收藏id
|
||||
const isPreview = ref(''); // 记录是否是预览
|
||||
const tabAct = ref(0);
|
||||
const scrollTop = ref(0);
|
||||
const tabSwitch = (item) => {
|
||||
@@ -159,7 +150,7 @@
|
||||
commentRef.value?.getData();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const getData = async () => {
|
||||
const { body } = await getCourseDetailApi({
|
||||
crsId: crsId.value
|
||||
@@ -184,8 +175,8 @@
|
||||
const opacity = Math.min(1, (scrollTop.value - 20) / 80);
|
||||
return `rgba(255,255,255,${opacity})`;
|
||||
});
|
||||
// 子组件滑动开启状态
|
||||
const childScrollStatus = ref(false);
|
||||
|
||||
|
||||
const scroll_fun = (e) => {
|
||||
scrollTop.value = e.detail.scrollTop;
|
||||
};
|
||||
@@ -193,8 +184,10 @@
|
||||
const swiper_change = (res) => {
|
||||
tabAct.value = res.detail.current;
|
||||
};
|
||||
|
||||
// 去考试
|
||||
const goto_examination = async () => {
|
||||
if(isPreview.value === 'preview') return common.msg('预览课程不允许考试');
|
||||
common.loading();
|
||||
startExamByCrs({
|
||||
crsId: crsId.value
|
||||
@@ -213,6 +206,7 @@
|
||||
};
|
||||
// 去练习
|
||||
const goto_practice = async () => {
|
||||
if(isPreview.value === 'preview') return common.msg('预览课程不允许练习');
|
||||
common.loading();
|
||||
startPracticeByCrs({
|
||||
crsId: crsId.value
|
||||
@@ -230,7 +224,6 @@
|
||||
common.hideLoading();
|
||||
});
|
||||
};
|
||||
// uni.$emit('refresh_comment_data');
|
||||
const collect_click = async (id) => {
|
||||
try {
|
||||
if (!id) {
|
||||
@@ -258,7 +251,6 @@
|
||||
};
|
||||
onMounted(async () => {
|
||||
uni.$on('refresh_comment_data', () => {
|
||||
// console.log('发评论了刷新');
|
||||
commentRef.value?.getData('submit');
|
||||
tabAct.value = 2;
|
||||
});
|
||||
@@ -266,6 +258,7 @@
|
||||
onLoad((params) => {
|
||||
crsId.value = params.crsId;
|
||||
collectId.value = params.collectId || '';
|
||||
isPreview.value = params.isPreview || '';
|
||||
});
|
||||
onShow(() => {
|
||||
getData();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="main_div max_page">
|
||||
<nav-bar></nav-bar>
|
||||
<view class="nav-div">
|
||||
<view class="title ellipsis-text">练习记录</view>
|
||||
<view class="back_div" @click="common.navigateBack()">
|
||||
@@ -116,6 +117,7 @@
|
||||
}
|
||||
|
||||
.main_div {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #f0f5f9;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const props = defineProps({
|
||||
dialogConfiguration: {
|
||||
type: Object,
|
||||
required: true,
|
||||
required: false,
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(['button_click'])
|
||||
@@ -45,13 +45,13 @@
|
||||
}
|
||||
|
||||
const close = () => PopupRef.value?.close()
|
||||
const open = () => {
|
||||
const open = (dialogConfiguration) => {
|
||||
// 解构赋值更清晰
|
||||
const {
|
||||
title: t,
|
||||
html: h,
|
||||
buttonList: bl = []
|
||||
} = props.dialogConfiguration || {};
|
||||
} = dialogConfiguration || props.dialogConfiguration || {};
|
||||
title.value = t || '';
|
||||
html.value = h || '';
|
||||
buttonList.value = Array.isArray(bl) ? bl : [];
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
const startTime = Date.now();
|
||||
saveTraQnsFeedback({
|
||||
qnsId: feedbackInfo.qnsId,
|
||||
fbComtent: feedbackInfo.text.trim(),
|
||||
fbContent: feedbackInfo.text.trim(),
|
||||
fbTyp: feedbackInfo.type.join(',')
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
const touchBtnRef = ref(null);
|
||||
let examinationStartTime = 0; // 考试开始时间
|
||||
|
||||
const mode = ref('examination'); // 考试 examination 练习practice
|
||||
const mode = 'examination'; // 考试 examination 练习practice
|
||||
const paperData = reactive({
|
||||
crsId: '', // 课程ID,通过课程id是否为空字符串判断这个试卷是课程考试还是考试中心考试
|
||||
execId: '', // 执行ID
|
||||
@@ -406,6 +406,7 @@
|
||||
// 执行交卷
|
||||
const hand_in_paper = () => {
|
||||
const answerDtoList = topicList.map((res) => {
|
||||
console.log('resres', res);
|
||||
let answerItem = {
|
||||
examId: paperData.examId,
|
||||
papersId: paperData.papersId,
|
||||
@@ -417,7 +418,9 @@
|
||||
// 问答题特殊处理
|
||||
return {
|
||||
...answerItem,
|
||||
anserResult: ''
|
||||
anserResult: res.my_answer.anserResult,
|
||||
ossKey: res.my_answer.ossKey || '',
|
||||
ossAddr: res.my_answer.ossAddr || ''
|
||||
};
|
||||
} else {
|
||||
//其他题
|
||||
@@ -427,7 +430,7 @@
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
console.log('提交的', answerDtoList);
|
||||
console.log('answerDtoList', answerDtoList);
|
||||
dialogRef.value.close();
|
||||
common.loading('正在提交');
|
||||
@@ -457,7 +460,7 @@
|
||||
// 需要查分
|
||||
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}`
|
||||
`/pages/examination/result?execId=${res.body.execId}&examLenTm=${examLenTm}&papersName=${paperData.papersName}&papersId=${paperData.papersId}&mode=${mode}&crsId=${paperData.crsId}`
|
||||
);
|
||||
} else {
|
||||
// todo 此处应该有个弹窗交代下结果
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<view class="scroll-div">
|
||||
<view class="paper_title_div">
|
||||
<image src="@/static/images/testingHall/testing.png" class="img" mode="aspectFit"></image>
|
||||
<view class="title">试卷信息</view>
|
||||
<view class="title">任务历程</view>
|
||||
</view>
|
||||
<scroll-view
|
||||
ref="scrollRef"
|
||||
|
||||
+42
-117
@@ -38,7 +38,7 @@
|
||||
<view class="fl1"></view>
|
||||
</view>
|
||||
<!-- 显示当前选中的徽章 -->
|
||||
<view class="dan" @click="changeBadge">
|
||||
<!-- <view class="dan" @click="changeBadge">
|
||||
<view class="dan_img">
|
||||
<image
|
||||
class="img_100"
|
||||
@@ -48,7 +48,7 @@
|
||||
></image>
|
||||
</view>
|
||||
<view class="dan_text">{{ badgeList[currentIndex].name }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 用户学习时间信息 -->
|
||||
<view class="study_information">
|
||||
@@ -56,8 +56,8 @@
|
||||
<view class="top">我的积分</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to
|
||||
:startVal="statistics_data['startAccmTaskCnt']"
|
||||
:endVal="statistics_data['accmTaskCnt']"
|
||||
:startVal="0"
|
||||
:endVal="0"
|
||||
:useEasing="true"
|
||||
ref="accmTaskCntRef"
|
||||
></uv-count-to>
|
||||
@@ -68,8 +68,8 @@
|
||||
<view class="top">徽章墙</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to
|
||||
:startVal="statistics_data['startAccmTaskCnt']"
|
||||
:endVal="statistics_data['accmTaskCnt']"
|
||||
:startVal="0"
|
||||
:endVal="0"
|
||||
:useEasing="true"
|
||||
ref="accmTaskCntRef"
|
||||
></uv-count-to>
|
||||
@@ -80,41 +80,34 @@
|
||||
</view>
|
||||
<!-- 4个导航 -->
|
||||
<view class="navigation_div">
|
||||
<uv-scroll-list class="scroll-view">
|
||||
<!-- <scroll-view scroll-x="true" :show-scrollbar="false"> -->
|
||||
<view class="scroll-view-item">
|
||||
<view class="item" @click="common.navigateTo('/pages/courseRecord/index')">
|
||||
<image class="icon" src="@/static/images/me/study.png"></image>
|
||||
<view class="title">课程记录</view>
|
||||
</view>
|
||||
<!-- <uv-scroll-list class="scroll-view"> -->
|
||||
<!-- <scroll-view scroll-x="true" :show-scrollbar="false"> -->
|
||||
<view class="scroll-view-item">
|
||||
<view class="item" @click="common.navigateTo('/pages/courseRecord/index')">
|
||||
<image class="icon" src="@/static/images/me/study.png"></image>
|
||||
<view class="title">课程记录</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="scroll-view-item" @click="common.navigateTo('/pages/examinationRecord/index')">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/examination.png"></image>
|
||||
<view class="title">考试记录</view>
|
||||
</view>
|
||||
<view class="scroll-view-item" @click="common.navigateTo('/pages/examinationRecord/index')">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/report.png"></image>
|
||||
<view class="title">考试记录</view>
|
||||
</view>
|
||||
<view class="scroll-view-item">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/report.png"></image>
|
||||
<view class="title">竞赛记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll-view-item">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/todo.png"></image>
|
||||
<view class="title">AI陪练记录</view>
|
||||
</view>
|
||||
<view class="scroll-view-item">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/todo.png"></image>
|
||||
<view class="title">AI陪练记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll-view-item">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/examination.png"></image>
|
||||
<view class="title">竞赛记录</view>
|
||||
</view>
|
||||
<view class="scroll-view-item">
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/me/report.png"></image>
|
||||
<view class="title">AI问答记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- </scroll-view> -->
|
||||
</uv-scroll-list>
|
||||
</view>
|
||||
<!-- </uv-scroll-list> -->
|
||||
</view>
|
||||
<view class="cell_div">
|
||||
<uv-cell-group :border="false">
|
||||
@@ -212,72 +205,7 @@
|
||||
const accmTaskCntRef = ref(null);
|
||||
const accmPointRef = ref(null);
|
||||
const stdtTmLenRef = ref(null);
|
||||
const statistics_data = reactive({
|
||||
stdtTmLen: 0, // 累计学习时长
|
||||
accmTaskCnt: 0, // 累计完成任务
|
||||
accmPoint: 0, // 累计获得积分
|
||||
startStdtTmLen: 0, // 起始累计学习时长
|
||||
startAccmTaskCnt: 0, // 起始累计完成任务
|
||||
startAccmPoint: 0, // 起始累计获得积分
|
||||
request_time: 0, // 上次请求时间
|
||||
init: function () {
|
||||
// 初始化统计数据
|
||||
console.log('初始化统计数据');
|
||||
const me_statistics_data = common.getValue('statistics_data'); // 获取缓存
|
||||
if (me_statistics_data) {
|
||||
this.stdtTmLen = me_statistics_data.stdtTmLen;
|
||||
this.accmTaskCnt = me_statistics_data.accmTaskCnt;
|
||||
this.accmPoint = me_statistics_data.accmPoint;
|
||||
}
|
||||
},
|
||||
get_statistics_data: async function () {
|
||||
try {
|
||||
const time_now = Date.now();
|
||||
let statistics_data = common.getValue('statistics_data') || {};
|
||||
if (time_now - this.request_time > 300) {
|
||||
this.request_time = time_now;
|
||||
// 获取最新数据
|
||||
const res = await queryTraStdyStatisticsSelf();
|
||||
if (res && res.body) {
|
||||
// 合并新数据与缓存数据,确保只更新有效字段
|
||||
statistics_data = {
|
||||
...statistics_data,
|
||||
stdtTmLen: res.body.stdtTmLen || 0,
|
||||
accmTaskCnt: res.body.accmTaskCnt || 0,
|
||||
accmPoint: res.body.accmPoint || 0
|
||||
};
|
||||
|
||||
common.setValue('statistics_data', statistics_data);
|
||||
}
|
||||
}
|
||||
|
||||
// 解构赋值获取最新值
|
||||
const { accmPoint = 0, accmTaskCnt = 0, stdtTmLen = 0 } = statistics_data;
|
||||
|
||||
// 更新数据并触发动画
|
||||
if (accmPoint !== this.accmPoint) {
|
||||
this.startAccmPoint = this.accmPoint;
|
||||
this.accmPoint = accmPoint;
|
||||
accmPointRef.value?.start();
|
||||
}
|
||||
|
||||
if (accmTaskCnt !== this.accmTaskCnt) {
|
||||
this.startAccmTaskCnt = this.accmTaskCnt;
|
||||
this.accmTaskCnt = accmTaskCnt;
|
||||
accmTaskCntRef.value?.start();
|
||||
}
|
||||
|
||||
if (stdtTmLen !== this.stdtTmLen) {
|
||||
this.startStdtTmLen = this.stdtTmLen;
|
||||
this.stdtTmLen = stdtTmLen;
|
||||
stdtTmLenRef.value?.start();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
// 可以在这里添加更多的错误处理逻辑,比如显示错误提示
|
||||
}
|
||||
}
|
||||
});
|
||||
const user_info = reactive({
|
||||
userName: '',
|
||||
userId: '',
|
||||
@@ -302,16 +230,12 @@
|
||||
common.reLaunch('/pages/login/login');
|
||||
});
|
||||
};
|
||||
onLoad(() => {
|
||||
statistics_data['init'](); // 初始化数据
|
||||
});
|
||||
onLoad(() => {});
|
||||
onShow(() => {
|
||||
setMascot();
|
||||
Object.assign(user_info, getUserInfo());
|
||||
statistics_data['get_statistics_data'](); // 获取统计数据
|
||||
});
|
||||
onPullDownRefresh(() => {
|
||||
console.log('下拉刷新');
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
|
||||
@@ -389,11 +313,12 @@
|
||||
// 快捷导航栏
|
||||
.navigation_div {
|
||||
margin: 30rpx $bg-margin-left 0 $bg-margin-left;
|
||||
padding: 24rpx 0 0 20rpx;
|
||||
// padding: 24rpx 0 0 20rpx;
|
||||
padding: 24rpx 10rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 23rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// flex-direction: column;
|
||||
justify-content: space-around;
|
||||
z-index: 101;
|
||||
|
||||
@@ -541,15 +466,15 @@
|
||||
top: 20%;
|
||||
transform: translateX(-50%);
|
||||
width: 1rpx;
|
||||
height: 60%;
|
||||
width: 4rpx;
|
||||
height: 54rpx;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(239, 246, 255, 0) 0%,
|
||||
rgba(229, 239, 255, 1) 30%,
|
||||
rgba(229, 239, 255, 1) 70%,
|
||||
rgba(239, 246, 255, 0) 100%
|
||||
height: 60%;
|
||||
width: 4rpx;
|
||||
height: 54rpx;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(239, 246, 255, 0) 0%,
|
||||
rgba(229, 239, 255, 1) 30%,
|
||||
rgba(229, 239, 255, 1) 70%,
|
||||
rgba(239, 246, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,6 @@
|
||||
<image class="img" src="@/static/images/messageNotification/delete_icon.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="input-view">
|
||||
<uv-input
|
||||
shape="circle"
|
||||
placeholderStyle="color:#999999;font-size:28rpx"
|
||||
placeholder="请输入关键词"
|
||||
suffixIcon="search"
|
||||
:customStyle="customStyle"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
>
|
||||
|
||||
</uv-input>
|
||||
</view> -->
|
||||
<scroll-view
|
||||
ref="scrollRef"
|
||||
:scroll-y="true"
|
||||
@@ -36,23 +24,17 @@
|
||||
<view class="item" v-for="(item, index) in data_list" @click="readMessageOpen(item)">
|
||||
<view class="icon">
|
||||
<image
|
||||
v-if="item.noticeTyp == '01'"
|
||||
class="img_100"
|
||||
src="@/static/images/messageNotification/type_01.png"
|
||||
:src="imageMap[item.noticeTyp]"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<image
|
||||
<!-- <image
|
||||
v-if="item.noticeTyp == '02'"
|
||||
class="img_100"
|
||||
src="@/static/images/messageNotification/type_02.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<image
|
||||
v-if="item.noticeTyp == '03'"
|
||||
class="img_100"
|
||||
src="@/static/images/messageNotification/type_03.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
></image> -->
|
||||
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="top">
|
||||
@@ -96,22 +78,21 @@
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { queryTraPersonalMessageNoticePaging, readNotice, oneTimeRead } from '@/api/messageNotification.js';
|
||||
import common from '../../common/common';
|
||||
|
||||
const customStyle = {
|
||||
backgroundColor: '#ffffff',
|
||||
paddingLeft: '40rpx',
|
||||
height: '78rpx',
|
||||
paddingTop: '5px',
|
||||
paddingBottom: '5px',
|
||||
border: 'none'
|
||||
|
||||
import type_01 from '@/static/images/messageNotification/type_01.png';
|
||||
import type_02 from '@/static/images/messageNotification/type_02.png';
|
||||
import type_03 from '@/static/images/messageNotification/type_03.png';
|
||||
import type_04 from '@/static/images/messageNotification/type_04.png';
|
||||
|
||||
const imageMap = {
|
||||
'01': type_01,
|
||||
'02': type_02,
|
||||
'03': type_03,
|
||||
'04': type_04,
|
||||
};
|
||||
const suffixIconStyle = {
|
||||
color: '#2c8ef2',
|
||||
fontSize: '50rpx'
|
||||
};
|
||||
|
||||
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
@@ -135,7 +116,7 @@
|
||||
page.data_list.length = 0;
|
||||
getData();
|
||||
};
|
||||
|
||||
|
||||
// 刷新处理函数
|
||||
const onRefresh = () => {
|
||||
if (_freshing.value) return;
|
||||
@@ -317,7 +298,7 @@
|
||||
.right {
|
||||
margin-left: 16rpx;
|
||||
flex: 1;
|
||||
|
||||
overflow: hidden;
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -356,6 +337,8 @@
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.num_div {
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
<view class="main_div max_page">
|
||||
<nav-bar :is_seat="true"></nav-bar>
|
||||
<view class="nav-div">
|
||||
<view class="title ellipsis-text" @click="hand_in_paper_button_click()">
|
||||
<view class="title ellipsis-text">
|
||||
{{ paperData.name }}
|
||||
</view>
|
||||
<view class="back_div"></view>
|
||||
<view class="back_div" @click="exit_practice">
|
||||
<image :src="practiceExitIcon()" class="img"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="countdown-and-question-number-div">
|
||||
<view class="top">
|
||||
@@ -39,6 +41,7 @@
|
||||
:current="questionNumber"
|
||||
easing-function="linear"
|
||||
@transition="transition"
|
||||
@animationfinish="animationfinish"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in topicList">
|
||||
<view class="content">
|
||||
@@ -71,7 +74,7 @@
|
||||
<!-- 反馈组件 -->
|
||||
<Feedback ref="feedbackRef"></Feedback>
|
||||
<!-- 结尾弹出层 -->
|
||||
<Dialog ref="dialogRef" :dialogConfiguration="dialogConfiguration" @button_click="result_click"></Dialog>
|
||||
<Dialog ref="dialogRef" @button_click="result_click"></Dialog>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -87,7 +90,7 @@
|
||||
import common from '@/common/common';
|
||||
import { setPageCache, formatSeconds, getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { optionErrorIcon, examinationSheetIcon } from '@/common/imgSvg';
|
||||
import { optionErrorIcon, examinationSheetIcon, practiceExitIcon } from '@/common/imgSvg';
|
||||
import { practiceAnswer, practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
|
||||
import { startExamByCrs } from '@/api/examination.js';
|
||||
import { startPracticeByCrs } from '@/api/practice.js';
|
||||
@@ -116,7 +119,6 @@
|
||||
set: (val) => (topicList[questionNumber.value] = val)
|
||||
});
|
||||
|
||||
const isLastTopic = computed(() => topicList.length === questionNumber.value + 1);
|
||||
const showTouchBtn = computed(() => {
|
||||
return topic.value?.qnsTyp === 'ES';
|
||||
});
|
||||
@@ -134,8 +136,6 @@
|
||||
const completed = questionNumber.value + 1;
|
||||
return Math.min(Math.round((completed / total) * 10000) / 100, 100);
|
||||
});
|
||||
// 弹出框配置
|
||||
const dialogConfiguration = reactive({});
|
||||
|
||||
// 滑动切换
|
||||
const swiperChange = (item) => {
|
||||
@@ -143,10 +143,20 @@
|
||||
};
|
||||
const isTriggered = ref(false); // 下面这个得防抖
|
||||
// 滑动发生改变
|
||||
const finishCurrent = ref(questionNumber.value);
|
||||
// 滑动组件结束事件
|
||||
const animationfinish = (event) => {
|
||||
finishCurrent.value = event.detail.current;
|
||||
};
|
||||
// 判断是否滑动结束
|
||||
const isLastTopic = computed(
|
||||
() => topicList.length === finishCurrent.value + 1 && finishCurrent.value === questionNumber.value
|
||||
);
|
||||
|
||||
const transition = (event) => {
|
||||
if (isTriggered.value) return;
|
||||
const dx = event.detail.dx;
|
||||
if (dx > 50 && isLastTopic.value && ['P', 'U'].includes(topic.value.judgeResult)) {
|
||||
if (dx > 90 && dx < 250 && isLastTopic.value && ['P', 'U'].includes(topic.value.judgeResult)) {
|
||||
// 如果是最后一题并且右滑动大于50,并且这题已经答了,就触发练习完成
|
||||
isTriggered.value = true;
|
||||
hand_in_paper_button_click();
|
||||
@@ -222,7 +232,7 @@
|
||||
const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
|
||||
if (!addProblem()) {
|
||||
// 返回false说明到了最后一题
|
||||
console.log('最后一题');
|
||||
console.log('最后一题', topic.value.qnsTyp, !judgeResultStatus);
|
||||
if (topic.value.qnsTyp === 'ES' || !judgeResultStatus) {
|
||||
// 最后一题是问答题,或者答错了,都不自动弹出
|
||||
return;
|
||||
@@ -319,11 +329,9 @@
|
||||
// 添加一道题
|
||||
const addProblem = () => {
|
||||
if (topicList.length >= storageTopicList.value.length) {
|
||||
console.log('最后一题了', storageTopicList.value.length);
|
||||
return false;
|
||||
}
|
||||
topicList.push(storageTopicList.value[topicList.length]);
|
||||
console.log('topicList', topicList);
|
||||
return true;
|
||||
};
|
||||
// 初始化时检查
|
||||
@@ -352,97 +360,80 @@
|
||||
});
|
||||
});
|
||||
const result_click = async ({ key }) => {
|
||||
isTriggered.value = false;
|
||||
if (key === 'goto_test') {
|
||||
// 去考试
|
||||
try {
|
||||
dialogRef.value.close();
|
||||
await nextTick();
|
||||
common.loading();
|
||||
const res = await startExamByCrs({
|
||||
crsId: paperData.crsId
|
||||
});
|
||||
setPageCache('examination', {
|
||||
...res.body,
|
||||
name: paperData.name,
|
||||
crsId: paperData.crsId
|
||||
});
|
||||
common.hideLoading();
|
||||
common.redirectTo('/pages/examination/index');
|
||||
} catch (e) {
|
||||
console.log('e', e);
|
||||
common.navigateBack();
|
||||
}
|
||||
} else if (key === 'again') {
|
||||
// 重新练
|
||||
try {
|
||||
dialogRef.value.close();
|
||||
await nextTick();
|
||||
common.loading();
|
||||
const res = await startPracticeByCrs({
|
||||
crsId: paperData.crsId
|
||||
});
|
||||
setPageCache('practice', {
|
||||
...res.body,
|
||||
name: paperData.name,
|
||||
crsId: paperData.crsId
|
||||
});
|
||||
common.hideLoading();
|
||||
common.redirectTo('/pages/practice/index');
|
||||
} catch (e) {
|
||||
console.log('e', e);
|
||||
common.navigateBack();
|
||||
}
|
||||
} else if (key === 'return') {
|
||||
// 返回
|
||||
isTriggered.value = false; // 恢复
|
||||
if (key === 'exit') {
|
||||
// 中途退出
|
||||
dialogRef.value.close();
|
||||
common.loading();
|
||||
await practiceCommit({ exrId: paperData.exrId, examLenTm: practiceTime.value, stat: 'U' });
|
||||
common.hideLoading();
|
||||
await nextTick();
|
||||
common.navigateBack();
|
||||
} else if (key === 'revert') {
|
||||
// 返回
|
||||
dialogRef.value.close();
|
||||
}
|
||||
};
|
||||
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#0066FF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const style_button_2 = {
|
||||
color: '#0066FF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
// 弹出框配置
|
||||
const dialogConfiguration = reactive({});
|
||||
// 交卷按钮点击,打开交卷确认框
|
||||
const hand_in_paper_button_click = async () => {
|
||||
common.loading();
|
||||
try {
|
||||
await practiceCommit({ exrId: paperData.exrId, examLenTm: practiceTime.value, stat: 'P' });
|
||||
} catch (e) {}
|
||||
common.hideLoading();
|
||||
console.log('点击交卷', paperData);
|
||||
// 判断是否完成所有题目
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#0066FF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const style_button_2 = {
|
||||
color: '#0066FF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
console.log('交卷按钮');
|
||||
const stat = 'P'
|
||||
// 都做完弹窗了,产品说改成跳页,说客户觉得奇怪
|
||||
common.redirectTo(`/pages/practice/result?name=${paperData.name}&exrId=${paperData.exrId}&crsId=${paperData.crsId}&examLenTm=${practiceTime.value}&stat=${stat}`);
|
||||
// 完成
|
||||
dialogConfiguration.type = 'complete';
|
||||
dialogConfiguration.title = '恭喜你,已完成全部练习!';
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
key: 'goto_test',
|
||||
name: '去考试',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'again',
|
||||
name: '重新练',
|
||||
style: style_button_2
|
||||
},
|
||||
{
|
||||
key: 'return',
|
||||
name: '返回',
|
||||
style: style_button_2
|
||||
}
|
||||
];
|
||||
dialogRef.value.open();
|
||||
// dialogRef.value.open({
|
||||
// // type: 'complete',
|
||||
// title: '恭喜你,已完成全部练习!',
|
||||
// buttonList: [
|
||||
// {
|
||||
// key: 'goto_test',
|
||||
// name: '去考试',
|
||||
// style: style_button_1
|
||||
// },
|
||||
// {
|
||||
// key: 'again',
|
||||
// name: '重新练',
|
||||
// style: style_button_2
|
||||
// },
|
||||
// {
|
||||
// key: 'return',
|
||||
// name: '返回',
|
||||
// style: style_button_2
|
||||
// }
|
||||
// ]
|
||||
// });
|
||||
};
|
||||
// 中途退出
|
||||
const exit_practice = () => {
|
||||
dialogRef.value.open({
|
||||
title: '确认现在退出吗?',
|
||||
buttonList: [
|
||||
{
|
||||
key: 'exit',
|
||||
name: '退出',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'revert',
|
||||
name: '返回',
|
||||
style: style_button_2
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
// 启动练习时长定时器
|
||||
const startTimer = () => {
|
||||
@@ -748,6 +739,13 @@
|
||||
top: 0;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
.img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view class="max_page">
|
||||
<image src="@/static/images/common/wc.png" class="show_img"></image>
|
||||
<view class="show_msg">练习完成</view>
|
||||
<view class="fl1"></view>
|
||||
<view class="show_button">
|
||||
<uv-button
|
||||
type="primary"
|
||||
class="button"
|
||||
color="#0066FF"
|
||||
:throttleTime="100"
|
||||
text="去考试"
|
||||
:loading="loading === '01'"
|
||||
loadingText="正在获取考试内容"
|
||||
:custom-style="customStyle1"
|
||||
@click="goto_examination"
|
||||
></uv-button>
|
||||
<uv-button
|
||||
type="primary"
|
||||
class="button"
|
||||
color="#FFFFFF"
|
||||
:throttleTime="100"
|
||||
text="重新练"
|
||||
:loading="loading === '02'"
|
||||
loadingText="正在获取练习内容"
|
||||
@click="goto_practice"
|
||||
:custom-style="customStyle2"
|
||||
></uv-button>
|
||||
<uv-button
|
||||
type="primary"
|
||||
class="button"
|
||||
color="#0066FF"
|
||||
:throttleTime="100"
|
||||
text="返回"
|
||||
@click="back_page"
|
||||
:custom-style="customStyle3"
|
||||
></uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onMounted, ref, onUnmounted } from 'vue';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache } from '@/common/common';
|
||||
import { startExamByCrs } from '@/api/examination.js';
|
||||
import { startPracticeByCrs } from '@/api/practice.js';
|
||||
import { practiceCommit } from '@/api/practice.js';
|
||||
const customStyle1 = {
|
||||
borderRadius: '12rpx',
|
||||
color: '#FFFFFF',
|
||||
fontWeight: '600',
|
||||
fontSize: '28rpx',
|
||||
border: '1px solid #E0E0E0',
|
||||
height: '92rpx'
|
||||
};
|
||||
const customStyle2 = {
|
||||
borderRadius: '12rpx',
|
||||
color: '#333333',
|
||||
fontWeight: '600',
|
||||
fontSize: '28rpx',
|
||||
border: '1px solid #E0E0E0',
|
||||
height: '92rpx'
|
||||
};
|
||||
const customStyle3 = {
|
||||
color: '#333333',
|
||||
fontWeight: '600',
|
||||
fontSize: '28rpx',
|
||||
border: 'none',
|
||||
backgroundColor: '#fff',
|
||||
height: '92rpx'
|
||||
};
|
||||
const crsId = ref('');
|
||||
const name = ref('');
|
||||
const loading = ref('');
|
||||
|
||||
// 用于标记组件是否已卸载
|
||||
let isUnmounted = false;
|
||||
// 存储请求取消函数
|
||||
let abortController = null;
|
||||
// 返回上一页
|
||||
const back_page = () => {
|
||||
if (loading.value !== '') return;
|
||||
common.navigateBack();
|
||||
};
|
||||
// 去考试
|
||||
const goto_examination = async () => {
|
||||
if (loading.value !== '') return;
|
||||
try {
|
||||
loading.value = '01';
|
||||
const res = await startExamByCrs({
|
||||
crsId: crsId.value
|
||||
});
|
||||
setPageCache('examination', {
|
||||
...res.body,
|
||||
name: name.value,
|
||||
crsId: crsId.value
|
||||
});
|
||||
loading.value = '';
|
||||
common.redirectTo('/pages/examination/index');
|
||||
} catch (e) {
|
||||
loading.value = '';
|
||||
}
|
||||
};
|
||||
// 去练习
|
||||
const goto_practice = async () => {
|
||||
if (loading.value !== '') return;
|
||||
try {
|
||||
loading.value = '02';
|
||||
const res = await startPracticeByCrs({
|
||||
crsId: crsId.value
|
||||
});
|
||||
setPageCache('practice', {
|
||||
...res.body,
|
||||
name: name.value,
|
||||
crsId: crsId.value
|
||||
});
|
||||
loading.value = '';
|
||||
common.redirectTo('/pages/practice/index');
|
||||
} catch (e) {
|
||||
loading.value = '';
|
||||
}
|
||||
};
|
||||
const exrId = ref('')
|
||||
const examLenTm = ref('')
|
||||
const stat = ref('')
|
||||
const commit = ref(false)
|
||||
onLoad((e) => {
|
||||
crsId.value = e.crsId
|
||||
name.value = e.name
|
||||
exrId.value = e.exrId
|
||||
examLenTm.value = e.examLenTm
|
||||
stat.value = e.stat
|
||||
practiceCommitFun()
|
||||
});
|
||||
const practiceCommitFun = () => {
|
||||
practiceCommit({ exrId: exrId.value, examLenTm: examLenTm.value, stat: stat.value }).then(() => {
|
||||
console.log('提交练习状态成功');
|
||||
commit.value = true
|
||||
})
|
||||
}
|
||||
|
||||
onUnmounted(() => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.max_page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.show_img {
|
||||
margin-top: 300rpx;
|
||||
width: 231rpx;
|
||||
height: 231rpx;
|
||||
}
|
||||
.show_msg {
|
||||
margin-top: 38rpx;
|
||||
font-weight: 700;
|
||||
font-size: 46rpx;
|
||||
color: #000000;
|
||||
line-height: 62rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
.show_button {
|
||||
width: 80%;
|
||||
margin-bottom: 90rpx;
|
||||
.button:nth-child(2) {
|
||||
margin-top: 38rpx;
|
||||
margin-bottom: 38rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="scroll_div">
|
||||
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower" :show-scrollbar="false">
|
||||
<view class="item" v-for="item in data_list" @click="item_click(item)">
|
||||
<view class="item" v-for="item in data_list" @click="goto_course_detail(item)">
|
||||
<view class="img_div">
|
||||
<image-preview class="img" :imgId="item.imgId" mode="scaleToFill"></image-preview>
|
||||
</view>
|
||||
@@ -23,6 +23,7 @@
|
||||
const limit = 15;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
import common from '@/common/common';
|
||||
const data_list = reactive([]);
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { queryTraStdyInfoPreviewPaging } from '@/api/preview.js';
|
||||
@@ -59,9 +60,8 @@
|
||||
const scrolltolower = (item) => {
|
||||
getData();
|
||||
};
|
||||
const item_click = (item) => {
|
||||
console.log(item, 'item');
|
||||
crsId
|
||||
const goto_course_detail = (item) => {
|
||||
common.navigateTo('/pages/courseDetail/index?isPreview=preview&crsId=' + item.crsId);
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
</picker>
|
||||
</template>
|
||||
</uv-cell>
|
||||
<uv-cell title="百禄形象" @click="gotoMascot()" :isLink="true"></uv-cell>
|
||||
<uv-cell :isLink="true" :border="false">
|
||||
<uv-cell title="百禄形象" @click="gotoMascot()" :isLink="true" :border="false"></uv-cell>
|
||||
<!-- <uv-cell :isLink="true" :border="false">
|
||||
<template #title>
|
||||
<text class="font_pf">竞赛是否匿名</text>
|
||||
</template>
|
||||
@@ -42,7 +42,7 @@
|
||||
<view style="text-align: right">{{showAnonymousText}}</view>
|
||||
</picker>
|
||||
</template>
|
||||
</uv-cell>
|
||||
</uv-cell> -->
|
||||
</uv-cell-group>
|
||||
</view>
|
||||
<avatar-cropper v-if="avatarCropperStatus" mode="ratio" :imageUrl="avatarCropperUrl" :width="500" :height="500"
|
||||
|
||||
@@ -1,168 +1,77 @@
|
||||
<template>
|
||||
<view class="scroll_div content">
|
||||
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower">
|
||||
<view class="item" :class="getStatusClass(index)" v-for="(item,index) in data_list">
|
||||
<view class="top">
|
||||
<view class="type">
|
||||
单选题
|
||||
</view>
|
||||
<view class="score">
|
||||
5分
|
||||
</view>
|
||||
<view class="fl1">
|
||||
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="right_text">
|
||||
展开
|
||||
</view>
|
||||
<uv-icon class="arrow-icon" name="arrow-right"></uv-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
属于商业银行风险管理“三道防线”的哪些风险管理部门,为什么?
|
||||
</view>
|
||||
<view class="max_page detail-main">
|
||||
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" @scrolltolower="scrolltolower">
|
||||
<view class="content" v-for="(item, index) in data_list">
|
||||
<subject :item="item" mode="mistake" :isPreview="true" :clearResult="false"></subject>
|
||||
</view>
|
||||
<list-no-data v-if="total == 0 && status == 'nomore'"></list-no-data>
|
||||
<uv-load-more v-if="total != 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
const status = ref('loading') // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const total = ref(-1)
|
||||
const page = ref(0)
|
||||
const data_list = reactive([])
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
nextTick
|
||||
} from 'vue'
|
||||
import {
|
||||
queryTraCrsBbsInfoByCrsId
|
||||
} from '@/api/courseDetail.js';
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { queryTraCrsBbsInfoByCrsId } from '@/api/courseDetail.js';
|
||||
import { queryTraMistakesCollectionPaging } from '@/api/wrongQuestionRecord.js';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (total.value !== -1) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
status.value = 'loading'
|
||||
total.value = -1
|
||||
page.value = 1
|
||||
data_list.length = 0
|
||||
status.value = 'loading';
|
||||
total.value = -1;
|
||||
page.value = 1;
|
||||
data_list.length = 0;
|
||||
} else {
|
||||
if (status.value !== 'loadmore' && status.value !== '') return
|
||||
status.value = 'loading'
|
||||
page.value++
|
||||
if (status.value !== 'loadmore' && status.value !== '') return;
|
||||
status.value = 'loading';
|
||||
page.value++;
|
||||
}
|
||||
console.log(status.value, '阿斯顿撒');
|
||||
|
||||
setTimeout(() => {
|
||||
queryTraCrsBbsInfoByCrsId({
|
||||
crsId: 'CRS0250181220722025070408313900000018729',
|
||||
queryTraMistakesCollectionPaging({
|
||||
isCorrect: 'Y',
|
||||
page: page.value,
|
||||
limit: limit
|
||||
}).then(res => {
|
||||
total.value = res.total
|
||||
data_list.push(...res.body)
|
||||
}).finally(() => {
|
||||
if (data_list.length >= total.value) {
|
||||
status.value = 'nomore'
|
||||
} else {
|
||||
status.value = 'loadmore'
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
const getStatusClass = (index) => {
|
||||
const remainder = index % 3;
|
||||
if (remainder === 0) return 'in_progress';
|
||||
if (remainder === 1) return 'completed';
|
||||
return 'expired';
|
||||
.then((res) => {
|
||||
total.value = res.total;
|
||||
data_list.push(...res.body);
|
||||
})
|
||||
.finally(() => {
|
||||
if (data_list.length >= total.value) {
|
||||
status.value = 'nomore';
|
||||
} else {
|
||||
status.value = 'loadmore';
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
getData()
|
||||
getData();
|
||||
};
|
||||
defineExpose({
|
||||
getData
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.scroll_div {
|
||||
background-color: #F1F5FA;
|
||||
padding: 22rpx;
|
||||
}
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - var(--status-bar-height) - 54rpx - 88rpx - 20rpx - 44rpx);
|
||||
// background-color: #fff;
|
||||
|
||||
}
|
||||
|
||||
.scroll-Y .item {
|
||||
// height: 170rpx;
|
||||
$bg-margin-left: 30rpx;
|
||||
.content {
|
||||
position: relative;
|
||||
margin: 32rpx $bg-margin-left;
|
||||
border-radius: 16rpx;
|
||||
margin: 32rpx 0;
|
||||
padding: 34rpx 30rpx 34rpx 36rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.type {
|
||||
width: 108rpx;
|
||||
height: 46rpx;
|
||||
background: #267EFF;
|
||||
border-radius: 8rpx;
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
font-size: 25rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 46rpx;
|
||||
}
|
||||
|
||||
.score {
|
||||
margin-left: 24rpx;
|
||||
font-family: ArialMT;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.right_text {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 48rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
.scroll-Y {
|
||||
background-color: #f1f5fa;
|
||||
max-height: calc(100vh - var(--status-bar-height) - 78rpx - 88rpx - 156rpx);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="scroll_div">
|
||||
<scroll-view :scroll-y="true" class="scroll-Y " :show-scrollbar="false" @scrolltolower="scrolltolower">
|
||||
<view class="max_page detail-main">
|
||||
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" @scrolltolower="scrolltolower">
|
||||
<view class="content" v-for="(item, index) in data_list">
|
||||
<subject :item="item" mode="mistake" :isPreview="true" :clearResult="false"></subject>
|
||||
</view>
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
@@ -52,12 +52,7 @@
|
||||
});
|
||||
}, 200);
|
||||
};
|
||||
const getStatusClass = (index) => {
|
||||
const remainder = index % 3;
|
||||
if (remainder === 0) return 'in_progress';
|
||||
if (remainder === 1) return 'completed';
|
||||
return 'expired';
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
getData();
|
||||
};
|
||||
@@ -74,10 +69,9 @@
|
||||
border-radius: 16rpx;
|
||||
padding: 34rpx 30rpx 34rpx 36rpx;
|
||||
background-color: #fff;
|
||||
// min-height: calc(100vh - var(--status-bar-height) - 54rpx - 88rpx - 20rpx - 44rpx - 156rpx);
|
||||
}
|
||||
.scroll-Y {
|
||||
background-color: #f1f5fa;
|
||||
min-height: calc(100vh - var(--status-bar-height) - 78rpx - 88rpx - 156rpx);
|
||||
max-height: calc(100vh - var(--status-bar-height) - 78rpx - 88rpx - 156rpx);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,737 @@
|
||||
<template>
|
||||
<view class="main_div max_page">
|
||||
<nav-bar :is_seat="true"></nav-bar>
|
||||
<view class="nav-div">
|
||||
<view class="title ellipsis-text">
|
||||
{{ paperData.name }}
|
||||
</view>
|
||||
<view class="back_div" @click="exit_practice">
|
||||
<image :src="practiceExitIcon()" class="img"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="countdown-and-question-number-div">
|
||||
<view class="top">
|
||||
<view class="countdown">
|
||||
<text class="grey">答题进度</text>
|
||||
<text class="bold">{{ questionNumber + 1 }}</text>
|
||||
<text class="grey">/{{ storageIdList.length }}</text>
|
||||
</view>
|
||||
<view class="question"></view>
|
||||
</view>
|
||||
<view class="progress">
|
||||
<uv-line-progress
|
||||
:percentage="progress"
|
||||
:showText="false"
|
||||
activeColor="#FFFFFF"
|
||||
inactiveColor="#89B8FF"
|
||||
:height="8"
|
||||
></uv-line-progress>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_div">
|
||||
<swiper
|
||||
class="swiper"
|
||||
:indicator-dots="false"
|
||||
@change="swiperChange"
|
||||
:current="questionNumber"
|
||||
easing-function="linear"
|
||||
@transition="transition"
|
||||
@animationfinish="animationfinish"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in topicList">
|
||||
<view class="content">
|
||||
<view class="expose_shadow"></view>
|
||||
<scroll-view :scroll-y="true" class="scroll-Y" :show-scrollbar="false" :refresher-threshold="0">
|
||||
<Subject
|
||||
:item="item"
|
||||
:mode="mode"
|
||||
:isPreview="item.isPreview"
|
||||
:clearResult="item.clearResult"
|
||||
@subject_click="subject_click"
|
||||
v-model="item.my_answer"
|
||||
></Subject>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="fixed-box font_pf" :style="{ marginBottom: popup_input_bottom }">
|
||||
<view class="touch-btn-div" :class="{ show: showTouchBtn }">
|
||||
<TouchBtn
|
||||
ref="touchBtnRef"
|
||||
class="talk-btns"
|
||||
@submit="touchBtnSubmit"
|
||||
disabledText="只能进行一条回答"
|
||||
:isDisabled="touchIsDisabled"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 反馈组件 -->
|
||||
<Feedback ref="feedbackRef"></Feedback>
|
||||
<!-- 结尾弹出层 -->
|
||||
<Dialog ref="dialogRef" @button_click="result_click"></Dialog>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted, nextTick, onUnmounted } from 'vue';
|
||||
import { onLoad, onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
|
||||
import Feedback from '@/pages/examination/components/feedback.vue';
|
||||
import Dialog from '@/pages/examination/components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import CharactersSubject from '@/components/examination/characters-subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache, getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { optionErrorIcon, examinationSheetIcon, practiceExitIcon } from '@/common/imgSvg';
|
||||
import { practiceAnswer, practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
|
||||
|
||||
import { queryMistakesAnswerByMisId, mistakesCorrect } from '@/api/wrongQuestionRecord.js';
|
||||
const feedbackRef = ref(null);
|
||||
const dialogRef = ref(null);
|
||||
const touchBtnRef = ref(null);
|
||||
|
||||
|
||||
|
||||
const mode = ref('practice'); // 考试 examination 练习practice
|
||||
const paperData = reactive({
|
||||
name: '' // 名称
|
||||
}); // 试卷信息
|
||||
const topicList = reactive([]); // 问题列表
|
||||
const storageIdList = ref([]); // 所有题ID列表
|
||||
const popup_input_bottom = ref('0px');
|
||||
const questionNumber = ref(0); // 题号
|
||||
|
||||
|
||||
const topic = computed({
|
||||
get: () => topicList[questionNumber.value],
|
||||
set: (val) => (topicList[questionNumber.value] = val)
|
||||
});
|
||||
|
||||
const showTouchBtn = computed(() => {
|
||||
return topic.value?.qnsTyp === 'ES';
|
||||
});
|
||||
|
||||
// 下面语音组件的禁用状态判断
|
||||
const touchIsDisabled = computed(() => {
|
||||
console.log('下面语音组件的禁用状态判断', topic.value?.es_status !== '' && topic.value?.es_status !== undefined);
|
||||
return topic.value?.es_status !== '' && topic.value?.es_status !== undefined;
|
||||
});
|
||||
|
||||
const progress = computed(() => {
|
||||
// 计算进度百分比(保留两位小数)
|
||||
const total = storageIdList.value.length;
|
||||
if (total === 0) return 0;
|
||||
const completed = questionNumber.value + 1;
|
||||
return Math.min(Math.round((completed / total) * 10000) / 100, 100);
|
||||
});
|
||||
|
||||
// 滑动切换
|
||||
const swiperChange = (item) => {
|
||||
questionNumber.value = item.detail.current;
|
||||
};
|
||||
const isTriggered = ref(false); // 下面这个得防抖
|
||||
// 滑动发生改变
|
||||
const finishCurrent = ref(questionNumber.value);
|
||||
// 滑动组件结束事件
|
||||
const animationfinish = (event) => {
|
||||
finishCurrent.value = event.detail.current;
|
||||
};
|
||||
// 判断是否滑动结束
|
||||
const isLastTopic = computed(
|
||||
() => topicList.length === finishCurrent.value + 1 && finishCurrent.value === questionNumber.value
|
||||
);
|
||||
|
||||
const transition = (event) => {
|
||||
if (isTriggered.value) return;
|
||||
const dx = event.detail.dx;
|
||||
if (dx > 50 && dx < 200 && isLastTopic.value && ['P', 'U'].includes(topic.value.judgeResult)) {
|
||||
// 如果是最后一题并且右滑动大于50,并且这题已经答了,就触发练习完成
|
||||
isTriggered.value = true;
|
||||
hand_in_paper_button_click();
|
||||
}
|
||||
};
|
||||
|
||||
const subject_click = (type, params) => {
|
||||
if (type === 'feedback') {
|
||||
// 反馈
|
||||
feedbackRef.value.open(params.qnsId);
|
||||
} else if (type === 'answer') {
|
||||
//多选点击按钮答题
|
||||
if (params.qnsTyp === 'MU') {
|
||||
submitProblem({
|
||||
anserResult: params.answer.join(',')
|
||||
});
|
||||
}
|
||||
} else if (type === 'choose') {
|
||||
//单选判断点击选项答题
|
||||
if (['JD', 'SN'].includes(params.qnsTyp)) {
|
||||
submitProblem({ anserResult: params.answer.join(',') });
|
||||
}
|
||||
} else if (type === 'complete') {
|
||||
// 问答题点击完成
|
||||
// ossAddr
|
||||
// anserResult 作答结果
|
||||
// ossKey 对象存储
|
||||
submitProblem(params.answer);
|
||||
} else if (type === 'again') {
|
||||
// 问答题点击重答
|
||||
topic.value.my_answer = {};
|
||||
topic.value.isPreview = false;
|
||||
topic.value.es_status = ''; // 取消转圈
|
||||
}
|
||||
};
|
||||
|
||||
// 单题回答
|
||||
const submitProblem = (answer) => {
|
||||
console.log('答题内容', answer);
|
||||
console.log('答单题', topic);
|
||||
common.loading('答题中');
|
||||
mistakesCorrect({
|
||||
misId: topic.value.misId,
|
||||
ossKey: '',
|
||||
...answer
|
||||
})
|
||||
.then(async (res) => {
|
||||
let traQnsInfoVo;
|
||||
// 是问答题
|
||||
if (topic.value.qnsTyp === 'ES') {
|
||||
try {
|
||||
const result = await queryWithRetry(res.body.execLogId);
|
||||
traQnsInfoVo = result.body.traQnsInfoVo;
|
||||
} catch (e) {
|
||||
common.hideLoading();
|
||||
topic.value.isPreview = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
traQnsInfoVo = res.body;
|
||||
}
|
||||
topic.value.isPreview = true; // 不能在点击了,打开预览模式
|
||||
console.log('给出来的traQnsInfoVo', traQnsInfoVo);
|
||||
common.hideLoading();
|
||||
topic.value.clearResult = false; // 不清除正确答案
|
||||
topic.value.analyContent = traQnsInfoVo.analyContent; // 答案解析
|
||||
// 更新选项正确项目
|
||||
topic.value.itemVos = traQnsInfoVo.itemVos; // 答案选项(todo应该不这样替换)
|
||||
topic.value.anserResult = traQnsInfoVo.anserResult; // 正确答案字符串分割
|
||||
topic.value.judgeResult = traQnsInfoVo.judgeResult; // 正确答案字符串分割
|
||||
const judgeResultStatus = traQnsInfoVo.judgeResult === 'P'; // P为正确U为错误
|
||||
// 加载下一题
|
||||
addProblem(questionNumber.value + 1)
|
||||
|
||||
// if (!addProblem()) {
|
||||
// // 返回false说明到了最后一题
|
||||
// console.log('最后一题', topic.value.qnsTyp, !judgeResultStatus);
|
||||
// if (topic.value.qnsTyp === 'ES' || !judgeResultStatus) {
|
||||
// // 最后一题是问答题,或者答错了,都不自动弹出
|
||||
// return;
|
||||
// } else {
|
||||
// await hand_in_paper_button_click();
|
||||
// }
|
||||
// } else {
|
||||
// // 自动切换下一题的条件
|
||||
// if (
|
||||
// judgeResultStatus && // 条件1.答题正确
|
||||
// topic.value.qnsTyp !== 'ES' // 问答题答对打答错都不切换
|
||||
// ) {
|
||||
// questionNumber.value++;
|
||||
// } else {
|
||||
// console.log('为什么不跳转2', judgeResultStatus);
|
||||
// console.log('为什么不跳转3', topic.value.qnsTyp !== 'ES');
|
||||
// }
|
||||
// }
|
||||
})
|
||||
.catch(() => {
|
||||
common.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
// 问答题轮询结果方法
|
||||
const queryWithRetry = (execLogId, maxRetries = 10) => {
|
||||
// 递归终止条件:达到最大重试次数
|
||||
if (maxRetries <= 0) {
|
||||
return Promise.reject(new Error('超过最大重试次数,查询失败'));
|
||||
}
|
||||
return queryCrsPracticeAnswerResult({ execLogId })
|
||||
.then((res) => {
|
||||
console.log('queryCrsPracticeAnswerResult', maxRetries, res.body);
|
||||
const isWait = res.body.isWait;
|
||||
if (isWait === 'Y') {
|
||||
// 如果是Y,延迟2秒后重试,重试次数减1
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(queryWithRetry(execLogId, maxRetries - 1));
|
||||
}, 2000);
|
||||
});
|
||||
} else {
|
||||
// 不是Y,直接返回结果
|
||||
return res;
|
||||
}
|
||||
})
|
||||
.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(); // 清除发送框数据
|
||||
|
||||
if (type === 'voice') {
|
||||
topic.value.es_status = '00'; // 00转圈
|
||||
const voicePath = submitObj;
|
||||
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
|
||||
.then((res) => {
|
||||
let _res = JSON.parse(res.data);
|
||||
if (_res.rtnCode === '0000') {
|
||||
topic.value.es_status = '02';
|
||||
topic.value.my_answer = {
|
||||
anserResult: _res.body.transContent,
|
||||
ossKey: _res.body.fileId,
|
||||
ossAddr: _res.body.ossFileAddr,
|
||||
voicePath: voicePath
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
topic.value.es_status = ''; // 取消转圈
|
||||
// 失败了再把发送框数据还原回去
|
||||
touchBtnRef.value?.clearinputText(old_text); // 清除发送框数据
|
||||
common.msg('系统异常,请联系管理员');
|
||||
});
|
||||
} else if (type === 'text') {
|
||||
topic.value.es_status = '01';
|
||||
topic.value.my_answer = {
|
||||
anserResult: submitObj // 正确答案文字内容
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 添加一道题
|
||||
const addProblem = async (index, isLoading) => {
|
||||
// index 要加载的题号 isLoading是否显示loading
|
||||
if(index < topicList.length) return true; // 说明此题已经加载
|
||||
if (topicList.length >= storageIdList.value.length) return false; // 说明已经就
|
||||
if (isLoading) common.loading('加载题目中');
|
||||
const id = storageIdList.value[index];
|
||||
queryMistakesAnswerByMisId({ misId: id })
|
||||
.then(({ body }) => {
|
||||
console.log('加载了一道题', body);
|
||||
topicList.push({
|
||||
...body,
|
||||
isPreview: false,
|
||||
clearResult: true,
|
||||
es_status: '', // 预设一下问答题的状态,'' 空为没有 00 转圈 01 播放,其他暂定
|
||||
my_answer: []
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
if (isLoading) common.hideLoading();
|
||||
});
|
||||
};
|
||||
// 初始化时检查
|
||||
onLoad(() => {
|
||||
const correct = getPageCache('correct');
|
||||
if (!correct) {
|
||||
return common.navigateBack();
|
||||
}
|
||||
paperData.name = correct.name;
|
||||
storageIdList.value = correct.list;
|
||||
// 记录练习起始时间
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
});
|
||||
setTimeout(() => {
|
||||
addProblem(0, true);
|
||||
}, 10);
|
||||
});
|
||||
const result_click = async ({ key }) => {
|
||||
isTriggered.value = false; // 恢复
|
||||
if (key === 'return') {
|
||||
// 返回
|
||||
dialogRef.value.close();
|
||||
await nextTick();
|
||||
common.navigateBack();
|
||||
} else if (key === 'exit') {
|
||||
// 中途退出
|
||||
dialogRef.value.close();
|
||||
common.loading();
|
||||
await practiceCommit({ exrId: paperData.exrId, stat: 'U' });
|
||||
common.hideLoading();
|
||||
await nextTick();
|
||||
common.navigateBack();
|
||||
} else if (key === 'revert') {
|
||||
// 返回
|
||||
dialogRef.value.close();
|
||||
}
|
||||
};
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#0066FF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const style_button_2 = {
|
||||
color: '#0066FF',
|
||||
fontSize: '30rpx',
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
// 弹出框配置
|
||||
const dialogConfiguration = reactive({});
|
||||
// 交卷按钮点击,打开交卷确认框
|
||||
const hand_in_paper_button_click = async () => {
|
||||
console.log('交卷按钮');
|
||||
common.loading();
|
||||
try {
|
||||
await practiceCommit({ exrId: paperData.exrId, stat: 'P' });
|
||||
} catch (e) {}
|
||||
common.hideLoading();
|
||||
console.log('点击交卷', paperData);
|
||||
// 完成
|
||||
dialogRef.value.open({
|
||||
// type: 'complete',
|
||||
title: '恭喜你,已完成全部练习!',
|
||||
buttonList: [
|
||||
{
|
||||
key: 'goto_test',
|
||||
name: '去考试',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'again',
|
||||
name: '重新练',
|
||||
style: style_button_2
|
||||
},
|
||||
{
|
||||
key: 'return',
|
||||
name: '返回',
|
||||
style: style_button_2
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
// 中途退出
|
||||
const exit_practice = () => {
|
||||
dialogRef.value.open({
|
||||
title: '确认现在退出吗?',
|
||||
buttonList: [
|
||||
{
|
||||
key: 'exit',
|
||||
name: '退出',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'revert',
|
||||
name: '返回',
|
||||
style: style_button_2
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
onShow(() => {});
|
||||
onHide(() => {});
|
||||
onUnload(() => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$bg-margin-left: 30rpx;
|
||||
|
||||
.popup_title_text {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.popup {
|
||||
//答题卡
|
||||
z-index: 1800;
|
||||
padding: 0 38rpx;
|
||||
|
||||
.sheet_popup_div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
padding: 10rpx 34rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
border-radius: 16rpx 16rpx 0px 0px;
|
||||
position: relative;
|
||||
|
||||
.title_div {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 30rpx 0;
|
||||
font-family: PingFangSC;
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
border-bottom: 2rpx solid #efefef;
|
||||
}
|
||||
|
||||
.popup_back_div {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
right: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sheet_table {
|
||||
margin-top: 48rpx;
|
||||
margin-bottom: 48rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: calc(100vw - 108rpx);
|
||||
align-content: space-between;
|
||||
|
||||
.sheet_table_item {
|
||||
width: calc((100vw - 108rpx) / 5 - 16rpx);
|
||||
height: calc((100vw - 108rpx) / 5 - 16rpx);
|
||||
margin: 8rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.current {
|
||||
background-color: rgba(0, 102, 255, 0.6);
|
||||
border-color: #0066ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.completed {
|
||||
// 已完成
|
||||
background-color: rgba(0, 102, 255, 0.1);
|
||||
border-color: #0066ff;
|
||||
color: #0066ff;
|
||||
}
|
||||
|
||||
.mark,
|
||||
.completed.mark {
|
||||
background-color: rgba(232, 181, 49, 0.1);
|
||||
color: #e8b531;
|
||||
border-color: #e8b531;
|
||||
}
|
||||
|
||||
.current.mark {
|
||||
// 已完成
|
||||
background-color: rgba(0, 102, 255, 0.6);
|
||||
color: #ffffff;
|
||||
border-color: #e8b531;
|
||||
}
|
||||
}
|
||||
|
||||
.sheet_button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fixed-box {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-radius: 16rpx 16rpx 0px 0px;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.touch-btn-div {
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
transition: height 0.2s ease-out;
|
||||
}
|
||||
|
||||
.touch-btn-div.show {
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.fixed-btn-box {
|
||||
height: 154rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20rpx 20rpx 20rpx;
|
||||
|
||||
.sheet_button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 0 70rpx;
|
||||
|
||||
.img {
|
||||
width: 38rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.sheet_text {
|
||||
margin-top: 8rpx;
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
.button_div {
|
||||
flex: 1;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-Y {
|
||||
max-height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx - 68rpx - 60rpx);
|
||||
min-height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx - 68rpx - 60rpx - 380rpx);
|
||||
}
|
||||
|
||||
.swiper {
|
||||
// 状态栏 var(--status-bar-height)
|
||||
// 标题栏 70rpx
|
||||
// 进度时间栏 70rpx
|
||||
// 进度时间栏上下间距 40rpx = 20rpx + 20rpx
|
||||
// 正文上下间距 64rpx
|
||||
height: calc(100vh - var(--status-bar-height) - 70rpx - 70rpx - 40rpx - 64rpx);
|
||||
// background-color: red;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
margin: 32rpx $bg-margin-left;
|
||||
border-radius: 16rpx;
|
||||
padding: 34rpx 30rpx 34rpx 36rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.expose_shadow {
|
||||
margin-left: 36rpx;
|
||||
position: absolute;
|
||||
bottom: -26rpx;
|
||||
left: 0%;
|
||||
width: calc(100% - 66rpx);
|
||||
height: 28rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 0 0 14rpx 14rpx;
|
||||
opacity: 0.4;
|
||||
z-index: 0;
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.countdown-and-question-number-div {
|
||||
margin: 20rpx $bg-margin-left;
|
||||
height: 70rpx;
|
||||
// background-color: red;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
z-index: 10;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-family: PingFangSC;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.question {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// background-color: red;
|
||||
width: 242rpx;
|
||||
|
||||
.grey {
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #b6e2ff;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-div {
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
// padding-top:var(--status-bar-height);
|
||||
// padding: 0 30rpx;
|
||||
margin: 0 calc($bg-margin-left + 70rpx);
|
||||
height: 70rpx;
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
.back_div {
|
||||
position: absolute;
|
||||
right: $bg-margin-left;
|
||||
top: 0;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
.img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.main_div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(to top, #3480ff, #0066ff);
|
||||
/* 确保背景占满整个视口高度 */
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -22,7 +22,13 @@
|
||||
></uv-tabs>
|
||||
</view>
|
||||
<view class="uni-margin-wrap no-overflow">
|
||||
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
|
||||
<swiper
|
||||
class="swiper"
|
||||
:current="tabAct"
|
||||
:indicator-dots="false"
|
||||
:disable-touch="true"
|
||||
@change="swiperChange"
|
||||
>
|
||||
<swiper-item>
|
||||
<FavoritesCourse ref="courseRef"></FavoritesCourse>
|
||||
</swiper-item>
|
||||
@@ -32,18 +38,16 @@
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fixed-box">
|
||||
<view class="fixed-box" :class="{ 'fixed-box-hidden': tabAct === 1 }">
|
||||
<uv-button
|
||||
@click="redo_subject"
|
||||
type="primary"
|
||||
class="send_evaluate"
|
||||
color="#0066FF"
|
||||
:throttleTime="100"
|
||||
text='重做错题'
|
||||
text="重做错题"
|
||||
:custom-style="customStyle"
|
||||
|
||||
>
|
||||
|
||||
</uv-button>
|
||||
></uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -54,14 +58,15 @@
|
||||
// 我的收藏
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { LineBg } from '@/enum.js';
|
||||
import { queryTraCrsBbsInfoByCrsId, replyTraCrsBbsInfo, qryChildTraCrsBbsInfo } from '@/api/courseDetail.js';
|
||||
|
||||
import { queryMistakesAnswerByMisId, queryTraMistakesCollection } from '@/api/wrongQuestionRecord.js';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache } from '@/common/common';
|
||||
|
||||
const customStyle = {
|
||||
borderRadius: '16rpx'
|
||||
}
|
||||
};
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
|
||||
|
||||
const courseRef = ref(null);
|
||||
const correctRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
@@ -80,6 +85,23 @@
|
||||
const swiperChange = (item) => {
|
||||
tabAct.value = item.detail.current;
|
||||
};
|
||||
const redo_subject = async () => {
|
||||
// 重做错题
|
||||
|
||||
common.loading();
|
||||
queryTraMistakesCollection()
|
||||
.then((res) => {
|
||||
setPageCache('correct', {
|
||||
list: res.body,
|
||||
name: '错题本'
|
||||
});
|
||||
common.navigateTo('/pages/wrongQuestionRecord/correct');
|
||||
})
|
||||
.finally(() => {
|
||||
common.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
watch(
|
||||
tabAct,
|
||||
@@ -99,24 +121,29 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$bg-margin-left: 50rpx;
|
||||
|
||||
.fixed-box-hidden {
|
||||
height: 0 !important;
|
||||
}
|
||||
|
||||
.fixed-box {
|
||||
height: 156rpx;
|
||||
overflow: hidden; /* 关键:隐藏超出部分 */
|
||||
transition: height 0.3s ease-out;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-radius: 16rpx 16rpx 0px 0px;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
background: #ffffff;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 2rpx #E5E5E5;
|
||||
.send_evaluate{
|
||||
box-shadow: 0 2rpx 2rpx #e5e5e5;
|
||||
.send_evaluate {
|
||||
padding: 38rpx 52rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
background: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.my_tabs {
|
||||
// 解决这个圆角的图片,开穿透
|
||||
:deep(.uv-tabs__wrapper__nav__line) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<view class="max_page">
|
||||
<image src="@/static/images/common/wc.png" class="img"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -126,6 +126,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wrongQuestionRecord/correct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "错题本做题页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/examination/index",
|
||||
"style": {
|
||||
@@ -215,6 +224,25 @@
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/wrongQuestionRecord/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "答题本答题完成结果页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/practice/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "练习完成结果页",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user