定损弹框优化

This commit is contained in:
bb_pan 2025-09-03 22:03:42 +08:00
parent 72bc630f35
commit b085d9349e
1 changed files with 17 additions and 2 deletions

View File

@ -116,8 +116,8 @@
{{ modalContent }}
</view>
<view class="custom-modal-footer">
<button class="custom-modal-btn cancel" @tap="handleCancel">转至维修</button>
<button class="custom-modal-btn confirm" @tap="handleConfirm">进入定损</button>
<button class="custom-modal-btn cancel" @tap="handleCancel">转至维修{{ countdown > 0 ? '(' + countdown + ')' : '' }}</button>
<button class="custom-modal-btn confirm" @tap="handleConfirm">进入定损{{ countdown > 0 ? '(' + countdown + ')' : '' }}</button>
</view>
</view>
</view>
@ -130,6 +130,8 @@ import { getLossAssessmentListAPI,repairSubmitAPI,repairRejectAPI,updateRepairSt
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const timer = ref(null)
const countdown = ref(0)
const total = ref(0) // <EFBFBD><EFBFBD>
const active = ref(1) // tap
const tableList = ref([]) //
@ -299,6 +301,17 @@ const handleItem = (item) => {
if(item.repairStatusCode == "0") {
// 使
showCustomModal.value = true
if (timer.value) clearInterval(timer.value)
countdown.value = 3
timer.value = setInterval(() => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer.value)
timer.value = null
countdown.value = 0
}
}, 1000)
} else {
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
}
@ -343,12 +356,14 @@ const handleItem = (item) => {
//
const handleConfirm = () => {
if (countdown.value > 0) return
showCustomModal.value = false
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${currentItem.value.taskId}` })
}
//
const handleCancel = async () => {
if (countdown.value > 0) return
showCustomModal.value = false
const res = await updateRepairStatusAPI({taskId: currentItem.value.taskId})
if(res.code == 200) {