From c83e7c5a9bf9e54061d409eb1fbc719361b8cec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Mon, 4 Aug 2025 15:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=8A=A5=E4=BF=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BF=85=E5=A1=AB=E9=A1=B9=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/community/oneRepair/index.css | 4 ++ packages/community/oneRepair/index.vue | 63 +++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 7 deletions(-) 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: '提交中' });