diff --git a/packages/community/oneRepair/index.css b/packages/community/oneRepair/index.css index fe82058a..5758b7b1 100644 --- a/packages/community/oneRepair/index.css +++ b/packages/community/oneRepair/index.css @@ -59,6 +59,10 @@ page { font-size: 32rpx; } +.red{ + color: #FF0000; +} + .label { font-size: 28rpx; color: #999999; diff --git a/packages/community/oneRepair/index.vue b/packages/community/oneRepair/index.vue index c7435e9c..f5896b54 100644 --- a/packages/community/oneRepair/index.vue +++ b/packages/community/oneRepair/index.vue @@ -12,16 +12,16 @@
- *报修信息 + 报修信息
-
选择房源信息
+
*选择房源信息
{{ item.name }}
-
报修类型
+
*报修类型
@@ -29,28 +29,28 @@
-
问题描述
+
*问题描述
-
联系人
+
*联系人
-
联系电话
+
*联系电话
-
上门时间
+
*上门时间
@@ -235,6 +235,55 @@ export default { this.active = e; }, async handlerSubmitClick() { + // 表单验证 + if (!this.roomList[this.active]) { + uni.showToast({ + title: '请选择房源信息', + icon: 'none' + }); + return; + } + + if (!this.category.id) { + uni.showToast({ + title: '请选择报修类型', + icon: 'none' + }); + return; + } + + if (!this.repairInfo.trim()) { + uni.showToast({ + title: '请输入问题描述', + icon: 'none' + }); + return; + } + + if (!this.contactName.trim()) { + uni.showToast({ + title: '请输入联系人姓名', + icon: 'none' + }); + return; + } + + if (!this.contactPhone.trim() || this.contactPhone.length !== 11) { + uni.showToast({ + title: '请输入有效的联系电话', + icon: 'none' + }); + return; + } + + if (!this.time) { + uni.showToast({ + title: '请选择上门时间', + icon: 'none' + }); + return; + } + uni.showLoading({ title: '提交中' });