fix:按html的假数据demo
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/api/report_data_source.dart';
|
||||
import '../../theme/app_icons.dart';
|
||||
import '../../theme/yanting_text.dart';
|
||||
import '../../theme/yanting_tokens.dart';
|
||||
import '../../theme/wise_tokens.dart';
|
||||
import '../../widgets/app_buttons.dart';
|
||||
import '../../widgets/app_card.dart';
|
||||
import '../../widgets/page_header.dart';
|
||||
import '../../widgets/sheets.dart';
|
||||
import '../../widgets/states.dart';
|
||||
|
||||
@@ -15,63 +19,176 @@ class ProfilePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(WiseSpacing.x4),
|
||||
padding: const EdgeInsets.fromLTRB(WiseSpacing.x4, 4, WiseSpacing.x4, 16),
|
||||
children: [
|
||||
const PageHeader(title: '我的'),
|
||||
AppCard(
|
||||
color: WiseColors.secondary200,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
color: YantingColors.secondary,
|
||||
child: Row(
|
||||
children: [
|
||||
Text('游客', style: Theme.of(context).textTheme.headlineSmall),
|
||||
const SizedBox(height: WiseSpacing.x2),
|
||||
Text('浏览、阅读和完整收听不需要登录。收藏、历史同步和保存听单等待 auth 接口接入。', style: Theme.of(context).textTheme.bodyMedium),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
AppButton(
|
||||
label: '登录后保存个人状态',
|
||||
icon: Icons.login,
|
||||
onPressed: () => showLoginSheet(context),
|
||||
CircleAvatar(
|
||||
radius: 27,
|
||||
backgroundColor: YantingColors.background,
|
||||
foregroundColor: YantingColors.mutedForeground,
|
||||
child: const Icon(AppIcons.user, size: 28),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'未登录',
|
||||
style: YantingText.cardTitle.copyWith(fontSize: 18),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
'登录后同步收藏、历史和听单',
|
||||
style: YantingText.meta.copyWith(height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x4),
|
||||
_ProfileRow(icon: Icons.favorite_border, title: '收藏研报', subtitle: '登录后同步收藏', onTap: () => showLoginSheet(context, reason: '登录后保存到你的收藏')),
|
||||
_ProfileRow(icon: Icons.history, title: '浏览历史', subtitle: '本地历史占位,服务端同步待接入', onTap: () => showAppToast(context, '历史同步接口待接入')),
|
||||
_ProfileRow(icon: Icons.playlist_add_check, title: '保存听单', subtitle: '登录后保存到你的听单', onTap: () => showLoginSheet(context, reason: '登录后保存到你的听单')),
|
||||
_ProfileRow(icon: Icons.open_in_new, title: '了解研值相关服务', subtitle: '外跳前提示风险边界', onTap: () => showOutboundSheet(context, title: '研值相关服务')),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
AppButton(
|
||||
label: '登录 / 注册',
|
||||
expand: true,
|
||||
onPressed: () => showLoginSheet(context),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
_MenuGroup(
|
||||
children: [
|
||||
_MenuRow(
|
||||
icon: AppIcons.history,
|
||||
title: '本地浏览记录',
|
||||
trailing: '0 条 · 本地临时',
|
||||
onTap: () => showAppToast(context, '历史同步接口待接入'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
_MenuGroup(
|
||||
children: [
|
||||
_MenuRow(
|
||||
icon: AppIcons.settings,
|
||||
title: '设置',
|
||||
onTap: () => showAppToast(context, '设置待接入'),
|
||||
),
|
||||
_MenuRow(
|
||||
icon: AppIcons.fileList,
|
||||
title: '用户协议',
|
||||
onTap: () => showOutboundSheet(context, title: '用户协议'),
|
||||
),
|
||||
_MenuRow(
|
||||
icon: AppIcons.shield,
|
||||
title: '隐私政策',
|
||||
onTap: () => showOutboundSheet(context, title: '隐私政策'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: WiseSpacing.x3),
|
||||
AppCard(
|
||||
color: YantingColors.secondary,
|
||||
onTap: () => showOutboundSheet(context, title: '相关服务'),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'了解相关服务',
|
||||
style: YantingText.body.copyWith(
|
||||
color: YantingColors.foreground,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
const Icon(AppIcons.arrowRight, size: 18),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'与你关注主题相关的延伸服务,内容不构成投资建议。',
|
||||
style: YantingText.meta.copyWith(height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 22),
|
||||
Text(
|
||||
'研听 · 全球机构研报中文解读\n登录不阻断游客完整收听第一期 · 内容不构成投资建议',
|
||||
textAlign: TextAlign.center,
|
||||
style: YantingText.meta.copyWith(fontSize: 12, height: 1.7),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ProfileRow extends StatelessWidget {
|
||||
const _ProfileRow({required this.icon, required this.title, required this.subtitle, required this.onTap});
|
||||
class _MenuGroup extends StatelessWidget {
|
||||
const _MenuGroup({required this.children});
|
||||
|
||||
final List<Widget> children;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(children: children),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _MenuRow extends StatelessWidget {
|
||||
const _MenuRow({
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
this.trailing,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String? trailing;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: WiseSpacing.x3),
|
||||
child: AppCard(
|
||||
onTap: onTap,
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: WiseColors.primary),
|
||||
const SizedBox(width: WiseSpacing.x3),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title, style: Theme.of(context).textTheme.titleMedium),
|
||||
Text(subtitle, style: Theme.of(context).textTheme.bodySmall),
|
||||
],
|
||||
Icon(icon, size: 20, color: YantingColors.foreground),
|
||||
const SizedBox(width: 13),
|
||||
Expanded(child: Text(title, style: YantingText.body)),
|
||||
if (trailing != null)
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: YantingColors.secondary,
|
||||
borderRadius: BorderRadius.circular(YantingRadius.pill),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 3,
|
||||
),
|
||||
child: Text(
|
||||
trailing!,
|
||||
style: YantingText.meta.copyWith(fontSize: 11.5),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
const Icon(
|
||||
AppIcons.arrowRight,
|
||||
color: YantingColors.mutedForeground,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
const Icon(Icons.chevron_right, color: WiseColors.textTertiary),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user