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:
parent
c5c4e1667e
commit
13dd42d2be
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue