From 3f607f74e28dfd4a6cc8d0f83fd0c89dbd800b37 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Tue, 25 Nov 2025 07:49:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=81=E5=88=86=E6=9C=9F=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AE=9A=E4=BD=8D=EF=BC=8C=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E6=9C=AA=E7=BB=93=E6=B8=85=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/work/bill/creditCardBill/list.vue | 7 +- .../bill/creditInstallmentHistory/details.vue | 65 ++++++++++++++++- .../bill/creditInstallmentHistory/list.vue | 8 +-- .../work/bill/onlineLendHistory/details.vue | 71 +++++++++++++++++-- .../work/bill/onlineLendHistory/list.vue | 4 +- .../work/bill/peopleLendHistory/list.vue | 5 +- 6 files changed, 140 insertions(+), 20 deletions(-) diff --git a/src/pages/work/bill/creditCardBill/list.vue b/src/pages/work/bill/creditCardBill/list.vue index c5211e8..20d7417 100644 --- a/src/pages/work/bill/creditCardBill/list.vue +++ b/src/pages/work/bill/creditCardBill/list.vue @@ -141,9 +141,10 @@ const data = reactive({ }, queryParams: { creditCardId: null, - name: '', - type: '', - } + name: '', + type: '', + billState: '0' // 默认未出账单 + } }) const { queryBankCardLendParams, queryParams} = toRefs(data) onLoad(() => { diff --git a/src/pages/work/bill/creditInstallmentHistory/details.vue b/src/pages/work/bill/creditInstallmentHistory/details.vue index 1d8c0f7..fdee9df 100644 --- a/src/pages/work/bill/creditInstallmentHistory/details.vue +++ b/src/pages/work/bill/creditInstallmentHistory/details.vue @@ -10,7 +10,7 @@ - + @@ -18,9 +18,9 @@ - + - + @@ -96,6 +96,8 @@ const status = ref('loadmore') const postingStateList = ref([]) const settingPickShow = ref(false) const settingColumns = ref([]) +const scrollIntoView = ref('') +const firstUnpaidIndex = ref(-1) const data = reactive({ form: {}, queryParams: { @@ -137,10 +139,52 @@ function getList() { } else { status.value = 'nomore' } + // 查找最近一条未入账的数据 + scrollToFirstUnpaid() }).catch(() => { status.value = 'nomore' }) } + +// 滚动到最近一条未入账的数据 +function scrollToFirstUnpaid() { + // 查找所有未入账的记录 + const unpaidRecords = listData.value + .map((item, index) => ({ ...item, originalIndex: index })) + .filter(item => item.postingState !== '1') + + if (unpaidRecords.length === 0) return + + // 获取当前日期 + const now = new Date() + + // 找到距离当前日期最近的未入账记录 + let closestRecord = unpaidRecords[0] + let minDiff = Math.abs(new Date(unpaidRecords[0].repaymentDate) - now) + + unpaidRecords.forEach(record => { + const recordDate = new Date(record.repaymentDate) + const diff = Math.abs(recordDate - now) + if (diff < minDiff) { + minDiff = diff + closestRecord = record + } + }) + + const index = closestRecord.originalIndex + firstUnpaidIndex.value = index + + // 延迟执行,确保 DOM 渲染完成 + setTimeout(() => { + scrollIntoView.value = 'item-' + index + + // 3秒后移除高亮效果 + setTimeout(() => { + firstUnpaidIndex.value = -1 + scrollIntoView.value = '' + }, 3000) + }, 800) +} function getDict() { // 交易类型 getDicts('posting_state').then(res => { @@ -272,6 +316,12 @@ page { border-radius: 16rpx; overflow: hidden; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08); + transition: all 0.3s ease; + + &.highlight-item { + animation: highlight 2s ease-in-out; + box-shadow: 0 0 20rpx rgba(102, 126, 234, 0.6); + } .item-header { display: flex; @@ -433,4 +483,13 @@ page { } } } + +@keyframes highlight { + 0%, 100% { + background-color: #fff; + } + 50% { + background-color: rgba(102, 126, 234, 0.1); + } +} \ No newline at end of file diff --git a/src/pages/work/bill/creditInstallmentHistory/list.vue b/src/pages/work/bill/creditInstallmentHistory/list.vue index 67c0d9b..352abee 100644 --- a/src/pages/work/bill/creditInstallmentHistory/list.vue +++ b/src/pages/work/bill/creditInstallmentHistory/list.vue @@ -48,8 +48,8 @@ - 分期日期 - {{ item.installmentDate }} + 分期期数 + {{ item.period }}期 已还期数 @@ -141,8 +141,8 @@ const data = reactive({ name: null, type: '2', bankCardLendId: null, - state: '' - } + state: '0' // 默认未结清 + } }) const { queryBankCardLendParams, queryParams} = toRefs(data) onLoad(() => { diff --git a/src/pages/work/bill/onlineLendHistory/details.vue b/src/pages/work/bill/onlineLendHistory/details.vue index 04a01ed..fc68e13 100644 --- a/src/pages/work/bill/onlineLendHistory/details.vue +++ b/src/pages/work/bill/onlineLendHistory/details.vue @@ -10,7 +10,7 @@ - + @@ -18,9 +18,9 @@ - + - + @@ -97,6 +97,8 @@ const status = ref('loadmore') const postingStateList = ref([]) const settingPickShow = ref(false) const settingColumns = ref([]) +const scrollIntoView = ref('') +const firstUnpaidIndex = ref(-1) const data = reactive({ form: {}, queryParams: { @@ -112,9 +114,9 @@ const { queryParams,form} = toRefs(data) onLoad((option) => { queryParams.value.installmentHistoryId = option.id queryParams.value.name = option.name - getDict() - getList() - }); + getDict() + getList() +}); onShow(() => { if (isShow.value) { @@ -138,10 +140,52 @@ function getList() { } else { status.value = 'nomore' } + // 查找第一条未还款的数据 + scrollToFirstUnpaid() }).catch(() => { status.value = 'nomore' }) } + +// 滚动到最近一条未还款的数据 +function scrollToFirstUnpaid() { + // 查找所有未还款的记录 + const unpaidRecords = listData.value + .map((item, index) => ({ ...item, originalIndex: index })) + .filter(item => item.postingState !== '1') + + if (unpaidRecords.length === 0) return + + // 获取当前日期 + const now = new Date() + + // 找到距离当前日期最近的未还款记录 + let closestRecord = unpaidRecords[0] + let minDiff = Math.abs(new Date(unpaidRecords[0].repaymentDate) - now) + + unpaidRecords.forEach(record => { + const recordDate = new Date(record.repaymentDate) + const diff = Math.abs(recordDate - now) + if (diff < minDiff) { + minDiff = diff + closestRecord = record + } + }) + + const index = closestRecord.originalIndex + firstUnpaidIndex.value = index + + // 延迟执行,确保 DOM 渲染完成 + setTimeout(() => { + scrollIntoView.value = 'item-' + index + + // 3秒后移除高亮效果 + setTimeout(() => { + firstUnpaidIndex.value = -1 + scrollIntoView.value = '' + }, 3000) + }, 800) +} function getDict() { // 交易类型 getDicts('repayment_state').then(res => { @@ -282,6 +326,12 @@ page { border-radius: 16rpx; overflow: hidden; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08); + transition: all 0.3s ease; + + &.highlight-item { + animation: highlight 2s ease-in-out; + box-shadow: 0 0 20rpx rgba(102, 126, 234, 0.6); + } .item-header { display: flex; @@ -463,4 +513,13 @@ page { } } } + +@keyframes highlight { + 0%, 100% { + background-color: #fff; + } + 50% { + background-color: rgba(102, 126, 234, 0.1); + } +} \ No newline at end of file diff --git a/src/pages/work/bill/onlineLendHistory/list.vue b/src/pages/work/bill/onlineLendHistory/list.vue index 21fa00d..028ea51 100644 --- a/src/pages/work/bill/onlineLendHistory/list.vue +++ b/src/pages/work/bill/onlineLendHistory/list.vue @@ -143,8 +143,8 @@ const data = reactive({ name: null, type: '3', bankCardLendId: null, - state: '' - } + state: '0' // 默认未结清 + } }) const { queryBankCardLendParams, queryParams} = toRefs(data) onLoad(() => { diff --git a/src/pages/work/bill/peopleLendHistory/list.vue b/src/pages/work/bill/peopleLendHistory/list.vue index f9da383..5594864 100644 --- a/src/pages/work/bill/peopleLendHistory/list.vue +++ b/src/pages/work/bill/peopleLendHistory/list.vue @@ -119,8 +119,9 @@ const data = reactive({ queryParams: { name: null, type: '4', - bankCardLendId: null - } + bankCardLendId: null, + state: '0' // 默认未结清 + } }) const { filterPanel, queryBankCardLendParams, queryParams} = toRefs(data) const windowHeight = computed(() => {