diff --git a/main.uts b/main.uts
index f8fa502212cd567f9ee877a33b293b86e2c776d7..f321b3c4f1191409326709752fc3c05d4a943163 100644
--- a/main.uts
+++ b/main.uts
@@ -19,8 +19,8 @@ export function createApp() {
str: 'default reactive string',
num: 0,
bool: false,
- })
- app.config.globalProperties.globalPropertiesFn = () : string => {
+ } as UTSJSONObject)
+ app.config.globalProperties.globalPropertiesFn = function () : string {
console.log('this.globalPropertiesStr', this.globalPropertiesStr)
console.log('this.globalPropertiesNum', this.globalPropertiesNum)
return `globalPropertiesStr: ${this.globalPropertiesStr}, globalPropertiesNum: ${this.globalPropertiesNum}`
@@ -29,4 +29,4 @@ export function createApp() {
return {
app
}
-}
+}
diff --git a/pages.json b/pages.json
index 29513c3a1bb6e50745afc9b6f4894a6ded83538e..8dec1fa70376619f24e36867fb912994b62cbd46 100644
--- a/pages.json
+++ b/pages.json
@@ -163,7 +163,7 @@
"style": {
"navigationBarTitleText": "video-format"
}
- },
+ },
{
"path": "pages/component/web-view/web-view",
"style": {
@@ -344,13 +344,14 @@
"navigationBarTitleText": "数据存储"
}
},
+ // #ifndef WEB
{
"path": "pages/API/get-file-system-manager/get-file-system-manager",
"style": {
- "navigationBarTitleText": "沙盒文件管理"
+ "navigationBarTitleText": "文件管理"
}
},
-
+ // #endif
{
"path": "pages/API/action-sheet/action-sheet",
"style": {
@@ -393,23 +394,23 @@
"navigationBarTitleText": "获取定位"
}
},
- {
- "path": "pages/API/interceptor/interceptor",
- "style": {
- "navigationBarTitleText": "拦截器"
- }
- },
- {
- "path": "pages/API/interceptor/page1",
- "style": {
- "navigationBarTitleText": "拦截器测试页面 1"
- }
- },
- {
- "path": "pages/API/interceptor/page2",
- "style": {
- "navigationBarTitleText": "拦截器测试页面 2"
- }
+ {
+ "path": "pages/API/interceptor/interceptor",
+ "style": {
+ "navigationBarTitleText": "拦截器"
+ }
+ },
+ {
+ "path": "pages/API/interceptor/page1",
+ "style": {
+ "navigationBarTitleText": "拦截器测试页面 1"
+ }
+ },
+ {
+ "path": "pages/API/interceptor/page2",
+ "style": {
+ "navigationBarTitleText": "拦截器测试页面 2"
+ }
},
{
"path": "pages/API/request/request",
@@ -543,6 +544,7 @@
"navigationBarTitleText": "get-window-info"
}
},
+ // #ifndef WEB
{
"path": "pages/API/facial-recognition-verify/facial-recognition-verify",
"style": {
@@ -550,6 +552,7 @@
"enablePullDownRefresh": false
}
},
+ // #endif
{
"path": "pages/API/element-takesnapshot/element-takesnapshot",
"style": {
@@ -1071,46 +1074,50 @@
}
},
{
- "path": "pages/component/sticky-header/sticky-header",
+ "path": "pages/component/sticky-header/sticky-header",
"style": {
- "navigationBarTitleText": "sticky-header",
+ "navigationBarTitleText": "sticky-header",
"enablePullDownRefresh": false
}
},
{
- "path": "pages/component/general-event/transition-event",
- "style": {
- "navigationBarTitleText": "transitionend事件",
+ "path": "pages/component/general-event/transition-event",
+ "style": {
+ "navigationBarTitleText": "transitionend事件",
"enablePullDownRefresh" : false
}
},
+ // #ifndef WEB
{
- "path": "pages/template/schema/schema",
- "style": {
- "navigationBarTitleText": "打开schema示例"
+ "path": "pages/template/schema/schema",
+ "style": {
+ "navigationBarTitleText": "打开schema示例"
}
},
+ // #endif
{
- "path": "pages/component/sticky-section/sticky-section",
- "style": {
- "navigationBarTitleText": "sticky-section",
+ "path": "pages/component/sticky-section/sticky-section",
+ "style": {
+ "navigationBarTitleText": "sticky-section",
"enablePullDownRefresh" : false
}
},
{
- "path": "pages/component/list-view/list-view-multiplex",
- "style": {
- "navigationBarTitleText": "list-view-multiplex",
+ "path": "pages/component/list-view/list-view-multiplex",
+ "style": {
+ "navigationBarTitleText": "list-view-multiplex",
"enablePullDownRefresh" : false
}
},
+ // #ifndef WEB
{
- "path": "pages/template/share/share",
- "style": {
- "navigationBarTitleText": "分享",
- "enablePullDownRefresh": false
+ "path": "pages/template/share/share",
+ "style": {
+ "navigationBarTitleText": "分享",
+ "enablePullDownRefresh": false
}
},
+ // #endif
{
"path" : "pages/component/general-event/touch-event",
"style" :
diff --git a/pages/API/download-file/download-file.test.js b/pages/API/download-file/download-file.test.js
index 9b41ee42097f2cf6240fd095bc47f1dafe551f33..3f15f2753ffee7cbd3ed17fc50a8ce2d80e78690 100644
--- a/pages/API/download-file/download-file.test.js
+++ b/pages/API/download-file/download-file.test.js
@@ -8,7 +8,7 @@ describe('ExtApi-DownloadFile', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
await page.callMethod('jest_downloadFile');
- await page.waitFor(500);
+ await page.waitFor(1000);
res = await page.data('jest_result');
});
diff --git a/pages/API/get-file-system-manager/get-file-system-manager.test.js b/pages/API/get-file-system-manager/get-file-system-manager.test.js
index 7fbc71e1b2d2a5169bf7ca1dcb181c2112bba6e9..105a953f11023c788f820ce1281aafe14c29f09b 100644
--- a/pages/API/get-file-system-manager/get-file-system-manager.test.js
+++ b/pages/API/get-file-system-manager/get-file-system-manager.test.js
@@ -43,21 +43,21 @@ describe('ExtApi-FileManagerTest', () => {
})
// 先清除文件,需要清除全部可能存在的历史测试文件,避免运行失败
- const btnUnLinkFileButton = await page.$('.btn-clear-file')
+ const btnUnLinkFileButton = await page.$('#btn-clear-file')
await btnUnLinkFileButton.tap()
await isDone()
// 清除文件夹
- const btnRmDirButton = await page.$('.btn-remove-dir')
+ const btnRmDirButton = await page.$('#btn-remove-dir')
await btnRmDirButton.tap()
await isDone()
// 重新创建测试目录
- const btnMkdDirButton = await page.$('.btn-mkdir')
+ const btnMkdDirButton = await page.$('#btn-mkdir')
await btnMkdDirButton.tap()
await isDone()
- const btnReadDirButton = await page.$('.btn-read-dir')
+ const btnReadDirButton = await page.$('#btn-read-dir')
await btnReadDirButton.tap()
await isDone()
@@ -104,7 +104,7 @@ describe('ExtApi-FileManagerTest', () => {
expect(JSON.stringify(fileListSuccess)).toEqual("[\"b\"]")
// 测试写入文件
- const btnWriteFileButton = await page.$('.btn-write-file')
+ const btnWriteFileButton = await page.$('#btn-write-file')
await btnWriteFileButton.tap()
await isDone()
// 检查目录列表数量
@@ -115,7 +115,7 @@ describe('ExtApi-FileManagerTest', () => {
fileListSuccess = await getData('fileListSuccess')
expect(JSON.stringify(fileListSuccess)).toEqual("[\"b\",\"1.txt\"]")
// 获取和对比 文件内容
- const btnReadFileButton = await page.$('.btn-read-file')
+ const btnReadFileButton = await page.$('#btn-read-file')
await btnReadFileButton.tap()
await isDone()
let readFileRet = await getData('readFileRet')
@@ -134,7 +134,7 @@ describe('ExtApi-FileManagerTest', () => {
readFileRet = await getData('readFileRet')
expect(readFileRet).toEqual("If you were a teardrop;In my eye,For fear of losing you,I would never cry.And if the golden sun,Should cease to shine its light,Just one smile from you,Would make my whole world bright.")
- const btnGetFileInfoButton = await page.$('.btn-get-file-info')
+ const btnGetFileInfoButton = await page.$('#btn-get-file-info')
await btnGetFileInfoButton.tap()
await isDone()
@@ -161,7 +161,7 @@ describe('ExtApi-FileManagerTest', () => {
copyFromFile:"a/1.txt",
copyToFile:"a/2.txt"
})
- const btnCopyFileButton = await page.$('.btn-copy-file')
+ const btnCopyFileButton = await page.$('#btn-copy-file')
await btnCopyFileButton.tap()
await isDone()
@@ -181,7 +181,7 @@ describe('ExtApi-FileManagerTest', () => {
renameToFile:"a/3.txt"
})
- const btnRenameFileButton = await page.$('.btn-rename-file')
+ const btnRenameFileButton = await page.$('#btn-rename-file')
await btnRenameFileButton.tap()
await isDone()
@@ -211,22 +211,22 @@ describe('ExtApi-FileManagerTest', () => {
// 先清除文件,需要清除全部可能存在的历史测试文件,避免运行失败
- const btnUnLinkFileButton = await page.$('.btn-unlink-file')
+ const btnUnLinkFileButton = await page.$('#btn-unlink-file')
await btnUnLinkFileButton.tap()
await isDone()
// 清除文件夹
- const btnRmDirButton = await page.$('.btn-remove-dir')
+ const btnRmDirButton = await page.$('#btn-remove-dir')
await btnRmDirButton.tap()
await isDone()
// 重新创建测试目录
- const btnMkdDirButton = await page.$('.btn-mkdir')
+ const btnMkdDirButton = await page.$('#btn-mkdir')
await btnMkdDirButton.tap()
await isDone()
- const btnReadDirButton = await page.$('.btn-read-dir')
+ const btnReadDirButton = await page.$('#btn-read-dir')
await btnReadDirButton.tap()
await isDone()
@@ -283,7 +283,7 @@ describe('ExtApi-FileManagerTest', () => {
// 获取和对比 文件内容
- const btnReadFileButton = await page.$('.btn-read-file')
+ const btnReadFileButton = await page.$('#btn-read-file')
await btnReadFileButton.tap()
await isDone()
let readFileRet = await getData('readFileRet')
@@ -299,7 +299,7 @@ describe('ExtApi-FileManagerTest', () => {
})
- const btnWriteFileButton = await page.$('.btn-write-file')
+ const btnWriteFileButton = await page.$('#btn-write-file')
await btnWriteFileButton.tap()
await isDone()
@@ -325,7 +325,7 @@ describe('ExtApi-FileManagerTest', () => {
getFileInfoAlgorithm:"md5",
})
- const btnGetFileInfoButton = await page.$('.btn-get-file-info')
+ const btnGetFileInfoButton = await page.$('#btn-get-file-info')
await btnGetFileInfoButton.tap()
await isDone()
@@ -367,7 +367,7 @@ describe('ExtApi-FileManagerTest', () => {
renameToFile:"a/没有提前创建的目录/3.txt"
})
- const btnRenameFileButton = await page.$('.btn-rename-file')
+ const btnRenameFileButton = await page.$('#btn-rename-file')
await btnRenameFileButton.tap()
await isDone()
@@ -404,7 +404,7 @@ describe('ExtApi-FileManagerTest', () => {
copyToFile:"a/提前创建的目录/4.txt"
})
- const btnCopyFileButton = await page.$('.btn-copy-file')
+ const btnCopyFileButton = await page.$('#btn-copy-file')
await btnCopyFileButton.tap()
await isDone()
@@ -457,22 +457,22 @@ describe('ExtApi-FileManagerTest', () => {
// 先清除文件,需要清除全部可能存在的历史测试文件,避免运行失败
- const btnClearFileButton = await page.$('.btn-clear-file')
+ const btnClearFileButton = await page.$('#btn-clear-file')
await btnClearFileButton.tap()
await isDone()
// 清除文件夹
- const btnRmDirButton = await page.$('.btn-remove-dir')
+ const btnRmDirButton = await page.$('#btn-remove-dir')
await btnRmDirButton.tap()
await isDone()
// 重新创建测试目录,期望通过 recursive = true的 文件夹删除,得到一个空的 /a 目录
- const btnMkdDirButton = await page.$('.btn-mkdir')
+ const btnMkdDirButton = await page.$('#btn-mkdir')
await btnMkdDirButton.tap()
await isDone()
- const btnReadDirButton = await page.$('.btn-read-dir')
+ const btnReadDirButton = await page.$('#btn-read-dir')
await btnReadDirButton.tap()
await isDone()
@@ -483,7 +483,7 @@ describe('ExtApi-FileManagerTest', () => {
// 检查资源文件,此时不存在
- const btnAccessFileButton = await page.$('.btn-access-file')
+ const btnAccessFileButton = await page.$('#btn-access-file')
await btnAccessFileButton.tap()
await isDone()
@@ -505,7 +505,7 @@ describe('ExtApi-FileManagerTest', () => {
expect(accessFileRet).toEqual('access:ok')
// 尝试删除资源,期望失败
- const btnUnLinkFileButton = await page.$('.btn-unlink-file')
+ const btnUnLinkFileButton = await page.$('#btn-unlink-file')
await btnUnLinkFileButton.tap()
await isDone()
@@ -520,7 +520,7 @@ describe('ExtApi-FileManagerTest', () => {
copyFromFile:"static/list-mock/safe.png",
copyToFile:"a/从代码目录拷贝的资源.png"
})
- const btnCopyFileButton = await page.$('.btn-copy-file')
+ const btnCopyFileButton = await page.$('#btn-copy-file')
await btnCopyFileButton.tap()
await isDone()
@@ -548,7 +548,7 @@ describe('ExtApi-FileManagerTest', () => {
expect(accessFileRet).toEqual('')
// 从页面的按钮触发一次文件复制
- const btnCopyStaticFileButton = await page.$('.btn-copyStatic-file')
+ const btnCopyStaticFileButton = await page.$('#btn-copyStatic-file')
await btnCopyStaticFileButton.tap()
await isDone()
@@ -598,21 +598,21 @@ describe('ExtApi-FileManagerTest', () => {
})
// 先清除文件,需要清除全部可能存在的历史测试文件,避免运行失败
- const btnUnLinkFileButton = await page.$('.btn-unlink-file')
+ const btnUnLinkFileButton = await page.$('#btn-unlink-file')
await btnUnLinkFileButton.tap()
await isDone()
// 清除文件夹
- const btnRmDirButton = await page.$('.btn-remove-dir')
+ const btnRmDirButton = await page.$('#btn-remove-dir')
await btnRmDirButton.tap()
await isDone()
// 重新创建测试目录,期望通过 recursive = true的 文件夹删除,得到一个空的 /a 目录
- const btnMkdDirButton = await page.$('.btn-mkdir')
+ const btnMkdDirButton = await page.$('#btn-mkdir')
await btnMkdDirButton.tap()
await isDone()
- const btnReadDirButton = await page.$('.btn-read-dir')
+ const btnReadDirButton = await page.$('#btn-read-dir')
await btnReadDirButton.tap()
await isDone()
@@ -622,17 +622,17 @@ describe('ExtApi-FileManagerTest', () => {
expect(JSON.stringify(fileListSuccess)).toEqual('[]')
// 先用utf-8 写入内容
- const btnWriteFileButton = await page.$('.btn-write-file')
+ const btnWriteFileButton = await page.$('#btn-write-file')
await btnWriteFileButton.tap()
await isDone()
- const btnReadFileButton = await page.$('.btn-read-file')
+ const btnReadFileButton = await page.$('#btn-read-file')
await btnReadFileButton.tap()
await isDone()
let readFileRet = await getData('readFileRet')
expect(readFileRet).toEqual("我爱北京天安门,天安门前太阳升")
- const btnGetFileInfoButton = await page.$('.btn-get-file-info')
+ const btnGetFileInfoButton = await page.$('#btn-get-file-info')
await btnGetFileInfoButton.tap()
await isDone()
@@ -729,7 +729,7 @@ describe('ExtApi-FileManagerTest', () => {
})
// 先清除文件,需要清除全部可能存在的历史测试文件,避免运行失败
- const btnUnLinkFileButton = await page.$('.btn-unlink-file')
+ const btnUnLinkFileButton = await page.$('#btn-unlink-file')
await btnUnLinkFileButton.tap()
await isDone()
@@ -746,15 +746,15 @@ describe('ExtApi-FileManagerTest', () => {
await isDone()
// // 清除文件夹
- const btnRmDirButton = await page.$('.btn-remove-dir')
+ const btnRmDirButton = await page.$('#btn-remove-dir')
await btnRmDirButton.tap()
await isDone()
// // 重新创建测试目录
- const btnMkdDirButton = await page.$('.btn-mkdir')
+ const btnMkdDirButton = await page.$('#btn-mkdir')
await btnMkdDirButton.tap()
await isDone()
- const btnReadDirButton = await page.$('.btn-read-dir')
+ const btnReadDirButton = await page.$('#btn-read-dir')
await btnReadDirButton.tap()
await isDone()
@@ -777,11 +777,11 @@ describe('ExtApi-FileManagerTest', () => {
let lastFailError = await getData('lastFailError')
console.log(lastFailError)
- const btnWriteFileButton = await page.$('.btn-write-file')
+ const btnWriteFileButton = await page.$('#btn-write-file')
await btnWriteFileButton.tap()
await isDone()
- const btnStatFileButton = await page.$('.btn-stat-file')
+ const btnStatFileButton = await page.$('#btn-stat-file')
await btnStatFileButton.tap()
await isDone()
@@ -819,7 +819,7 @@ describe('ExtApi-FileManagerTest', () => {
copyFromFile:'file:///android_asset/uni-uts/uni-prompt/toast_error.png',
copyToFile:'a/m/3.txt',
})
- const btnCopyFileButton = await page.$('.btn-copy-file')
+ const btnCopyFileButton = await page.$('#btn-copy-file')
await btnCopyFileButton.tap()
await isDone()
diff --git a/pages/API/get-file-system-manager/get-file-system-manager.uvue b/pages/API/get-file-system-manager/get-file-system-manager.uvue
index 622efb8cdf51a6c48a6e601be00ea657e8aedf90..d53702c84f7dca3fc664a9067019387cb358472d 100644
--- a/pages/API/get-file-system-manager/get-file-system-manager.uvue
+++ b/pages/API/get-file-system-manager/get-file-system-manager.uvue
@@ -4,20 +4,20 @@
显示简易操作日志,详细日志需真机运行查看
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+ id="btn-rename-file">重命名文件{{renameFromFile}}到{{renameToFile}}
+
+
+
+
+
+
@@ -76,7 +76,7 @@
methods: {
- statFileInfoTest: function (e : any) {
+ statFileInfoTest: function (_ : any) {
let fileManager = uni.getFileSystemManager()
fileManager.stat({
@@ -107,7 +107,7 @@
} as StatOptions)
},
- getFileInfoTest: function (e : any) {
+ getFileInfoTest: function () {
let fileManager = uni.getFileSystemManager()
fileManager.getFileInfo({
@@ -139,7 +139,7 @@
},
- copyFileTest: function (e : any) {
+ copyFileTest: function () {
let fileManager = uni.getFileSystemManager()
@@ -169,7 +169,7 @@
} as CopyFileOptions)
},
- renameFileTest: function (e : any) {
+ renameFileTest: function () {
let fileManager = uni.getFileSystemManager()
@@ -199,7 +199,7 @@
} as RenameOptions)
},
- readDirTest: function (e : any) {
+ readDirTest: function () {
let fileManager = uni.getFileSystemManager()
fileManager.readdir({
dirPath: `${this.basePath}${this.readDir}`,
@@ -231,7 +231,7 @@
},
- writeFileTest: function (e : any) {
+ writeFileTest: function (_ : any) {
let fileManager = uni.getFileSystemManager()
fileManager.writeFile({
@@ -263,7 +263,7 @@
},
- readFileTest: function (e : any) {
+ readFileTest: function () {
let fileManager = uni.getFileSystemManager()
@@ -294,7 +294,7 @@
} as ReadFileOptions)
},
- rmdirTest: function (e : any) {
+ rmdirTest: function () {
let fileManager = uni.getFileSystemManager()
fileManager.rmdir({
dirPath: `${this.basePath}${this.rmDirFile}`,
@@ -322,7 +322,7 @@
} as RmDirOptions)
},
- mkdirTest: function (e : any) {
+ mkdirTest: function () {
// 准备测试数据
let fileManager = uni.getFileSystemManager()
@@ -353,7 +353,7 @@
} as MkDirOptions)
},
- accessFileTest: function (e : any) {
+ accessFileTest: function () {
this.accessFileRet = ''
let fileManager = uni.getFileSystemManager()
fileManager.access({
@@ -382,7 +382,7 @@
} as AccessOptions)
},
- unlinkTest: function (e : any) {
+ unlinkTest: function () {
let fileManager = uni.getFileSystemManager()
@@ -410,7 +410,7 @@
}
} as UnLinkOptions)
},
- unlinkAllFileTest: function (e : any) {
+ unlinkAllFileTest: function () {
let fileManager = uni.getFileSystemManager()
fileManager.readdir({
dirPath: `${this.basePath}${this.rmDirFile}`,
@@ -460,7 +460,7 @@
}
} as ReadDirOptions)
},
- copyStaticToFilesTest: function (e : any) {
+ copyStaticToFilesTest: function () {
let fileManager = uni.getFileSystemManager()
diff --git a/pages/API/request/request.test.js b/pages/API/request/request.test.js
index 58555dcb047e4b3aa77e7aec666793b2cf3dc543..db18e65c23d44f8fc3a6d8af060bc4437e716f53 100644
--- a/pages/API/request/request.test.js
+++ b/pages/API/request/request.test.js
@@ -22,7 +22,7 @@ async function request(page, method, header, data, url) {
header: header
})
res = await page.callMethod('jest_request')
- await page.waitFor(200);
+ await page.waitFor(500);
res = await page.data('jest_result');
expect(res).toBe(true)
}
diff --git a/pages/API/storage/storage.uvue b/pages/API/storage/storage.uvue
index 22f96ef17092d441c030ed961b612f45efb8bf3a..39a0f5bfd6d47ba41e4cebc19bffabdde95edf4b 100644
--- a/pages/API/storage/storage.uvue
+++ b/pages/API/storage/storage.uvue
@@ -40,10 +40,10 @@
{{ storageInfo }}
diff --git a/pages/API/upload-file/upload-file.test.js b/pages/API/upload-file/upload-file.test.js
index b02e2bc12f1307e983d2717960a0a4354dcdc043..56f73f062bc53dcfa0fd42aafc95a8ffe7c4019a 100644
--- a/pages/API/upload-file/upload-file.test.js
+++ b/pages/API/upload-file/upload-file.test.js
@@ -8,7 +8,7 @@ describe('ExtApi-UploadFile', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
await page.callMethod('jest_uploadFile');
- await page.waitFor(500);
+ await page.waitFor(1000);
res = await page.data('jest_result');
});
diff --git a/pages/API/websocket-socketTask/websocket-socketTask.test.js b/pages/API/websocket-socketTask/websocket-socketTask.test.js
index 6a3bc3d3b279d2f7a94022abb395813b5255b207..081ff8bc19d7199af906befafdaed13647ce0a35 100644
--- a/pages/API/websocket-socketTask/websocket-socketTask.test.js
+++ b/pages/API/websocket-socketTask/websocket-socketTask.test.js
@@ -8,7 +8,7 @@ describe('ExtApi-WebSocket', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
await page.callMethod('jest_connectSocket');
- await page.waitFor(500);
+ await page.waitFor(1500);
res = await page.data('jest_result');
});
diff --git a/pages/CSS/overflow/overflow.test.js b/pages/CSS/overflow/overflow.test.js
index e2e22bed95c044cd5e0baa379e028dcae76adb6d..2969b0eab260062d1db324d80e172945b61ec06c 100644
--- a/pages/CSS/overflow/overflow.test.js
+++ b/pages/CSS/overflow/overflow.test.js
@@ -1,4 +1,4 @@
-describe('component-native-list-view', () => {
+describe('component-native-overflow', () => {
let page
beforeAll(async () => {
//打开list-view测试页
diff --git a/pages/CSS/transition/transition.uvue b/pages/CSS/transition/transition.uvue
index 5b26c35d7b10afa31c3bc337acbe4c8e61bafb5d..74c5d6b273427d06a8e3054182cf368b88da7083 100644
--- a/pages/CSS/transition/transition.uvue
+++ b/pages/CSS/transition/transition.uvue
@@ -21,10 +21,18 @@
点击修改Background
+
+ 动态修改Background
+
+
点击修改Transform
+
+ 点击修改Transform(含transform-origin)
+
+
点击修改Border
@@ -57,6 +65,11 @@
styleBorder: null as Element | null,
isTransitionstylePosition: false,
stylePosition: null as Element | null,
+ isSetTransition: false,
+ isTransitionpropertystyleBackground: false,
+ propertyStyleBackground: null as Element | null,
+ isTransitionStyleTransformWithOrigin: false,
+ styleTransformWithOrigin: null as Element | null,
}
},
onReady() {
@@ -67,6 +80,8 @@
this.styleTransform = uni.getElementById("styleTransform")
this.styleBorder = uni.getElementById("styleBorder")
this.stylePosition = uni.getElementById("stylePosition")
+ this.propertyStyleBackground = uni.getElementById("propertyStyleBackground")
+ this.styleTransformWithOrigin = uni.getElementById("styleTransformWithOrigin")
},
methods: {
changeWidthOrHeight() {
@@ -107,6 +122,18 @@
)
this.isTransitionstyleBackground = !this.isTransitionstyleBackground
},
+ propertyChangeBackground() {
+ if (!this.isSetTransition) {
+ this.propertyStyleBackground?.style?.setProperty("transition-property", "background-color")
+ this.propertyStyleBackground?.style?.setProperty("transition-duration", "1000")
+ this.isSetTransition = true
+ }
+ this.propertyStyleBackground?.style?.setProperty("background-color", this.isTransitionpropertystyleBackground
+ ? 'brown'
+ : 'black'
+ )
+ this.isTransitionpropertystyleBackground = !this.isTransitionpropertystyleBackground
+ },
changeTransform() {
this.styleTransform?.style?.setProperty("transform", this.isTransitionStyleTransform
? 'rotate(0deg)'
@@ -114,6 +141,13 @@
)
this.isTransitionStyleTransform = !this.isTransitionStyleTransform
},
+ changeTransformWithOrigin() {
+ this.styleTransformWithOrigin?.style?.setProperty("transform", this.isTransitionStyleTransformWithOrigin
+ ? 'scaleX(1)'
+ : 'scaleX(0)'
+ )
+ this.isTransitionStyleTransformWithOrigin = !this.isTransitionStyleTransformWithOrigin
+ },
changeBorder() {
this.styleBorder?.style?.setProperty("border-color", this.isTransitionstyleBorder
? 'brown'
@@ -186,4 +220,4 @@
transition-property: left;
transition-duration: 1000;
}
-
\ No newline at end of file
+
diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js
index fe7fd79e05c4e00cfd8b05d4e204608141c47583..d2d3962ecd90e1be1b8b2401421e95d70d9c8dec 100644
--- a/pages/component/input/input.test.js
+++ b/pages/component/input/input.test.js
@@ -139,6 +139,14 @@ describe('component-native-input', () => {
// await page.waitFor(500)
// })
+ it("cursor-color", async () => {
+ await page.setData({
+ cursor_color: "transparent",
+ })
+ await page.waitFor(500)
+ expect(await (await page.$('.uni-input-cursor-color')).property("cursor-color")).toBe("transparent")
+ })
+
it("afterAllTestScreenshot", async () => {
const image = await program.screenshot({
fullPage: true
diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue
index 91017ae21f954bd22687c53d7af81d701cbebbb6..36a52c337e6182783cd2ddcc18a1bbecbf524a6c 100644
--- a/pages/component/input/input.uvue
+++ b/pages/component/input/input.uvue
@@ -77,8 +77,8 @@
-
-
+
+
自动获取焦点
@@ -134,6 +134,15 @@
+
+
+
+
+ 设置光标颜色为透明(点击本行文字生效,再点复位)
+
+
+
+
@@ -218,7 +227,8 @@
showClearIcon: false,
inputClearValue: '',
showPassword: true,
- cursor: -1,
+ cursor: -1,
+ cursor_color: "#3393E2",
selectionStart: -1,
selectionEnd: -1,
inputEventDetail: '',
@@ -290,6 +300,13 @@
},
test_check_input_value():number {
return this.onMaxLengthInputValue.length
+ },
+ changeCursorColor(){
+ if(this.cursor_color == "#3393E2"){
+ this.cursor_color = "transparent"
+ }else{
+ this.cursor_color = "#3393E2"
+ }
}
}
}
diff --git a/pages/component/textarea/textarea.test.js b/pages/component/textarea/textarea.test.js
index dc97a1e478313c75f5f9b85408cf5b9cd00247af..76770603b85092eb167a7447eacdc05b17de0818 100644
--- a/pages/component/textarea/textarea.test.js
+++ b/pages/component/textarea/textarea.test.js
@@ -61,6 +61,13 @@ describe('component-native-textarea', () => {
} = await textarea.size()
expect(height).toBeLessThanOrEqual(150)
}) */
+ it("cursor-color", async () => {
+ await page.setData({
+ cursor_color: "transparent",
+ })
+ await page.waitFor(500)
+ expect(await textarea.property("cursor-color")).toBe("transparent")
+ })
it("inputmode", async () => {
const inputmodeEnum = await page.data("inputmode_enum")
@@ -73,16 +80,4 @@ describe('component-native-textarea', () => {
await page.waitFor(500)
}
})
-
- it("confirm-type", async () => {
- const inputmodeEnum = await page.data("confirm_type_enum")
- for (var i = 0; i < inputmodeEnum.length; i++) {
- var x = inputmodeEnum[i]
- console.log(x['value'], x['name'])
- await page.callMethod("radio_change_confirm_type_enum", x['value']);
- await page.waitFor(500)
- expect(await textarea.property("confirm-type")).toEqual(x['name'])
- await page.waitFor(500)
- }
- })
});
diff --git a/pages/component/textarea/textarea.uvue b/pages/component/textarea/textarea.uvue
index 3ac2f94ccdf450d8ec3be1ed9c4609bbc0cccfb7..21e5590d3891108772ac95681b50c6e46ff835d6 100644
--- a/pages/component/textarea/textarea.uvue
+++ b/pages/component/textarea/textarea.uvue
@@ -12,9 +12,8 @@ export default {
auto_focus_boolean: false,
default_value:"",
maxlength:-1,
- confirm_type_enum: [{"value":0,"name":"send"},{"value":1,"name":"search"},{"value":2,"name":"next"},{"value":3,"name":"go"},{"value":4,"name":"done"}] as ItemType[],
- confirm_type_enum_current: 0,
- inputmode_enum: [{"value":0,"name":"none"},{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"}] as ItemType[],
+ inputmode_enum: [{"value":0,"name":"none"},{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"}] as ItemType[],
+ cursor_color: "#3393E2",
inputmode_enum_current: 0
}
},
@@ -39,8 +38,8 @@ export default {
change_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked },
change_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked },
change_focus_boolean(checked : boolean) { this.focus_boolean = checked },
- change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },
- radio_change_confirm_type_enum(checked : number) { this.confirm_type_enum_current = checked },
+ change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },
+ change_cursor_color_boolean(checked : boolean) { if(checked){ this.cursor_color = "transparent"} else {this.cursor_color = "#3393E2"}},
radio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked }
}
}
@@ -53,12 +52,12 @@ export default {
class="uni-textarea"
:auto-focus="auto_focus_boolean"
:focus="focus_boolean"
- :confirm-type="confirm_type_enum[confirm_type_enum_current].name"
:confirm-hold="confirm_hold_boolean"
:auto-height="auto_height_boolean"
:fixed="fixed_boolean"
:show-confirm-bar="show_confirm_bar_boolean"
- :adjust-position="adjust_position_boolean"
+ :adjust-position="adjust_position_boolean"
+ :cursor-color="cursor_color"
:inputmode="inputmode_enum[inputmode_enum_current].name"
:maxlength="maxlength"
@click="textarea_click"
@@ -118,12 +117,12 @@ export default {
:defaultValue="false"
title="自动获取焦点"
@change="change_auto_focus_boolean"
+ >
+
-
-
-
-
+
+
+
+
diff --git a/uni_modules/uni-installApk/changelog.md b/uni_modules/uni-installApk/changelog.md
deleted file mode 100644
index f6c958315f645b5da63f7296755c1493e57d5c20..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/changelog.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## 1.0.3(2023-10-27)
-遵循UniError规范
-## 1.0.2(2023-10-27)
-修改文档
-## 1.0.1(2023-10-27)
-支持js层调用
-## 1.0.0(2023-10-26)
-安装apk的插件
diff --git a/uni_modules/uni-installApk/package.json b/uni_modules/uni-installApk/package.json
deleted file mode 100644
index c3889207923f11964792eb3bd7659e39427e6ab8..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/package.json
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "id": "uni-installApk",
- "displayName": "uni-installApk",
- "version": "1.0.3",
- "description": "uni-installApk",
- "keywords": [
- "uni-installApk"
- ],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.94"
- },
- "dcloudext": {
- "type": "uts",
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "android.permission.REQUEST_INSTALL_PACKAGES"
- },
- "npmurl": ""
- },
- "uni_modules": {
- "dependencies": [],
- "uni-ext-api": {
- "uni": {
- "installApk": {
- "name": "installApk",
- "app": {
- "js": true,
- "kotlin": true,
- "swift": false
- }
- }
- }
- },
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "Vue": {
- "vue2": "y",
- "vue3": "y"
- },
- "App": {
- "app-android": "y",
- "app-ios": "n"
- },
- "H5-mobile": {
- "Safari": "n",
- "Android Browser": "n",
- "微信浏览器(Android)": "n",
- "QQ浏览器(Android)": "n"
- },
- "H5-pc": {
- "Chrome": "n",
- "IE": "n",
- "Edge": "n",
- "Firefox": "n",
- "Safari": "n"
- },
- "小程序": {
- "微信": "n",
- "阿里": "n",
- "百度": "n",
- "字节跳动": "n",
- "QQ": "n",
- "钉钉": "n",
- "快手": "n",
- "飞书": "n",
- "京东": "n"
- },
- "快应用": {
- "华为": "n",
- "联盟": "n"
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-installApk/readme.md b/uni_modules/uni-installApk/readme.md
deleted file mode 100644
index 898834d79b542157a264adc6401bce2076c7768e..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/readme.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# uni-installApk
-
-## 使用说明
-
-Android平台安装Apk
-
-**注意: 3.95以下需要自定义基座**
-
-### uni.installApk(options : InstallApkOptions):void
-
-安装apk
-
-参数说明
-
-```
-type InstallApkOptions = {
- /**
- * apk文件地址
- */
- filePath : string,
- /**
- * 接口调用成功的回调函数
- * @defaultValue null
- */
- success ?: (res : any) => void,
- /**
- * 接口调用失败的回调函数
- * @defaultValue null
- */
- fail ?: (err : any) => void,
- /**
- * 接口调用结束的回调函数(调用成功、失败都会执行)
- * @defaultValue null
- */
- complete ?: (res : any) => void,
-}
-```
\ No newline at end of file
diff --git a/uni_modules/uni-installApk/utssdk/app-android/AndroidManifest.xml b/uni_modules/uni-installApk/utssdk/app-android/AndroidManifest.xml
deleted file mode 100644
index 5cf3ce22599398429807a3305a5a549277079dc2..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/utssdk/app-android/AndroidManifest.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/uni_modules/uni-installApk/utssdk/app-android/index.uts b/uni_modules/uni-installApk/utssdk/app-android/index.uts
deleted file mode 100644
index cfdef2ed5ce2368b42ad73e9152d2dadf2ddc9cb..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/utssdk/app-android/index.uts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { InstallApkOptions, InstallApkSuccess } from "../interface.uts"
-import { InstallApkFailImpl } from "../unierror.uts"
-import Intent from 'android.content.Intent';
-import Build from 'android.os.Build';
-import File from 'java.io.File';
-import FileProvider from 'androidx.core.content.FileProvider';
-import Context from 'android.content.Context';
-import Uri from 'android.net.Uri';
-
-export function installApk(options : InstallApkOptions) : void {
- const context = UTSAndroid.getAppContext() as Context
- const filePath = UTSAndroid.convert2AbsFullPath(options.filePath)
- const apkFile = new File(filePath)
- if (!apkFile.exists() && !apkFile.isFile()) {
- let error = new InstallApkFailImpl(1300002);
- options.fail?.(error)
- options.complete?.(error)
- return
- }
- const intent = new Intent()
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- intent.setAction(Intent.ACTION_VIEW)
-
- if (Build.VERSION.SDK_INT >= 24) {
- const authority = context.getPackageName() + ".dc.fileprovider"
- const apkUri = FileProvider.getUriForFile(context, authority, apkFile)
- intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
- } else {
- intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
- }
-
- context.startActivity(intent)
- const success : InstallApkSuccess = {
- errMsg: "success"
- }
- options.success?.(success)
- options.complete?.(success)
-}
\ No newline at end of file
diff --git a/uni_modules/uni-installApk/utssdk/app-ios/index.uts b/uni_modules/uni-installApk/utssdk/app-ios/index.uts
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/uni_modules/uni-installApk/utssdk/index.d.ts b/uni_modules/uni-installApk/utssdk/index.d.ts
deleted file mode 100644
index ad24effbc1e07f4f30aa894e39cb3d388350dabe..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/utssdk/index.d.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-declare namespace UniNamespace {
-
-interface InstallApkSuccess {
- /**
- * 安装成功消息
- */
- errMsg : string
-}
-
-type InstallApkErrorCode = 1300002
-interface InstallApkFail {
- errCode : InstallApkErrorCode
-}
-
-type InstallApkComplete = any
-
-type InstallApkSuccessCallback = (res : InstallApkSuccess) => void
-type InstallApkFailCallback = (err : InstallApkFail) => void
-type InstallApkCompleteCallback = (res : InstallApkComplete) => void
-
-interface InstallApkOptions {
- /**
- * apk文件地址
- */
- filePath : string,
- /**
- * 接口调用成功的回调函数
- * @defaultValue null
- */
- success ?: InstallApkSuccessCallback | null,
- /**
- * 接口调用失败的回调函数
- * @defaultValue null
- */
- fail ?: InstallApkFailCallback | null,
- /**
- * 接口调用结束的回调函数(调用成功、失败都会执行)
- * @defaultValue null
- */
- complete ?: InstallApkCompleteCallback | null
-}
-
-}
-
-
-declare interface Uni {
- /**
- * installApk()
- * @description
- * 安装apk
- * @param {InstallApkOptions}
- * @return {void}
- * @uniPlatform {
- * "app": {
- * "android": {
- * "osVer": "4.4",
- * "uniVer": "3.94+",
- * "unixVer": "3.94+"
- * },
- * "ios": {
- * "osVer": "x",
- * "uniVer": "x",
- * "unixVer": "x"
- * }
- * }
- * }
- * @example
- ```typescript
- uni.installApk({
- filePath: "/xx/xx/xx.apk",
- complete: (res: any) => {
- console.log("complete => " + JSON.stringify(res));
- }
- });
- ```
- */
- installApk(options : UniNamespace.InstallApkOptions) : void
-}
diff --git a/uni_modules/uni-installApk/utssdk/interface.uts b/uni_modules/uni-installApk/utssdk/interface.uts
deleted file mode 100644
index 35edfcd7eaeddfd4f192803385829389bac78689..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/utssdk/interface.uts
+++ /dev/null
@@ -1,76 +0,0 @@
-export interface Uni {
- /**
- * installApk()
- * @description
- * 安装apk
- * @param {InstallApkOptions}
- * @return {void}
- * @uniPlatform {
- * "app": {
- * "android": {
- * "osVer": "4.4",
- * "uniVer": "3.94+",
- * "unixVer": "3.94+"
- * },
- * "ios": {
- * "osVer": "x",
- * "uniVer": "x",
- * "unixVer": "x"
- * }
- * }
- * }
- * @example
- ```typescript
- uni.installApk({
- filePath: "/xx/xx/xx.apk",
- complete: (res: any) => {
- console.log("complete => " + JSON.stringify(res));
- }
- });
- ```
- */
- installApk(options : InstallApkOptions) : void
-}
-export type InstallApkSuccess = {
- /**
- * 安装成功消息
- */
- errMsg : string
-}
-export type InstallApkComplete = any
-export type InstallApkSuccessCallback = (res : InstallApkSuccess) => void
-/**
- * 错误码
- * - 1300002 找不到文件
- */
-export type InstallApkErrorCode = 1300002
-/**
- * 网络请求失败的错误回调参数
- */
-export interface InstallApkFail extends IUniError {
- errCode : InstallApkErrorCode
-};
-export type InstallApkFailCallback = (err : InstallApkFail) => void
-export type InstallApkCompleteCallback = (res : InstallApkComplete) => void
-
-export type InstallApkOptions = {
- /**
- * apk文件地址
- */
- filePath : string,
- /**
- * 接口调用成功的回调函数
- * @defaultValue null
- */
- success ?: InstallApkSuccessCallback | null,
- /**
- * 接口调用失败的回调函数
- * @defaultValue null
- */
- fail ?: InstallApkFailCallback | null,
- /**
- * 接口调用结束的回调函数(调用成功、失败都会执行)
- * @defaultValue null
- */
- complete ?: InstallApkCompleteCallback | null
-}
\ No newline at end of file
diff --git a/uni_modules/uni-installApk/utssdk/unierror.uts b/uni_modules/uni-installApk/utssdk/unierror.uts
deleted file mode 100644
index 8b849401edbdd8c58adc547ce737f5b367463b4d..0000000000000000000000000000000000000000
--- a/uni_modules/uni-installApk/utssdk/unierror.uts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { InstallApkErrorCode, InstallApkFail } from "./interface.uts"
-
-/**
- * 错误主题
- */
-export const UniErrorSubject = 'uni-installApk';
-/**
- * 错误码
- * @UniError
- */
-export const UniErrors : Map = new Map([
- /**
- * 找不到文件
- */
- [1300002, 'No such file'],
-]);
-
-export class InstallApkFailImpl extends UniError implements InstallApkFail {
- override errCode : InstallApkErrorCode
- constructor(errCode : InstallApkErrorCode) {
- super();
- this.errSubject = UniErrorSubject;
- this.errCode = errCode;
- this.errMsg = UniErrors[errCode] ?? "";
- }
-}
\ No newline at end of file