feat(client): 设置授权卡重排——在线购买/续费升为主 CTA

卡片改名「授权管理」,购买按钮升 primary 并排进到期统计条(窄屏通栏在统计条下方),
不再藏在「没有兑换券?」后面;兑换券降为次要入口;非管理员显示联系管理员+官网价格链接。

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:21:34 +08:00
parent c15ffc7d32
commit 15ed05dc1e
@@ -697,12 +697,13 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
: null; : null;
return _SettingsCard( return _SettingsCard(
title: '授权兑换券', title: '授权管理',
desc: '本系统以「时长兑换券」授权,输入兑换券短码即可续期,无需订阅', desc: '在线购买或使用兑换券续期,时长在现有到期时间上叠加',
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// 原型 .lic 统计条:bg 底 / border / r-md / pad 18 20 // 原型 .lic 统计条:bg 底 / border / r-md / pad 18 20
// 主 CTA「在线购买 / 续费」宽屏并排在统计条内,窄屏换行到统计条下方通栏
Container( Container(
padding: const EdgeInsets.fromLTRB(20, 18, 20, 18), padding: const EdgeInsets.fromLTRB(20, 18, 20, 18),
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -715,6 +716,12 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
const SizedBox(width: 24), const SizedBox(width: 24),
_stat(t, '剩余天数', days != null ? '剩余 $days' : '', warn: true), _stat(t, '剩余天数', days != null ? '剩余 $days' : '', warn: true),
const Spacer(), const Spacer(),
if (isAdmin && !context.isMobile) ...[
DsButton('在线购买 / 续费',
variant: DsBtnVariant.primary,
onPressed: () => showPurchaseDialog(context)),
const SizedBox(width: 14),
],
Container( Container(
width: 46, width: 46,
height: 46, height: 46,
@@ -727,6 +734,15 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
), ),
]), ]),
), ),
if (isAdmin && context.isMobile) ...[
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
child: DsButton('在线购买 / 续费',
variant: DsBtnVariant.primary,
onPressed: () => showPurchaseDialog(context)),
),
],
const SizedBox(height: 16), const SizedBox(height: 16),
// 兑换(原型 .redeeminput + 按钮,max 520 // 兑换(原型 .redeeminput + 按钮,max 520
ConstrainedBox( ConstrainedBox(
@@ -758,16 +774,13 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
], ],
), ),
), ),
const SizedBox(height: 14), // 在线购买仅管理员(后端 purchase 接口 admin only,主 CTA 已上移到统计条);
Row(children: [ // 其他角色引导看官网价格页
Text('没有兑换券?', if (!isAdmin) ...[
style: TextStyle(fontSize: AppDims.fsSm, color: t.muted)), const SizedBox(height: 14),
// 在线购买仅管理员(后端 purchase 接口 admin only);其他角色引导看官网价格页 Row(children: [
if (isAdmin) Text('在线购买请联系门店管理员 · ',
DsButton('在线购买 / 续费', style: TextStyle(fontSize: AppDims.fsSm, color: t.muted)),
variant: DsBtnVariant.accent,
onPressed: () => showPurchaseDialog(context))
else
InkWell( InkWell(
onTap: () => onTap: () =>
launchUrl(Uri.parse('${AppInfo.website}/#pricing')), launchUrl(Uri.parse('${AppInfo.website}/#pricing')),
@@ -777,7 +790,8 @@ class _LicensePanelState extends ConsumerState<_LicensePanel> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: t.primary)), color: t.primary)),
), ),
]), ]),
],
const SizedBox(height: 16), const SizedBox(height: 16),
// 过期降级说明(现有能力保留) // 过期降级说明(现有能力保留)
Container( Container(