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`,