This commit is contained in:
parent
4374511cb2
commit
18a8c1faa5
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue