③ 借款提现

以 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/NoWithdrawLimitedDialog 阻断引导popAPPConfig(useWithdrawData:313)已展开
3设备人脸验证faceVerify 且 checkDeviceStage=UF 且 result≠Y跳人脸验证页user/v1/deviceVerification已展开
4设备 OTP 验证checkDeviceStage=OTP 且 result≠YOtpVerifyPopup + isSkipPINFlag=YdeviceVerification已展开
5设备已验证checkDeviceStageResult=YisSkipPINFlag=Y(跳 PIN)deviceVerification已展开
6重授信-更新联系人needReCreditContractList=Y跳 /updateEmergencyContactuseWithdrawCore:149链出 → 05-提额复借重授信
7重授信-活体needReCreditliveDetection=Y跳活体检测useWithdrawCore:152链出 → 05-提额复借重授信
8金额非法amount<=0 或 <min 或 >max提示,阻断useWithdrawCore:191/247已展开
9借款用途未选purposeActive=-1PurposePopup 必选loanDetail.purposeList已展开
10期限未选longActive=-1必选期限useWithdrawCore:206已展开
11无银行账户bankAcctList.length=0绑卡跳转(routeRedirect)见绑卡子流程已展开
12有账户无卡新户hasNoCards && !cardSkip && !isWallet && isNewUser预提现 loanApplyNoBindCardInitapply/v1/loanApplyNoBindCardInit已展开
13需 PINisPin 且 isSkipPINFlag≠YPinVerifyPopup 输密码useWithdrawCore:365已展开
14跳过 PINisSkipPINFlag=Y直接提现useWithdrawCore:376已展开
15未设 PIN非 isPin 且非 isSkipPIN跳 setPinuser/v1/setTransactionPassword4nc已展开
16钱包用户提现isWalletWithdrawalUserbankCode=verifyType, bankAccNo=”useWithdrawCore:419已展开(提交参数)
17Auto SettlerepayDebt=3页面切 auto_settle 态,参数带 repayDebtuseWithdrawCore:472已展开(注)
18优惠券coupon.couponId 有值CouponDialog 选券,入参带 couponIduseWithdrawCoupon已展开(注)
19多账户选择bankAcctList>1SelectBankAccountPopupcomponents暂略(UI 选择,非资金分支)
20营销弹窗Gift/Reason/ReCreditDialog 条件GiftPopup/ReasonPopup 等dialogs暂略(营销/挽留 UI,非提现主链路)

接口落地

步骤接口(真实路径)发起目标后端
查阶段query/v1/queryStageInfo4ncH5blc-service
查产品额度cust/queryCustProductInfoH5blc-service
查已绑卡cust/queryCustCardInfoH5blc-service
页面配置/限制query/v1/popAPPConfigH5blc-service
试算apply/v1/loanCalculate4ncH5blc-service
设备检测user/v1/deviceVerificationH5 useWithdrawDeviceblc-service
绑卡跳转 urluser/v1/routeRedirect(scene=2)H5 useBankAccountActionsblc-service
刷新提现账户query/v1/queryWithdrawAcctInfoCutoverSelect4ncH5blc-service
预提现锁单apply/v1/loanApplyNoBindCardInitH5blc-service
正式提现cust/loanApply4mergeH5blc-service
设置 PINuser/v1/setTransactionPassword4ncH5 setPinblc-service
提现状态query/v1/queryLoanList4ncH5 withdrawStatusblc-service
银行列表query/v1/queryBankList4ncH5blc-service
优惠券coupon/v1/queryCouponList4ncH5blc-service
原生绑卡 chargebank/paystackCharge原生 bankacountblc-service(当前主走 H5 跳转,原生直绑调用少)

要点与缺口

  • 绑卡两层回调要分清
    • 前端层:用户在通道托管页完成 → 浏览器 redirect 回跳 H5 路由 /addBankAccount(useWithdrawRoute 判断 from.name === 'addBankAccount')→ 刷新账户继续提现。
    • 后端层:通道异步回调 IMS → IMS 回调 bns bindCardCallBack(前端不可见,见后端 03-借款)。两者不同层面,别混。
  • 设备检测决定是否跳 PINdeviceVerification 返回 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-提额复借重授信