From b77e8e776af4d81e748e9e21d51b64a11085a195 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期四, 19 十二月 2024 10:49:11 +0800 Subject: [PATCH] 未提交退出提示 --- packageBookService/pages/psychologyAnswer/psychologyAnswer.js | 43 +++++++++++++++++-------------------------- 1 files changed, 17 insertions(+), 26 deletions(-) diff --git a/packageBookService/pages/psychologyAnswer/psychologyAnswer.js b/packageBookService/pages/psychologyAnswer/psychologyAnswer.js index ad07a50..bde6646 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,11 +486,16 @@ loading: false, showDialog: false, }); + this.setData({ + isShowDialog: true, + submitStatus: true, + }); }, // 鍒濆鍖栧嚱鏁� async init(isReset) { this.setData({ - loading: false, + showDialog: true, + loading: true, }); const questuionName = this.data.questuionName const questuionList = pastData.postData.list @@ -723,25 +715,24 @@ this.setData({ questionDataList: newArr, scoreDataList: scoreArr, + loading: false, }) } catch (error) { this.setData({ questionDataList: newArr, - scoreDataList: scoreArr + scoreDataList: scoreArr, + loading: false, }) console.log(error); } + const e = { + detail: { + index: 0 + } + }; + this.changeSwiper(e) }); }, - - - - - - - - - // 璁板綍妯¤�冪瓟棰樻暟鎹� saveMockData() { -- Gitblit v1.9.1