From 9b43bb048d3e10d49abfbe60483e07f4c09f6e22 Mon Sep 17 00:00:00 2001 From: wanganxp Date: Wed, 19 Jul 2023 04:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84getCurrentPages=E5=92=8C?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0=E7=9A=84=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get-current-pages/get-current-pages.uvue | 59 +++++++++++-------- .../get-launch-options-sync.uvue | 18 +++--- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue index f454273b..509b20b3 100644 --- a/pages/API/get-current-pages/get-current-pages.uvue +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -1,28 +1,37 @@ + export default { + data() { + return { + checked: false, + result:"" + } + }, + methods: { + getCurrentPages: function () { + const pages = getCurrentPages() + let tmps ="当前页面栈中有" + pages.length.toString() + "个页面。列表如下:\n" + for (let i = 0; i < pages.length; i++) { + tmps = tmps + pages[i].route + "\n" + } + this.result = tmps + // console.log('pages: ',pages.toString()); + // TODO 判断条件不对,需要根据自动化测试执行脚本准确验证所有栈内页面 + if (pages[0].route.includes('/tabBar/')) { + this.checked = true + } + for (let i = 1; i < pages.length; i++) { + if (pages[i].route.includes('/tabBar/')) { + this.checked = false + } + } + }, + }, + } + \ No newline at end of file diff --git a/pages/API/get-launch-options-sync/get-launch-options-sync.uvue b/pages/API/get-launch-options-sync/get-launch-options-sync.uvue index 68d9d8b7..8e564834 100644 --- a/pages/API/get-launch-options-sync/get-launch-options-sync.uvue +++ b/pages/API/get-launch-options-sync/get-launch-options-sync.uvue @@ -2,22 +2,26 @@ + 结果:{{result}} + \ No newline at end of file -- GitLab