定损弹框优化
This commit is contained in:
parent
72bc630f35
commit
b085d9349e
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue