From 72c5f98ee1a2ffeff800b683d8a4e04a5797572f Mon Sep 17 00:00:00 2001 From: hdx Date: Mon, 27 May 2024 17:09:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(navigator):=20=E5=A2=9E=E5=8A=A0=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/navigator/navigator.uvue | 42 +++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/pages/API/navigator/navigator.uvue b/pages/API/navigator/navigator.uvue index 2256e8a1..0477d3c5 100644 --- a/pages/API/navigator/navigator.uvue +++ b/pages/API/navigator/navigator.uvue @@ -32,7 +32,8 @@ + + @@ -59,7 +60,18 @@ onLoadTime: 0, onShowTime: 0, onReadyTime: 0, - onHideTime: 0, + onHideTime: 0, + animationTypeList: [ + 'slide-in-right', + 'slide-in-left', + 'slide-in-top', + 'slide-in-bottom', + 'pop-in', + 'fade-in', + 'zoom-out', + 'zoom-fade-out', + 'none', + ] } }, onLoad() { @@ -109,7 +121,31 @@ }, navigateTo() { uni.navigateTo({ - url: '/pages/API/navigator/new-page/new-page-1?data=Hello', + url: '/pages/API/navigator/new-page/new-page-1?data=Hello', + animationType: 'fade-in', + animationDuration: 200, + success(result) { + console.log('navigateTo success', result.errMsg) + // 自动化测试 + setLifeCycleNum(state.lifeCycleNum + 1) + }, + fail(error) { + console.log('navigateTo fail', error.errMsg) + // 自动化测试 + setLifeCycleNum(state.lifeCycleNum - 1) + }, + complete(result) { + console.log('navigateTo complete', result.errMsg) + // 自动化测试 + setLifeCycleNum(state.lifeCycleNum + 1) + }, + }) + }, + navigateToAnimationType(animationType: string) { + uni.navigateTo({ + url: '/pages/API/navigator/new-page/new-page-1?data=Hello', + animationType: animationType, + animationDuration: 200, success(result) { console.log('navigateTo success', result.errMsg) // 自动化测试 -- GitLab