From 8ee2fc8dc1816dbbfc7962649f1131c33562b560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 13 Sep 2024 14:45:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=9C=80=E5=A4=A7=E8=BE=93=E5=85=A5=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=202.=20=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=97=B6=E6=98=BE=E7=A4=BA=E5=8E=9F=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pages/safeQuestion/safeQuestion.vue | 8 +++--- .../updateSafeQuestion/updateSafeQuestion.vue | 26 ++++++++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/pages.json b/pages.json index c8331f0..c6faf86 100644 --- a/pages.json +++ b/pages.json @@ -60,7 +60,7 @@ { "path": "pages/updateSafeQuestion/updateSafeQuestion", "style": { - "navigationBarTitleText": "修改安全问题" + "navigationBarTitleText": "安全问题" } }, { diff --git a/pages/safeQuestion/safeQuestion.vue b/pages/safeQuestion/safeQuestion.vue index fc67494..6d4d2ae 100644 --- a/pages/safeQuestion/safeQuestion.vue +++ b/pages/safeQuestion/safeQuestion.vue @@ -7,7 +7,7 @@ - 修改 @@ -51,8 +51,10 @@ export default { return } this.routeJump({ - type: 'redirectTo', - name: 'updateSafeQuestion' + name: 'updateSafeQuestion', + params: { + questionAnswer: JSON.stringify(this.questionAnswer) + } }) } } diff --git a/pages/updateSafeQuestion/updateSafeQuestion.vue b/pages/updateSafeQuestion/updateSafeQuestion.vue index c4fb2a0..c7b88f9 100644 --- a/pages/updateSafeQuestion/updateSafeQuestion.vue +++ b/pages/updateSafeQuestion/updateSafeQuestion.vue @@ -7,7 +7,7 @@ - @@ -16,7 +16,7 @@ - @@ -25,7 +25,7 @@ - 保存 @@ -65,14 +65,26 @@ export default { answer: '' }], show: false, - pending: false + pending: false, + questionAnswer: null } }, computed: { ...mapState(useUserStore, ['userInfo']) }, - onLoad() { - this.getQuestionList() + async onLoad (data) { + await this.getQuestionList() + const questionAnswer = JSON.parse(data.questionAnswer) + if (questionAnswer) { + this.questionAnswer = questionAnswer + this.answer = questionAnswer.map(item => { + return { + question: item.question, + answer: item.answer, + questionId: item.questionId + } + }) + } }, methods: { ...mapActions(useUserStore, ['updateUserInfo']), @@ -113,7 +125,7 @@ export default { ...this.userInfo, haveSafeAnswer: 1 }) - this.backAndToast('设置成功') + this.backAndToast('设置成功', 2) } else { uni.showToast({ title: message,