feat(client): 购买卡按 render_type 分发——redirect 外跳/qr 内嵌二维码/重选取消订单

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-10 23:46:19 +08:00
parent 179051a8fa
commit 9fe1e2766f
6 changed files with 101 additions and 10 deletions
@@ -84,6 +84,9 @@ class LicenseRepository {
return data?['canceled'] as bool? ?? false;
} on DioException catch (e) {
final status = e.response?.statusCode;
// 409 分支防御性保留:本后端实现里非 pending 单取消返回 200 +
// canceled:false(业务性失败,非 HTTP 错误),故 409 实际永不触发;
// 保留兜底以防后端未来改走标准 HTTP 语义时前端仍能优雅降级。
if (status == 404 || status == 409) return false;
throw AppException(
e.response?.data?['error'] as String? ?? '取消订单失败,请稍后重试',