From ed612a2f4a196f31f1272b7e5b3eb6b3cd667097 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Mon, 1 Jul 2024 15:51:11 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E7=A4=BA=E4=BE=8B=E9=A1=B5=E9=9D=A2=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 14 +-
.../request-payment}/order-detail.uvue | 0
.../request-payment-uni-pay.uvue | 0
.../unicloud-call-function.test.js | 33 --
.../unicloud-call-function.uvue | 108 ------
.../unicloud-database/unicloud-database.uvue | 322 ------------------
.../unicloud-import-object.uvue | 161 ---------
.../unicloud/unicloud/call-function.test.js | 2 +-
.../unicloud/cloud-object.test.js} | 2 +-
.../unicloud/database.test.js} | 2 +-
.../websocket/websocket-socketTask.test.js | 18 +
pages/component/unicloud-db/add.uvue | 117 -------
pages/component/unicloud-db/detail.uvue | 110 ------
pages/component/unicloud-db/edit.uvue | 170 ---------
pages/component/unicloud-db/types.uts | 25 --
.../unicloud-db/contacts}/add.uvue | 0
.../unicloud-db/contacts}/detail.uvue | 0
.../unicloud-db/contacts}/edit.uvue | 0
.../unicloud-db/contacts}/list.uvue | 0
.../unicloud-db/contacts}/types.uts | 0
.../unicloud-db/unicloud-db/datacom.uvue | 70 ----
.../unicloud-db/mixin-datacom.test.js | 20 --
.../unicloud-db/mixin-datacom.uvue | 27 --
.../unicloud-db/mixin-datacom}/datacom.uvue | 0
.../mixin-datacom}/mixin-datacom.test.js | 0
.../mixin-datacom}/mixin-datacom.uvue | 0
pages/pages.test.js | 24 +-
27 files changed, 40 insertions(+), 1185 deletions(-)
rename pages/API/{request-payment-uni-pay => request-payment/request-payment}/order-detail.uvue (100%)
rename pages/API/{request-payment-uni-pay => request-payment/request-payment}/request-payment-uni-pay.uvue (100%)
delete mode 100644 pages/API/unicloud-call-function/unicloud-call-function.test.js
delete mode 100644 pages/API/unicloud-call-function/unicloud-call-function.uvue
delete mode 100644 pages/API/unicloud-database/unicloud-database.uvue
delete mode 100644 pages/API/unicloud-import-object/unicloud-import-object.uvue
rename pages/API/{unicloud-import-object/unicloud-import-object.test.js => unicloud/unicloud/cloud-object.test.js} (93%)
rename pages/API/{unicloud-database/unicloud-database.test.js => unicloud/unicloud/database.test.js} (95%)
create mode 100644 pages/API/websocket/websocket-socketTask.test.js
delete mode 100644 pages/component/unicloud-db/add.uvue
delete mode 100644 pages/component/unicloud-db/detail.uvue
delete mode 100644 pages/component/unicloud-db/edit.uvue
delete mode 100644 pages/component/unicloud-db/types.uts
rename pages/component/{unicloud-db-contacts => unicloud-db/unicloud-db/contacts}/add.uvue (100%)
rename pages/component/{unicloud-db-contacts => unicloud-db/unicloud-db/contacts}/detail.uvue (100%)
rename pages/component/{unicloud-db-contacts => unicloud-db/unicloud-db/contacts}/edit.uvue (100%)
rename pages/component/{unicloud-db-contacts => unicloud-db/unicloud-db/contacts}/list.uvue (100%)
rename pages/component/{unicloud-db-contacts => unicloud-db/unicloud-db/contacts}/types.uts (100%)
delete mode 100644 pages/component/unicloud-db/unicloud-db/datacom.uvue
delete mode 100644 pages/component/unicloud-db/unicloud-db/mixin-datacom.test.js
delete mode 100644 pages/component/unicloud-db/unicloud-db/mixin-datacom.uvue
rename pages/component/{datacom => unicloud-db/unicloud-db/mixin-datacom}/datacom.uvue (100%)
rename pages/component/{datacom => unicloud-db/unicloud-db/mixin-datacom}/mixin-datacom.test.js (100%)
rename pages/component/{datacom => unicloud-db/unicloud-db/mixin-datacom}/mixin-datacom.uvue (100%)
diff --git a/pages.json b/pages.json
index 80ad54f8..a5a46293 100644
--- a/pages.json
+++ b/pages.json
@@ -283,32 +283,32 @@
}
},
{
- "path": "pages/component/unicloud-db/unicloud-db",
+ "path": "pages/component/unicloud-db/unicloud-db/contacts/list",
"style": {
"navigationBarTitleText": "联系人",
"enablePullDownRefresh": true
}
},
{
- "path": "pages/component/unicloud-db/add",
+ "path": "pages/component/unicloud-db/unicloud-db/contacts/add",
"style": {
"navigationBarTitleText": "新增联系人"
}
},
{
- "path": "pages/component/unicloud-db/edit",
+ "path": "pages/component/unicloud-db/unicloud-db/contacts/edit",
"style": {
"navigationBarTitleText": "编辑联系人"
}
},
{
- "path": "pages/component/unicloud-db/detail",
+ "path": "pages/component/unicloud-db/unicloud-db/contacts/detail",
"style": {
"navigationBarTitleText": ""
}
},
{
- "path": "pages/component/unicloud-db/unicloud-db/mixin-datacom",
+ "path": "pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom",
"style": {
"navigationBarTitleText": "mixinDatacom"
}
@@ -886,14 +886,14 @@
// #endif
// #ifdef APP || WEB
{
- "path": "pages/API/request-payment-uni-pay/request-payment-uni-pay",
+ "path": "pages/API/request-payment/request-payment/request-payment-uni-pay",
"style": {
"navigationBarTitleText": "uni-pay示例",
"enablePullDownRefresh": false
}
},
{
- "path": "pages/API/request-payment-uni-pay/order-detail",
+ "path": "pages/API/request-payment/request-payment/order-detail",
"style": {
"navigationBarTitleText": "订单详情示例",
"enablePullDownRefresh": false
diff --git a/pages/API/request-payment-uni-pay/order-detail.uvue b/pages/API/request-payment/request-payment/order-detail.uvue
similarity index 100%
rename from pages/API/request-payment-uni-pay/order-detail.uvue
rename to pages/API/request-payment/request-payment/order-detail.uvue
diff --git a/pages/API/request-payment-uni-pay/request-payment-uni-pay.uvue b/pages/API/request-payment/request-payment/request-payment-uni-pay.uvue
similarity index 100%
rename from pages/API/request-payment-uni-pay/request-payment-uni-pay.uvue
rename to pages/API/request-payment/request-payment/request-payment-uni-pay.uvue
diff --git a/pages/API/unicloud-call-function/unicloud-call-function.test.js b/pages/API/unicloud-call-function/unicloud-call-function.test.js
deleted file mode 100644
index 2917aef6..00000000
--- a/pages/API/unicloud-call-function/unicloud-call-function.test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const PAGE_PATH = '/pages/API/unicloud-call-function/unicloud-call-function'
-
-describe('unicloud-call-function', () => {
- let page
- beforeAll(async () => {
- page = await program.reLaunch(PAGE_PATH)
- await page.waitFor(500)
- await page.setData({
- isUniTest: true
- })
- })
-
- it('callFunction', async () => {
- await page.callMethod('callFunction')
- const {
- callFunctionResult,
- callFunctionError,
- } = await page.data()
- console.error(callFunctionResult)
- console.error(callFunctionError)
- expect(callFunctionResult['showMessage']).toBe("Hello uniCloud function")
- expect(callFunctionResult['event']['num']).toBe(1)
- expect(callFunctionResult['event']['str']).toBe('ABC')
- })
-
- it('callFunctionWithGeneric', async () => {
- await page.callMethod('callFunctionWithGeneric')
- const {
- genericDemoShowMessage,
- } = await page.data()
- expect(genericDemoShowMessage).toBe("Hello uniCloud function")
- })
-})
diff --git a/pages/API/unicloud-call-function/unicloud-call-function.uvue b/pages/API/unicloud-call-function/unicloud-call-function.uvue
deleted file mode 100644
index 58f32841..00000000
--- a/pages/API/unicloud-call-function/unicloud-call-function.uvue
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/API/unicloud-database/unicloud-database.uvue b/pages/API/unicloud-database/unicloud-database.uvue
deleted file mode 100644
index f37730e2..00000000
--- a/pages/API/unicloud-database/unicloud-database.uvue
+++ /dev/null
@@ -1,322 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/API/unicloud-import-object/unicloud-import-object.uvue b/pages/API/unicloud-import-object/unicloud-import-object.uvue
deleted file mode 100644
index 1b71ea1e..00000000
--- a/pages/API/unicloud-import-object/unicloud-import-object.uvue
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/API/unicloud/unicloud/call-function.test.js b/pages/API/unicloud/unicloud/call-function.test.js
index acd034b6..65d0cf04 100644
--- a/pages/API/unicloud/unicloud/call-function.test.js
+++ b/pages/API/unicloud/unicloud/call-function.test.js
@@ -1,4 +1,4 @@
-const PAGE_PATH = '/pages/API/call-function/call-function'
+const PAGE_PATH = '/pages/API/unicloud/unicloud/call-function'
describe('unicloud-call-function', () => {
let page
diff --git a/pages/API/unicloud-import-object/unicloud-import-object.test.js b/pages/API/unicloud/unicloud/cloud-object.test.js
similarity index 93%
rename from pages/API/unicloud-import-object/unicloud-import-object.test.js
rename to pages/API/unicloud/unicloud/cloud-object.test.js
index 46fbf87c..ec731d20 100644
--- a/pages/API/unicloud-import-object/unicloud-import-object.test.js
+++ b/pages/API/unicloud/unicloud/cloud-object.test.js
@@ -1,4 +1,4 @@
-const PAGE_PATH = '/pages/API/unicloud-import-object/unicloud-import-object'
+const PAGE_PATH = '/pages/API/unicloud/unicloud/cloud-object'
describe('unicloud-import-object', () => {
let page
diff --git a/pages/API/unicloud-database/unicloud-database.test.js b/pages/API/unicloud/unicloud/database.test.js
similarity index 95%
rename from pages/API/unicloud-database/unicloud-database.test.js
rename to pages/API/unicloud/unicloud/database.test.js
index cec19a63..d268f97d 100644
--- a/pages/API/unicloud-database/unicloud-database.test.js
+++ b/pages/API/unicloud/unicloud/database.test.js
@@ -1,4 +1,4 @@
-const PAGE_PATH = '/pages/API/unicloud-database/unicloud-database'
+const PAGE_PATH = '/pages/API/unicloud/unicloud/database'
describe('unicloud-database', () => {
let page
diff --git a/pages/API/websocket/websocket-socketTask.test.js b/pages/API/websocket/websocket-socketTask.test.js
new file mode 100644
index 00000000..0b53e85d
--- /dev/null
+++ b/pages/API/websocket/websocket-socketTask.test.js
@@ -0,0 +1,18 @@
+const PAGE_PATH = '/pages/API/websocket/websocket-socketTask'
+
+describe('ExtApi-WebSocket', () => {
+
+ let page;
+ let res;
+ beforeAll(async () => {
+ page = await program.reLaunch(PAGE_PATH)
+ await page.waitFor(600);
+ await page.callMethod('jest_connectSocket');
+ await page.waitFor(1500);
+ res = await page.data('jest_result');
+ });
+
+ it('Check ', async () => {
+ expect(res).toBe(2);
+ });
+});
diff --git a/pages/component/unicloud-db/add.uvue b/pages/component/unicloud-db/add.uvue
deleted file mode 100644
index fd216944..00000000
--- a/pages/component/unicloud-db/add.uvue
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/component/unicloud-db/detail.uvue b/pages/component/unicloud-db/detail.uvue
deleted file mode 100644
index 0585a9dc..00000000
--- a/pages/component/unicloud-db/detail.uvue
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
- {{error.errMsg}}
- 正在加载...
-
-
- 姓名
- {{data[0]['username']}}
-
-
- 电话
- {{data[0]['mobile']}}
-
-
- 邮箱
- {{data[0]['email']}}
-
-
- 备注
- {{data[0]['comment']}}
-
-
- 性别
- {{displayGender(data[0].getNumber('gender'))}}
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/component/unicloud-db/edit.uvue b/pages/component/unicloud-db/edit.uvue
deleted file mode 100644
index 083d971f..00000000
--- a/pages/component/unicloud-db/edit.uvue
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
- {{error.errMsg}}
- 正在加载...
-
-
-
-
-
-
-
-
diff --git a/pages/component/unicloud-db/types.uts b/pages/component/unicloud-db/types.uts
deleted file mode 100644
index 4d204bfe..00000000
--- a/pages/component/unicloud-db/types.uts
+++ /dev/null
@@ -1,25 +0,0 @@
-export const COLLECTION_NAME = 'opendb-contacts'
-
-export type GenderType = {
- text : string,
- value : number,
-}
-
-export const GenderList = [
- {
- text: "未知",
- value: 0
- },
- {
- text: "男",
- value: 1
- },
- {
- text: "女",
- value: 2
- },
-] as GenderType[]
-
-export const UNICLOUD_DB_CONTACTS_ADD = 'unicloud-db-contacts-add'
-export const UNICLOUD_DB_CONTACTS_UPDATE = 'unicloud-db-contacts-update'
-export const UNICLOUD_DB_CONTACTS_DELETE = 'unicloud-db-contacts-delete'
diff --git a/pages/component/unicloud-db-contacts/add.uvue b/pages/component/unicloud-db/unicloud-db/contacts/add.uvue
similarity index 100%
rename from pages/component/unicloud-db-contacts/add.uvue
rename to pages/component/unicloud-db/unicloud-db/contacts/add.uvue
diff --git a/pages/component/unicloud-db-contacts/detail.uvue b/pages/component/unicloud-db/unicloud-db/contacts/detail.uvue
similarity index 100%
rename from pages/component/unicloud-db-contacts/detail.uvue
rename to pages/component/unicloud-db/unicloud-db/contacts/detail.uvue
diff --git a/pages/component/unicloud-db-contacts/edit.uvue b/pages/component/unicloud-db/unicloud-db/contacts/edit.uvue
similarity index 100%
rename from pages/component/unicloud-db-contacts/edit.uvue
rename to pages/component/unicloud-db/unicloud-db/contacts/edit.uvue
diff --git a/pages/component/unicloud-db-contacts/list.uvue b/pages/component/unicloud-db/unicloud-db/contacts/list.uvue
similarity index 100%
rename from pages/component/unicloud-db-contacts/list.uvue
rename to pages/component/unicloud-db/unicloud-db/contacts/list.uvue
diff --git a/pages/component/unicloud-db-contacts/types.uts b/pages/component/unicloud-db/unicloud-db/contacts/types.uts
similarity index 100%
rename from pages/component/unicloud-db-contacts/types.uts
rename to pages/component/unicloud-db/unicloud-db/contacts/types.uts
diff --git a/pages/component/unicloud-db/unicloud-db/datacom.uvue b/pages/component/unicloud-db/unicloud-db/datacom.uvue
deleted file mode 100644
index d6392ff8..00000000
--- a/pages/component/unicloud-db/unicloud-db/datacom.uvue
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
- Loading...
-
- 请求错误:{{mixinDatacomError}}
-
-
-
-
-
-
- {{item}}
-
-
-
-
- 无数据
-
-
-
-
-
-
-
diff --git a/pages/component/unicloud-db/unicloud-db/mixin-datacom.test.js b/pages/component/unicloud-db/unicloud-db/mixin-datacom.test.js
deleted file mode 100644
index 95a8804a..00000000
--- a/pages/component/unicloud-db/unicloud-db/mixin-datacom.test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-const PAGE_PATH = '/pages/component/mixin-datacom/mixin-datacom'
-
-describe('mixin-datacom', () => {
- if (process.env.uniTestPlatformInfo.startsWith('web')) {
- it('dummyTest', async () => {
- expect(1).toBe(1)
- })
- return
- }
- let page
- beforeAll(async () => {
- page = await program.reLaunch(PAGE_PATH)
- await page.waitFor(500)
- })
- it('mixinDatacomGet', async () => {
- const datacom = await page.$('.datacom')
- const children = await datacom.$$('.list-item')
- expect(children.length > 0).toBe(true)
- })
-})
diff --git a/pages/component/unicloud-db/unicloud-db/mixin-datacom.uvue b/pages/component/unicloud-db/unicloud-db/mixin-datacom.uvue
deleted file mode 100644
index 9f3ce405..00000000
--- a/pages/component/unicloud-db/unicloud-db/mixin-datacom.uvue
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/pages/component/datacom/datacom.uvue b/pages/component/unicloud-db/unicloud-db/mixin-datacom/datacom.uvue
similarity index 100%
rename from pages/component/datacom/datacom.uvue
rename to pages/component/unicloud-db/unicloud-db/mixin-datacom/datacom.uvue
diff --git a/pages/component/datacom/mixin-datacom.test.js b/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom.test.js
similarity index 100%
rename from pages/component/datacom/mixin-datacom.test.js
rename to pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom.test.js
diff --git a/pages/component/datacom/mixin-datacom.uvue b/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom.uvue
similarity index 100%
rename from pages/component/datacom/mixin-datacom.uvue
rename to pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom.uvue
diff --git a/pages/pages.test.js b/pages/pages.test.js
index a76970d8..d22b57f6 100755
--- a/pages/pages.test.js
+++ b/pages/pages.test.js
@@ -76,12 +76,12 @@ const pages = [
// '/pages/component/web-view/web-view-local',
// 动态内容
// '/pages/component/unicloud-db/unicloud-db',
- '/pages/component/unicloud-db/add',
+ '/pages/component/unicloud-db/unicloud-db/contacts/add',
// 动态内容
- // '/pages/component/unicloud-db/edit',
+ // '/pages/component/unicloud-db/unicloud-db/contacts/edit',
// 动态内容
- // '/pages/component/unicloud-db/detail',
- '/pages/component/datacom/datacom',
+ // '/pages/component/unicloud-db/unicloud-db/contacts/detail',
+ '/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom',
// 单独测试例截图
// '/pages/component/general-attribute/general-attribute',
'/pages/component/general-event/general-event',
@@ -144,8 +144,10 @@ const pages = [
'/pages/API/websocket/websocket-socketTask',
// 页面销毁时会关闭socket连接,所以规避
// '/pages/API/websocket/websocket',
- '/pages/API/unicloud/call-function',
- '/pages/API/unicloud/import-object',
+ '/pages/API/unicloud/unicloud/cloud-function',
+ '/pages/API/unicloud/unicloud/cloud-object',
+ '/pages/API/unicloud/unicloud/database',
+ '/pages/API/unicloud/unicloud/cloud-storage',
'/pages/API/get-system-info/get-system-info',
'/pages/API/get-device-info/get-device-info',
'/pages/API/get-app-base-info/get-app-base-info',
@@ -155,13 +157,11 @@ const pages = [
'/pages/API/get-network-type/get-network-type',
'/pages/API/page-scroll-to/page-scroll-to',
'/pages/API/event-bus/event-bus',
- '/pages/API/unicloud-file-api/unicloud-file-api',
- '/pages/API/unicloud-database/unicloud-database',
'/pages/API/get-battery-info/get-battery-info',
'/pages/API/get-window-info/get-window-info',
'/pages/API/rpx2px/rpx2px',
- '/pages/API/request-payment-uni-pay/request-payment-uni-pay',
- '/pages/API/request-payment-uni-pay/order-detail',
+ '/pages/API/request-payment/request-payment/request-payment-uni-pay',
+ '/pages/API/request-payment/request-payment/order-detail',
// 单独测试例截图
// '/pages/API/resize-observer/resize-observer',
// 单独测试例截图
@@ -356,8 +356,8 @@ function getWaitForTagName(pagePath) {
return 'text'
}
if (
- pagePath === '/pages/component/unicloud-db-contacts/edit' ||
- pagePath === '/pages/component/unicloud-db-contacts/detail'
+ pagePath === '/pages/component/unicloud-db/unicloud-db/contacts/edit' ||
+ pagePath === '/pages/component/unicloud-db/unicloud-db/contacts/detail'
) {
return 'scroll-view'
}
--
GitLab