diff --git a/pages/component/unicloud-db-contacts/add.uvue b/pages/component/unicloud-db-contacts/add.uvue
index d8bb56141d35a14e3482560d5e97fe27fcc37ae9..b41cbc239ba888f41aa7440c392245c6f37ad8cd 100644
--- a/pages/component/unicloud-db-contacts/add.uvue
+++ b/pages/component/unicloud-db-contacts/add.uvue
@@ -3,32 +3,34 @@
{{error.errMsg}}
-
- 姓名
-
-
-
- 电话
-
-
-
- 邮箱
-
-
-
- 备注
-
-
-
- 性别
-
-
-
- {{item.text}}
-
-
-
-
+
@@ -39,11 +41,6 @@
data() {
return {
collection: COLLECTION_NAME,
- username: "",
- mobile: "",
- gender: "",
- comment: "",
- email: "",
genderList: GenderList as GenderType[],
$uniCloudElement: null as UniCloudDBElement | null
}
@@ -52,19 +49,14 @@
this.$uniCloudElement = this.$refs['udb'] as UniCloudDBElement
},
methods: {
- radioChange(e : RadioGroupChangeEvent) {
- this.gender = e.detail.value
- },
- submit() {
- const value = {
- username: this.username,
- gender: parseInt(this.gender),
- mobile: this.mobile,
- comment: this.comment,
- email: this.email,
- };
-
- this.$uniCloudElement!.add(value, {
+ // radioChange(e : RadioGroupChangeEvent) {
+ // this.gender = e.detail.value
+ // },
+ onFormSubmit: function (e : FormSubmitEvent) {
+ const formData = e.detail.value
+ // TODO 待调整 value 属性为 any 后可省略此转换
+ formData['gender'] = parseInt(formData['gender'] as string)
+ this.$uniCloudElement!.add(formData, {
showToast: false,
needLoading: true,
loadingTitle: "正在保存...",