287 lines
11 KiB
Dart
287 lines
11 KiB
Dart
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:forui/forui.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:pj_supermarket_cloud/common/index.dart';
|
|
|
|
import 'controller.dart';
|
|
|
|
class LoadPage extends GetView<LoadController> {
|
|
const LoadPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = FTheme.of(context);
|
|
return GetBuilder<LoadController>(
|
|
init: LoadController(),
|
|
id: 'load',
|
|
builder: (_) => ColoredBox(
|
|
color: XfjDesignTokens.canvas,
|
|
child: SafeArea(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(28.w),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Text(
|
|
'ZAX',
|
|
style: theme.typography.xl4.copyWith(
|
|
color: const Color(0xFF0865E8),
|
|
fontWeight: FontWeight.w900,
|
|
fontStyle: FontStyle.italic,
|
|
),
|
|
),
|
|
SizedBox(width: 20.w),
|
|
Container(
|
|
width: 1, height: 32.h, color: XfjDesignTokens.line),
|
|
SizedBox(width: 20.w),
|
|
Text(
|
|
'智慧消费终端',
|
|
style: theme.typography.xl.copyWith(
|
|
color: XfjDesignTokens.ink,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
const Spacer(),
|
|
const TerminalStatusPill(label: '安全启动'),
|
|
],
|
|
),
|
|
Center(
|
|
child: TerminalSurface(
|
|
width: 1000.w,
|
|
height: 620.h,
|
|
clipBehavior: Clip.hardEdge,
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 390.w,
|
|
color: XfjDesignTokens.primarySoft,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 230.w,
|
|
height: 230.w,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.white.withValues(alpha: 0.72),
|
|
border: Border.all(
|
|
color: XfjDesignTokens.primary
|
|
.withValues(alpha: 0.18),
|
|
),
|
|
),
|
|
child: Center(
|
|
child: Container(
|
|
width: 142.w,
|
|
height: 142.w,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle,
|
|
boxShadow: XfjDesignTokens.surfaceShadow,
|
|
),
|
|
child: FIcon(
|
|
FAssets.icons.monitor,
|
|
size: 70.w,
|
|
color: XfjDesignTokens.primary,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(height: 30.h),
|
|
Text(
|
|
'环境自适应检测',
|
|
style: theme.typography.xl.copyWith(
|
|
color: XfjDesignTokens.primary,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
SizedBox(height: 8.h),
|
|
Text(
|
|
'正在检查双屏与本地设备能力',
|
|
style: theme.typography.sm.copyWith(
|
|
color: XfjDesignTokens.muted,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.all(42.w),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'正在启动收银终端',
|
|
style: theme.typography.xl4.copyWith(
|
|
color: XfjDesignTokens.ink,
|
|
fontWeight: FontWeight.w800,
|
|
),
|
|
),
|
|
SizedBox(height: 12.h),
|
|
Text(
|
|
'系统正在准备本地数据与设备服务,完成后将自动进入登录页面。',
|
|
style: theme.typography.base.copyWith(
|
|
color: XfjDesignTokens.muted,
|
|
),
|
|
),
|
|
SizedBox(height: 30.h),
|
|
const LinearProgressIndicator(
|
|
minHeight: 10,
|
|
color: XfjDesignTokens.primary,
|
|
backgroundColor: Color(0xFFEDEFF3),
|
|
borderRadius:
|
|
BorderRadius.all(Radius.circular(999)),
|
|
),
|
|
SizedBox(height: 26.h),
|
|
_StartupStep(
|
|
icon: FAssets.icons.hardDrive,
|
|
title: '加载终端配置',
|
|
detail: '读取设备模式与本地设置',
|
|
complete: true,
|
|
),
|
|
SizedBox(height: 12.h),
|
|
_StartupStep(
|
|
icon: FAssets.icons.database,
|
|
title: '打开业务数据库',
|
|
detail: '准备订单、商品与用户数据',
|
|
complete: true,
|
|
),
|
|
SizedBox(height: 12.h),
|
|
_StartupStep(
|
|
icon: FAssets.icons.printer,
|
|
title: '初始化设备服务',
|
|
detail: '检查打印、读卡与电子秤',
|
|
active: true,
|
|
),
|
|
SizedBox(height: 12.h),
|
|
_StartupStep(
|
|
icon: FAssets.icons.wifi,
|
|
title: '连接网络与同步',
|
|
detail: '启动消息服务与后台同步',
|
|
),
|
|
],
|
|
),
|
|
).expanded(),
|
|
],
|
|
),
|
|
),
|
|
).expanded(),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 8.w,
|
|
height: 8.w,
|
|
decoration: const BoxDecoration(
|
|
color: XfjDesignTokens.success,
|
|
shape: BoxShape.circle,
|
|
),
|
|
),
|
|
SizedBox(width: 8.w),
|
|
Text(
|
|
'ZAX 智慧消费终端 · 本地服务运行中',
|
|
style: theme.typography.sm.copyWith(
|
|
color: XfjDesignTokens.muted,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// 启动步骤统一展示完成、进行中和等待三种状态,避免只用进度动画表达结果。
|
|
class _StartupStep extends StatelessWidget {
|
|
const _StartupStep({
|
|
required this.icon,
|
|
required this.title,
|
|
required this.detail,
|
|
this.complete = false,
|
|
this.active = false,
|
|
});
|
|
|
|
final SvgAsset icon;
|
|
final String title;
|
|
final String detail;
|
|
final bool complete;
|
|
final bool active;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = FTheme.of(context);
|
|
final color = complete
|
|
? XfjDesignTokens.success
|
|
: active
|
|
? XfjDesignTokens.primary
|
|
: XfjDesignTokens.muted;
|
|
return Container(
|
|
height: 78.h,
|
|
padding: EdgeInsets.symmetric(horizontal: 18.w),
|
|
decoration: BoxDecoration(
|
|
color: active ? XfjDesignTokens.primarySoft : XfjDesignTokens.surface,
|
|
border: Border.all(
|
|
color: active
|
|
? XfjDesignTokens.primary.withValues(alpha: 0.36)
|
|
: XfjDesignTokens.line,
|
|
),
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 48.w,
|
|
height: 48.w,
|
|
decoration: BoxDecoration(
|
|
color: complete || active ? color : XfjDesignTokens.control,
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: FIcon(
|
|
complete ? FAssets.icons.check : icon,
|
|
color: complete || active ? Colors.white : color,
|
|
),
|
|
),
|
|
SizedBox(width: 14.w),
|
|
Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: theme.typography.base.copyWith(
|
|
color: color,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
detail,
|
|
style:
|
|
theme.typography.sm.copyWith(color: XfjDesignTokens.muted),
|
|
),
|
|
],
|
|
),
|
|
const Spacer(),
|
|
Text(
|
|
complete
|
|
? '已完成'
|
|
: active
|
|
? '进行中'
|
|
: '等待中',
|
|
style: theme.typography.sm.copyWith(
|
|
color: color,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|