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
+95 -108
View File
@@ -699,127 +699,114 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// ── 卡1:授权到期时间(原型 .lic 统计条:bg 底 / border / r-md)──
_SettingsCard(
title: '授权管理',
desc: '使用兑换券续期时长在现有到期时间上叠加',
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 原型 .lic 统计条:bg 底 / border / r-md / pad 18 20
title: '授权到期时间',
desc: '当前门店的授权有效期,续期时长在现有到期时间上叠加',
child: Container(
padding: const EdgeInsets.fromLTRB(20, 18, 20, 18),
decoration: BoxDecoration(
color: t.bg,
border: Border.all(color: t.border),
borderRadius: BorderRadius.circular(AppDims.rMd),
),
child: Row(children: [
_stat(t, '授权到期日', expires),
const SizedBox(width: 24),
_stat(t, '剩余天数', days != null ? '剩余 $days' : '', warn: true),
const Spacer(),
Container(
padding: const EdgeInsets.fromLTRB(20, 18, 20, 18),
width: 46,
height: 46,
decoration: BoxDecoration(
color: t.bg,
border: Border.all(color: t.border),
color: t.okSoft,
borderRadius: BorderRadius.circular(AppDims.rMd),
),
child: Row(children: [
_stat(t, '授权到期日', expires),
const SizedBox(width: 24),
_stat(t, '剩余天数', days != null ? '剩余 $days' : '',
warn: true),
const Spacer(),
Container(
width: 46,
height: 46,
decoration: BoxDecoration(
color: t.okSoft,
borderRadius: BorderRadius.circular(AppDims.rMd),
),
child: Icon(LucideIcons.shieldCheck,
size: 22, color: t.success),
),
]),
child:
Icon(LucideIcons.shieldCheck, size: 22, color: t.success),
),
const SizedBox(height: 16),
// 兑换(原型 .redeeminput + 按钮,max 520
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 520),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('兑换券短码',
style: TextStyle(
fontSize: AppDims.fsSm, color: t.muted)),
const SizedBox(height: 6),
DsInput(
controller: _voucherCtrl,
hintText: '输入兑换券短码',
),
],
),
),
const SizedBox(width: 10),
WriteGuard(
child: DsButton(_redeeming ? '兑换中…' : '兑换续期',
variant: DsBtnVariant.primary,
onPressed: _redeeming ? null : _redeem),
),
],
),
),
// 在线购买仅管理员(后端 purchase 接口 admin only,主 CTA 已上移到统计条);
// 其他角色引导看官网价格页
if (!isAdmin) ...[
const SizedBox(height: 14),
Row(children: [
Text('在线购买请联系门店管理员 · ',
style: TextStyle(fontSize: AppDims.fsSm, color: t.muted)),
InkWell(
onTap: () =>
launchUrl(Uri.parse('${AppInfo.website}/#pricing')),
child: Text('查看套餐价格 →',
style: TextStyle(
fontSize: AppDims.fsSm,
fontWeight: FontWeight.w600,
color: t.primary)),
),
]),
],
const SizedBox(height: 16),
// 过期降级说明(现有能力保留)
Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: t.bg,
border: Border.all(color: t.borderSubtle),
borderRadius: BorderRadius.circular(AppDims.rMd),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('到期后的降级规则',
style: TextStyle(
fontSize: AppDims.fsSm,
fontWeight: FontWeight.w600,
color: t.heading)),
const SizedBox(height: 6),
for (final note in LicenseCopy.degradationNotes())
Padding(
padding: const EdgeInsets.only(top: 3),
child: Text('· $note',
style: TextStyle(
fontSize: AppDims.fsSm, color: t.muted)),
),
],
),
),
],
]),
),
),
// 在线购买仅管理员(后端 purchase 接口 admin only),单独一张卡内联展示
if (isAdmin) ...[
const SizedBox(height: 16),
const SizedBox(height: 16),
// ── 卡2:在线购买 / 续费(后端 purchase 接口 admin only
// 非管理员引导看官网价格页)──
if (isAdmin)
const _SettingsCard(
title: '在线购买 / 续费',
desc: '选择套餐支付宝支付,到账后授权自动续期',
child: PurchaseCard(),
)
else
_SettingsCard(
title: '在线购买 / 续费',
desc: '在线购买仅门店管理员可操作',
child: Row(children: [
Text('在线购买请联系门店管理员 · ',
style: TextStyle(fontSize: AppDims.fsSm, color: t.muted)),
InkWell(
onTap: () =>
launchUrl(Uri.parse('${AppInfo.website}/#pricing')),
child: Text('查看套餐价格 →',
style: TextStyle(
fontSize: AppDims.fsSm,
fontWeight: FontWeight.w600,
color: t.primary)),
),
]),
),
],
const SizedBox(height: 16),
// ── 卡3:兑换券(原型 .redeeminput + 按钮,max 520)──
_SettingsCard(
title: '兑换券',
desc: '输入兑换券短码续期',
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 520),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('兑换券短码',
style: TextStyle(
fontSize: AppDims.fsSm, color: t.muted)),
const SizedBox(height: 6),
DsInput(
controller: _voucherCtrl,
hintText: '输入兑换券短码',
),
],
),
),
const SizedBox(width: 10),
WriteGuard(
child: DsButton(_redeeming ? '兑换中…' : '兑换续期',
variant: DsBtnVariant.primary,
onPressed: _redeeming ? null : _redeem),
),
],
),
),
),
const SizedBox(height: 16),
// ── 卡4:到期后的降级规则(现有能力保留)──
_SettingsCard(
title: '到期后的降级规则',
desc: '授权到期后系统各功能的可用性说明',
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (final note in LicenseCopy.degradationNotes())
Padding(
padding: const EdgeInsets.only(top: 3),
child: Text('· $note',
style: TextStyle(fontSize: AppDims.fsSm, color: t.muted)),
),
],
),
),
],
);
}