From ce062b3ff6d8e3db929820d004972df893882d4e Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期三, 18 十二月 2024 09:47:49 +0800
Subject: [PATCH] bug优化

---
 packageBookService/pages/psychologyAnswer/psychologyAnswer.js |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/packageBookService/pages/psychologyAnswer/psychologyAnswer.js b/packageBookService/pages/psychologyAnswer/psychologyAnswer.js
index ad07a50..a913ecf 100644
--- a/packageBookService/pages/psychologyAnswer/psychologyAnswer.js
+++ b/packageBookService/pages/psychologyAnswer/psychologyAnswer.js
@@ -282,21 +282,12 @@
   },
   // 鍒囨崲棰樼洰
   changeSwiper(e) {
-    let index = e.detail.index - 1 >= 0 ? e.detail.index - 1 : 0;
-    const item = this.data.questionDataList[index];
-    const lastItem = this.data.questionDataList[index + 1];
+    let index = e.detail.index;
+    const lastItem = this.data.questionDataList[index];
     this.setData({
       currentIndex: e.detail.index,
       showId: lastItem.id
     });
-    if (
-      (this.data.answerType == "collectQuestion" ||
-        this.data.answerType == "errorQuestion") &&
-      !item.isComplete
-    ) {
-      let flag = this.isHaveAnswer(item.userAnswer);
-      if (flag) this.handleQuestion(index);
-    }
   },
   // 鎴戠殑閿欓锛屾敹钘忔煡鐪嬭В鏋愭寜閽�
   viewParsing() {
@@ -471,10 +462,6 @@
     // 鍏堥亶鍘嗘墍鏈夐鐩紝灏嗘湭鎵规敼鐨勯鐩壒鏀�
     const qustionList = this.data.questionDataList;
     if (qustionList.length) this.handleQuestion();
-    this.setData({
-      isShowDialog: true,
-      submitStatus: true,
-    })
     // 璁板綍鐢ㄦ埛绛旈鏁版嵁
     let saveData = [];
     for (let index = 0; index < this.data.questionDataList.length; index++) {
@@ -499,6 +486,10 @@
       loading: false,
       showDialog: false,
     });
+    this.setData({
+      isShowDialog: true,
+      submitStatus: true,
+    });
   },
   // 鍒濆鍖栧嚱鏁�
   async init(isReset) {

--
Gitblit v1.9.1