feat(client): 授权管理独立一级屏——授权/购买续费/订单管理三 tab(桌面+移动)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Before Width: | Height: | Size: 477 KiB After Width: | Height: | Size: 482 KiB |
|
Before Width: | Height: | Size: 480 KiB After Width: | Height: | Size: 483 KiB |
|
Before Width: | Height: | Size: 526 KiB After Width: | Height: | Size: 529 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 415 KiB After Width: | Height: | Size: 420 KiB |
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 410 KiB |
|
Before Width: | Height: | Size: 417 KiB After Width: | Height: | Size: 422 KiB |
|
Before Width: | Height: | Size: 275 KiB After Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 281 KiB |
|
Before Width: | Height: | Size: 420 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 414 KiB After Width: | Height: | Size: 419 KiB |
|
Before Width: | Height: | Size: 422 KiB After Width: | Height: | Size: 427 KiB |
|
After Width: | Height: | Size: 282 KiB |
|
After Width: | Height: | Size: 278 KiB |
|
After Width: | Height: | Size: 282 KiB |
|
After Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 342 KiB After Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 305 KiB After Width: | Height: | Size: 310 KiB |
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 306 KiB |
|
Before Width: | Height: | Size: 305 KiB After Width: | Height: | Size: 310 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 304 KiB |
|
Before Width: | Height: | Size: 296 KiB After Width: | Height: | Size: 300 KiB |
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 305 KiB |
|
Before Width: | Height: | Size: 294 KiB After Width: | Height: | Size: 300 KiB |
|
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 294 KiB |
|
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 241 KiB |
|
Before Width: | Height: | Size: 232 KiB After Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 242 KiB |
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:jiu_client/core/auth/auth_state.dart';
|
||||
import 'package:jiu_client/core/utils/clock.dart';
|
||||
import 'package:jiu_client/providers/license_provider.dart';
|
||||
import 'package:jiu_client/screens/license/license_screen.dart';
|
||||
|
||||
import '../support/shell_harness.dart';
|
||||
|
||||
/// 授权管理独立一级屏 golden × 三主题(回归闸 + 保真基准),照原型
|
||||
/// design/prototype/screens/license.html:默认落「授权信息」tab(与原型截图
|
||||
/// 默认态一致),三 tab 均可见(admin + 非 iOS)。到期日照抄 about/settings
|
||||
/// 现有 golden 基准 2027-03-15,appClock 冻结 2026-07-13 09:30:15。
|
||||
/// node tools/fidelity.mjs license
|
||||
/// 窄屏另见 license_mobile_golden_test.dart。
|
||||
/// 更新基准:flutter test --update-goldens test/golden/license_golden_test.dart
|
||||
|
||||
class _FakeLicenseActive extends LicenseNotifier {
|
||||
@override
|
||||
Future<LicenseInfo?> build() async => LicenseInfo(
|
||||
id: 1,
|
||||
type: 'annual',
|
||||
isActive: true,
|
||||
maxDevices: 3,
|
||||
phase: 'normal',
|
||||
expiresAt: DateTime(2027, 3, 15),
|
||||
);
|
||||
}
|
||||
|
||||
List<Override> _overrides() => [
|
||||
licenseProvider.overrideWith(() => _FakeLicenseActive()),
|
||||
isReadonlyProvider.overrideWithValue(false),
|
||||
];
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
appClock = () => DateTime(2026, 7, 13, 9, 30, 15);
|
||||
|
||||
shellGoldenAcrossThemes(
|
||||
'license 授权信息 tab 整框(桌面)',
|
||||
path: '/license',
|
||||
screen: (_) => const LicenseScreen(),
|
||||
goldenPrefix: 'license',
|
||||
overrides: _overrides,
|
||||
logical: const Size(1280, 900),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:jiu_client/core/auth/auth_state.dart';
|
||||
import 'package:jiu_client/core/utils/clock.dart';
|
||||
import 'package:jiu_client/providers/license_provider.dart';
|
||||
import 'package:jiu_client/screens/license/license_screen.dart';
|
||||
|
||||
import '../support/golden_harness.dart';
|
||||
|
||||
/// 授权管理独立一级屏窄屏 golden × 三主题(390×844 @2x),对齐原型
|
||||
/// m-license.html:通栏 DsSeg 三 tab + 默认「授权信息」tab 内容。
|
||||
/// 更新基准:flutter test --update-goldens test/golden/license_mobile_golden_test.dart
|
||||
|
||||
class _FakeAuth extends AuthNotifier {
|
||||
_FakeAuth() {
|
||||
state = const AuthState(
|
||||
user: AuthUser(
|
||||
accessToken: 't',
|
||||
refreshToken: 'r',
|
||||
id: 1,
|
||||
username: 'wang',
|
||||
realName: '王经理',
|
||||
shopNo: 'DSJH-001',
|
||||
shopId: 1,
|
||||
role: 'admin'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _FakeLicenseActive extends LicenseNotifier {
|
||||
@override
|
||||
Future<LicenseInfo?> build() async => LicenseInfo(
|
||||
id: 1,
|
||||
type: 'annual',
|
||||
isActive: true,
|
||||
maxDevices: 3,
|
||||
phase: 'normal',
|
||||
expiresAt: DateTime(2027, 3, 15),
|
||||
);
|
||||
}
|
||||
|
||||
List<Override> _overrides() => [
|
||||
authStateProvider.overrideWith((ref) => _FakeAuth()),
|
||||
licenseProvider.overrideWith(() => _FakeLicenseActive()),
|
||||
isReadonlyProvider.overrideWithValue(false),
|
||||
];
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
appClock = () => DateTime(2026, 7, 13, 9, 30, 15);
|
||||
|
||||
goldenAcrossThemes(
|
||||
'license 授权信息 tab 整屏(移动)',
|
||||
goldenPrefix: 'license_mobile',
|
||||
child: () => const Scaffold(body: LicenseScreen()),
|
||||
overrides: _overrides,
|
||||
logical: const Size(390, 844),
|
||||
);
|
||||
}
|
||||
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 264 KiB |
|
After Width: | Height: | Size: 276 KiB |