feat(client): 授权管理拆四卡,首月特惠默认选中,关于页备案号加链接

- 授权管理面板拆四张卡:授权到期时间 / 在线购买续费 / 兑换券 / 到期降级规则;
  非管理员在购买卡位显示「联系管理员 + 查看套餐价格」引导
- 购买卡套餐 tab 首月特惠放第一位并默认选中;已享受过特惠则默认高级版年付
- 关于页页脚备案号可点击跳转工信部备案查询

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-03 23:46:40 +08:00
parent 2a5fea2647
commit c3455ce7a7
3 changed files with 124 additions and 116 deletions
+14 -5
View File
@@ -32,7 +32,7 @@ class PurchaseCard extends ConsumerStatefulWidget {
class _PurchaseCardState extends ConsumerState<PurchaseCard> {
_Phase _phase = _Phase.pick;
int _tabIdx = 0; // 0=标准版 1=首月特惠 2=高级版
int _tabIdx = 0; // 0=首月特惠 1=标准版 2=高级版
int _cycleIdx = 0; // 0=年付 1=月付
bool _submitting = false;
bool _checking = false;
@@ -42,9 +42,9 @@ class _PurchaseCardState extends ConsumerState<PurchaseCard> {
DateTime? _newExpiresAt;
Timer? _pollTimer;
bool get _isPromo => _tabIdx == 1;
bool get _isPromo => _tabIdx == 0;
LicensePlanGroup get _group =>
_tabIdx == 0 ? LicensePlans.standard : LicensePlans.pro;
_tabIdx == 1 ? LicensePlans.standard : LicensePlans.pro;
LicensePlan get _plan => _isPromo
? LicensePlans.promo
: (_cycleIdx == 0 ? _group.annual : _group.monthly);
@@ -54,7 +54,16 @@ class _PurchaseCardState extends ConsumerState<PurchaseCard> {
void initState() {
super.initState();
ref.read(licenseRepositoryProvider).promoUsed().then((used) {
if (mounted && used) setState(() => _promoUsed = true);
// 已享受过特惠:置灰并把默认选中切到「高级版 · 年付」
if (mounted && used) {
setState(() {
_promoUsed = true;
if (_phase == _Phase.pick && _isPromo) {
_tabIdx = 2;
_cycleIdx = 0;
}
});
}
});
}
@@ -149,8 +158,8 @@ class _PurchaseCardState extends ConsumerState<PurchaseCard> {
Wrap(spacing: 10, runSpacing: 8, children: [
DsSeg(
items: [
'标准版',
_promoUsed ? '首月特惠(已享受)' : '🔥 首月特惠 ¥1',
'标准版',
'高级版',
],
index: _tabIdx,