③ 借款提现
以 H5 为主(h5/wp_h5/src/views/withdraw-refactor),原生壳入口拉起 WebView。提现主流程 goWithdraw(useWithdrawCore.js)含多条分支,下方「分支清单」穷举,时序图展开主干 + 关键分支。
概述
| 项 | 内容 |
|---|
| 起点 | 进件完成进入借款 / 首页提现入口 |
| 终点 | 提现申请提交(applyNo),展示提现状态 |
| 发起端 | H5(WebView)为主;原生壳承载入口与绑卡通道交互 |
| 后端 | blc-service(cust/、apply/、query/、user/、plutus/)+ 支付通道托管页(外部) |
| 核心子流程 | 设备检测、绑卡跳转、PIN 校验 |
主流程时序
sequenceDiagram
autonumber
actor U as 用户
participant NAT as 原生壳
participant H5 as H5 提现页(WebView)
participant CHAN as 通道托管页(外部)
participant BLC as blc-service
NAT->>H5: 拉起 WebView 加载 /withdraw
Note over U,BLC: 初始化(阶段/产品/卡/配置)
H5->>BLC: query/v1/queryStageInfo4nc
H5->>BLC: cust/queryCustProductInfo(产品+额度)
H5->>BLC: cust/queryCustCardInfo(已绑卡)
H5->>BLC: query/v1/popAPPConfig(页面配置)
BLC-->>H5: 数据
opt 提现受限(popAPPConfig 含 limitAcct)
H5->>U: WithdrawLimitedDialog(阻断, 引导)
end
U->>H5: 选金额/期限/借款用途
H5->>BLC: apply/v1/loanCalculate4nc(试算)
BLC-->>H5: 月供/利息/计划
Note over U,BLC: 点提现 goWithdraw — 设备检测
U->>H5: 确认提现
H5->>BLC: user/v1/deviceVerification
BLC-->>H5: checkDeviceStage(UF/OTP/Y)
alt UF 且未通过
H5->>U: 跳人脸验证(checkDeviceStage)
else OTP 且未通过
H5->>U: OtpVerifyPopup 输 OTP
H5->>H5: isSkipPINFlag = Y
else 已通过(Y)
H5->>H5: isSkipPINFlag = Y(跳 PIN)
end
opt 重授信入口(needReCredit*)
H5->>U: 更新紧急联系人 / 活体检测
end
Note over U,BLC: 校验 + 绑卡分支
H5->>H5: 校验金额(min/max)、用途必选、期限必选
alt 无银行账户
U->>H5: 新增账户(绑卡跳转, 见下方子流程)
else 有账户无卡且新户
H5->>BLC: apply/v1/loanApplyNoBindCardInit(预锁单)
end
Note over U,BLC: PIN 分支
alt 需 PIN(isPin 且 isSkipPINFlag != Y)
U->>H5: PinVerifyPopup 输交易密码
else 可跳过(isSkipPINFlag = Y)
H5->>H5: 跳过 PIN
else 未设 PIN
H5->>U: 跳 setPin 设置
end
Note over U,BLC: 提交
H5->>BLC: cust/loanApply4merge(金额/期限/卡/用途/PIN, 钱包用户 bankCode=verifyType)
BLC-->>H5: applyNo
H5->>BLC: query/v1/queryLoanList4nc(轮询提现状态)
H5->>U: /withdrawStatus
绑卡跳转子流程
sequenceDiagram
autonumber
actor U as 用户
participant H5 as H5 提现页
participant CHAN as 通道托管页(外部)
participant BLC as blc-service
U->>H5: 新增银行账户
H5->>BLC: user/v1/routeRedirect(scene=2)
BLC-->>H5: redirectUrl + bindCardType
H5->>CHAN: location.href = redirectUrl(跳通道托管页)
U->>CHAN: 完成绑卡(BVN/银行/OTP)
Note over CHAN,BLC: 后端侧:通道异步回调→IMS→bns bindCardCallBack(前端不可见,见后端13)
CHAN->>H5: redirect 回跳 /addBankAccount
H5->>BLC: query/v1/queryWithdrawAcctInfoCutoverSelect4nc(刷新账户)
BLC-->>H5: 新账户列表
H5->>BLC: apply/v1/loanApplyNoBindCardInit(预锁单)
BLC-->>H5: applyNo → 继续提现
分支清单(穷举 goWithdraw 全部分支)
标准:本阶段所有用户 CTA / 后端返回分支逐条列出,标「已展开 / 链出 / 暂略」,杜绝悄悄省略。出处均为 useWithdrawCore.js(除注明)。
| # | 分支 | 触发条件 | 处理 | 接口/出处 | 状态 |
|---|
| 1 | 数据未就绪 | criticalReady=loading/fail | 等待/报错,阻断提现 | useWithdrawCore | 已展开(隐含) |
| 2 | 提现受限 | popAPPConfig 含 limitAcctName/No | WithdrawLimitedDialog 阻断引导 | popAPPConfig(useWithdrawData:313) | 已展开 |
| 3 | 设备人脸验证 | faceVerify 且 checkDeviceStage=UF 且 result≠Y | 跳人脸验证页 | user/v1/deviceVerification | 已展开 |
| 4 | 设备 OTP 验证 | checkDeviceStage=OTP 且 result≠Y | OtpVerifyPopup + isSkipPINFlag=Y | deviceVerification | 已展开 |
| 5 | 设备已验证 | checkDeviceStageResult=Y | isSkipPINFlag=Y(跳 PIN) | deviceVerification | 已展开 |
| 6 | 重授信-更新联系人 | needReCreditContractList=Y | 跳 /updateEmergencyContact | useWithdrawCore:149 | 链出 → 05-提额复借重授信 |
| 7 | 重授信-活体 | needReCreditliveDetection=Y | 跳活体检测 | useWithdrawCore:152 | 链出 → 05-提额复借重授信 |
| 8 | 金额非法 | amount<=0 或 <min 或 >max | 提示,阻断 | useWithdrawCore:191/247 | 已展开 |
| 9 | 借款用途未选 | purposeActive=-1 | PurposePopup 必选 | loanDetail.purposeList | 已展开 |
| 10 | 期限未选 | longActive=-1 | 必选期限 | useWithdrawCore:206 | 已展开 |
| 11 | 无银行账户 | bankAcctList.length=0 | 绑卡跳转(routeRedirect) | 见绑卡子流程 | 已展开 |
| 12 | 有账户无卡新户 | hasNoCards && !cardSkip && !isWallet && isNewUser | 预提现 loanApplyNoBindCardInit | apply/v1/loanApplyNoBindCardInit | 已展开 |
| 13 | 需 PIN | isPin 且 isSkipPINFlag≠Y | PinVerifyPopup 输密码 | useWithdrawCore:365 | 已展开 |
| 14 | 跳过 PIN | isSkipPINFlag=Y | 直接提现 | useWithdrawCore:376 | 已展开 |
| 15 | 未设 PIN | 非 isPin 且非 isSkipPIN | 跳 setPin | user/v1/setTransactionPassword4nc | 已展开 |
| 16 | 钱包用户提现 | isWalletWithdrawalUser | bankCode=verifyType, bankAccNo=” | useWithdrawCore:419 | 已展开(提交参数) |
| 17 | Auto Settle | repayDebt=3 | 页面切 auto_settle 态,参数带 repayDebt | useWithdrawCore:472 | 已展开(注) |
| 18 | 优惠券 | coupon.couponId 有值 | CouponDialog 选券,入参带 couponId | useWithdrawCoupon | 已展开(注) |
| 19 | 多账户选择 | bankAcctList>1 | SelectBankAccountPopup | components | 暂略(UI 选择,非资金分支) |
| 20 | 营销弹窗 | Gift/Reason/ReCreditDialog 条件 | GiftPopup/ReasonPopup 等 | dialogs | 暂略(营销/挽留 UI,非提现主链路) |
接口落地
| 步骤 | 接口(真实路径) | 发起 | 目标后端 |
|---|
| 查阶段 | query/v1/queryStageInfo4nc | H5 | blc-service |
| 查产品额度 | cust/queryCustProductInfo | H5 | blc-service |
| 查已绑卡 | cust/queryCustCardInfo | H5 | blc-service |
| 页面配置/限制 | query/v1/popAPPConfig | H5 | blc-service |
| 试算 | apply/v1/loanCalculate4nc | H5 | blc-service |
| 设备检测 | user/v1/deviceVerification | H5 useWithdrawDevice | blc-service |
| 绑卡跳转 url | user/v1/routeRedirect(scene=2) | H5 useBankAccountActions | blc-service |
| 刷新提现账户 | query/v1/queryWithdrawAcctInfoCutoverSelect4nc | H5 | blc-service |
| 预提现锁单 | apply/v1/loanApplyNoBindCardInit | H5 | blc-service |
| 正式提现 | cust/loanApply4merge | H5 | blc-service |
| 设置 PIN | user/v1/setTransactionPassword4nc | H5 setPin | blc-service |
| 提现状态 | query/v1/queryLoanList4nc | H5 withdrawStatus | blc-service |
| 银行列表 | query/v1/queryBankList4nc | H5 | blc-service |
| 优惠券 | coupon/v1/queryCouponList4nc | H5 | blc-service |
| 原生绑卡 charge | bank/paystackCharge 等 | 原生 bankacount | blc-service(当前主走 H5 跳转,原生直绑调用少) |
要点与缺口
- 绑卡两层回调要分清:
- 前端层:用户在通道托管页完成 → 浏览器
redirect 回跳 H5 路由 /addBankAccount(useWithdrawRoute 判断 from.name === 'addBankAccount')→ 刷新账户继续提现。
- 后端层:通道异步回调 IMS → IMS 回调 bns
bindCardCallBack(前端不可见,见后端 03-借款)。两者不同层面,别混。
- 设备检测决定是否跳 PIN:
deviceVerification 返回 checkDeviceStage(UF 人脸 / OTP / Y 已验证);OTP 或已验证 → isSkipPINFlag=Y 跳过交易密码。
- 借款用途、期限为必选阻断项:未选不放行(purposeActive/longActive=-1)。
- 绑卡主走 H5 跳转(routeRedirect):原生绑卡 charge 接口仅 1 处定义、调用很少;不轻判”废弃”,但当前不是主路径。
- 提现两接口:
loanApply4merge(已绑卡正式提现)/ loanApplyNoBindCardInit(绑账户未绑卡预锁单)。
- Auto Settle(repayDebt=3):有待还债务时页面切自动结算态,提现入参带 repayDebt(0 无 / 1 逾期 / 2 待还 / 3 自动扣款)。
- 钱包用户提现:isWalletWithdrawalUser 时 bankCode 用 verifyType、bankAccNo 置空。
- 试算在后端(loanCalculate4nc)。
- 原生↔H5:提现主体在 H5;原生壳负责入口拉起 + 绑卡通道交互;H5↔原生经
H5JsInterface(JSBridge)。
- 衔接:提现申请提交 → 后端放款(fcs→pmt 事件桥,04-放款);前端 withdrawStatus 轮询展示。重授信入口(分支 6/7)详见 05-提额复借重授信。