From 66ff10018f23ee0361183ca90a742e629e24cb38 Mon Sep 17 00:00:00 2001 From: duanshuwen Date: Wed, 5 Nov 2025 20:42:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=91=BC=E5=8F=AB=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=BF=E9=97=B4=E5=8F=B7=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CreateServiceOrder/index.vue | 47 ++++++--------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/src/components/CreateServiceOrder/index.vue b/src/components/CreateServiceOrder/index.vue index 6a8a6d2..fbbd4b2 100644 --- a/src/components/CreateServiceOrder/index.vue +++ b/src/components/CreateServiceOrder/index.vue @@ -131,20 +131,14 @@ const workOrderId = ref(0); // 工单ID // 处理图片上传 const handleChooseImage = () => { - console.log("选择图片"); uni.chooseImage({ count: 1, success: (res) => { const file = res.tempFilePaths[0]; updateImagehandle(file); }, - fail: (err) => { - console.error("选择图片失败:", err); - uni.showToast({ - title: "选择图片失败", - icon: "none", - duration: 2000, - }); + fail: () => { + uni.showToast({ title: "选择图片失败", icon: "none" }); }, }); }; @@ -169,21 +163,18 @@ const handleCall = async () => { return; } + if (!roomId.value.trim()) { + uni.showToast({ title: "请填写房间号", icon: "none" }); + return; + } + if (!contactPhone.value.trim()) { - uni.showToast({ - title: "请填写联系电话", - icon: "none", - duration: 2000, - }); + uni.showToast({ title: "请填写联系电话", icon: "none" }); return; } if (!contactText.value.trim()) { - uni.showToast({ - title: "请填写需求信息描述内容", - icon: "none", - duration: 2000, - }); + uni.showToast({ title: "请填写需求信息描述内容", icon: "none" }); return; } @@ -208,31 +199,17 @@ const sendCreateWorkOrder = async () => { // 设置成功状态 isCallSuccess.value = true; - uni.showToast({ - title: "呼叫成功", - icon: "success", - duration: 2000, - }); + uni.showToast({ title: "呼叫成功", icon: "success" }); } else { - uni.showToast({ - title: res.message || "呼叫失败", - icon: "none", - duration: 2000, - }); + uni.showToast({ title: res.message || "呼叫失败", icon: "none" }); } } catch (error) { - console.error("呼叫失败:", error); - uni.showToast({ - title: "网络错误,请重试", - icon: "none", - duration: 2000, - }); + uni.showToast({ title: "网络错误,请重试", icon: "none" }); } }; // 查看工单 const viewWorkOrder = () => { - console.log("查看工单:", workOrderId.value); // 这里可以跳转到工单详情页面 uni.navigateTo({ url: `/pages-service/order/list`,