This commit is contained in:
田岩
2025-08-21 15:02:13 +08:00
parent 76c71bbb03
commit 7975afc065
7 changed files with 74 additions and 62 deletions
+31 -23
View File
@@ -2,7 +2,7 @@
<view class="item">
<view class="top">
<view class="type">{{ subject_type_text }}</view>
<view class="score" v-if="[''].includes(props.mode)">{{ item.tgtGrade }}</view>
<view class="score" v-if="['settlement', 'examination'].includes(props.mode)">{{ item.tgtGrade }}</view>
<view class="fl1"></view>
<view class="right">
<!-- 反馈中心 -->
@@ -14,9 +14,9 @@
></image>
<image :src="feedbackIcon()" class="img" @click="feedback_click()"></image>
</view>
<template v-if="[''].includes(props.mode)">
<template v-if="['mistake'].includes(props.mode)">
<view class="right_text">展开</view>
<uv-icon class="arrow-icon" name="arrow-right"></uv-icon>
<uv-icon class="arrow-icon" name="arrow-right" color="#0066FF"></uv-icon>
</template>
</view>
</view>
@@ -52,17 +52,15 @@
确定
</uv-button>
</view>
<view class="analysis_div" v-if="!clearResult && ['study', 'mistake'].includes(props.mode)">
<view class="analysis_div" v-if="!clearResult && ['study', 'mistake', 'settlement'].includes(props.mode)">
<view class="analysis_title">
<view class="success_answer">正确答案{{ correctResultLabel.join('') }}</view>
<view class="your_answer">
你的答案
<text class="red_color">{{ myResultLabel.join('') }}</text>
<text :class="right_or_wrong_class ? 'success' : 'error'">{{ myResultLabel.join('') }}</text>
</view>
</view>
<view class="analysis_note">
题目解析{{subject_data?.analyContent}}
</view>
<view class="analysis_note">题目解析{{ subject_data?.analyContent }}</view>
</view>
</view>
</template>
@@ -77,7 +75,7 @@
backgroundColor: '#0066FF',
border: '1rpx solid rgb(12, 123, 245)'
};
const emit = defineEmits(['subject_click']);
const props = defineProps({
modelValue: {
@@ -92,8 +90,8 @@
type: String,
required: true,
validator: (value) => {
// 考试: examination 练习: practice 错题本: mistake 学习: study
return ['examination', 'practice', 'mistake', 'study'].includes(value);
// 考试: examination 练习: practice 错题本: mistake 学习: study 考试结算页 settlement
return ['examination', 'practice', 'mistake', 'study', 'settlement'].includes(value);
}
},
// 是否预览模式
@@ -105,13 +103,13 @@
clearResult: {
type: Boolean,
default: true
},
}
});
const modelValue = computed({
get: () => props.modelValue,
set: (val) => emit('update:modelValue', val)
});
let answerText = props.item?.my_answer
let answerText = props.item?.my_answer;
const item_answer = ref(typeof answerText === 'string' ? answerText.split(',') : []);
const feedback_click = () => {
emit('subject_click', 'feedback', props.item);
@@ -130,12 +128,18 @@
const anserResultArray = props.item.anserResult.split(',');
return subject_data.itemVos.filter((res) => anserResultArray.includes(res.itemId)).map((res) => res.itemNo);
});
// 判断选项是否完全正确
const right_or_wrong_class = computed(
() =>
correctResultLabel.value.length === myResultLabel.value.length &&
myResultLabel.value.every((res) => correctResultLabel.value.includes(res))
);
const subject_data = reactive({
qnsId: props.item.qnsId,
qnsContent: props.item.qnsContent,
qnsTyp: props.item.qnsTyp,
analyContent: props.item.analyContent,
itemVos: (props.item.itemVos??[]).map((res) => ({
itemVos: (props.item.itemVos ?? []).map((res) => ({
...res,
correctFlag: props.clearResult ? '' : res.correctFlag
}))
@@ -212,18 +216,20 @@
justify-content: space-between;
align-items: center;
margin: 32rpx 0 28rpx 0;
.success_answer {
}
.your_answer {
}
.red_color {
color: #f5212d;
.success {
color: #15b859;
}
.error {
color: #f5212d;
}
}
}
.analysis_note {
font-family: PingFangSC;
font-weight: 500;
@@ -272,11 +278,13 @@
.right_text {
font-family: PingFangSC;
font-weight: 600;
font-weight: 400;
font-size: 28rpx;
color: #333;
color: #333333;
line-height: 40px;
text-align: left;
font-style: normal;
}
}
}