feat(融资): 新增产品对比页面及相关接口实现
新增产品对比页面 compare/compare,支持同一评估下最多3个产品的横向对比,展示额度、期限、利率、适用条件等核心指标及匹配详情。 新增 matches.uts 服务层,封装匹配列表、详情、公共产品查询接口。 新增 account 分包的 latest-report.uts 服务,用于查找用户最新成功报告。 调整个人中心页面,将“评估记录”改为“开始评估”,新增最近报告直达功能。 更新文档,标记匹配相关接口及原型07、09页面已实现,调整页面数量至26页。 移除 finance 分包中旧的 fetchMatches、fetchProduct 模拟数据接口,统一使用正式API。
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { API_DEMO_ENABLED, API_BASE_URL, wait, requestJson } from '@/services/api.uts'
|
||||
import { demoProducts, parseProduct, FinanceProduct } from './finance.uts'
|
||||
import { createAssessment } from './records.uts'
|
||||
export { API_BASE_URL } from '@/services/api.uts'
|
||||
|
||||
@@ -7,26 +6,6 @@ export async function submitAssessment(payload: UTSJSONObject): Promise<string>
|
||||
return await createAssessment(payload)
|
||||
}
|
||||
|
||||
export async function fetchMatches(): Promise<FinanceProduct[]> {
|
||||
if (API_DEMO_ENABLED) {
|
||||
await wait(320)
|
||||
return demoProducts.slice()
|
||||
}
|
||||
const result = await requestJson('/matches', 'GET', new UTSJSONObject())
|
||||
const items = result['items'] as UTSJSONObject[] | null
|
||||
return items == null ? [] : items.map((item: UTSJSONObject): FinanceProduct => parseProduct(item))
|
||||
}
|
||||
|
||||
export async function fetchProduct(id: string): Promise<FinanceProduct | null> {
|
||||
if (API_DEMO_ENABLED) {
|
||||
await wait(180)
|
||||
const products = demoProducts.filter((item: FinanceProduct): boolean => item.id == id)
|
||||
return products.length > 0 ? products[0] : null
|
||||
}
|
||||
const result = await requestJson('/products/' + encodeURIComponent(id), 'GET', new UTSJSONObject())
|
||||
return parseProduct(result)
|
||||
}
|
||||
|
||||
export async function sendAssistantMessage(message: string): Promise<string> {
|
||||
if (API_DEMO_ENABLED) {
|
||||
await wait(600)
|
||||
|
||||
Reference in New Issue
Block a user