diff --git a/pages.json b/pages.json
index a6b55ce91f9cc7ed4353474f9da074c7196c4451..a1f054150f6ab914440f00d60a672974d2291e6e 100644
--- a/pages.json
+++ b/pages.json
@@ -193,6 +193,32 @@
"style": {
"navigationBarTitleText": "general-event"
}
+ },
+ {
+ "path": "pages/component/unicloud-db-contacts/list",
+ "style": {
+ "navigationBarTitleText": "联系人",
+ "enablePullDownRefresh": true
+ }
+ },
+ {
+ "path": "pages/component/unicloud-db-contacts/add",
+ "style": {
+ "navigationBarTitleText": "新增联系人"
+ }
+ },
+ {
+ "path": "pages/component/unicloud-db-contacts/edit",
+ "style": {
+ "navigationBarTitleText": "编辑联系人",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/component/unicloud-db-contacts/detail",
+ "style": {
+ "navigationBarTitleText": ""
+ }
},
{
"path": "pages/tabBar/API",
diff --git a/pages/component/unicloud-db-contacts/add.uvue b/pages/component/unicloud-db-contacts/add.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..9d0fcfac95fed3b68aad3f36615d603ce2e1f494
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/add.uvue
@@ -0,0 +1,129 @@
+
+
+
+ {{error}}
+
+
+ 姓名
+
+
+
+ 电话
+
+
+
+ 邮箱
+
+
+
+ 备注
+
+
+
+ 性别
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/component/unicloud-db-contacts/detail.uvue b/pages/component/unicloud-db-contacts/detail.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..d930f2087cc9f3b2f3b9a3a3bf80f7e3f0c66701
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/detail.uvue
@@ -0,0 +1,112 @@
+
+
+
+ {{error.errMsg}}
+ 正在加载...
+
+
+ 姓名
+ {{data[0]['username']}}
+
+
+ 电话
+ {{data[0]['mobile']}}
+
+
+ 邮箱
+ {{data[0]['email']}}
+
+
+ 备注
+ {{data[0]['comment']}}
+
+
+ 性别
+ {{displayGender(data[0]['gender'])}}
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/component/unicloud-db-contacts/edit.uvue b/pages/component/unicloud-db-contacts/edit.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..a34b0e2afd46a2ffedcf52ba1446e034282f25b2
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/edit.uvue
@@ -0,0 +1,212 @@
+
+
+
+
+ 取消
+
+
+ 保存
+
+
+
+
+ {{error.errMsg}}
+ 正在加载...
+
+
+ 姓名
+
+
+
+ 电话
+
+
+
+ 邮箱
+
+
+
+ 备注
+
+
+
+ 性别
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/component/unicloud-db-contacts/list.uvue b/pages/component/unicloud-db-contacts/list.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..6501694d0f16e46210e669929a62300c8954ab70
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/list.uvue
@@ -0,0 +1,136 @@
+
+
+
+ {{error.errMsg}}
+
+
+
+ {{item['username']}}
+ {{item['mobile']}}
+
+
+
+ 正在加载...
+
+
+
+ +
+
+
+
+
+
+
+
diff --git a/pages/component/unicloud-db-contacts/navbar.uvue b/pages/component/unicloud-db-contacts/navbar.uvue
new file mode 100644
index 0000000000000000000000000000000000000000..2f72c365e4f8f082afe463de24fc192ee0ac2cfa
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/navbar.uvue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/component/unicloud-db-contacts/types.uts b/pages/component/unicloud-db-contacts/types.uts
new file mode 100644
index 0000000000000000000000000000000000000000..68fcbe9522f6234ad9f10c3bf92b10b87ac19935
--- /dev/null
+++ b/pages/component/unicloud-db-contacts/types.uts
@@ -0,0 +1,25 @@
+export const COLLECTION_NAME = 'opendb-contacts'
+
+export type GenderType = {
+ text : string,
+ value : string,
+}
+
+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/tabBar/component.uvue b/pages/tabBar/component.uvue
index 6851c88d43e109eefb0992f885b4373bc16c8e69..7b07032f6801de50ce081fd2197692f26a045cd9 100644
--- a/pages/tabBar/component.uvue
+++ b/pages/tabBar/component.uvue
@@ -220,6 +220,17 @@ export default {
url: '/pages/component/web-view-local/web-view-local',
},
] as Page[],
+ },
+ {
+ id: 'unicloud-db',
+ name: 'uniCloud-db',
+ pages: [
+ {
+ name: '联系人',
+ enable: true,
+ url: '/pages/component/unicloud-db-contacts/list'
+ }
+ ] as Page[],
},
/*
{
diff --git a/uniCloud-aliyun/database/opendb-contacts.schema.json b/uniCloud-aliyun/database/opendb-contacts.schema.json
new file mode 100644
index 0000000000000000000000000000000000000000..9c55878d7175d1564c95adef2ddb402813ca98d2
--- /dev/null
+++ b/uniCloud-aliyun/database/opendb-contacts.schema.json
@@ -0,0 +1,76 @@
+{
+ "bsonType": "object",
+ "permission": {
+ "read": true,
+ "create": true,
+ "update": true,
+ "delete": true
+ },
+ "required": ["username", "mobile"],
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID(用户 ID),系统自动生成"
+ },
+ "username": {
+ "bsonType": "string",
+ "title": "姓名",
+ "description": "姓名",
+ "order": 1,
+ "trim": "both"
+ },
+ "gender": {
+ "bsonType": "int",
+ "title": "性别",
+ "description": "用户性别:0 未知 1 男性 2 女性",
+ "order": 2,
+ "defaultValue": 0,
+ "enum": [{
+ "text": "未知",
+ "value": 0
+ },
+ {
+ "text": "男",
+ "value": 1
+ },
+ {
+ "text": "女",
+ "value": 2
+ }
+ ]
+ },
+ "mobile": {
+ "bsonType": "string",
+ "title": "电话",
+ "order": 3,
+ "description": "电话",
+ "pattern": "^\\+?[0-9-]{3,20}$",
+ "trim": "both"
+ },
+ "email": {
+ "bsonType": "string",
+ "format": "email",
+ "title": "邮箱",
+ "order": 4,
+ "description": "邮箱地址",
+ "trim": "both"
+ },
+ "comment": {
+ "bsonType": "string",
+ "title": "备注",
+ "order": 5,
+ "description": "备注",
+ "trim": "both",
+ "component": {
+ "name": "textarea"
+ }
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ },
+ "version": "0.0.1"
+}
\ No newline at end of file