From 1f760b5089a8597a640f772fe44d0502b810dddf Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Sat, 12 Aug 2023 16:31:18 +0800
Subject: [PATCH] feat(App): add scroll-view
---
pages/SyntaxCase/index.uvue | 787 ++++++++++++++++---------------
pages/SyntaxCase/utsAndroid.uvue | 460 +++++++++---------
pages/index/basicTest.uvue | 111 ++---
3 files changed, 705 insertions(+), 653 deletions(-)
diff --git a/pages/SyntaxCase/index.uvue b/pages/SyntaxCase/index.uvue
index 5781e1f..3e3905b 100644
--- a/pages/SyntaxCase/index.uvue
+++ b/pages/SyntaxCase/index.uvue
@@ -1,396 +1,445 @@
+
+
+
-
- 测试return:
- {{ format(testUtsSyncResult) }}
-
-
- 测试return:{{ format(testUtsSyncWithCallbackResult.return) }}
- 测试success:{{ format(testUtsSyncWithCallbackResult.success) }}
- 测试complete:{{ format(testUtsSyncWithCallbackResult.complete) }}
-
-
- 测试callback:{{ format(testUtsClassConstructorResult.callback) }}
-
- 测试value:{{ format(testUtsClassStaticPropResult) }}
-
- 测试return:{{ format(testUtsClassStaticSyncWithCallbackResult.return) }}
- 测试success:{{ format(testUtsClassStaticSyncWithCallbackResult.success) }}
- 测试complete:{{ format(testUtsClassStaticSyncWithCallbackResult.complete) }}
-
-
- 测试value:{{ format(testUtsClassPropResult) }}
-
- 测试return:{{ format(testUtsClassSyncWithCallbackResult.return) }}
- 测试success:{{ format(testUtsClassSyncWithCallbackResult.success) }}
- 测试complete:{{ format(testUtsClassSyncWithCallbackResult.complete) }}
-
-
- 测试prop:{{ format(testUtsClassInstanceResult.prop) }}
- 测试return:{{ format(testUtsClassInstanceResult.return) }}
- 测试success:{{ format(testUtsClassInstanceResult.success) }}
- 测试complete:{{ format(testUtsClassInstanceResult.complete) }}
- 测试callback:{{ format(testUtsClassInstanceResult.callback) }}
-
+
+ 测试prop:{{ format(testUtsClassInstanceResult.prop) }}
+ 测试return:{{ format(testUtsClassInstanceResult.return) }}
+ 测试success:{{ format(testUtsClassInstanceResult.success) }}
+ 测试complete:{{ format(testUtsClassInstanceResult.complete) }}
+ 测试callback:{{ format(testUtsClassInstanceResult.callback) }}
+
+
+
+
\ No newline at end of file
+ } catch (e) {}
+ },
+ // async testUtsClassAsync() {
+ // if (test != null) {
+ // this.testUtsClassConstructor()
+ // }
+ // this.testUtsClassAsyncResult.return = FALSE;
+ // this.testUtsClassAsyncResult.success = FALSE;
+ // // testUtsClassAsyncResult.fail = FALSE;
+ // this.testUtsClassAsyncResult.complete = FALSE;
+ // try {
+ // const res = await test.testClassAsync({
+ // type: "success",
+ // success: (res) => {
+ // console.log("testAsync.success.callback", res);
+ // this.testUtsClassAsyncResult.success = TRUE;
+ // },
+ // fail: (res) => {
+ // console.log("testAsync.fail.callback", res);
+ // },
+ // complete: (res) => {
+ // console.log("testAsync.complete.callback", res);
+ // this.testUtsClassAsyncResult.complete = TRUE;
+ // },
+ // });
+ // console.log('res', res)
+ // if (res.name === "testAsync") {
+ // this.testUtsClassAsyncResult.return = TRUE;
+ // }
+ // } catch (e) {
+ // console.error(e)
+ // }
+ // },
+ testUtsClassInstance() {
+ this.testUtsClassInstanceResult.prop = FALSE
+ this.testUtsClassInstanceResult.return = FALSE
+ this.testUtsClassInstanceResult.success = FALSE
+ // testUtsClassAsyncResult.fail = FALSE;
+ this.testUtsClassInstanceResult.complete = FALSE
+ this.testUtsClassInstanceResult.callback = FALSE
+ const url = 'https://dcloud.io/'
+ const task = request(url)
+ if (task != null) {
+ if (task.url === url && task.abort().url === url) {
+ this.testUtsClassInstanceResult.prop = TRUE
+ }
+ task.onCallback((res) => {
+ if (res === 'onCallback') {
+ this.testUtsClassInstanceResult.callback = TRUE
+ }
+ })
+ const res = task.sync({
+ success: (res) => {
+ console.log('task.sync.success.callback', res)
+ this.testUtsClassInstanceResult.success = TRUE
+ },
+ fail: (res) => {
+ console.log('task.sync.fail.callback', res)
+ },
+ complete: (res) => {
+ console.log('task.sync.complete.callback', res)
+ this.testUtsClassInstanceResult.complete = TRUE
+ },
+ } as SyncOptions)
+ if (res === 'sync') {
+ this.testUtsClassInstanceResult.return = TRUE
+ }
+ }
+ },
+ },
+}
+
diff --git a/pages/SyntaxCase/utsAndroid.uvue b/pages/SyntaxCase/utsAndroid.uvue
index 084e0e7..2eb8636 100644
--- a/pages/SyntaxCase/utsAndroid.uvue
+++ b/pages/SyntaxCase/utsAndroid.uvue
@@ -1,238 +1,240 @@
-
-
-
- 逐一点击执行,观察测试反馈
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1. 当前页面已通过initAppLifecycle函数注册了生命周期监听。
-
-
- 2. 手动切换其他APP再返回,可在控制台和界面观察事件日志
-
-
-
-
- {{text}}
-
-
-
-
-
-
-
-
- 获取设备信息,观察是否符合预期
-
-
-
-
+
+
+
+
+
+ 逐一点击执行,观察测试反馈
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1. 当前页面已通过initAppLifecycle函数注册了生命周期监听。
+
+
+ 2. 手动切换其他APP再返回,可在控制台和界面观察事件日志
+
+
+
+
+ {{ text }}
+
+
+
+
+
+
+
+ 获取设备信息,观察是否符合预期
+
+
+
+
+
+
\ No newline at end of file
+.testButton {
+ width: 100%;
+}
+
diff --git a/pages/index/basicTest.uvue b/pages/index/basicTest.uvue
index b409578..88d5427 100644
--- a/pages/index/basicTest.uvue
+++ b/pages/index/basicTest.uvue
@@ -1,66 +1,67 @@
-
-
-
- {{names[index]}}测试结果:
-
- 测试api:{{item.passed.join(', ')}}
-
- 总共:{{item.total}}
- 通过:{{item.passed.length}}
- 失败:{{item.failed.length}}
-
- {{fail}}
-
+
+
+
+
+
+
+ {{ names[index] }}测试结果:
+ 测试api:{{ item.passed.join(', ') }}
+ 总共:{{ item.total }}
+ 通过:{{ item.passed.length }}
+ 失败:{{ item.failed.length }}
+
+ {{ fail }}
+
+
+
+
-
\ No newline at end of file
+.result {
+ margin-bottom: 20rpx;
+}
+
--
GitLab