feat: 呼叫服务新增房间号验证

This commit is contained in:
duanshuwen
2025-11-05 20:42:58 +08:00
parent 19c21d2510
commit 66ff10018f

View File

@@ -131,20 +131,14 @@ const workOrderId = ref(0); // 工单ID
// 处理图片上传 // 处理图片上传
const handleChooseImage = () => { const handleChooseImage = () => {
console.log("选择图片");
uni.chooseImage({ uni.chooseImage({
count: 1, count: 1,
success: (res) => { success: (res) => {
const file = res.tempFilePaths[0]; const file = res.tempFilePaths[0];
updateImagehandle(file); updateImagehandle(file);
}, },
fail: (err) => { fail: () => {
console.error("选择图片失败:", err); uni.showToast({ title: "选择图片失败", icon: "none" });
uni.showToast({
title: "选择图片失败",
icon: "none",
duration: 2000,
});
}, },
}); });
}; };
@@ -169,21 +163,18 @@ const handleCall = async () => {
return; return;
} }
if (!roomId.value.trim()) {
uni.showToast({ title: "请填写房间号", icon: "none" });
return;
}
if (!contactPhone.value.trim()) { if (!contactPhone.value.trim()) {
uni.showToast({ uni.showToast({ title: "请填写联系电话", icon: "none" });
title: "请填写联系电话",
icon: "none",
duration: 2000,
});
return; return;
} }
if (!contactText.value.trim()) { if (!contactText.value.trim()) {
uni.showToast({ uni.showToast({ title: "请填写需求信息描述内容", icon: "none" });
title: "请填写需求信息描述内容",
icon: "none",
duration: 2000,
});
return; return;
} }
@@ -208,31 +199,17 @@ const sendCreateWorkOrder = async () => {
// 设置成功状态 // 设置成功状态
isCallSuccess.value = true; isCallSuccess.value = true;
uni.showToast({ uni.showToast({ title: "呼叫成功", icon: "success" });
title: "呼叫成功",
icon: "success",
duration: 2000,
});
} else { } else {
uni.showToast({ uni.showToast({ title: res.message || "呼叫失败", icon: "none" });
title: res.message || "呼叫失败",
icon: "none",
duration: 2000,
});
} }
} catch (error) { } catch (error) {
console.error("呼叫失败:", error); uni.showToast({ title: "网络错误,请重试", icon: "none" });
uni.showToast({
title: "网络错误,请重试",
icon: "none",
duration: 2000,
});
} }
}; };
// 查看工单 // 查看工单
const viewWorkOrder = () => { const viewWorkOrder = () => {
console.log("查看工单:", workOrderId.value);
// 这里可以跳转到工单详情页面 // 这里可以跳转到工单详情页面
uni.navigateTo({ uni.navigateTo({
url: `/pages-service/order/list`, url: `/pages-service/order/list`,