feat: 修复

This commit is contained in:
FlowerWater
2025-12-23 17:18:55 +08:00
parent 06df763ed4
commit a5c7e9f6ca
7 changed files with 143 additions and 55 deletions

View File

@@ -2,6 +2,7 @@
import { getLoanApplicationDetail, operateLoanApplication } from '@/api/loan'
import { LoanStatus } from '@/typings/loan'
import type { LoanApplication, RelatedMerchant } from '@/typings/loan'
import { mockTransactions } from '@/pagesBank/mock'
definePage({
style: {
@@ -30,6 +31,7 @@ const currentStepIndex = computed(() => {
const index = steps.findIndex(s => s.key === status)
// 特殊处理中间状态映射
if (status === LoanStatus.REPORTED) return 3 // 上报后进入审批阶段
if (status === LoanStatus.PENDING_SUPPLEMENT) return 2 // 待补充资料,留在中间阶段
if (status === LoanStatus.APPROVED) return 4 // 审批通过等待签约
if (status === LoanStatus.SIGNED) return 5 // 签约完成等待放款
return index > -1 ? index : 0
@@ -58,6 +60,14 @@ async function handleAction(action: string) {
})
if (!res.confirm) return
data = { report: res.content }
} else if (action === 'request_supplement') {
const res = await uni.showModal({
title: '要求补充资料',
editable: true,
placeholderText: '请输入需补充的资料及原因...'
})
if (!res.confirm) return
data = { reason: res.content }
} else if (action === 'approve' || action === 'reject') {
const res = await uni.showModal({
title: action === 'approve' ? '确认通过' : '确认拒绝',
@@ -141,6 +151,20 @@ onLoad((options) => {
</div>
</view>
<!-- 平台交易流水(Mock) -->
<view class="section-card">
<view class="card-header">平台交易流水 (最近5笔)</view>
<view class="transaction-list">
<view class="t-item" v-for="t in mockTransactions" :key="t.id">
<view class="t-main">
<text class="t-title">{{ t.title }}</text>
<text class="t-time">{{ t.time }}</text>
</view>
<text class="t-amount" :class="t.type">{{ t.type === 'expend' ? '-' : '+' }}{{ t.amount }}</text>
</view>
</view>
</view>
<!-- 关联商家及辅助材料 -->
<view class="section-card">
<view class="card-header">
@@ -213,6 +237,7 @@ onLoad((options) => {
<template v-else-if="[LoanStatus.REPORTED, LoanStatus.APPROVING].includes(detail.status)">
<button class="btn danger" @click="handleAction('reject')">拒绝</button>
<button class="btn warning" @click="handleAction('request_supplement')">要求补充</button>
<button class="btn primary" @click="handleAction('approve')">通过审批</button>
</template>
@@ -377,6 +402,40 @@ onLoad((options) => {
}
}
}
}
.transaction-list {
padding: 20rpx 0;
.t-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid #f9f9f9;
&:last-child { border-bottom: none; }
.t-main {
display: flex;
flex-direction: column;
.t-title { font-size: 26rpx; color: #333; margin-bottom: 6rpx; }
.t-time { font-size: 22rpx; color: #999; }
}
.t-amount {
font-size: 30rpx;
font-weight: bold;
color: #333;
&.income { color: #fe2c55; }
&.expend { color: #333; }
}
}
}
.merchant-list {
padding: 20rpx 0;

View File

@@ -53,7 +53,7 @@ export const mockCustomerList: BankCustomer[] = [
{
id: 'C1001',
merchantId: 'M1001',
merchantName: '广州酷玩玩具城',
merchantName: '张三', // 模拟个人客户
creditLimit: 500000.00,
usedLimit: 125000.00,
balance: 375000.00,
@@ -65,7 +65,7 @@ export const mockCustomerList: BankCustomer[] = [
{
id: 'C1002',
merchantId: 'M1002',
merchantName: '深圳特粉专卖店',
merchantName: '李四', // 模拟个人客户
creditLimit: 200000.00,
usedLimit: 180000.00,
balance: 20000.00,