From a5c7e9f6ca5a02c6838b70cd5d09f786f1e44ffb Mon Sep 17 00:00:00 2001 From: FlowerWater <9579043+flowerwater2@user.noreply.gitee.com> Date: Tue, 23 Dec 2025 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/loan.ts | 1 + src/pages/me/loan-application.vue | 114 ++++++++++++++++---------- src/pagesBank/audit/detail.vue | 59 +++++++++++++ src/pagesBank/mock/index.ts | 4 +- src/pagesMerchant/dashboard/index.vue | 3 +- src/pagesMerchant/loan/assist.vue | 14 ++-- src/typings/loan.ts | 3 +- 7 files changed, 143 insertions(+), 55 deletions(-) diff --git a/src/api/loan.ts b/src/api/loan.ts index 5c69252..741d9bc 100644 --- a/src/api/loan.ts +++ b/src/api/loan.ts @@ -168,6 +168,7 @@ export function operateLoanApplication(id: string, action: string, data?: any) { case 'sign': item.status = LoanStatus.SIGNED; break; case 'disburse': item.status = LoanStatus.DISBURSED; break; case 'reject': item.status = LoanStatus.REJECTED; break; + case 'request_supplement': item.status = LoanStatus.PENDING_SUPPLEMENT; break; } // 添加记录 diff --git a/src/pages/me/loan-application.vue b/src/pages/me/loan-application.vue index c5c764f..4c72dca 100644 --- a/src/pages/me/loan-application.vue +++ b/src/pages/me/loan-application.vue @@ -398,12 +398,37 @@ function handleBack() { // 商家选择相关 import { getUserMerchants, submitLoanApplication } from '@/api/loan' import type { RelatedMerchant } from '@/typings/loan' +import { useUserStore } from '@/store/user' const merchantList = ref([]) +const userStore = useUserStore() onMounted(async () => { + // 1. 获取商户列表 const res = await getUserMerchants() merchantList.value = res.list + + // 2. 检查是否需要授权填充个人信息 + if (!formData.value.personalInfo.name) { + uni.showModal({ + title: '授权申请', + content: '允许本应用获取您的个人信息(姓名、电话、身份证)以自动填充申请表?', + success: (res) => { + if (res.confirm) { + // 自动填充 + const { userInfo } = userStore + if (userInfo) { + formData.value.personalInfo.name = userInfo.nickname || userInfo.username || '' + formData.value.personalInfo.phone = userInfo.phone || '' + // 模拟身份证和地址 (因为 store 中暂无这些字段) + formData.value.personalInfo.idCard = '110101199003078888' + formData.value.personalInfo.region = ['北京市', '北京市', '东城区'] + formData.value.personalInfo.detailAddress = '王府井大街1号' + } + } + } + }) + } }) function toggleMerchant(item: RelatedMerchant) { @@ -496,6 +521,50 @@ function toggleExpand() { + + + + + 关联商家 (辅助证明) + + + + + 选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。 + + + + + + + + + {{ item.merchantName }} + 最近交易: {{ item.lastTradeTime }} + + + + + + {{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }} + + + + + @@ -603,50 +672,7 @@ function toggleExpand() { - - - - - 关联商家 (辅助证明) - - - - - 选择交易过的商家,系统将通知商家为您提供交易辅助材料,有助于提高审批通过率。 - - - - - - - - - {{ item.merchantName }} - 最近交易: {{ item.lastTradeTime }} - - - - - - {{ isExpanded ? '收起' : '展开更多 (' + (merchantList.length - 3) + ')' }} - - - - - + diff --git a/src/pagesBank/audit/detail.vue b/src/pagesBank/audit/detail.vue index 08ebba9..903ab95 100644 --- a/src/pagesBank/audit/detail.vue +++ b/src/pagesBank/audit/detail.vue @@ -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) => { + + + 平台交易流水 (最近5笔) + + + + {{ t.title }} + {{ t.time }} + + {{ t.type === 'expend' ? '-' : '+' }}{{ t.amount }} + + + + @@ -213,6 +237,7 @@ onLoad((options) => { @@ -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; diff --git a/src/pagesBank/mock/index.ts b/src/pagesBank/mock/index.ts index e07cd6f..a680e3c 100644 --- a/src/pagesBank/mock/index.ts +++ b/src/pagesBank/mock/index.ts @@ -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, diff --git a/src/pagesMerchant/dashboard/index.vue b/src/pagesMerchant/dashboard/index.vue index f46264d..edb8711 100644 --- a/src/pagesMerchant/dashboard/index.vue +++ b/src/pagesMerchant/dashboard/index.vue @@ -18,7 +18,8 @@ const todos = computed(() => { { icon: 'i-carbon-shopping-bag', label: '待发货订单', count: merchantStore.stats.pendingOrders, path: '/pagesMerchant/order/list' }, { icon: 'i-carbon-warning', label: '库存预警', count: merchantStore.stats.lowStockGoods, path: '/pagesMerchant/goods/list' }, { icon: 'i-carbon-wallet', label: '待结算', count: `¥${(merchantStore.stats.pendingSettlement / 100).toFixed(0)}`, path: '/pagesMerchant/finance/index' }, - { icon: 'i-carbon-document', label: '待提供材料', count: 1, path: '/pagesMerchant/loan/assist' }, // 模拟数据 + { icon: 'i-carbon-document', label: '待提供材料', count: 1, path: '/pagesMerchant/loan/assist' }, // 模拟数据; 实际应从API获取 + // 实际项目中应增加获取该count的API,目前保持模拟 ].filter(item => item.count) }) diff --git a/src/pagesMerchant/loan/assist.vue b/src/pagesMerchant/loan/assist.vue index 170bbd2..0685477 100644 --- a/src/pagesMerchant/loan/assist.vue +++ b/src/pagesMerchant/loan/assist.vue @@ -109,14 +109,14 @@ onMounted(() => { 请上传与该用户的真实交易凭证 - - 上传订单 - - - 上传流水 - - 上传发票 + 上传发票 + + + 上传合同 + + + 上传附件 diff --git a/src/typings/loan.ts b/src/typings/loan.ts index cd0ca67..59cb05d 100644 --- a/src/typings/loan.ts +++ b/src/typings/loan.ts @@ -12,13 +12,14 @@ export enum LoanStatus { APPROVING = 'approving', // 审批中 APPROVED = 'approved', // 审批通过 REJECTED = 'rejected', // 已拒绝 + PENDING_SUPPLEMENT = 'pending_supplement', // 待完善(补充资料) SIGNING = 'signing', // 待签约 SIGNED = 'signed', // 已签约 DISBURSED = 'disbursed', // 已放款 } /** 辅助材料类型 */ -export type MaterialType = 'order' | 'flow' | 'invoice' | 'other' +export type MaterialType = 'order' | 'flow' | 'invoice' | 'contract' | 'attachment' | 'other' /** 商家辅助材料 */ export interface AssistMaterial {