Merge branch 'dev-20250930' of http://25.13.9.101:9000/K17_AITS/tra-app into dev-20250930
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view class="analysis_div" @click.stop="click_option()" :class="status">
|
||||
<view class="line">
|
||||
<text class="tr">维度评分:</text>
|
||||
<text class="td">{{ dimension_all_score }}</text>
|
||||
</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'">
|
||||
<rich-text :nodes="highlightedText" class="content" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick, computed, toRaw, watch } from 'vue';
|
||||
const emit = defineEmits(['click_option']);
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
required: false
|
||||
},
|
||||
judgeResult: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
},
|
||||
answerText: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: false
|
||||
}
|
||||
});
|
||||
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 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>`
|
||||
);
|
||||
});
|
||||
const dimension_all_score = computed(() => {
|
||||
return (
|
||||
evalSettingVos.value
|
||||
// 先通过map提取每个item的anlyGrade,不存在或非数字则取0
|
||||
.map((item) => (item?.anlyGrade && typeof item.anlyGrade === 'number' ? item.anlyGrade : 0))
|
||||
// 再通过reduce累加所有数值
|
||||
.reduce((total, current) => total + current, 0)
|
||||
);
|
||||
});
|
||||
watch(evalSettingVos.value, (newVal) => {
|
||||
console.log('newVal2', newVal);
|
||||
});
|
||||
const click_option = () => {
|
||||
emit('click_option', props.analysisVo);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.success {
|
||||
background-color: #e7f8ed;
|
||||
.td {
|
||||
color: #15b859;
|
||||
}
|
||||
:deep(.highlight) {
|
||||
color: #15b859;
|
||||
}
|
||||
}
|
||||
.error {
|
||||
background-color: #fce8e9;
|
||||
.td {
|
||||
color: #f5212d;
|
||||
}
|
||||
:deep(.highlight) {
|
||||
color: #f5212d;
|
||||
}
|
||||
}
|
||||
.your_answer{
|
||||
:deep(.highlight) {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.analysis_div {
|
||||
margin-top: 30rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
padding: 22rpx 15rpx 15rpx 34rpx;
|
||||
.line {
|
||||
margin: 12rpx 0;
|
||||
}
|
||||
.tr {
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.td {
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.your_answer{
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,57 +1,63 @@
|
||||
<template>
|
||||
<view class="talking-info" v-if="status === '02'">
|
||||
<view :class="['talking-gif', isPlaying ? 'is-play' : '']">
|
||||
<!-- <CommonLoading color="#fff" /> -->
|
||||
<view class="talking-line">
|
||||
<view class="talking-info" v-if="status === '02'">
|
||||
<view :class="['talking-gif', isPlaying ? 'is-play' : '']">
|
||||
<!-- <CommonLoading color="#fff" /> -->
|
||||
</view>
|
||||
<view class="right-time">{{ voiceTime }}</view>
|
||||
<view class="talking-cont">
|
||||
<text :class="['talking-text translate-text loading']" v-show="textShow">
|
||||
{{ showContent }}
|
||||
</text>
|
||||
<view class="talking-text translate-text" v-if="textLoading">
|
||||
<CommonLoading color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns-cont">
|
||||
<view class="play-btn">
|
||||
<image
|
||||
v-show="!isPlaying"
|
||||
class="icon"
|
||||
@click="playVoice"
|
||||
src="@/static/images/course/play-blue.png"
|
||||
style="width: 100%; height: 100%"
|
||||
></image>
|
||||
<image
|
||||
v-show="isPlaying"
|
||||
class="icon"
|
||||
@click.stop="playVoice"
|
||||
src="@/static/images/course/stop-blue.png"
|
||||
style="width: 100%; height: 100%"
|
||||
></image>
|
||||
</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>
|
||||
<view v-show="!props.isPreview && props.button_complete_show" class="btns-cont-button-text" @click.stop="buutton_click('complete')">
|
||||
完成
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-time">{{ voiceTime }}</view>
|
||||
<view class="talking-cont">
|
||||
<text :class="['talking-text translate-text loading']" v-show="textShow">
|
||||
{{ showContent }}
|
||||
</text>
|
||||
<view class="talking-text translate-text" v-if="textLoading">
|
||||
<!-- 01纯文字 -->
|
||||
<view class="talking-info talking-info-text" v-else-if="status === '01'">
|
||||
<view class="talking-cont">
|
||||
<text :class="['talking-text translate-text loading']">
|
||||
{{ showContent }}
|
||||
</text>
|
||||
</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>
|
||||
</view>
|
||||
<view class="talking-info talking-info-loading" v-else-if="status === '00'">
|
||||
<view :class="['talking-gif']">
|
||||
<CommonLoading color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns-cont">
|
||||
<view class="play-btn">
|
||||
<image
|
||||
v-show="!isPlaying"
|
||||
class="icon"
|
||||
@click="playVoice"
|
||||
src="@/static/images/course/play-blue.png"
|
||||
style="width: 100%; height: 100%"
|
||||
></image>
|
||||
<image
|
||||
v-show="isPlaying"
|
||||
class="icon"
|
||||
@click.stop="playVoice"
|
||||
src="@/static/images/course/stop-blue.png"
|
||||
style="width: 100%; height: 100%"
|
||||
></image>
|
||||
</view>
|
||||
<view class="text-btn" v-if="!textShow" @click.stop="translateVoice()">文</view>
|
||||
<view class="fl1"></view>
|
||||
<view class="btns-cont-button-text" @click.stop="buutton_click('again')">重答</view>
|
||||
<view class="btns-cont-button-text" @click.stop="buutton_click('complete')">完成</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 01纯文字 -->
|
||||
<view class="talking-info talking-info-text" v-else-if="status === '01'">
|
||||
<view class="talking-cont">
|
||||
<text :class="['talking-text translate-text loading']">
|
||||
{{ showContent }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="btns-cont">
|
||||
<view class="fl1"></view>
|
||||
<view class="btns-cont-button-text" @click.stop="buutton_click('again')">重答</view>
|
||||
<view 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'">
|
||||
<view :class="['talking-gif']">
|
||||
<CommonLoading color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -85,12 +91,23 @@
|
||||
default: '',
|
||||
type: String
|
||||
},
|
||||
isPreview: { // 是否是预览语音
|
||||
isPreview: {
|
||||
// 是否是预览语音
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
button_again_show: {
|
||||
// 是否显示重答按钮
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
button_complete_show: {
|
||||
// 是否显示重答按钮
|
||||
default: true,
|
||||
type: Boolean
|
||||
},
|
||||
});
|
||||
|
||||
console.log('props.isPreview', props.isPreview);
|
||||
const audioStore = useAudioStore();
|
||||
const { dataInfo } = toRefs(props);
|
||||
const status = computed(() => props.status);
|
||||
@@ -139,7 +156,7 @@
|
||||
console.log('点击播放');
|
||||
audioStore.playAudio();
|
||||
};
|
||||
let unsubscribe = () =>{};
|
||||
let unsubscribe = () => {};
|
||||
onMounted(() => {
|
||||
// 2. 监听 Store 中 isPlaying 的变化,实时同步
|
||||
unsubscribe = audioStore.$subscribe((mutation, state) => {
|
||||
@@ -174,12 +191,16 @@
|
||||
audioStore.stopAudio();
|
||||
// 2. 移除当前组件注册的回调(避免内存泄漏)
|
||||
audioStore.removeCallbacks();
|
||||
|
||||
|
||||
unsubscribe();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.talking-line {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.talking-info {
|
||||
padding: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
@@ -188,7 +209,6 @@
|
||||
position: relative;
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
float: right;
|
||||
|
||||
.talking-gif {
|
||||
width: 200rpx;
|
||||
@@ -220,14 +240,14 @@
|
||||
padding-bottom: 20rpx;
|
||||
width: auto;
|
||||
min-width: calc(100vw * 0.45);
|
||||
float: right;
|
||||
// float: right;
|
||||
.talking-cont {
|
||||
margin-top: 0rpx;
|
||||
// margin-top: 0rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.talking-cont {
|
||||
margin-top: 16rpx;
|
||||
// margin-top: 16rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.talking-text {
|
||||
@@ -251,7 +271,7 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
margin-top: 22rpx;
|
||||
margin-top: 14rpx;
|
||||
.replay-btn {
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
@@ -321,7 +341,7 @@
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-left: 10rpx;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
:isPreview="props.isPreview"
|
||||
:activeVoiceId="subject_data.qnsId"
|
||||
@buutton_click="questionButtonClick"
|
||||
:button_complete_show="props.mode === 'practice'"
|
||||
></questionVue>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -62,17 +63,31 @@
|
||||
确定
|
||||
</uv-button>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="analysis_div"
|
||||
v-if="!clearResult && ['study', 'mistake', 'settlement', 'practice'].includes(props.mode)"
|
||||
>
|
||||
<view class="analysis_title">
|
||||
<view class="analysis_title" v-if="qnsTyp !== 'ES'">
|
||||
<view class="success_answer">正确答案:{{ correctResultLabel.join('') }}</view>
|
||||
<view class="your_answer">
|
||||
你的答案:
|
||||
<text :class="right_or_wrong_class ? 'success' : 'error'">{{ myResultLabel.join('') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<esAnalysis
|
||||
v-if="qnsTyp === 'ES'"
|
||||
:value="subject_data.itemVos[0]"
|
||||
:judgeResult="judgeResultStatus"
|
||||
:answerText="subject_data.anserResult"
|
||||
></esAnalysis>
|
||||
|
||||
<!-- 问答题专属参考答案 -->
|
||||
<view class="reference_answer" v-if="qnsTyp === 'ES'">
|
||||
<view class="reference_answer_title">参考答案:</view>
|
||||
{{ subject_data.itemVos[0]?.itemAnswer ?? '' }}
|
||||
</view>
|
||||
|
||||
<view class="analysis_note">题目解析:{{ subject_data?.analyContent }}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -82,6 +97,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick, computed, getCurrentInstance } from 'vue';
|
||||
import radioSubjectItem from './radio-subject-item.vue';
|
||||
import esAnalysis from './es-analysis.vue';
|
||||
import questionVue from './question.vue';
|
||||
import { markIcon, feedbackIcon } from '@/common/imgSvg';
|
||||
import { SUBJECT_TYPE } from '@/enum.js';
|
||||
@@ -132,7 +148,7 @@
|
||||
const isExpanded = ref(false);
|
||||
const wrapperRef = ref(null);
|
||||
const contentRef = ref(null);
|
||||
|
||||
const judgeResultStatus = computed(() => props.item.judgeResult === 'P');
|
||||
const animationStyle = ref({
|
||||
height: '0px',
|
||||
overflow: 'hidden',
|
||||
@@ -271,14 +287,7 @@
|
||||
};
|
||||
|
||||
// 初始化动画
|
||||
onMounted(() => {
|
||||
// // 创建动画实例
|
||||
// animation = uni.createAnimation({
|
||||
// duration: 300,
|
||||
// timingFunction: 'ease-in-out',
|
||||
// delay: 0
|
||||
// });
|
||||
});
|
||||
onMounted(() => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -318,7 +327,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 32rpx 0 28rpx 0;
|
||||
margin: 32rpx 0 0 0;
|
||||
|
||||
.success_answer {
|
||||
}
|
||||
@@ -341,6 +350,22 @@
|
||||
line-height: 48rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
.reference_answer {
|
||||
.reference_answer_title {
|
||||
font-weight: 700;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
text-align: left;
|
||||
line-height: 30rpx;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
line-height: 48rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.item {
|
||||
|
||||
@@ -9,8 +9,18 @@
|
||||
<view class="title_div">
|
||||
<view class="name">{{ item.userName }}</view>
|
||||
<view class="title_tip">
|
||||
<image class="img" v-if="item.bbsTag === 'ASK'" src="@/static/images/courseDetail/ASK.png" mode="widthFix"></image>
|
||||
<image class="img" v-if="item.bbsTag === 'SUG'" src="@/static/images/courseDetail/SUG.png" mode="widthFix"></image>
|
||||
<image
|
||||
class="img"
|
||||
v-if="item.bbsTag === 'ASK'"
|
||||
src="@/static/images/courseDetail/ASK.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<image
|
||||
class="img"
|
||||
v-if="item.bbsTag === 'SUG'"
|
||||
src="@/static/images/courseDetail/SUG.png"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</view>
|
||||
<!-- <view class="title_tip">{{item.bbsTagDesc}}</view> -->
|
||||
</view>
|
||||
@@ -385,7 +395,7 @@
|
||||
.title_div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.name {
|
||||
height: 35rpx;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
@@ -395,7 +405,6 @@
|
||||
line-height: 35rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
|
||||
.title_tip {
|
||||
@@ -471,7 +480,7 @@
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #0066FF;
|
||||
color: #0066ff;
|
||||
line-height: 30rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
@@ -198,7 +198,6 @@
|
||||
common.loading();
|
||||
startExamByCrs({
|
||||
crsId: crsId.value
|
||||
// crsId: 'CRS0250181220722025070408313900000018729'
|
||||
})
|
||||
.then((res) => {
|
||||
setPageCache('examination', {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<uni-popup ref="PopupRef" class="popup">
|
||||
<uni-popup ref="PopupRef" class="popup" :mask-click="false">
|
||||
<view class="popup_div">
|
||||
<view class="title_div">
|
||||
<!-- 1. 插槽优先 -->
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<view
|
||||
class="feedback_item"
|
||||
:class="{ feedback_item_clidked: feedbackInfo.type.includes(feedback_type_item.value) }"
|
||||
@click="feedback_item_click(feedback_type_item.label)"
|
||||
@click="feedback_item_click(feedback_type_item.value)"
|
||||
v-for="feedback_type_item in feedbackTypeList"
|
||||
>
|
||||
{{ feedback_type_item.label }}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</view>
|
||||
<view class="question">
|
||||
<view class="grey">剩余时间</view>
|
||||
<uv-count-down :time="paperData.limitTm * 1000" format="HH:mm:ss"></uv-count-down>
|
||||
<uv-count-down :time="paperData.limitTm * 1000" format="HH:mm:ss" @finish="finish"></uv-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="progress">
|
||||
@@ -66,6 +66,7 @@
|
||||
type="primary"
|
||||
:throttleTime="100"
|
||||
text="上一题"
|
||||
:disabled="questionNumber === 0"
|
||||
color="#E2EDFF"
|
||||
custom-style="color:#0066FF;borderRadius:16rpx;height:92rpx;"
|
||||
@click="button_tab(-1)"
|
||||
@@ -87,7 +88,7 @@
|
||||
class="talk-btns"
|
||||
ref="touchBtnRef"
|
||||
@submit="touchBtnSubmit"
|
||||
loadingText="问题回答中,请在问题回答结束后重试!"
|
||||
disabledText="只能进行一条回答"
|
||||
:isLoading="!answerIsOver"
|
||||
:isDisabled="touchIsDisabled"
|
||||
/>
|
||||
@@ -220,6 +221,11 @@
|
||||
questionNumber.value = item.detail.current;
|
||||
};
|
||||
|
||||
// 倒计时结束
|
||||
const finish = (item) => {
|
||||
console.log('倒计时结束自动交卷');
|
||||
};
|
||||
|
||||
// 按上一题下一题
|
||||
const button_tab = (num) => {
|
||||
let newNumber = questionNumber.value + num;
|
||||
@@ -231,7 +237,7 @@
|
||||
}
|
||||
questionNumber.value = newNumber;
|
||||
};
|
||||
|
||||
|
||||
// 打开或者关闭弹出层
|
||||
const openSheet = (status) => (status ? popupRef.value.open('bottom') : popupRef.value.close());
|
||||
|
||||
@@ -246,6 +252,10 @@
|
||||
} else if (type === 'feedback') {
|
||||
console.log('feedbackRef.value', feedbackRef.value);
|
||||
feedbackRef.value.open(params.qnsId);
|
||||
} else if (type === 'again') {
|
||||
// 问答题点击重答
|
||||
topic.value.my_answer = {};
|
||||
topic.value.es_status = ''; // 取消转圈
|
||||
}
|
||||
};
|
||||
|
||||
@@ -278,7 +288,9 @@
|
||||
});
|
||||
} else if (type === 'text') {
|
||||
topic.value.es_status = '01';
|
||||
topic.value.anserResult = submitObj; // 正确答案文字内容
|
||||
topic.value.my_answer = {
|
||||
anserResult: submitObj // 正确答案文字内容
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -291,7 +303,7 @@
|
||||
}
|
||||
// 记录起始时间
|
||||
examinationStartTime = new Date().getTime();
|
||||
|
||||
|
||||
paperData.crsId = examination.crsId;
|
||||
paperData.execId = examination.execId;
|
||||
paperData.examId = examination.examId;
|
||||
|
||||
+183
-179
@@ -6,10 +6,15 @@
|
||||
<image src="@/static/images/index/bg.png" class="bg_img"></image>
|
||||
<view class="fixed_search_div" v-show="opacity" :style="{ opacity: opacity }">
|
||||
<view class="fixed_search_input_div" @click="goto_search_page">
|
||||
<uv-input shape="circle" :customStyle="fixedCustomStyles"
|
||||
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入关键字" suffixIcon="search"
|
||||
:suffixIconStyle="suffixIconStyle" :readonly="true">
|
||||
</uv-input>
|
||||
<uv-input
|
||||
shape="circle"
|
||||
:customStyle="fixedCustomStyles"
|
||||
placeholderStyle="color:#999999;font-size:26rpx"
|
||||
placeholder="请输入关键字"
|
||||
suffixIcon="search"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:readonly="true"
|
||||
></uv-input>
|
||||
</view>
|
||||
<view class="message_div">
|
||||
<image src="@/static/images/index/message_b.png" class="message_img"></image>
|
||||
@@ -17,7 +22,6 @@
|
||||
<view class="message_num message_num_font">30</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 文字logo -->
|
||||
<view class="title_logo">
|
||||
<image src="@/static/images/index/logo_text.png" class="log_img" mode="heightFix"></image>
|
||||
@@ -25,28 +29,38 @@
|
||||
</view>
|
||||
<!-- 搜索框 -->
|
||||
<view class="search_div">
|
||||
<uv-input shape="circle" @click="goto_search_page" :customStyle="customStyles"
|
||||
:placeholderStyle="placeholderStyle" placeholder="请输入关键字" suffixIcon="search"
|
||||
:suffixIconStyle="suffixIconStyle" :readonly="true">
|
||||
</uv-input>
|
||||
<uv-input
|
||||
shape="circle"
|
||||
@click="goto_search_page"
|
||||
:customStyle="customStyles"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
placeholder="请输入关键字"
|
||||
suffixIcon="search"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:readonly="true"
|
||||
></uv-input>
|
||||
<view class="message_div">
|
||||
<image src="@/static/images/index/message.png" class="message_img"></image>
|
||||
<view class="message_text">消息</view>
|
||||
<view class="message_num message_num_font">
|
||||
30
|
||||
</view>
|
||||
<view class="message_num message_num_font">30</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 滚动通知 -->
|
||||
<view class="notice_div">
|
||||
<uv-notice-bar v-show="notice_text.length" :text="notice_text" :bgColor="null"
|
||||
color="rgba(255,255,255,0.7)" :speed="40" direction="column"></uv-notice-bar>
|
||||
<uv-notice-bar
|
||||
v-show="notice_text.length"
|
||||
:text="notice_text"
|
||||
:bgColor="null"
|
||||
color="rgba(255,255,255,0.7)"
|
||||
:speed="40"
|
||||
direction="column"
|
||||
></uv-notice-bar>
|
||||
</view>
|
||||
<!-- 学习时长和飞天兔子,为了挡住部分兔子只能多一个盒子 -->
|
||||
<view class="study_duration_and_profile_div">
|
||||
<!-- 飞天兔子 -->
|
||||
<view class="profile_div">
|
||||
<image :src="mascotInfo?.imgAddr ||''" alt="" class="profile" mode="widthFix"></image>
|
||||
<image :src="mascotInfo?.imgAddr || ''" alt="" class="profile" mode="widthFix"></image>
|
||||
<!-- <image src="/static/images/index/fttz.png" class="profile"></image> -->
|
||||
</view>
|
||||
<!-- 学习时长 -->
|
||||
@@ -54,24 +68,38 @@
|
||||
<view class="item">
|
||||
<view class="top">本年学习时长</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to :startVal="statistics_data['startStdtTmLen']"
|
||||
:endVal="statistics_data['stdtTmLen']" :useEasing="true" :decimals="1"
|
||||
ref="stdtTmLenRef"></uv-count-to>h
|
||||
<uv-count-to
|
||||
:startVal="statistics_data['startStdtTmLen']"
|
||||
:endVal="statistics_data['stdtTmLen']"
|
||||
:useEasing="true"
|
||||
:decimals="1"
|
||||
ref="stdtTmLenRef"
|
||||
></uv-count-to>
|
||||
h
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="top">累计训练次数</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to :startVal="statistics_data['startAccmExamCnt']"
|
||||
:endVal="statistics_data['accmExamCnt']" :useEasing="true"
|
||||
ref="accmExamCntRef"></uv-count-to><span class="number">次</span>
|
||||
<uv-count-to
|
||||
:startVal="statistics_data['startAccmExamCnt']"
|
||||
:endVal="statistics_data['accmExamCnt']"
|
||||
:useEasing="true"
|
||||
ref="accmExamCntRef"
|
||||
></uv-count-to>
|
||||
<span class="number">次</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="top">累计考试次数</view>
|
||||
<view class="bottom"><uv-count-to :startVal="statistics_data['starAccmPracticeCnt']"
|
||||
:endVal="statistics_data['accmPracticeCnt']" :useEasing="true"
|
||||
ref="accmPracticeCntRef"></uv-count-to><span class="number">次</span>
|
||||
<view class="bottom">
|
||||
<uv-count-to
|
||||
:startVal="statistics_data['starAccmPracticeCnt']"
|
||||
:endVal="statistics_data['accmPracticeCnt']"
|
||||
:useEasing="true"
|
||||
ref="accmPracticeCntRef"
|
||||
></uv-count-to>
|
||||
<span class="number">次</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -83,12 +111,14 @@
|
||||
<image class="icon" src="@/static/images/index/navigation_course.png"></image>
|
||||
<view class="title">AI学习</view>
|
||||
</view>
|
||||
<view class="item"
|
||||
@click="common.navigateTo('/pages/index/dialog',{ animationType: 'slide-in-bottom'})">
|
||||
<view
|
||||
class="item"
|
||||
@click="common.navigateTo('/pages/index/dialog', { animationType: 'slide-in-bottom' })"
|
||||
>
|
||||
<image class="icon" src="@/static/images/index/navigation_question_answering.png"></image>
|
||||
<view class="title">AI问答</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="item">
|
||||
<image class="icon" src="@/static/images/index/navigation_ai.png"></image>
|
||||
<view class="title">AI陪练</view>
|
||||
@@ -127,18 +157,24 @@
|
||||
<!-- 热门课程 -->
|
||||
<view class="hot_class_div">
|
||||
<scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false">
|
||||
<view class="scroll-view-item" v-for="(item,index) in hot_class_list" :key="index">
|
||||
<view class="scroll-view-item" v-for="(item, index) in hot_class_list" :key="index">
|
||||
<view class="item_div">
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsId)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
|
||||
:isCache="true" :width="240" :height="240"></image-preview>
|
||||
<image-preview
|
||||
class="img-box img"
|
||||
:imgId="item.imgId"
|
||||
mode="aspectFill"
|
||||
:isCache="true"
|
||||
:width="240"
|
||||
:height="240"
|
||||
></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
<view class="title ellipsis-text">{{ item.crsName }}</view>
|
||||
<view class="note ellipsis-text">
|
||||
更新:{{(item.mtTime||'').substr(0, 10)}} 丨已学:{{item.accmStdyCnt}}
|
||||
更新:{{ (item.mtTime || '').substr(0, 10) }} 丨已学:{{ item.accmStdyCnt }}
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<view class="button">去学习</view>
|
||||
@@ -161,18 +197,24 @@
|
||||
<!-- 推荐课程 -->
|
||||
<view class="hot_class_div">
|
||||
<scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false">
|
||||
<view class="scroll-view-item" v-for="(item,index) in recommend_class_list" :key="index">
|
||||
<view class="scroll-view-item" v-for="(item, index) in recommend_class_list" :key="index">
|
||||
<view class="item_div">
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsId)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
|
||||
:isCache="true" :width="240" :height="240"></image-preview>
|
||||
<image-preview
|
||||
class="img-box img"
|
||||
:imgId="item.imgId"
|
||||
mode="aspectFill"
|
||||
:isCache="true"
|
||||
:width="240"
|
||||
:height="240"
|
||||
></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
<view class="title ellipsis-text">{{ item.crsName }}</view>
|
||||
<view class="note ellipsis-text">
|
||||
更新:{{(item.mtTime||'').substr(0, 10)}} 丨已学:{{item.accmStdyCnt}}
|
||||
更新:{{ (item.mtTime || '').substr(0, 10) }} 丨已学:{{ item.accmStdyCnt }}
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<view class="button">去学习</view>
|
||||
@@ -194,18 +236,24 @@
|
||||
<!-- 最新课程 -->
|
||||
<view class="hot_class_div">
|
||||
<scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false">
|
||||
<view class="scroll-view-item" v-for="(item,index) in new_class_list" :key="index">
|
||||
<view class="scroll-view-item" v-for="(item, index) in new_class_list" :key="index">
|
||||
<view class="item_div">
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsId)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill"
|
||||
:isCache="true" :width="240" :height="240"></image-preview>
|
||||
<image-preview
|
||||
class="img-box img"
|
||||
:imgId="item.imgId"
|
||||
mode="aspectFill"
|
||||
:isCache="true"
|
||||
:width="240"
|
||||
:height="240"
|
||||
></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
<view class="title ellipsis-text">{{ item.crsName }}</view>
|
||||
<view class="note ellipsis-text">
|
||||
更新:{{(item.mtTime||'').substr(0, 10)}} 丨已学:{{item.accmStdyCnt}}
|
||||
更新:{{ (item.mtTime || '').substr(0, 10) }} 丨已学:{{ item.accmStdyCnt }}
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<view class="button">去学习</view>
|
||||
@@ -218,7 +266,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottom_line">
|
||||
<uv-divider text='我是有底线的' lineColor="#9cB0DC" :hairline="true"></uv-divider>
|
||||
<uv-divider text="我是有底线的" lineColor="#9cB0DC" :hairline="true"></uv-divider>
|
||||
</view>
|
||||
</view>
|
||||
<tabbar-shadow></tabbar-shadow>
|
||||
@@ -226,40 +274,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
onBeforeMount,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onLoad,
|
||||
onHide
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
customStyles,
|
||||
fixedCustomStyles,
|
||||
placeholderStyle,
|
||||
suffixIconStyle
|
||||
} from './index.js'
|
||||
import {
|
||||
getUserInfo
|
||||
} from '@/common/common';
|
||||
import { computed, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
|
||||
import { onShow, onPageScroll, onLoad, onHide } from '@dcloudio/uni-app';
|
||||
import { customStyles, fixedCustomStyles, placeholderStyle, suffixIconStyle } from './index.js';
|
||||
import { getUserInfo } from '@/common/common';
|
||||
|
||||
import common from '@/common/common'
|
||||
import {
|
||||
setMascot
|
||||
} from "@/common/mascot.js"
|
||||
import {
|
||||
getStatisticsData,
|
||||
queryCrsInfoByLastnew,
|
||||
queryCrsInfoByPopular,
|
||||
queryCrsInfoByRecmd,
|
||||
} from '@/api/index.js'
|
||||
import common from '@/common/common';
|
||||
import { setMascot } from '@/common/mascot.js';
|
||||
import { getStatisticsData, queryCrsInfoByLastnew, queryCrsInfoByPopular, queryCrsInfoByRecmd } from '@/api/index.js';
|
||||
|
||||
const scrollTop = ref(0);
|
||||
const mascotShow = ref(false);
|
||||
@@ -280,28 +302,31 @@
|
||||
|
||||
// 首页滑动事件监听
|
||||
onPageScroll((e) => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
scrollTop.value = e.scrollTop;
|
||||
});
|
||||
// 滚动消息
|
||||
const notice_text = ref(['绿色金融政策解析与商业银行绿色水水水水水水水水水水水水水', '绿色金融政策解析与商业银行红色'])
|
||||
const init_class_data = [{
|
||||
crsNum: '',
|
||||
img: '',
|
||||
crsName: '',
|
||||
issuTm: '',
|
||||
accmStdyCnt: ''
|
||||
}, {
|
||||
crsNum: '',
|
||||
img: '',
|
||||
crsName: '',
|
||||
issuTm: '',
|
||||
accmStdyCnt: ''
|
||||
}]
|
||||
const notice_text = ref(['绿色金融政策解析与商业银行绿色水水水水水水水水水水水水水', '绿色金融政策解析与商业银行红色']);
|
||||
const init_class_data = [
|
||||
{
|
||||
crsNum: '',
|
||||
img: '',
|
||||
crsName: '',
|
||||
issuTm: '',
|
||||
accmStdyCnt: ''
|
||||
},
|
||||
{
|
||||
crsNum: '',
|
||||
img: '',
|
||||
crsName: '',
|
||||
issuTm: '',
|
||||
accmStdyCnt: ''
|
||||
}
|
||||
];
|
||||
// 热门课程
|
||||
const hot_class_list = ref([...init_class_data])
|
||||
const new_class_list = ref([...init_class_data])
|
||||
const recommend_class_list = ref([...init_class_data])
|
||||
const mascotInfo = ref({})
|
||||
const hot_class_list = ref([...init_class_data]);
|
||||
const new_class_list = ref([...init_class_data]);
|
||||
const recommend_class_list = ref([...init_class_data]);
|
||||
const mascotInfo = ref({});
|
||||
const statistics_data = reactive({
|
||||
stdtTmLen: 0, // 学习
|
||||
accmPracticeCnt: 0, // 训练
|
||||
@@ -310,15 +335,16 @@
|
||||
startAccmPracticeCnt: 0, // 起始训练
|
||||
startAccmExamCnt: 0, // 起始考试
|
||||
request_time: 0, // 上次请求时间
|
||||
init: function() { // 初始化统计数据
|
||||
const index_statistics_data = common.getValue('statistics_data') // 获取缓存
|
||||
init: function () {
|
||||
// 初始化统计数据
|
||||
const index_statistics_data = common.getValue('statistics_data'); // 获取缓存
|
||||
if (index_statistics_data) {
|
||||
this.stdtTmLen = index_statistics_data.stdtTmLen;
|
||||
this.accmPracticeCnt = index_statistics_data.accmPracticeCnt;
|
||||
this.accmExamCnt = index_statistics_data.accmExamCnt;
|
||||
}
|
||||
},
|
||||
get_statistics_data: async function() {
|
||||
get_statistics_data: async function () {
|
||||
try {
|
||||
const time_now = Date.now();
|
||||
let statistics_data = common.getValue('statistics_data') || {};
|
||||
@@ -340,27 +366,24 @@
|
||||
}
|
||||
|
||||
// 解构赋值获取最新值
|
||||
const {
|
||||
accmExamCnt = 0, accmPracticeCnt = 0, stdtTmLen = 0
|
||||
} = statistics_data;
|
||||
const { accmExamCnt = 0, accmPracticeCnt = 0, stdtTmLen = 0 } = statistics_data;
|
||||
|
||||
// 更新数据并触发动画
|
||||
if (stdtTmLen !== this.stdtTmLen) {
|
||||
this.startStdtTmLen = this.stdtTmLen
|
||||
this.stdtTmLen = stdtTmLen
|
||||
stdtTmLenRef.value.start()
|
||||
this.startStdtTmLen = this.stdtTmLen;
|
||||
this.stdtTmLen = stdtTmLen;
|
||||
stdtTmLenRef.value.start();
|
||||
}
|
||||
if (accmPracticeCnt !== this.accmPracticeCnt) {
|
||||
this.startAccmPracticeCnt = this.accmPracticeCnt
|
||||
this.accmPracticeCnt = accmPracticeCnt
|
||||
accmPracticeCntRef.value.start()
|
||||
this.startAccmPracticeCnt = this.accmPracticeCnt;
|
||||
this.accmPracticeCnt = accmPracticeCnt;
|
||||
accmPracticeCntRef.value.start();
|
||||
}
|
||||
if (accmExamCnt !== this.accmExamCnt) {
|
||||
this.startAccmExamCnt = this.accmExamCnt
|
||||
this.accmExamCnt = accmExamCnt
|
||||
accmExamCntRef.value.start()
|
||||
this.startAccmExamCnt = this.accmExamCnt;
|
||||
this.accmExamCnt = accmExamCnt;
|
||||
accmExamCntRef.value.start();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
// 可以在这里添加更多的错误处理逻辑,比如显示错误提示
|
||||
@@ -368,72 +391,70 @@
|
||||
}
|
||||
});
|
||||
|
||||
const index = ref(0)
|
||||
const index = ref(0);
|
||||
const ai_test = () => {
|
||||
index.value++
|
||||
index.value++;
|
||||
if (index.value == 4) {
|
||||
index.value = 1
|
||||
index.value = 1;
|
||||
}
|
||||
uni.setTabBarStyle({
|
||||
midButton: {
|
||||
iconPath: "/static/images/icon/fawn-" + index.value + ".png",
|
||||
width: "86px",
|
||||
height: "86px",
|
||||
iconWidth: "90px"
|
||||
},
|
||||
})
|
||||
}
|
||||
iconPath: '/static/images/icon/fawn-' + index.value + '.png',
|
||||
width: '86px',
|
||||
height: '86px',
|
||||
iconWidth: '90px'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 进入搜索页
|
||||
const goto_search_page = () => {
|
||||
common.navigateTo('/pages/search/search')
|
||||
}
|
||||
common.navigateTo('/pages/search/search');
|
||||
};
|
||||
// 进入课程详情页
|
||||
const goto_course_detail = (crsId) => {
|
||||
common.navigateTo('/pages/courseDetail/index?crsId=' + crsId)
|
||||
}
|
||||
common.navigateTo('/pages/courseDetail/index?crsId=' + crsId);
|
||||
};
|
||||
const scrolltolower = () => {
|
||||
common.navigateTo('/pages/index/dialog', {
|
||||
animationType: 'slide-in-bottom'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
onLoad(() => {
|
||||
statistics_data['init'](); // 初始化数据
|
||||
// 检测如果没设置吉祥物,跳转到吉祥物界面
|
||||
// 判断下如果没有设置吉祥物就跳转到吉祥物页面
|
||||
const userInfo = getUserInfo()
|
||||
if (userInfo?.mascotInfo.mascotId === null) { //说明这人在上次选吉祥物的时候退出了,没有选到吉祥物
|
||||
const userInfo = getUserInfo();
|
||||
if (userInfo?.mascotInfo.mascotId === null) {
|
||||
//说明这人在上次选吉祥物的时候退出了,没有选到吉祥物
|
||||
common.redirectTo('/pages/mascot/mascot_select_list');
|
||||
return
|
||||
return;
|
||||
}
|
||||
})
|
||||
});
|
||||
onShow(() => {
|
||||
if (!common.isLogin()) {
|
||||
common.navigateTo('/pages/login/login')
|
||||
return
|
||||
common.navigateTo('/pages/login/login');
|
||||
return;
|
||||
}
|
||||
const userInfo = getUserInfo()
|
||||
const userInfo = getUserInfo();
|
||||
if (userInfo) {
|
||||
mascotInfo.value = userInfo?.mascotInfo
|
||||
mascotInfo.value = userInfo?.mascotInfo;
|
||||
}
|
||||
setMascot()
|
||||
statistics_data['get_statistics_data']() // 获取统计数据
|
||||
queryCrsInfoByLastnew().then(res => {
|
||||
new_class_list.value = res.body
|
||||
})
|
||||
queryCrsInfoByPopular().then(res => {
|
||||
hot_class_list.value = res.body
|
||||
})
|
||||
queryCrsInfoByRecmd().then(res => {
|
||||
recommend_class_list.value = res.body
|
||||
})
|
||||
})
|
||||
onHide(() => {
|
||||
|
||||
})
|
||||
setMascot();
|
||||
statistics_data['get_statistics_data'](); // 获取统计数据
|
||||
queryCrsInfoByLastnew().then((res) => {
|
||||
new_class_list.value = res.body;
|
||||
});
|
||||
queryCrsInfoByPopular().then((res) => {
|
||||
hot_class_list.value = res.body;
|
||||
});
|
||||
queryCrsInfoByRecmd().then((res) => {
|
||||
recommend_class_list.value = res.body;
|
||||
});
|
||||
});
|
||||
onHide(() => {});
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
$bg-margin-left: 30rpx;
|
||||
|
||||
@@ -471,7 +492,6 @@
|
||||
padding: 32rpx 22rpx 36rpx 26rpx;
|
||||
}
|
||||
|
||||
|
||||
.item_div {
|
||||
width: 562rpx;
|
||||
display: block;
|
||||
@@ -517,32 +537,28 @@
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
|
||||
.button_div {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
.button {
|
||||
text-align: center;
|
||||
line-height: 62rpx;
|
||||
width: 138rpx;
|
||||
height: 62rpx;
|
||||
background: #EBF1FF;
|
||||
background: #ebf1ff;
|
||||
border-radius: 30rpx;
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
color: #0066FF;
|
||||
color: #0066ff;
|
||||
font-style: normal;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.bg_div {
|
||||
@@ -574,7 +590,6 @@
|
||||
margin-left: 10rpx;
|
||||
// width: 300rpx;
|
||||
height: 50rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -629,7 +644,6 @@
|
||||
// font-size: 10rpx;
|
||||
// font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.message_num_font {
|
||||
@@ -641,7 +655,6 @@
|
||||
font-size: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 搜索框
|
||||
@@ -672,7 +685,7 @@
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
line-height: 24rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -688,7 +701,6 @@
|
||||
// height: 20rpx;
|
||||
// font-size: 10rpx;
|
||||
color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.message_num_font {
|
||||
@@ -735,7 +747,6 @@
|
||||
// :deep(.u-notice__left-icon) {
|
||||
// margin-right: 5rpx;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// 学习时长
|
||||
@@ -758,13 +769,13 @@
|
||||
|
||||
.study_duration_div {
|
||||
height: 162rpx;
|
||||
background: linear-gradient(180deg, rgba(238, 246, 255, 0.65) 0%, #C5DFFD 4%, #FFFFFF 100%);
|
||||
background: linear-gradient(180deg, rgba(238, 246, 255, 0.65) 0%, #c5dffd 4%, #ffffff 100%);
|
||||
|
||||
border-radius: 23rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
z-index: 20;
|
||||
opacity: .9;
|
||||
opacity: 0.9;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
@@ -793,7 +804,6 @@
|
||||
font-style: normal;
|
||||
text-align: center;
|
||||
|
||||
|
||||
// 数字滚动组件
|
||||
:deep(.uv-count-num) {
|
||||
font-weight: bold !important;
|
||||
@@ -802,7 +812,6 @@
|
||||
}
|
||||
|
||||
.number {
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
@@ -817,12 +826,12 @@
|
||||
.navigation_div {
|
||||
margin: 16rpx $bg-margin-left 0 $bg-margin-left;
|
||||
height: 338rpx;
|
||||
background-color: #FFFFFF;
|
||||
background-color: #ffffff;
|
||||
border-radius: 23rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
box-shadow: #E6E8EF 0 5rpx 20rpx;
|
||||
box-shadow: #e6e8ef 0 5rpx 20rpx;
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
@@ -863,16 +872,13 @@
|
||||
|
||||
.icon {
|
||||
margin-right: 6rpx;
|
||||
|
||||
}
|
||||
|
||||
.icon_1 {
|
||||
|
||||
.img {
|
||||
width: 31rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.icon_2 {
|
||||
@@ -885,7 +891,6 @@
|
||||
}
|
||||
|
||||
.icon_3 {
|
||||
|
||||
// margin-top: 10rpx;
|
||||
.img {
|
||||
width: 38rpx;
|
||||
@@ -895,7 +900,7 @@
|
||||
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
color: #323E57;
|
||||
color: #323e57;
|
||||
font-weight: 700;
|
||||
line-height: 46rpx;
|
||||
text-align: left;
|
||||
@@ -903,10 +908,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.main_div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #F6F8FF;
|
||||
background-color: #f6f8ff;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
+138
-99
@@ -38,6 +38,7 @@
|
||||
@change="swiperChange"
|
||||
:current="questionNumber"
|
||||
easing-function="linear"
|
||||
@transition="transition"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in topicList">
|
||||
<view class="content">
|
||||
@@ -62,9 +63,7 @@
|
||||
ref="touchBtnRef"
|
||||
class="talk-btns"
|
||||
@submit="touchBtnSubmit"
|
||||
loadingText="问题回答中,请在问题回答结束后重试!"
|
||||
disabledText="只能进行一条回答"
|
||||
:isLoading="!answerIsOver"
|
||||
:isDisabled="touchIsDisabled"
|
||||
/>
|
||||
</view>
|
||||
@@ -72,24 +71,26 @@
|
||||
<!-- 反馈组件 -->
|
||||
<Feedback ref="feedbackRef"></Feedback>
|
||||
<!-- 结尾弹出层 -->
|
||||
<!-- <Dialog ref="dialogRef" :dialogConfiguration="dialogConfiguration" @button_click="result_click"></Dialog> -->
|
||||
<Dialog ref="dialogRef" :dialogConfiguration="dialogConfiguration" @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 './components/dialog.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 { ref, reactive, computed, onMounted, nextTick, onUnmounted } from 'vue';
|
||||
import { onLoad, onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache, formatSeconds, getPageCache } from '@/common/common';
|
||||
import { setPageCache, formatSeconds, getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { optionErrorIcon, examinationSheetIcon } from '@/common/imgSvg';
|
||||
import { practiceAnswer, practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
|
||||
const answerIsOver = ref(true);
|
||||
import { startExamByCrs } from '@/api/examination.js';
|
||||
import { startPracticeByCrs } from '@/api/practice.js';
|
||||
const feedbackRef = ref(null);
|
||||
const dialogRef = ref(null);
|
||||
const touchBtnRef = ref(null);
|
||||
@@ -109,11 +110,13 @@
|
||||
const popup_input_bottom = ref('0px');
|
||||
const questionNumber = ref(0); // 题号
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
const topic = computed({
|
||||
get: () => topicList[questionNumber.value],
|
||||
set: (val) => (topicList[questionNumber.value] = val)
|
||||
});
|
||||
|
||||
const isLastTopic = computed(() => topicList.length === questionNumber.value + 1);
|
||||
const showTouchBtn = computed(() => {
|
||||
return topic.value?.qnsTyp === 'ES';
|
||||
});
|
||||
@@ -134,12 +137,23 @@
|
||||
// 弹出框配置
|
||||
const dialogConfiguration = reactive({});
|
||||
|
||||
// 滑动切换
|
||||
const swiperChange = (item) => {
|
||||
questionNumber.value = item.detail.current;
|
||||
};
|
||||
const isTriggered = ref(false); // 下面这个得防抖
|
||||
// 滑动发生改变
|
||||
const transition = (event) => {
|
||||
if (isTriggered.value) return;
|
||||
const dx = event.detail.dx;
|
||||
if (dx > 50 && 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);
|
||||
@@ -169,7 +183,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
// 单题回答(没有问答题)
|
||||
// 单题回答
|
||||
const submitProblem = (answer) => {
|
||||
console.log('答题内容', answer);
|
||||
console.log('答单题', topic);
|
||||
@@ -178,41 +192,54 @@
|
||||
exrId: paperData.exrId,
|
||||
ossKey: '',
|
||||
qnsId: topic.value.qnsId,
|
||||
examLenTm: practiceTime.value, // 练习时长
|
||||
...answer
|
||||
})
|
||||
.then(async (res) => {
|
||||
topic.value.isPreview = true; // 不能在点击了,打开预览模式
|
||||
let traQnsInfoVo;
|
||||
// 是问答题
|
||||
console.log('是问答题', topic.value.qnsTyp);
|
||||
if (topic.value.qnsTyp === 'ES') {
|
||||
const result = await queryWithRetry(res.body.execLogId);
|
||||
traQnsInfoVo = result.body.traQnsInfoVo;
|
||||
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.traQnsInfoVo;
|
||||
}
|
||||
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为错误
|
||||
if (!addProblem()) {
|
||||
// 返回false说明到了最后一题
|
||||
console.log('最后一题');
|
||||
if (topic.value.qnsTyp === 'ES') {
|
||||
// 最后一题是问答题,暂时不动
|
||||
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');
|
||||
}
|
||||
}
|
||||
// 自动切换下一题的条件
|
||||
if (
|
||||
judgeResultStatus && // 条件1.答题正确
|
||||
topic.value.qnsTyp !== 'ES' && // 问答题答对打答错都不切换
|
||||
topicList.length < storageTopicList.value.length // 条件3.不是最后一题(暂定这样判断)
|
||||
) {
|
||||
questionNumber.value++;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -221,14 +248,14 @@
|
||||
};
|
||||
|
||||
// 问答题轮询结果方法
|
||||
const queryWithRetry = (execLogId, maxRetries = 30) => {
|
||||
const queryWithRetry = (execLogId, maxRetries = 10) => {
|
||||
// 递归终止条件:达到最大重试次数
|
||||
if (maxRetries <= 0) {
|
||||
return Promise.reject(new Error('超过最大重试次数,查询失败'));
|
||||
}
|
||||
return queryCrsPracticeAnswerResult({ execLogId })
|
||||
.then((res) => {
|
||||
console.log('queryCrsPracticeAnswerResult', res.body);
|
||||
console.log('queryCrsPracticeAnswerResult', maxRetries, res.body);
|
||||
const isWait = res.body.isWait;
|
||||
if (isWait === 'Y') {
|
||||
// 如果是Y,延迟2秒后重试,重试次数减1
|
||||
@@ -283,16 +310,18 @@
|
||||
});
|
||||
} else if (type === 'text') {
|
||||
topic.value.es_status = '01';
|
||||
topic.value.anserResult = submitObj; // 正确答案文字内容
|
||||
topic.value.my_answer = {
|
||||
anserResult: submitObj // 正确答案文字内容
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 发送文本
|
||||
const submitAnswerNow = (val, cb = null) => {};
|
||||
|
||||
// 添加一道题
|
||||
const addProblem = () => {
|
||||
if (topicList.length >= storageTopicList.value.length) return false;
|
||||
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;
|
||||
@@ -315,46 +344,72 @@
|
||||
my_answer: []
|
||||
}));
|
||||
addProblem();
|
||||
// 记录起始时间
|
||||
// 记录练习起始时间
|
||||
practiceStartTime = new Date().getTime();
|
||||
// #ifdef APP-PLUS
|
||||
// 安全区域底部到屏幕底部的高度(即底部安全区域高度)
|
||||
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
|
||||
uni.onKeyboardHeightChange((res) => {
|
||||
let keyboardHeight = res.height;
|
||||
// 仅在iOS端补偿安全区域高度
|
||||
if (systemInfo.platform === 'ios') {
|
||||
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
|
||||
}
|
||||
popup_input_bottom.value = `${keyboardHeight}px`;
|
||||
console.log('端补偿安全区域高度', popup_input_bottom.value);
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
console.log('需要卸载吗');
|
||||
});
|
||||
// #endif
|
||||
});
|
||||
|
||||
const result_click = ({ key }) => {
|
||||
console.log('res', key);
|
||||
if (key === 'hand_in_paper') {
|
||||
// 现在交卷
|
||||
hand_in_paper();
|
||||
} else if (key === 'continue') {
|
||||
// 继续考试
|
||||
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') {
|
||||
// 返回
|
||||
dialogRef.value.close();
|
||||
await nextTick();
|
||||
common.navigateBack();
|
||||
}
|
||||
};
|
||||
|
||||
// 交卷按钮点击,打开交卷确认框
|
||||
const hand_in_paper_button_click = () => {
|
||||
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 completeList = topicList
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length : res.my_answer))
|
||||
.map((res) => ({
|
||||
a: res.qnsId,
|
||||
b: res.my_answer,
|
||||
c: !!res.my_answer
|
||||
}));
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
@@ -367,44 +422,29 @@
|
||||
backgroundColor: '#E2EDFF',
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const incompleteNumber = topicList.length - completeList.length;
|
||||
if (incompleteNumber === 0) {
|
||||
// 完成
|
||||
dialogConfiguration.type = 'complete';
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
key: 'hand_in_paper',
|
||||
name: '现在交卷',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'continue',
|
||||
name: '继续考试',
|
||||
style: style_button_2
|
||||
}
|
||||
];
|
||||
} else {
|
||||
dialogConfiguration.type = 'incomplete'; // 未完成
|
||||
dialogConfiguration.html = `当前考试进度:<text style="color:#0066FF;font-weight:bold;">${completeList.length}/${topicList.length}</text> 题 还有<text style="color:#0066FF;font-weight:bold;">${incompleteNumber}</text>道题未作答,确认交卷吗?`;
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
key: 'continue',
|
||||
name: '继续考试',
|
||||
style: style_button_1
|
||||
},
|
||||
{
|
||||
key: 'hand_in_paper',
|
||||
name: '现在交卷',
|
||||
style: style_button_2
|
||||
}
|
||||
];
|
||||
}
|
||||
// 完成
|
||||
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();
|
||||
};
|
||||
// 执行交卷
|
||||
const hand_in_paper = () => {};
|
||||
// 启动定时器
|
||||
// 启动练习时长定时器
|
||||
const startTimer = () => {
|
||||
if (practiceTimeTimer) {
|
||||
clearInterval(practiceTimeTimer);
|
||||
@@ -430,7 +470,6 @@
|
||||
}
|
||||
startTimer(); // 启动/恢复定时器
|
||||
});
|
||||
|
||||
onHide(() => {
|
||||
leaveStartTime = new Date().getTime();
|
||||
stopTimer();
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
getData();
|
||||
};
|
||||
const item_click = (item) => {
|
||||
|
||||
console.log(item, 'item');
|
||||
crsId
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="history_div">
|
||||
<view class="history_item" v-for="item in historyList" @click="search(item)">
|
||||
<view class="history_item ellipsis-text" v-for="item in historyList" @click="search(item)">
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -31,14 +31,12 @@
|
||||
const _freshing = ref(false);
|
||||
const offset = ref(0);
|
||||
const scrollRef = ref(null);
|
||||
|
||||
const props = defineProps({
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
});
|
||||
|
||||
const onRefresh = () => {
|
||||
if (_freshing.value) return;
|
||||
_freshing.value = true;
|
||||
|
||||
Reference in New Issue
Block a user