From 7e1a3ecd419b94abd333e56d444e1bd89733a93d Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Thu, 9 Jan 2025 18:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=95=8C=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/App.vue | 18 ++++++++++++------ im-uniapp/manifest.json | 6 +++--- im-uniapp/pages.json | 5 ++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/im-uniapp/App.vue b/im-uniapp/App.vue index cb6ece5..ad55083 100644 --- a/im-uniapp/App.vue +++ b/im-uniapp/App.vue @@ -356,6 +356,15 @@ export default { url: '/user/self', method: 'GET' }) + }, + closeSplashscreen(delay) { + // #ifdef APP-PLUS + // 关闭开机动画 + setTimeout(() => { + console.log("plus.navigator.closeSplashscreen()") + plus.navigator.closeSplashscreen() + }, delay) + // #endif } }, onLaunch() { @@ -365,17 +374,14 @@ export default { this.refreshToken(loginInfo).then(() => { // 初始化 this.init(); - // 跳转到聊天页面 - uni.switchTab({ - url: "/pages/chat/chat" - }) + this.closeSplashscreen(0); }).catch(() => { // 跳转到登录页 - // #ifdef H5 uni.navigateTo({ url: "/pages/login/login" }) - // #endif + // 延迟1s,避免用户看到页面跳转动画 + this.closeSplashscreen(1000); }) } } diff --git a/im-uniapp/manifest.json b/im-uniapp/manifest.json index 36b75c1..cfbc8be 100644 --- a/im-uniapp/manifest.json +++ b/im-uniapp/manifest.json @@ -11,9 +11,9 @@ "nvueStyleCompiler" : "uni-app", "compilerVersion" : 3, "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, + "alwaysShowBeforeRender" : false, + "waiting" : false, + "autoclose" : false, "delay" : 0 }, /* 模块配置 */ diff --git a/im-uniapp/pages.json b/im-uniapp/pages.json index a17086a..dd86682 100644 --- a/im-uniapp/pages.json +++ b/im-uniapp/pages.json @@ -8,14 +8,13 @@ } }, "pages": [{ + "path": "pages/chat/chat" + }, { "path": "pages/login/login" }, { "path": "pages/register/register" }, - { - "path": "pages/chat/chat" - }, { "path": "pages/friend/friend" },