|
|
@@ -6,7 +6,7 @@
|
|
|
<view class="px-20 py-12 text-24 relative"
|
|
|
:class="[index === questionIndex ? 'bg-primary-light text-primary' : 'bg-back']">
|
|
|
第{{ index + 1 }}题
|
|
|
- <view v-if="item.answer !== undefined" class="absolute top-0 right-0 w-12 h-12 bg-success rounded-full">
|
|
|
+ <view v-if="isAnswered(item)" class="absolute top-0 right-0 w-12 h-12 bg-success rounded-full">
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -20,6 +20,7 @@ defineOptions({
|
|
|
virtualHost: true,
|
|
|
}
|
|
|
});
|
|
|
+import { TestCenter } from '@/types';
|
|
|
import { SYMBOL_TEST_DATA, useTest } from '../components/useTest';
|
|
|
|
|
|
const tabItemStyle = {
|
|
|
@@ -34,5 +35,11 @@ const questionList = computed(() => {
|
|
|
const handleTabChange = (e: any) => {
|
|
|
setQuestionIndex?.(e.index);
|
|
|
}
|
|
|
+const isAnswered = (item: TestCenter.TestQuestionVO) => {
|
|
|
+ if (Array.isArray(item.answer)) {
|
|
|
+ return item.answer.length !== 0;
|
|
|
+ }
|
|
|
+ return item.answer !== undefined && item.answer !== '';
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped></style>
|