feat: 实现协议全文与同意记录功能
新增协议全文后台管理、版本化发布及本人同意记录功能,支持可撤销授权;完善资料与授权相关边界提示,调整评估提交时的资料与授权校验逻辑,同步更新相关页面文案与路由。
This commit is contained in:
@@ -3,6 +3,7 @@ import { readAssessmentFlow, writeAssessmentFlow, clearAssessmentFlow } from './
|
||||
export { clearAssessmentFlow } from './assessment-flow.uts'
|
||||
import { contributionBaseVisible, contributionBaseValid, contributionBaseYuan } from './contribution.uts'
|
||||
import { wanAmountValid, wanToYuan, wanToCents } from './money.uts'
|
||||
import { showAgreementNotice as openAgreementNotice } from './agreements.uts'
|
||||
|
||||
export type AssessmentForm = {
|
||||
name: string, idCard: string, phone: string, city: string, maritalStatus: string,
|
||||
@@ -12,7 +13,7 @@ export type AssessmentForm = {
|
||||
creditCardCount: string, creditCardTotalLimit: string, creditCardUsedLimit: string,
|
||||
otherAssets: string, enterpriseName: string, businessCode: string, annualRevenue: string, operatingYears: string, operatingMonths: string
|
||||
}
|
||||
export type SelectedDocument = { name: string, path: string }
|
||||
export type SelectedDocument = { name: string, path: string, documentId: string, consentId: string, deletePending: boolean }
|
||||
export type DataAuthorization = { key: string, name: string, selected: boolean }
|
||||
|
||||
export function emptyAssessmentForm(): AssessmentForm {
|
||||
@@ -91,12 +92,15 @@ export function documentsFromInput(saved: UTSJSONObject): SelectedDocument[] {
|
||||
if (items == null) return results
|
||||
items.forEach((item) => {
|
||||
const name = draftText(item, 'name'); const path = draftText(item, 'path')
|
||||
if (name.length > 0 && path.length > 0) { const document: SelectedDocument = { name, path }; results.push(document) }
|
||||
const documentId = draftText(item, 'documentId'); const consentId = draftText(item, 'consentId')
|
||||
if (name.length > 0 && (path.length > 0 || documentId.length > 0)) {
|
||||
const document: SelectedDocument = { name, path, documentId, consentId, deletePending: item.getBoolean('deletePending') ?? false }; results.push(document)
|
||||
}
|
||||
})
|
||||
return results
|
||||
}
|
||||
export function setAssessmentInput(type: string, step: number, form: AssessmentForm, documents: SelectedDocument[], authorizations: DataAuthorization[], documentConsent: boolean, dataConsent: boolean, editAssessmentId: string = '', baseRevisionId: string = ''): void {
|
||||
const files: UTSJSONObject[] = documents.map((item): UTSJSONObject => ({ name: item.name, path: item.path }))
|
||||
const files: UTSJSONObject[] = documents.map((item): UTSJSONObject => ({ name: item.name, path: '', documentId: item.documentId, consentId: item.consentId, deletePending: item.deletePending }))
|
||||
const grants: string[] = authorizations.filter((item) => item.selected).map((item) => item.key)
|
||||
const payload: UTSJSONObject = {
|
||||
type, step, editAssessmentId, baseRevisionId, moneyUnit: 'wan', name: form.name, idCard: form.idCard, phone: form.phone, city: form.city, maritalStatus: form.maritalStatus,
|
||||
@@ -110,7 +114,7 @@ export function setAssessmentInput(type: string, step: number, form: AssessmentF
|
||||
writeAssessmentFlow(flowToken(), payload)
|
||||
}
|
||||
export function showAgreementNotice(title: string): void {
|
||||
uni.showModal({ title, content: '完整协议将在相关服务开放时提供。当前勾选仅保存您的选择,不会发起实名认证、查询外部数据或上传资料。', showCancel: false, confirmText: '我知道了' })
|
||||
openAgreementNotice(title)
|
||||
}
|
||||
|
||||
export type AssessmentProgress = { percent: number, basicDone: boolean, incomeDone: boolean, assetsDone: boolean, authorizationSelected: boolean }
|
||||
|
||||
Reference in New Issue
Block a user