소스 검색

删除多余文件

shmily1213 2 주 전
부모
커밋
83be2b41b9

+ 1 - 1
src/pagesOther/pages/vhs/index/components/score-form.vue

@@ -15,7 +15,7 @@
             <template #prefix>填写位次:</template>
         </uv-input>
         <view class="font-[PingFang] text-content text-2xs mt-20">
-            <uv-icon name="info-circle" class="mr3" style="display: inline-block"/>
+            <uv-icon name="info-circle" class="mr-3" style="display: inline-block"/>
             已根据最新位次表获取分数的最低位次,您也可以修改为成绩单上的位次
             <template v-if="model.rank&&isScoreLocked">,位次区间[{{
                     model.rank.highestRank

+ 1 - 1
src/pagesOther/pages/vhs/index/components/voluntary-history-list.vue

@@ -25,7 +25,7 @@
                             {{ history.score || '-' }}
                             <uv-icon name="question-circle"/>
                         </view>
-                        <uv-badge v-if="history.collect" value="征集" shape="horn" class="mr3"
+                        <uv-badge v-if="history.collect" value="征集" shape="horn" class="mr-3"
                                   @click.native="$emit('notify', history.collectDesc)"/>
                     </view>
                 </uv-col>

+ 0 - 430
src/pagesStudy/pages/exam-start/components/question-item copy.vue

@@ -1,430 +0,0 @@
-<template>
-  <view class="question-item" :id="`qs_${question.id}`">
-    <view class="is-main-question">
-      <view v-if="question.typeId && !isSubQuestion" class="question-type">
-        {{ questionTypeDesc[question.typeId as EnumQuestionType] }}
-      </view>
-      <view class="question-content" :class="{ 'mt-30': isSubQuestion }">
-        <text v-if="question.isSubQuestion" class="text-nowrap text-30">{{ getQuestionTitle() }} &nbsp;</text>
-        <uv-parse :content="question.title" containerStyle="display:inline"
-          contentStyle="word-break:break-word;"></uv-parse>
-      </view>
-      <view class="question-options">
-        <view class="question-option" v-for="option in question.options" :class="getStyleClass(option)" :key="option.id"
-          @click="handleSelect(option)">
-          <template v-if="!readonly">
-            <view v-if="!isOnlySubjective" class="question-option-index">{{ option.no }}</view>
-            <view v-else>
-              <uv-icon name="info-circle" :color="isSelected(option) ? '#31A0FC' : '#999'" size="18" />
-            </view>
-          </template>
-          <view v-else>
-            <uv-icon v-if="isOptionCorrect(question, option)" name="checkmark-circle-fill" color="#2CC6A0" size="22" />
-            <uv-icon v-else-if="isOptionIncorrect(option)" name="close-circle-fill" color="#FF5B5C" size="22" />
-            <view v-else class="question-option-index">{{ option.no }}</view>
-          </view>
-          <view class="question-option-content">
-            <uv-parse :content="getOptionContent(option)" containerStyle="display:inline"
-              contentStyle="word-break:break-word;"></uv-parse>
-          </view>
-        </view>
-        <view v-if="question.options.length && !readonly && !isOnlySubjective" class="question-option"
-          :class="{ 'question-option-not-know': question.isNotKnow }" @click="handleNotKnow">
-          <view class="question-option-index">
-            <uv-icon name="info-circle" :color="question.isNotKnow ? '#31A0FC' : '#999'" size="18" />
-          </view>
-          <view class="question-option-content text-fore-light">不会</view>
-        </view>
-        <view v-if="!readonly && isOnlySubjective" class="mt-40 bg-[#EBF9FF] p-12 rounded-8">
-          <view class="rounded-8 bg-white px-10 py-20 text-primary text-24 flex gap-x-6 items-center">
-            <uv-icon name="info-circle" color="#31A0FC" size="16" />
-            <text>请线下答题,查看解析对比后,选“会”或“不会”</text>
-          </view>
-          <view class="mt-30 mb-20 text-24 text-white bg-primary w-fit mx-auto px-20 py-12 rounded-full text-center"
-            @click="handleShowParse">
-            查看解析</view>
-        </view>
-      </view>
-      <!-- 阅卷模式下显示答案 -->
-      <template v-if="readonly">
-        <view v-if="question.subQuestions.length === 0" class="answer-wrap mt-40 rounded-8 pt-60 pb-40 flex items-center text-center relative">
-          <ie-image v-if="question.isCorrect" src="/pagesStudy/static/image/icon-answer-correct.png"
-            class="absolute top-0 left-1/2 -translate-x-1/2 w-222 h-64" />
-          <ie-image v-else src="/pagesStudy/static/image/icon-answer-incorrect.png"
-            class="absolute top-0 left-1/2 -translate-x-1/2 w-240 h-64" />
-          <view v-if="!isOnlySubjective" class="flex-1">
-            <view class="text-34 text-[#2CC6A0] font-bold">{{ question.answer1 }}</view>
-            <view class="mt-4 text-26">正确答案</view>
-          </view>
-          <view class="h-40 w-1 bg-back"></view>
-          <view v-if="!isOnlySubjective" class="flex-1">
-            <view class="text-34 font-bold" :class="[question.isCorrect ? 'text-[#2CC6A0]' : 'text-[#FF5B5C]']">
-              {{ question.answers.join('') || (question.isNotKnow ? '不会' : '未作答') }}
-            </view>
-            <view class="mt-4 text-26">我的答案</view>
-          </view>
-          <view v-if="isOnlySubjective" class="text-left mt-10 px-20">
-            <uv-parse :content="'参考答案:' + question.answer2"></uv-parse>
-          </view>
-        </view>
-      </template>
-      <view v-if="(readonly && question.parse) || (!readonly && question.showParse)" class="mt-40">
-        <view class="text-30 text-fore-title font-bold">解析</view>
-        <view class="mt-10 text-26 text-fore-light">
-          <uv-parse :content="question.parse || '暂无解析'"></uv-parse>
-        </view>
-      </view>
-    </view>
-    <view v-if="question.subQuestions.length" class="is-sub-question">
-      <scroll-view class="w-full h-fit sticky top-0 bg-white py-10 z-1" scroll-x>
-        <view class="flex items-center px-20 gap-x-20">
-          <view class="px-40 py-8 rounded-full"
-            :class="[subIndex === subQuestionIndex ? 'bg-[#EBF9FF] text-primary font-bold' : 'bg-back']"
-            v-for="(subQuestion, subIndex) in question.subQuestions" @click="changeSubQuestion(subIndex)">
-            {{ question.index + question.offset + subIndex + 1 }}
-          </view>
-        </view>
-      </scroll-view>
-      <view v-if="subQuestion">
-        <question-item :question="subQuestion" :parent-question="question" :readonly="readonly" :is-sub-question="true"
-          :index="index" :total="question.subQuestions.length" @select="handleSelectOption"
-          @notKnow="handleSelectNotKnow" />
-      </view>
-    </view>
-  </view>
-</template>
-
-<script lang="ts" setup>
-import { Study } from '@/types';
-import { useExam } from '@/composables/useExam';
-import { EnumQuestionType } from '@/common/enum';
-import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY, SHOW_SUBMIT_CONFIRM, IS_ALL_DONE } from '@/types/injectionSymbols';
-const { questionTypeDesc, isOptionCorrect } = useExam();
-const props = defineProps<{
-  question: Study.Question;
-  parentQuestion?: Study.Question;
-  readonly?: boolean;
-  isSubQuestion?: boolean;
-  index: number;
-  total?: number;
-  subQuestionIndex?: number;
-}>();
-const nextQuestion = inject(NEXT_QUESTION);
-const prevQuestion = inject(PREV_QUESTION);
-const nextQuestionQuickly = inject(NEXT_QUESTION_QUICKLY);
-const prevQuestionQuickly = inject(PREV_QUESTION_QUICKLY);
-const isAllDone = inject(IS_ALL_DONE);
-const subQuestion = computed(() => {
-  return props.question.subQuestions[props.subQuestionIndex ?? 0];
-});
-const emit = defineEmits<{
-  (e: 'update:question', question: Study.Question): void;
-  (e: 'select', question: Study.Question): void;
-  (e: 'notKnow', question: Study.Question): void;
-  (e: 'scrollTo', selector: string): void;
-  (e: 'changeSubQuestion', index: number): void;
-  (e: 'selectSubQuestion', index: number): void;
-  (e: 'changeQuestion', question: Study.Question): void;
-}>();
-const isOnlySubjective = computed(() => {
-  // 除了单选、判断、多选题,其他题型都是主观题
-  return ![EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT, EnumQuestionType.MULTIPLE_CHOICE].includes(props.question.typeId);
-});
-const getStyleClass = (option: Study.QuestionOption) => {
-  if (!props.readonly) {
-    return isSelected(option) ? 'question-option-selected' : '';
-  }
-  let customClass = '';
-  let { answers, answer1 } = props.question;
-  answers = answers?.filter(item => item !== ' ') || [];
-  answer1 = answer1 || ''
-  if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(props.question.typeId)) {
-    if (answer1.includes(option.no)) {
-      customClass = 'question-option-correct';
-    } else if (answers.includes(option.no)) {
-      customClass = 'question-option-incorrect';
-    }
-  } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(props.question.typeId)) {
-    // 我选择的答案
-    if (answers.includes(option.no)) {
-      if (answer1.includes(option.no)) {
-        customClass = 'question-option-correct';
-      } else {
-        customClass = 'question-option-incorrect';
-      }
-    } else {
-      // 漏选的答案
-      if (answer1.includes(option.no)) {
-        customClass = 'question-option-miss';
-      }
-    }
-  }
-  // console.log(props.question, option)
-  return customClass;
-};
-
-const isOptionIncorrect = (option: Study.QuestionOption) => {
-  const { answers, answer1 } = props.question;
-  return answers.includes(option.no) && !answer1.includes(option.no);
-}
-const getQuestionTitle = () => {
-  if (props.isSubQuestion) {
-    const prefix = questionTypeDesc[props.question.typeId as EnumQuestionType].slice(0, 2);
-    return `[${prefix}]`;
-  }
-  return '';
-};
-const getOptionContent = (option: Study.QuestionOption) => {
-  // sb 问题,浪费几个小时
-  return option.name.replace(/\s/g, ' ');
-}
-const handleShowParse = () => {
-  props.question.showParse = !props.question.showParse;
-}
-const handleNotKnow = () => {
-  props.question.answers = [];
-  props.question.isNotKnow = !props.question.isNotKnow;
-  checkIsDone();
-  if (props.isSubQuestion) {
-    emit('select', props.question);
-  } else {
-    changeQuestion();
-  }
-}
-const handleSelect = (option: Study.QuestionOption) => {
-  if (props.readonly) {
-    return;
-  }
-  if ([
-    EnumQuestionType.JUDGMENT,
-    EnumQuestionType.SINGLE_CHOICE,
-    EnumQuestionType.SUBJECTIVE,
-    EnumQuestionType.SHORT_ANSWER,
-    EnumQuestionType.ESSAY,
-    EnumQuestionType.ANALYSIS
-  ].includes(props.question.typeId)) {
-    props.question.answers = [option.no];
-    // nextQuestion?.();
-
-  } else if (props.question.typeId === EnumQuestionType.MULTIPLE_CHOICE) {
-    if (props.question.answers.includes(option.no)) {
-      props.question.answers = props.question.answers.filter(item => item !== option.no);
-    } else {
-      props.question.answers.push(option.no);
-    }
-  }
-
-  props.question.isNotKnow = false;
-  checkIsDone(props.question);
-  if (props.question.isSubQuestion) {
-    // 同时检查父题是否已完成
-    checkIsDone(props.parentQuestion);
-  }
-  if (props.isSubQuestion) {
-    emit('select', props.question);
-  } else {
-    changeQuestion()
-  }
-}
-
-const checkIsDone = (question?: Study.Question) => {
-  if (!question) {
-    return;
-  }
-  if (question?.subQuestions && question?.subQuestions.length > 0) {
-    question.isDone = question.subQuestions.every(q => q.answers.length > 0 || q.isNotKnow);
-  } else {
-    question.isDone = question.answers.length > 0 || question.isNotKnow;
-  }
-}
-// 子题选中方法
-const handleSelectOption = () => {
-  findNotDoneSubQuestion();
-}
-const handleSelectNotKnow = () => {
-  findNotDoneSubQuestion();
-}
-// 查找是否有子题没有做,有的话就自动滚动到目标处
-const findNotDoneSubQuestion = () => {
-  console.log(props)
-  if (props.question.subQuestions.length - 1 === props.subQuestionIndex) {
-    changeQuestion();
-  } else {
-    changeSubQuestion((props.subQuestionIndex ?? 0) + 1);
-  }
-  // const notDoneSubQuestion = props.question.subQuestions.find(q => !q.isDone);
-  // if (notDoneSubQuestion) {
-  //   if (notDoneSubQuestion.subIndex !== undefined) {
-  //     changeSubQuestion(notDoneSubQuestion.subIndex);
-  //   }
-  // } else {
-  //   // 是否当前是最后一个子题
-  //   if (props.question.subQuestions.length - 1 === props.subQuestionIndex) {
-  //     changeQuestion();
-  //   } else {
-  //     changeSubQuestion(props.subQuestionIndex ?? 0 + 1);
-  //   }
-  // }
-}
-const changeSubQuestion = (index: number) => {
-  emit('changeSubQuestion', index);
-}
-const changeQuestion = () => {
-  emit('changeQuestion', props.question);
-}
-
-const isSelected = (option: Study.QuestionOption) => {
-  const { typeId, answers } = props.question;
-  if ([
-    EnumQuestionType.JUDGMENT,
-    EnumQuestionType.SINGLE_CHOICE,
-    EnumQuestionType.SUBJECTIVE,
-    EnumQuestionType.SHORT_ANSWER,
-    EnumQuestionType.ESSAY,
-    EnumQuestionType.ANALYSIS
-  ].includes(typeId)) {
-    return answers.includes(option.no);
-  } else if (typeId === EnumQuestionType.MULTIPLE_CHOICE) {
-    return answers.includes(option.no);
-  }
-  return false;
-}
-</script>
-
-<style lang="scss" scoped>
-.answer-wrap {
-  box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.06);
-}
-
-.prefix {
-  @apply relative pl-20 before:content-[''] before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:w-[3px] before:h-[15px] before:bg-primary before:rounded-full;
-}
-
-.is-sub-question {
-  @apply px-0;
-
-  .question-options {
-    @apply mt-0;
-  }
-}
-
-.is-main-question {
-  @apply px-40;
-
-  >.question-options {
-    @apply mt-40;
-  }
-}
-
-.question-item {
-  .question-type {
-    @apply mb-20 text-32 text-fore-subtitle font-bold;
-  }
-
-  .sub-question-type {
-    @apply text-28 text-fore-light font-bold;
-  }
-
-  .question-content {
-    @apply text-32 text-fore-title break-words;
-  }
-
-  .question-options {
-
-    .question-option {
-      @apply flex items-center px-30 py-24 bg-back rounded-8 border border-none border-transparent;
-
-      .question-option-index {
-        @apply w-40 h-40 rounded-full bg-transparent text-30 text-fore-light font-bold flex items-center justify-center flex-shrink-0;
-      }
-
-      .question-option-content {
-        @apply text-28 text-fore-title ml-20 flex-1 min-w-0;
-      }
-    }
-
-    .question-option-selected {
-      @apply bg-[#b5eaff8e];
-
-      .question-option-index {
-        @apply bg-primary text-white;
-      }
-
-      .question-option-content {
-        @apply text-primary;
-      }
-    }
-
-    .question-option-not-know {
-      @apply bg-[#b5eaff8e];
-
-      .question-option-content {
-        @apply text-primary;
-      }
-    }
-
-    .question-option-correct,
-    .question-option-miss {
-      @apply bg-[#E7FCF8] border-[#E7FCF8] text-[#2CC6A0];
-
-      .question-option-index {
-        @apply text-[#2CC6A0];
-      }
-
-      .question-option-content {
-        @apply text-[#2CC6A0];
-      }
-    }
-
-    .question-option-miss {
-      @apply relative overflow-hidden;
-
-      &::before {
-        content: '';
-        position: absolute;
-        right: -56rpx;
-        top: 15rpx;
-        width: 180rpx;
-        height: 36rpx;
-        background: rgba(255, 91, 92, 0.2);
-        transform: rotate(30deg);
-        box-shadow: 0 2rpx 4rpx rgba(255, 91, 92, 0.1);
-      }
-
-      &::after {
-        content: '漏选';
-        position: absolute;
-        right: -8rpx;
-        top: 14rpx;
-        width: 100rpx;
-        height: 32rpx;
-        color: #FF5B5C;
-        font-size: 20rpx;
-        // font-weight: bold;
-        transform: rotate(30deg);
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        line-height: 1;
-      }
-    }
-
-    .question-option-incorrect {
-      @apply bg-[#FEEDE9] border-[#FEEDE9] text-[#FF5B5C];
-
-      .question-option-index {
-        @apply text-[#FF5B5C];
-      }
-
-      .question-option-content {
-        @apply text-[#FF5B5C];
-      }
-
-    }
-
-    .question-option+.question-option {
-      @apply mt-24;
-    }
-  }
-}
-</style>

+ 0 - 393
src/pagesStudy/pages/exam-start/start-exam copy.vue

@@ -1,393 +0,0 @@
-<template>
-  <ie-page :fix-height="true" :safe-area-inset-bottom="false">
-    <ie-navbar :title="pageTitle" custom-back @left-click="handleLeftClick">
-      <template v-if="isReady" #headerRight>
-        <view v-if="isExamMode" class="countdown-text" :class="{ 'text-red-500': examDuration < 30 }">
-          {{ formatExamDuration }}
-        </view>
-        <view v-else class="">{{ formatPracticeDuration }}</view>
-      </template>
-    </ie-navbar>
-    <view v-if="isReady" class="px-20 py-14 bg-back flex justify-between items-center gap-x-20">
-      <text class="flex-1 min-w-1 text-26 ellipsis-1">{{ pageSubtitle }}</text>
-      <view class="flex items-baseline">
-        <text class="text-34 text-primary font-bold">{{ currentIndex + 1 }}</text>/
-        <text class="text-28 text-fore-subtitle">{{ totalCount }}</text>
-      </view>
-    </view>
-    <view class="flex-1 min-h-1 relative">
-      <view class="absolute inset-0 ">
-        <swiper class="h-full" :disable-touch="false" :current="currentIndex" :duration="swiperDuration"
-          @change="handleSwiperChange" @transition="handleSwiperTransition"
-          @animationfinish="handleSwiperAnimationFinish">
-          <swiper-item class="h-full" v-for="(item, index) in questionList" :key="index">
-            <question-wrap :question="item" @update:question="handleUpdateQuestion" />
-          </swiper-item>
-        </swiper>
-      </view>
-    </view>
-    <ie-safe-toolbar v-if="isReady" :height="64" :shadow="false">
-      <view class="px-18 h-full flex items-center justify-around border-0 border-t border-solid border-[#EFEFEF]">
-        <view class="w-48 h-48 flex items-center justify-center" @click="handleFavorite">
-          <uv-icon v-if="currentQuestion.isFavorite" name="star-fill" color="#FF9A18" size="27" />
-          <uv-icon v-else name="star" size="27" />
-        </view>
-        <view class="w-48 h-48 flex items-center justify-center" @click="handleMark">
-          <ie-image
-            :src="currentQuestion.isMark ? '/pagesStudy/static/image/icon-mark-active.png' : '/pagesStudy/static/image/icon-mark.png'"
-            custom-class="w-38 h-38" mode="aspectFill" />
-        </view>
-        <view class="w-48 h-48 flex items-center justify-center" @click="handleCalendar">
-          <uv-icon name="calendar" size="28" />
-        </view>
-      </view>
-    </ie-safe-toolbar>
-  </ie-page>
-  <question-stats-popup ref="questionStatsPopupRef">
-    <template #title>
-      <view class="ml-20">
-        <text class="text-30 text-primary">{{ doneCount }}</text>
-        <text>/</text>
-        <text class="text-30 text-fore-light">{{ totalCount }}</text>
-      </view>
-    </template>
-    <view class="popup-content">
-      <view class="flex-1 min-h-1">
-        <scroll-view class="h-full" scroll-y>
-          <view v-for="(item, i) in groupedQuestionList" :key="i" class="">
-            <template v-if="item.list.length > 0">
-              <view class="h-70 bg-back px-20 leading-70 text-fore-subcontent">{{ questionTypeDesc[item.type] }}</view>
-              <view class="grid grid-cols-5 place-items-center gap-x-20 gap-y-20 p-30">
-                <view v-for="(qs, j) in item.list" :key="j" class="aspect-square flex items-center justify-center"
-                  @click="hanadleNavigate(qs.index)">
-                  <view
-                    class="w-74 h-74 rounded-full flex items-center justify-center bg-white border border-solid border-border relative"
-                    :class="{
-                      'is-done': qs.question.isDone,
-                      'is-not-know': qs.question.isNotKnow,
-                      'is-mark': qs.question.isMark
-                    }">
-                    <text class="z-1">{{ qs.index + 1 }}</text>
-                    <ie-image v-if="qs.question.isMark" src="/pagesStudy/static/image/icon-mark-active.png"
-                      custom-class="absolute -top-12 left-14 w-28 h-28 z-1" mode="aspectFill" />
-                    <question-progress :progress="qs.question.progress || 0" />
-                  </view>
-                </view>
-
-              </view>
-
-            </template>
-          </view>
-        </scroll-view>
-      </view>
-      <view class="h-150 bg-white flex items-center gap-x-120 px-40">
-        <view class="flex flex-col items-center gap-x-10" @click="handleReset">
-          <uv-icon name="reload" size="20" :color="doneCount > 0 ? '#999' : '#cccccc'" />
-          <text class="mt-4 text-20 text-subcontent" :class="{ 'text-fore-light': doneCount <= 0 }">重新作答</text>
-        </view>
-        <view class="flex-1 py-20 text-center rounded-full bg-primary text-white" @click="beforeSubmit">交卷</view>
-      </view>
-    </view>
-  </question-stats-popup>
-</template>
-
-<script lang="ts" setup>
-import QuestionItem from './components/question-item.vue';
-import QuestionWrap from './components/question-wrap.vue';
-import QuestionStatsPopup from './components/question-stats-popup.vue';
-import QuestionProgress from './components/question-progress.vue';
-import { useTransferPage } from '@/hooks/useTransferPage';
-import { EnumExamMode } from '@/common/enum';
-import { getOpenExaminee, getPaper, commitExamineePaper, collectQuestion, cancelCollectQuestion } from '@/api/modules/study';
-import { useExam } from '@/composables/useExam';
-import { Study } from '@/types';
-import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY } from '@/types/injectionSymbols';
-// import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
-const { prevData, transferBack } = useTransferPage();
-const { setQuestionList, questionList, groupedQuestionList, stateQuestionList, questionTypeDesc, favoriteList, notKnowList, markList, currentIndex,
-  totalCount, doneCount, notDoneCount, isAllDone, nextQuestion, prevQuestion, nextQuestionQuickly, prevQuestionQuickly, swiperDuration,
-  formatPracticeDuration, formatExamDuration, practiceDuration, startPracticeDuration, stopPracticeDuration,
-  examDuration, startExamDuration, stopExamDuration, setExamDuration, setCountDownCallback, changeIndex, setDuration, reset } = useExam();
-
-provide(NEXT_QUESTION, nextQuestion);
-provide(PREV_QUESTION, prevQuestion);
-provide(NEXT_QUESTION_QUICKLY, nextQuestionQuickly);
-provide(PREV_QUESTION_QUICKLY, prevQuestionQuickly);
-
-const isAnimationFinish = ref(false);
-const transitionStartX = ref(null);
-const transitionEndX = ref(null);
-const isReady = ref(false);
-// 自动提交只提醒1次
-const hasShowSubmitConfirm = ref(false);
-const examineerData = ref<Study.Examinee>({} as Study.Examinee);
-const paperData = ref<Study.ExamPaper>({} as Study.ExamPaper);
-const pageTitle = computed(() => {
-  const { mode } = prevData.value;
-  return mode === EnumExamMode.PRACTICE ? '练习' : '考试';
-});
-const pageSubtitle = computed(() => {
-  const { mode, name } = prevData.value;
-  return (mode === EnumExamMode.PRACTICE ? '知识点练习' : '考试') + '-' + name;
-});
-const isExamMode = computed(() => {
-  return prevData.value.mode === EnumExamMode.EXAM;
-});
-const handleLeftClick = () => {
-  if (!isReady.value) {
-    transferBack();
-    return;
-  }
-  beforeQuit();
-};
-const handleSwiperChange = (e: any) => {
-  currentIndex.value = e.detail.current;
-};
-const beforeQuit = () => {
-  const { mode } = prevData.value;
-  if (!isReady.value) {
-    return;
-  }
-  stopTime();
-  const msg = mode === EnumExamMode.PRACTICE ? '当前练习未完成,确认退出?' : '当前考试未完成,确认退出?';
-  uni.$ie.showModal({
-    title: '提示',
-    content: msg,
-  }).then(confirm => {
-    if (confirm) {
-      handleSubmit(true);
-    } else {
-      startTime();
-    }
-  });
-};
-const currentQuestion = computed(() => {
-  return questionList.value[currentIndex.value] || {};
-});
-const hanadleNavigate = (index: number) => {
-  changeIndex(index);
-}
-const handleFavorite = async () => {
-  if (!currentQuestion.value.isFavorite) {
-    await collectQuestion(currentQuestion.value.id);
-    currentQuestion.value.isFavorite = true;
-    uni.$ie.showToast('收藏成功');
-  } else {
-    await cancelCollectQuestion(currentQuestion.value.id);
-    currentQuestion.value.isFavorite = false;
-    uni.$ie.showToast('取消收藏成功');
-  }
-};
-
-const handleMark = () => {
-  currentQuestion.value.isMark = !currentQuestion.value.isMark;
-};
-const questionStatsPopupRef = ref();
-const handleCalendar = () => {
-  questionStatsPopupRef.value.open();
-};
-
-const handleSwiperTransition = (e: any) => {
-  if (currentIndex.value === questionList.value.length - 1) {
-    if (!transitionStartX.value) {
-      transitionStartX.value = e.detail.dx;
-    } else {
-      transitionEndX.value = e.detail.dx;
-    }
-    return;
-  }
-};
-
-const startTime = () => {
-  if (isExamMode.value) {
-    startExamDuration();
-  } else {
-    startPracticeDuration();
-  }
-}
-
-const stopTime = () => {
-  if (isExamMode.value) {
-    stopExamDuration();
-  } else {
-    stopPracticeDuration();
-  }
-}
-
-const handleSwiperAnimationFinish = (e: any) => {
-  if (transitionStartX.value == null || transitionEndX.value == null || currentIndex.value !== questionList.value.length - 1) {
-    isAnimationFinish.value = true;
-    transitionStartX.value = null;
-    transitionEndX.value = null;
-    return;
-  }
-  const offsetX = transitionEndX.value - transitionStartX.value;
-  if (offsetX < 0 && offsetX > -150) {
-    beforeSubmit();
-  }
-  isAnimationFinish.value = true;
-  transitionStartX.value = null;
-  transitionEndX.value = null;
-};
-
-const beforeSubmit = () => {
-  const text = notDoneCount.value > 0 ? `还有${notDoneCount.value}题未做,确认交卷?` : '是否确认交卷?';
-  stopTime();
-  uni.$ie.showModal({
-    title: '提示',
-    content: text,
-  }).then(confirm => {
-    if (confirm) {
-      handleSubmit(false);
-    } else {
-      startTime();
-    }
-  });
-}
-
-const handleReset = () => {
-  if (doneCount.value <= 0) {
-    return;
-  }
-  uni.$ie.showModal({
-    title: '重新作答',
-    content: '是否确认清空全部作答数据?',
-  }).then(confirm => {
-    if (confirm) {
-      questionStatsPopupRef.value.close();
-      reset();
-      setTimeout(() => {
-        startTime();
-      }, 300);
-    }
-  });
-}
-
-const autoSubmit = () => {
-  if (isAllDone.value) {
-    if (hasShowSubmitConfirm.value) {
-      return;
-    }
-    hasShowSubmitConfirm.value = true;
-    beforeSubmit();
-  }
-}
-
-const handleSubmit = (tempSave: boolean = false) => {
-  console.log('handleSubmit', questionList.value)
-  const msg = tempSave ? '保存中...' : '提交中...';
-  uni.$ie.showLoading(msg);
-  setTimeout(() => {
-    uni.$ie.hideLoading();
-    const params = {
-      ...paperData.value,
-      questions: questionList.value.map(item => {
-        return {
-          ...item,
-          isDone: tempSave ? item.isDone : true
-        };
-      }),
-      examineeId: examineerData.value.examineeId,
-      isDone: isAllDone.value,
-      duration: isExamMode.value ? examDuration.value : practiceDuration.value
-    } as Study.ExamPaperSubmit;
-    if (!isExamMode.value) {
-      params.duration = practiceDuration.value;
-    }
-    commitExamineePaper(params);
-    uni.navigateBack();
-  }, 1000);
-}
-
-const handleUpdateQuestion = (question: Study.Question) => {
-  if (currentIndex.value === questionList.value.length - 1) {
-    autoSubmit();
-  }
-}
-/**
- * 恢复上次做题历史数据
- * @param savedQuestion 上次做题历史数据
- * @param fullQuestion 当前试卷数据
- */
-const restoreQuestion = (savedQuestion: Study.ExamineeQuestion[], fullQuestion: Study.ExamineeQuestion[]) => {
-  if (!savedQuestion) {
-    return fullQuestion;
-  }
-  console.log(savedQuestion, fullQuestion)
-  for (const item of fullQuestion) {
-    const savedQs = savedQuestion.find(q => q.id === item.id);
-    if (savedQs) {
-      if (savedQs.answers) {
-        item.answers = savedQs.answers.filter(ans => ans.trim());
-      }
-      item.isMark = savedQs.isMark;
-      item.isFavorite = savedQs.isFavorite;
-      item.isNotKnow = savedQs.isNotKnow;
-      if (item.subQuestions) {
-        restoreQuestion(savedQs.subQuestions, item.subQuestions);
-      }
-    }
-  }
-  return fullQuestion;
-}
-const loadData = async () => {
-  uni.$ie.showLoading();
-  const { data } = await getOpenExaminee({
-    paperType: prevData.value.paperType,
-    relateId: prevData.value.relateId,
-    directed: prevData.value.directed
-  });
-  if (!data) {
-    uni.$ie.hideLoading();
-    transferBack();
-    return;
-  }
-  examineerData.value = data;
-  if (data.paperId) {
-    const res = await getPaper({
-      type: prevData.value.paperType,
-      id: data.paperId
-    });
-
-    uni.$ie.hideLoading();
-    paperData.value = res.data;
-    paperData.value.questions = restoreQuestion(data.questions, res.data.questions);
-    setQuestionList(paperData.value.questions);
-    setDuration(data.duration || 0);
-  }
-  isReady.value = true;
-  setCountDownCallback(() => {
-    handleSubmit(false);
-  });
-  startTime();
-};
-onLoad(() => {
-  loadData();
-});
-</script>
-
-<style lang="scss" scoped>
-.countdown-text {
-  height: 100%;
-  display: flex;
-  align-items: center;
-  font-weight: bold;
-  font-family: 'Courier New', Courier, monospace;
-}
-
-.popup-content {
-  @apply h-[42vh] flex flex-col;
-}
-
-.scroll-view {
-  @apply h-full;
-}
-
-.is-done {
-  @apply text-primary border-[#EBF9FF] bg-[#EBF9FF];
-}
-
-.is-not-know {
-  @apply text-fore-title border-[#F2F2F2] bg-[#F2F2F2];
-}
-</style>

+ 0 - 115
src/pagesStudy/pages/targeted-setting/targeted-setting copy.vue

@@ -1,115 +0,0 @@
-<template>
-  <ie-page bg-color="#F6F8FA" :fix-height="true">
-    <ie-navbar title="定向刷题" />
-    <view class="p-32 bg-white flex items-center justify-between">
-      <view class="">
-        <text class="text-32 text-fore-title font-bold">添加定向院校</text>
-        <text class="ml-10 text-32 text-fore-title font-bold">({{ directedSchoolList.length }}/3)</text>
-      </view>
-    </view>
-    <view class="px-48 pt-52 pb-32 flex items-center justify-between">
-      <view class="text-32 text-fore-title font-bold">我的定向院校</view>
-    </view>
-    <view class="relative">
-      <view class="px-30">
-        <l-drag ref="dragRef" :list="sortList" :column="1" gridHeight="104px" :touchHandle="touchHandle" ghost handle
-          @change="changeSort">
-          <!-- // 每一项的插槽 grid 的 content 您传入的数据 -->
-          <template #grid="{ active, content, index }">
-            <!-- // grid.active 是否为当前拖拽项目 根据自己需要写样式 -->
-            <view class="bg-white rounded-10 py-28 pl-30 pr-20 relative flex items-center gap-x-16 mb-20"
-              :class="{ 'border border-solid border-primary': active }">
-              <view
-                class="w-44 text-64 text-primary font-bold absolute top-6 left-14 italic leading-[1] opacity-30 z-1">
-                {{ index + 1 }}
-              </view>
-              <view slot="handle" @touchstart="touchHandle = true" @touchend="touchHandle = false">
-                <ie-image src="/pagesStudy/static/image/icon-drag.png" custom-class="w-46 h-46" mode="aspectFill" />
-              </view>
-              <view class="flex-1 min-w-1 flex items-center gap-x-20">
-                <ie-image :src="content.universityLogo" custom-class="w-96 h-96" mode="aspectFill" />
-                <view class="flex-1 min-w-1">
-                  <view class="text-28 text-fore-title font-bold">{{ content.universityName }}</view>
-                  <view class="mt-8 w-fit text-20 text-primary border border-solid border-primary rounded-4 px-10 py-4">
-                    {{ content.majorName }}
-                  </view>
-                  <view class="flex items-center justify-between text-20">
-                    <view class="mt-8  text-fore-light">{{ content.majorAncestors }}</view>
-                    <view v-if="index === 0"
-                      class="flex items-center gap-x-4 text-white bg-gradient-to-r from-[#FED448] to-[#F9942F] rounded-full px-12 py-4">
-                      <ie-image src="/pagesStudy/static/image/icon-check-white.png" custom-class="w-24 h-24" />
-                      <text>定向学习中</text>
-                    </view>
-                    <view v-else class="flex items-center gap-x-4 text-22 text-primary px-12 py-4"
-                      @click="handleSetDirectedSchool(content, index)">
-                      <text>设置定向</text>
-                    </view>
-                  </view>
-                </view>
-              </view>
-            </view>
-          </template>
-          <template #ghots></template>
-        </l-drag>
-      </view>
-      <view v-if="sortList.length === 0" class="flex-1 flex flex-col items-center justify-center gap-y-50">
-        <ie-image src="/pagesStudy/static/image/icon-empty.png" custom-class="w-364 h-252 mx-auto" mode="aspectFill" />
-        <text class="text-30 text-fore-light text-center">目前暂无定向院校~</text>
-      </view>
-    </view>
-    <ie-safe-toolbar v-if="directedSchoolList.length < 3" :height="84" :shadow="false">
-      <view class="px-46 pt-24">
-        <ie-button type="primary" @click="handleAdd">添加</ie-button>
-      </view>
-    </ie-safe-toolbar>
-  </ie-page>
-</template>
-
-<script lang="ts" setup>
-import { useTransferPage } from '@/hooks/useTransferPage';
-import { DirectedSchool } from '@/types/study';
-import { useUserStore } from '@/store/userStore';
-
-const userStore = useUserStore();
-const { transferTo } = useTransferPage();
-const loading = ref(true);
-const sortList = ref<DirectedSchool[]>([]);
-const touchHandle = ref(false)
-const { directedSchoolList } = toRefs(userStore);
-const handleSetDirectedSchool = async (item: DirectedSchool, index: number) => {
-  // 将该院校设置为第一个
-  const list = [...directedSchoolList.value];
-  list.splice(index, 1);
-  list.unshift(item);
-  save(list);
-}
-const dragRef = ref();
-const handleAdd = () => {
-  transferTo('/pagesStudy/pages/targeted-add/targeted-add', {
-    data: {}
-  });
-}
-
-const changeSort = (e: any) => {
-  const list = e.map((item: any) => item.content);
-  save(list);
-}
-const save = async (list: DirectedSchool[]) => {
-  uni.$ie.showLoading();
-  await userStore.saveDirectedSchoolList(list);
-  await refresh();
-  uni.$ie.hideLoading();
-  uni.$ie.showSuccess('设置成功');
-  loading.value = false;
-}
-const refresh = async () => {
-  sortList.value = [...directedSchoolList.value];
-}
-onShow(() => {
-  nextTick(() => {
-    refresh();
-  });
-});
-</script>
-
-<style lang="scss" scoped></style>