Browse Source

修复跳转问题

shmily1213 3 tuần trước cách đây
mục cha
commit
d463ee72ce

+ 13 - 3
src/pagesStudy/pages/simulation-start/simulation-start.vue

@@ -63,6 +63,7 @@ const { prevData, transferTo } = useTransferPage();
 const userStore = useUserStore();
 
 const isReady = ref(false);
+const examineeId = ref();
 const paperInfo = ref<Study.ExamineePaperInfo>({
   score: 0,
   time: 0,
@@ -81,7 +82,16 @@ const subjectInfo = computed(() => {
   return prevData.value.subjectInfo;
 });
 const handleStartTest = () => {
-  transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis')
+  // transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis')
+  transferTo('/pagesStudy/pages/start-exam/start-exam', {
+    data: {
+      paperType: 'Simulated',
+      name: '模拟考试-' + subjectInfo.value.subject,
+      simulationInfo: {
+        examineeId: examineeId.value
+      }
+    }
+  });
 }
 const loadData = async () => {
   uni.$ie.showLoading('AI智能出卷中...');
@@ -94,12 +104,12 @@ const loadData = async () => {
     uni.$ie.hideLoading();
     return;
   }
-  const { paperId } = data;
+  examineeId.value = data.examineeId;
   paperInfo.value = {
     ...data.paperInfo,
     time: Math.round(data.paperInfo.time / 60)
   }
-  const { data: paperData } = await getPaper({ type: 'Simulated', id: paperId });
+  const { data: paperData } = await getPaper({ type: 'Simulated', id: data.paperId });
   if (paperData) {
     questions.value = paperData.questions;
     isReady.value = true;

+ 7 - 7
src/pagesStudy/pages/start-exam/start-exam.vue

@@ -17,7 +17,7 @@
         <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 stateQuestionList" :key="index">
+          <swiper-item class="h-full" v-for="(item, index) in questionList" :key="index">
             <question-wrap :question="item" @update:question="handleUpdateQuestion" />
           </swiper-item>
         </swiper>
@@ -188,7 +188,7 @@ const beforeQuit = () => {
   });
 };
 const currentQuestion = computed(() => {
-  return stateQuestionList.value[currentIndex.value] || {};
+  return questionList.value[currentIndex.value] || {};
 });
 const hanadleNavigate = (index: number) => {
   changeIndex(index);
@@ -219,7 +219,7 @@ const handleCalendar = () => {
 };
 
 const handleSwiperTransition = (e: any) => {
-  if (currentIndex.value === stateQuestionList.value.length - 1) {
+  if (currentIndex.value === questionList.value.length - 1) {
     if (!transitionStartX.value) {
       transitionStartX.value = e.detail.dx;
     } else {
@@ -238,7 +238,7 @@ const stopTime = () => {
 }
 
 const handleSwiperAnimationFinish = (e: any) => {
-  if (transitionStartX.value == null || transitionEndX.value == null || currentIndex.value !== stateQuestionList.value.length - 1) {
+  if (transitionStartX.value == null || transitionEndX.value == null || currentIndex.value !== questionList.value.length - 1) {
     isAnimationFinish.value = true;
     transitionStartX.value = null;
     transitionEndX.value = null;
@@ -297,14 +297,14 @@ const autoSubmit = () => {
 }
 
 const handleSubmit = (tempSave: boolean = false) => {
-  console.log('handleSubmit', stateQuestionList.value)
+  console.log('handleSubmit', questionList.value)
   const msg = tempSave ? '保存中...' : '提交中...';
   uni.$ie.showLoading(msg);
   setTimeout(() => {
     uni.$ie.hideLoading();
     const params = {
       ...paperData.value,
-      questions: stateQuestionList.value.map(item => {
+      questions: questionList.value.map(item => {
         return {
           ...item,
           isDone: tempSave ? item.isDone : true
@@ -321,7 +321,7 @@ const handleSubmit = (tempSave: boolean = false) => {
 }
 
 const handleUpdateQuestion = (question: Study.Question) => {
-  if (currentIndex.value === stateQuestionList.value.length - 1) {
+  if (currentIndex.value === questionList.value.length - 1) {
     autoSubmit();
   }
 }

+ 3 - 1
src/uni_modules/fast-guide/components/fast-guide/fast-guide.vue

@@ -307,7 +307,7 @@ export default {
         'top': top,
         'left': left,
         'right': right,
-        'transition': `all ${this.duration}ms`,
+        // 'transition': `all ${this.duration}ms`,
         'animation-name': animationName,
         '-webkit-animation-name': animationName,
 
@@ -334,8 +334,10 @@ export default {
       this.$emit('last', this.callBackData())
     },
     skipStep() {
+      this.contentVisible = false;
       this.pathInit()
       setTimeout(() => {
+        this.$emit('update:show', false)
         this.$emit('skip', this.callBackData())
       }, this.duration)
     },