From f79caf661e17a6d71bddcf9dbe5860da2b36e375 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Sat, 14 Sep 2024 09:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E5=8A=BF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/YNEduApp/exam/exam.vue | 12 ++++++++++++ pages/YNEduApp/exam/examination.vue | 12 ++++++++++++ pages/YNEduApp/exam/examinationDetails.vue | 12 ++++++++++++ pages/YNEduApp/learnProj/learnProj.vue | 12 ++++++++++++ pages/YNEduApp/learnProj/learnProjDetail.vue | 12 ++++++++++++ pages/YNEduApp/prac/exercises.vue | 12 ++++++++++++ pages/YNEduApp/prac/prac.vue | 12 ++++++++++++ 7 files changed, 84 insertions(+) diff --git a/pages/YNEduApp/exam/exam.vue b/pages/YNEduApp/exam/exam.vue index 29496f6..9d29802 100644 --- a/pages/YNEduApp/exam/exam.vue +++ b/pages/YNEduApp/exam/exam.vue @@ -191,6 +191,18 @@ export default { url: `/pages/YNEduApp/exam/examinationList?params=${JSON.stringify(params)}` }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/exam/examination.vue b/pages/YNEduApp/exam/examination.vue index cd4d528..59964e8 100644 --- a/pages/YNEduApp/exam/examination.vue +++ b/pages/YNEduApp/exam/examination.vue @@ -561,7 +561,19 @@ export default { console.log(err) } }) + }, + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/exam/examinationDetails.vue b/pages/YNEduApp/exam/examinationDetails.vue index ae62313..dffbfff 100644 --- a/pages/YNEduApp/exam/examinationDetails.vue +++ b/pages/YNEduApp/exam/examinationDetails.vue @@ -213,6 +213,18 @@ export default { } }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/learnProj/learnProj.vue b/pages/YNEduApp/learnProj/learnProj.vue index 85c479a..ebfcce0 100644 --- a/pages/YNEduApp/learnProj/learnProj.vue +++ b/pages/YNEduApp/learnProj/learnProj.vue @@ -248,6 +248,18 @@ export default { } }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/learnProj/learnProjDetail.vue b/pages/YNEduApp/learnProj/learnProjDetail.vue index 4fcba7a..3091427 100644 --- a/pages/YNEduApp/learnProj/learnProjDetail.vue +++ b/pages/YNEduApp/learnProj/learnProjDetail.vue @@ -374,6 +374,18 @@ export default { url: '/pages/YNEduApp/learnProj/learnProj' }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/prac/exercises.vue b/pages/YNEduApp/prac/exercises.vue index d763f3f..9f66cd7 100644 --- a/pages/YNEduApp/prac/exercises.vue +++ b/pages/YNEduApp/prac/exercises.vue @@ -832,6 +832,18 @@ export default { } }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } } diff --git a/pages/YNEduApp/prac/prac.vue b/pages/YNEduApp/prac/prac.vue index 5476f50..fd1473a 100644 --- a/pages/YNEduApp/prac/prac.vue +++ b/pages/YNEduApp/prac/prac.vue @@ -132,6 +132,18 @@ export default { url: '/pages/YNEduApp/prac/exercises?params=' + JSON.stringify(params) }) } + }, + onBackPress(options) { + console.log(options) + if (options.from == 'backbutton') { + // 来自手势返回 + console.log('手势返回') + // 返回为 true 时,不会执行返回操作,可以自定义返回逻辑 + // 返回为 false 或者不返回时,则执行默认返回操作 + return true + } + // 返回为 false 或者不返回时,则执行默认返回操作 + return false } }