This commit is contained in:
bb_pan 2025-09-01 14:55:43 +08:00
parent 4374511cb2
commit 18a8c1faa5
2 changed files with 24 additions and 8 deletions

View File

@ -188,7 +188,11 @@ const onClick = (e, item, itemIndex) => {
} }
swipeRef.value[itemIndex].closeAll() swipeRef.value[itemIndex].closeAll()
} }
const isSubmit = ref(false)
const submit = async () => { const submit = async () => {
if (isSubmit.value) return
isSubmit.value = true
let param = { let param = {
id: id.value, id: id.value,
taskId: taskId.value, taskId: taskId.value,
@ -209,6 +213,7 @@ const submit = async () => {
uni.showToast({ title: error.data.msg, icon: 'none' }) uni.showToast({ title: error.data.msg, icon: 'none' })
} finally { } finally {
uni.hideLoading() uni.hideLoading()
isSubmit.value = false
} }
// console.log(param) // console.log(param)
// submitBackApply(param).then(res => { // submitBackApply(param).then(res => {

View File

@ -202,15 +202,26 @@ const onRepairItem = (item) => {
} }
const isSubmit = ref(false)
const handleSubmit = async () => { const handleSubmit = async () => {
// try {
const res = await repairSubmitAPI([{ taskId: taskId.value }]) if (isSubmit.value) return
if (res.code === 200) { isSubmit.value = true
uni.showToast({ uni.showLoading({ title: '提交中...', mask: true })
title: '提交成功!', //
icon: 'none', const res = await repairSubmitAPI([{ taskId: taskId.value }])
}) if (res.code === 200) {
uni.navigateBack() uni.showToast({
title: '提交成功!',
icon: 'none',
})
uni.navigateBack()
}
} catch (error) {
console.log('🚀 ~ handleSubmit ~ error:', error)
} finally {
uni.hideLoading()
isSubmit.value = false
} }
} }