From 18a8c1faa566ef9a4fc94c54987e0f9e06bd09f7 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Mon, 1 Sep 2025 14:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/back/detail.vue | 5 +++++ src/pages/repair/repairManage/details.vue | 27 ++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/pages/back/detail.vue b/src/pages/back/detail.vue index 0ef1445..203e00c 100644 --- a/src/pages/back/detail.vue +++ b/src/pages/back/detail.vue @@ -188,7 +188,11 @@ const onClick = (e, item, itemIndex) => { } swipeRef.value[itemIndex].closeAll() } + +const isSubmit = ref(false) const submit = async () => { + if (isSubmit.value) return + isSubmit.value = true let param = { id: id.value, taskId: taskId.value, @@ -209,6 +213,7 @@ const submit = async () => { uni.showToast({ title: error.data.msg, icon: 'none' }) } finally { uni.hideLoading() + isSubmit.value = false } // console.log(param) // submitBackApply(param).then(res => { diff --git a/src/pages/repair/repairManage/details.vue b/src/pages/repair/repairManage/details.vue index d30569f..f97bf7b 100644 --- a/src/pages/repair/repairManage/details.vue +++ b/src/pages/repair/repairManage/details.vue @@ -202,15 +202,26 @@ const onRepairItem = (item) => { } +const isSubmit = ref(false) const handleSubmit = async () => { - // 提交逻辑 - const res = await repairSubmitAPI([{ taskId: taskId.value }]) - if (res.code === 200) { - uni.showToast({ - title: '提交成功!', - icon: 'none', - }) - uni.navigateBack() + try { + if (isSubmit.value) return + isSubmit.value = true + uni.showLoading({ title: '提交中...', mask: true }) + // 提交逻辑 + const res = await repairSubmitAPI([{ taskId: taskId.value }]) + if (res.code === 200) { + uni.showToast({ + title: '提交成功!', + icon: 'none', + }) + uni.navigateBack() + } + } catch (error) { + console.log('🚀 ~ handleSubmit ~ error:', error) + } finally { + uni.hideLoading() + isSubmit.value = false } }