fix(mobile-app): fix pending action completion detection

- Change FORCE_KYC check from isCompleted to level1.verified
  (FORCE_KYC only requires real-name verification, not all KYC levels)
- Add post-navigation re-check for FORCE_KYC and BIND_PHONE actions
  (handles cases where user completes action but page doesn't return true)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-02 21:09:35 -08:00
parent c5c4e1667e
commit 13dd42d2be
1 changed files with 10 additions and 5 deletions

View File

@ -122,13 +122,17 @@ class _PendingActionsPageState extends ConsumerState<PendingActionsPage> {
case 'BIND_PHONE':
//
final result = await context.push<bool>(RoutePaths.kycPhone);
return result == true;
if (result == true) return true;
//
return await _checkIfAlreadyCompleted(action);
case 'FORCE_KYC':
//
final orderNo = action.actionParams?['orderNo'] as String?;
final result = await context.push<bool>(RoutePaths.kycEntry, extra: orderNo);
return result == true;
if (result == true) return true;
//
return await _checkIfAlreadyCompleted(action);
case 'SIGN_CONTRACT':
//
@ -164,11 +168,12 @@ class _PendingActionsPageState extends ConsumerState<PendingActionsPage> {
try {
switch (action.actionCode) {
case 'FORCE_KYC':
// KYC
// (level1)
// FORCE_KYC
final kycService = ref.read(kycServiceProvider);
final kycStatus = await kycService.getKycStatus();
if (kycStatus.isCompleted) {
// debugPrint('[PendingActionsPage] KYC 已完成,跳过此操作');
if (kycStatus.level1.verified) {
debugPrint('[PendingActionsPage] 实名认证已完成,跳过 FORCE_KYC 操作');
return true;
}
return false;