1124 lines
30 KiB
Dart
1124 lines
30 KiB
Dart
/// ============================================================
|
||
/// 闲言APP — 工具数据模型
|
||
/// 创建时间: 2026-04-26
|
||
/// 更新时间: 2026-06-05
|
||
/// 作用: 发现工具中心的数据模型 + 分类枚举 + 工具类型 + 导航配置
|
||
/// 上次更新: nick_gen改用hanzi导航; 新增presetKeywords预置词字段; changshi改用hanzi_search
|
||
/// ============================================================
|
||
|
||
import 'package:flutter/material.dart';
|
||
|
||
import 'search_type.dart';
|
||
|
||
/// 工具分类
|
||
enum ToolCategory {
|
||
create('创作', '🎨', 'assets/svgs/categories/create.svg'),
|
||
hanzi('汉语', '📝', 'assets/svgs/categories/hanzi.svg'),
|
||
discover('发现', '🔍', 'assets/svgs/categories/discover.svg'),
|
||
life('生活', '🏥', 'assets/svgs/categories/life.svg'),
|
||
tool('工具', '🛠️', 'assets/svgs/categories/tool.svg'),
|
||
manage('管理', '📂', 'assets/svgs/categories/manage.svg'),
|
||
fun('趣味', '🎮', 'assets/svgs/categories/fun.svg');
|
||
|
||
const ToolCategory(this.label, this.emoji, this.svgAsset);
|
||
|
||
final String label;
|
||
final String emoji;
|
||
final String svgAsset;
|
||
}
|
||
|
||
/// 工具类型
|
||
enum ToolType {
|
||
local('本地'),
|
||
online('联网'),
|
||
hybrid('混合');
|
||
|
||
const ToolType(this.label);
|
||
|
||
final String label;
|
||
}
|
||
|
||
/// 工具状态
|
||
enum ToolStatus {
|
||
available('可用'),
|
||
offline('离线'),
|
||
maintenance('维护中'),
|
||
comingSoon('即将上线');
|
||
|
||
const ToolStatus(this.label);
|
||
|
||
final String label;
|
||
}
|
||
|
||
/// 导航类型枚举
|
||
enum ToolNavType {
|
||
/// 汉字工具(HanziToolPage)
|
||
hanzi,
|
||
|
||
/// 列表工具(ToolListPage)
|
||
list,
|
||
|
||
/// 计算器工具(CalcToolPage)
|
||
calc,
|
||
|
||
/// 直接路由跳转
|
||
route,
|
||
|
||
/// 内建功能(不跳转)
|
||
builtin,
|
||
}
|
||
|
||
/// 工具导航配置 — 数据驱动替代 switch-case
|
||
class ToolNavConfig {
|
||
const ToolNavConfig({
|
||
required this.type,
|
||
this.hanziType,
|
||
this.hanziTitle,
|
||
this.hanziEmoji,
|
||
this.hanziHintText,
|
||
this.hanziEmptyMessage,
|
||
this.isSingleChar = true,
|
||
this.listToolId,
|
||
this.listTitle,
|
||
this.listEmoji,
|
||
this.listType,
|
||
this.searchType,
|
||
this.showSearch = false,
|
||
this.calcId,
|
||
this.presetKeywords = const [],
|
||
});
|
||
|
||
/// 导航类型
|
||
final ToolNavType type;
|
||
|
||
/// ── 汉字工具配置 ──
|
||
final String? hanziType;
|
||
final String? hanziTitle;
|
||
final String? hanziEmoji;
|
||
final String? hanziHintText;
|
||
final String? hanziEmptyMessage;
|
||
final bool isSingleChar;
|
||
|
||
/// ── 列表工具配置 ──
|
||
final String? listToolId;
|
||
final String? listTitle;
|
||
final String? listEmoji;
|
||
final String? listType;
|
||
final SearchType? searchType;
|
||
final bool showSearch;
|
||
|
||
/// ── 计算器工具配置 ──
|
||
final String? calcId;
|
||
|
||
/// ── 预置搜索关键词 ──
|
||
/// 点击即可直接搜索,提升用户体验
|
||
final List<String> presetKeywords;
|
||
|
||
/// 便捷构造 — 汉字工具
|
||
const ToolNavConfig.hanzi({
|
||
required String type,
|
||
required String title,
|
||
required String emoji,
|
||
required String hintText,
|
||
required String emptyMessage,
|
||
bool isSingleChar = true,
|
||
List<String> presetKeywords = const [],
|
||
}) : this(
|
||
type: ToolNavType.hanzi,
|
||
hanziType: type,
|
||
hanziTitle: title,
|
||
hanziEmoji: emoji,
|
||
hanziHintText: hintText,
|
||
hanziEmptyMessage: emptyMessage,
|
||
isSingleChar: isSingleChar,
|
||
presetKeywords: presetKeywords,
|
||
);
|
||
|
||
/// 便捷构造 — 列表工具
|
||
const ToolNavConfig.list({
|
||
required String toolId,
|
||
required String title,
|
||
required String emoji,
|
||
required String listType,
|
||
SearchType? searchType,
|
||
bool showSearch = false,
|
||
List<String> presetKeywords = const [],
|
||
}) : this(
|
||
type: ToolNavType.list,
|
||
listToolId: toolId,
|
||
listTitle: title,
|
||
listEmoji: emoji,
|
||
listType: listType,
|
||
searchType: searchType,
|
||
showSearch: showSearch,
|
||
presetKeywords: presetKeywords,
|
||
);
|
||
|
||
/// 便捷构造 — 计算器工具
|
||
const ToolNavConfig.calc({required String calcId})
|
||
: this(type: ToolNavType.calc, calcId: calcId);
|
||
|
||
/// 便捷构造 — 直接路由
|
||
const ToolNavConfig.route() : this(type: ToolNavType.route);
|
||
|
||
/// 便捷构造 — 内建功能
|
||
const ToolNavConfig.builtin() : this(type: ToolNavType.builtin);
|
||
}
|
||
|
||
/// 工具项数据模型
|
||
class ToolItem {
|
||
const ToolItem({
|
||
required this.id,
|
||
required this.name,
|
||
required this.emoji,
|
||
required this.gradientColors,
|
||
required this.category,
|
||
required this.route,
|
||
this.description,
|
||
this.toolType = ToolType.online,
|
||
this.status = ToolStatus.available,
|
||
this.apiPath,
|
||
this.author = '官方',
|
||
this.tags = const [],
|
||
this.detailDesc,
|
||
this.useCount = 0,
|
||
this.lastUsedAt,
|
||
this.isPinned = false,
|
||
this.isNew = false,
|
||
this.isRecommended = false,
|
||
this.isFavorited = false,
|
||
this.isDeleted = false,
|
||
this.rating = 0.0,
|
||
this.ratingCount = 0,
|
||
this.navConfig,
|
||
this.version = '1.0.0',
|
||
this.changelog,
|
||
this.updatedAt,
|
||
});
|
||
|
||
final String id;
|
||
final String name;
|
||
final String emoji;
|
||
final List<Color> gradientColors;
|
||
final ToolCategory category;
|
||
final String route;
|
||
final String? description;
|
||
|
||
/// 工具类型(本地/联网/混合)
|
||
final ToolType toolType;
|
||
|
||
/// 工具状态
|
||
final ToolStatus status;
|
||
|
||
/// API路径(联网工具)
|
||
final String? apiPath;
|
||
|
||
/// 工具作者/来源
|
||
final String author;
|
||
|
||
/// 工具标签
|
||
final List<String> tags;
|
||
|
||
/// 详情页富文本描述(Markdown)
|
||
final String? detailDesc;
|
||
|
||
/// 使用次数
|
||
final int useCount;
|
||
|
||
/// 最后使用时间
|
||
final DateTime? lastUsedAt;
|
||
|
||
/// 是否固定到顶部
|
||
final bool isPinned;
|
||
|
||
/// 是否新工具(显示角标)
|
||
final bool isNew;
|
||
|
||
/// 是否推荐工具
|
||
final bool isRecommended;
|
||
|
||
/// 是否已收藏
|
||
final bool isFavorited;
|
||
|
||
/// 是否已删除(从工具中心移除)
|
||
final bool isDeleted;
|
||
|
||
/// 评分(0-5)
|
||
final double rating;
|
||
|
||
/// 评分人数
|
||
final int ratingCount;
|
||
|
||
/// 导航配置(数据驱动路由跳转)
|
||
final ToolNavConfig? navConfig;
|
||
|
||
/// 工具版本号
|
||
final String version;
|
||
|
||
/// 版本更新日志
|
||
final String? changelog;
|
||
|
||
/// 版本更新时间
|
||
final DateTime? updatedAt;
|
||
|
||
/// 是否需要联网
|
||
bool get needsNetwork => toolType != ToolType.local;
|
||
|
||
/// 生成深度链接
|
||
/// 格式: xianyan://tool/<route中的工具路径>
|
||
/// 例如: xianyan://tool/poetry, xianyan://tool/hanzi
|
||
String get deepLink {
|
||
final toolPath = route.replaceFirst('/tool/', '').replaceFirst('/', '');
|
||
return 'xianyan://tool/$toolPath';
|
||
}
|
||
|
||
/// 生成通用链接 (Universal Link)
|
||
/// 格式: https://s2ss.com/tool/<route中的工具路径>
|
||
String get universalLink {
|
||
final toolPath = route.replaceFirst('/tool/', '').replaceFirst('/', '');
|
||
return 'https://s2ss.com/tool/$toolPath';
|
||
}
|
||
|
||
/// 复制并修改字段
|
||
ToolItem copyWith({
|
||
int? useCount,
|
||
DateTime? lastUsedAt,
|
||
bool? isPinned,
|
||
bool? isNew,
|
||
bool? isRecommended,
|
||
bool? isFavorited,
|
||
bool? isDeleted,
|
||
double? rating,
|
||
int? ratingCount,
|
||
ToolStatus? status,
|
||
String? version,
|
||
String? changelog,
|
||
DateTime? updatedAt,
|
||
}) {
|
||
return ToolItem(
|
||
id: id,
|
||
name: name,
|
||
emoji: emoji,
|
||
gradientColors: gradientColors,
|
||
category: category,
|
||
route: route,
|
||
description: description,
|
||
toolType: toolType,
|
||
status: status ?? this.status,
|
||
apiPath: apiPath,
|
||
author: author,
|
||
tags: tags,
|
||
detailDesc: detailDesc,
|
||
useCount: useCount ?? this.useCount,
|
||
lastUsedAt: lastUsedAt ?? this.lastUsedAt,
|
||
isPinned: isPinned ?? this.isPinned,
|
||
isNew: isNew ?? this.isNew,
|
||
isRecommended: isRecommended ?? this.isRecommended,
|
||
isFavorited: isFavorited ?? this.isFavorited,
|
||
isDeleted: isDeleted ?? this.isDeleted,
|
||
rating: rating ?? this.rating,
|
||
ratingCount: ratingCount ?? this.ratingCount,
|
||
navConfig: navConfig,
|
||
version: version ?? this.version,
|
||
changelog: changelog ?? this.changelog,
|
||
updatedAt: updatedAt ?? this.updatedAt,
|
||
);
|
||
}
|
||
|
||
/// 记录一次使用
|
||
ToolItem recordUse() {
|
||
return copyWith(useCount: useCount + 1, lastUsedAt: DateTime.now());
|
||
}
|
||
}
|
||
|
||
/// 默认工具清单
|
||
const defaultTools = <ToolItem>[
|
||
// ── 创作 ──
|
||
ToolItem(
|
||
id: 'china_colors',
|
||
name: '中国传统色',
|
||
emoji: '🎨',
|
||
gradientColors: [Color(0xFFE8B4B8), Color(0xFFD4A5A5)],
|
||
category: ToolCategory.create,
|
||
route: '/tool/china_colors',
|
||
description: '传统色彩发现',
|
||
apiPath: '/api/hanzi/china_colors',
|
||
isNew: true,
|
||
),
|
||
ToolItem(
|
||
id: 'nick_gen',
|
||
name: '网名生成',
|
||
emoji: '😎',
|
||
gradientColors: [Color(0xFFA29BFE), Color(0xFF6C5CE7)],
|
||
category: ToolCategory.create,
|
||
route: '/tool/nick',
|
||
description: '个性网名一键生成',
|
||
apiPath: '/api/hanzi/nick',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'nick',
|
||
title: '网名生成',
|
||
emoji: '😎',
|
||
hintText: '输入关键词生成网名...',
|
||
emptyMessage: '输入关键词,一键生成个性网名',
|
||
isSingleChar: false,
|
||
presetKeywords: ['古风', '诗意', '霸气', '可爱', '文艺'],
|
||
),
|
||
),
|
||
|
||
// ── 汉语 ──
|
||
ToolItem(
|
||
id: 'hanzi_query',
|
||
name: '汉字查询',
|
||
emoji: '🔤',
|
||
gradientColors: [Color(0xFF0984E3), Color(0xFF74B9FF)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/hanzi',
|
||
description: '查字·笔顺·释义',
|
||
apiPath: '/api/hanzi/zi',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'zi',
|
||
title: '汉字查询',
|
||
emoji: '🔤',
|
||
hintText: '输入汉字查询...',
|
||
emptyMessage: '输入一个汉字,查询笔顺、释义等',
|
||
presetKeywords: ['龙', '凤', '福', '爱', '梦'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'chengyu',
|
||
name: '成语词典',
|
||
emoji: '📚',
|
||
gradientColors: [Color(0xFFE17055), Color(0xFFFAB1A0)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/chengyu',
|
||
description: '成语释义·典故',
|
||
apiPath: '/api/hanzi/chengyu',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'chengyu',
|
||
title: '成语词典',
|
||
emoji: '📚',
|
||
hintText: '输入成语查询...',
|
||
emptyMessage: '输入一个成语,查询释义典故',
|
||
isSingleChar: false,
|
||
presetKeywords: ['一马当先', '龙飞凤舞', '画龙点睛', '卧薪尝胆', '鹏程万里'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'poetry',
|
||
name: '古诗词',
|
||
emoji: '📜',
|
||
gradientColors: [Color(0xFF6C5CE7), Color(0xFFA29BFE)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/poetry',
|
||
description: '诗词搜索·鉴赏',
|
||
apiPath: '/api/hanzi/search',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'poetry',
|
||
title: '古诗词',
|
||
emoji: '📜',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.poetry,
|
||
showSearch: true,
|
||
presetKeywords: ['春', '月', '李白', '杜甫', '思乡'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'zuci',
|
||
name: '组词查询',
|
||
emoji: '🔗',
|
||
gradientColors: [Color(0xFF00B894), Color(0xFF55EFC4)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/zuci',
|
||
description: '汉字组词大全',
|
||
apiPath: '/api/hanzi/zuci',
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'zuci',
|
||
title: '组词查询',
|
||
emoji: '🔗',
|
||
hintText: '输入汉字查组词...',
|
||
emptyMessage: '输入一个汉字,查看组词大全',
|
||
presetKeywords: ['风', '花', '雪', '月', '山'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'cidian',
|
||
name: '词典查询',
|
||
emoji: '📖',
|
||
gradientColors: [Color(0xFFFDCB6E), Color(0xFFF9CA24)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/cidian',
|
||
description: '词语释义·用法',
|
||
apiPath: '/api/hanzi/cidian',
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'cidian',
|
||
title: '词典查询',
|
||
emoji: '📖',
|
||
hintText: '输入词语查询...',
|
||
emptyMessage: '输入词语,查看释义用法',
|
||
isSingleChar: false,
|
||
presetKeywords: ['春风', '明月', '山水', '天涯', '故乡'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'jinyici',
|
||
name: '近反义词',
|
||
emoji: '↔️',
|
||
gradientColors: [Color(0xFFE84393), Color(0xFFFD79A8)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/jinyici',
|
||
description: '近义词·反义词',
|
||
apiPath: '/api/hanzi/jinyici',
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'jinyici',
|
||
title: '近义词查询',
|
||
emoji: '↔️',
|
||
hintText: '输入词语查近/反义词...',
|
||
emptyMessage: '输入词语,查看近义词和反义词',
|
||
isSingleChar: false,
|
||
presetKeywords: ['快乐', '美丽', '勇敢', '聪明', '温暖'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'juzi',
|
||
name: '句子查询',
|
||
emoji: '💬',
|
||
gradientColors: [Color(0xFF636E72), Color(0xFFB2BEC3)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/juzi',
|
||
description: '关键词搜句子',
|
||
apiPath: '/api/hanzi/juzi',
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'juzi',
|
||
title: '句子查询',
|
||
emoji: '💬',
|
||
hintText: '输入关键词搜句子...',
|
||
emptyMessage: '输入关键词,搜索相关句子',
|
||
isSingleChar: false,
|
||
presetKeywords: ['春天', '爱情', '友情', '梦想', '人生'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'danci',
|
||
name: '英语单词',
|
||
emoji: '🔤',
|
||
gradientColors: [Color(0xFF0984E3), Color(0xFF74B9FF)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/danci',
|
||
description: '英汉词典查询',
|
||
apiPath: '/api/hanzi/danci',
|
||
status: ToolStatus.maintenance,
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'danci',
|
||
title: '英语单词',
|
||
emoji: '🔤',
|
||
hintText: '输入英文单词查询...',
|
||
emptyMessage: '输入英文单词,查看释义和音标',
|
||
isSingleChar: false,
|
||
presetKeywords: ['hello', 'love', 'dream', 'happy', 'peace'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'suoxie',
|
||
name: '英文缩写',
|
||
emoji: '📝',
|
||
gradientColors: [Color(0xFF00CEC9), Color(0xFF81ECEC)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/tool/suoxie',
|
||
description: '缩写全称查询',
|
||
apiPath: '/api/hanzi/suoxie',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.hanzi(
|
||
type: 'suoxie',
|
||
title: '英文缩写',
|
||
emoji: '📝',
|
||
hintText: '输入英文缩写查询...',
|
||
emptyMessage: '输入英文缩写,查看全称和含义',
|
||
isSingleChar: false,
|
||
presetKeywords: ['AI', 'API', 'CEO', 'VIP', 'DIY'],
|
||
),
|
||
),
|
||
|
||
// ── 发现 ──
|
||
ToolItem(
|
||
id: 'rss_reader',
|
||
name: 'RSS订阅',
|
||
emoji: '📡',
|
||
gradientColors: [Color(0xFFFF9800), Color(0xFFFFB74D)],
|
||
category: ToolCategory.discover,
|
||
route: '/tool/rss_reader',
|
||
description: '自定义RSS订阅源,聚合阅读',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 生活 ──
|
||
ToolItem(
|
||
id: 'exchange_rate',
|
||
name: '汇率换算',
|
||
emoji: '💱',
|
||
gradientColors: [Color(0xFF00B894), Color(0xFF55EFC4)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/exchange_rate',
|
||
description: '实时汇率换算',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
ToolItem(
|
||
id: 'jiufang',
|
||
name: '酒方大全',
|
||
emoji: '🍶',
|
||
gradientColors: [Color(0xFF8B4513), Color(0xFFD2691E)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/jiufang',
|
||
description: '药酒偏方查询',
|
||
apiPath: '/api/webapi/jiufang_search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'jiufang',
|
||
title: '酒方大全',
|
||
emoji: '🍶',
|
||
listType: 'jiufang',
|
||
showSearch: true,
|
||
presetKeywords: ['枸杞', '人参', '当归', '黄芪', '鹿茸'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'drug',
|
||
name: '药品查询',
|
||
emoji: '💊',
|
||
gradientColors: [Color(0xFF00CEC9), Color(0xFF81ECEC)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/drug',
|
||
description: '药品适应症查询',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'drug',
|
||
title: '药品查询',
|
||
emoji: '💊',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.drug,
|
||
showSearch: true,
|
||
presetKeywords: ['感冒', '发烧', '头痛', '咳嗽', '胃痛'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'food_clash',
|
||
name: '食物相克',
|
||
emoji: '🍎',
|
||
gradientColors: [Color(0xFF2ECC71), Color(0xFF58D68D)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/food',
|
||
description: '食物相生相克',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'food_clash',
|
||
title: '食物相克',
|
||
emoji: '🍎',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.food,
|
||
showSearch: true,
|
||
presetKeywords: ['鸡蛋', '牛奶', '螃蟹', '柿子', '蜂蜜'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'herbal',
|
||
name: '中药材',
|
||
emoji: '🌿',
|
||
gradientColors: [Color(0xFF27AE60), Color(0xFF52BE80)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/herbal',
|
||
description: '中药材功效查询',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'herbal',
|
||
title: '中药材',
|
||
emoji: '🌿',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.herbal,
|
||
showSearch: true,
|
||
presetKeywords: ['人参', '枸杞', '当归', '黄芪', '川芎'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'pianfang',
|
||
name: '民间偏方',
|
||
emoji: '🧪',
|
||
gradientColors: [Color(0xFF8E44AD), Color(0xFFBB8FCE)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/pianfang',
|
||
description: '民间偏方大全',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'pianfang',
|
||
title: '民间偏方',
|
||
emoji: '🧪',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.pianfang,
|
||
showSearch: true,
|
||
presetKeywords: ['感冒', '咳嗽', '失眠', '胃病', '风湿'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'tisana',
|
||
name: '药茶大全',
|
||
emoji: '🍵',
|
||
gradientColors: [Color(0xFFD35400), Color(0xFFE67E22)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/tisana',
|
||
description: '药茶配方查询',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'tisana',
|
||
title: '药茶大全',
|
||
emoji: '🍵',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.tisana,
|
||
showSearch: true,
|
||
presetKeywords: ['菊花', '枸杞', '玫瑰', '薄荷', '柠檬'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'changshi',
|
||
name: '生活常识',
|
||
emoji: '💡',
|
||
gradientColors: [Color(0xFFF39C12), Color(0xFFF5B041)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/changshi',
|
||
description: '日常小知识',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'changshi',
|
||
title: '生活常识',
|
||
emoji: '💡',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.changshi,
|
||
showSearch: true,
|
||
presetKeywords: ['健康', '饮食', '睡眠', '运动', '养生'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'zgjm',
|
||
name: '周公解梦',
|
||
emoji: '🌙',
|
||
gradientColors: [Color(0xFF2D3436), Color(0xFF636E72)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/zgjm',
|
||
description: '梦境解析查询',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'zgjm',
|
||
title: '周公解梦',
|
||
emoji: '🌙',
|
||
listType: 'searchall',
|
||
searchType: SearchType.zgjm,
|
||
showSearch: true,
|
||
presetKeywords: ['水', '蛇', '牙齿', '飞', '考试'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'illness',
|
||
name: '疾病自查',
|
||
emoji: '🩺',
|
||
gradientColors: [Color(0xFFE17055), Color(0xFFFAB1A0)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/illness',
|
||
description: '症状查疾病',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'illness',
|
||
title: '疾病自查',
|
||
emoji: '🩺',
|
||
listType: 'searchall',
|
||
searchType: SearchType.illness,
|
||
showSearch: true,
|
||
presetKeywords: ['头痛', '发烧', '咳嗽', '腹痛', '失眠'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'surname',
|
||
name: '姓氏起源',
|
||
emoji: '🏯',
|
||
gradientColors: [Color(0xFF8B4513), Color(0xFFD2691E)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/surname',
|
||
description: '姓氏文化查询',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'surname',
|
||
title: '姓氏起源',
|
||
emoji: '🏯',
|
||
listType: 'searchall',
|
||
searchType: SearchType.surname,
|
||
showSearch: true,
|
||
presetKeywords: ['李', '王', '张', '刘', '陈'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'jieqi',
|
||
name: '节气查询',
|
||
emoji: '🌾',
|
||
gradientColors: [Color(0xFF00B894), Color(0xFF55EFC4)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/jieqi',
|
||
description: '24节气详情',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'jieqi',
|
||
title: '节气查询',
|
||
emoji: '🌾',
|
||
listType: 'searchall',
|
||
searchType: SearchType.jieqi,
|
||
showSearch: true,
|
||
presetKeywords: ['立春', '清明', '立夏', '白露', '冬至'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'nation',
|
||
name: '国家查询',
|
||
emoji: '🌍',
|
||
gradientColors: [Color(0xFF0984E3), Color(0xFF74B9FF)],
|
||
category: ToolCategory.life,
|
||
route: '/tool/nation',
|
||
description: '世界各国信息',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'nation',
|
||
title: '国家查询',
|
||
emoji: '🌍',
|
||
listType: 'searchall',
|
||
searchType: SearchType.nation,
|
||
showSearch: true,
|
||
presetKeywords: ['中国', '美国', '日本', '法国', '巴西'],
|
||
),
|
||
),
|
||
|
||
// ── 工具 ──
|
||
ToolItem(
|
||
id: 'pomodoro',
|
||
name: '番茄钟',
|
||
emoji: '🍅',
|
||
gradientColors: [Color(0xFFE74C3C), Color(0xFFFF6B6B)],
|
||
category: ToolCategory.tool,
|
||
route: '/pomodoro',
|
||
description: '专注计时 · 短/长休息 · 统计报告',
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
ToolItem(
|
||
id: 'ocr',
|
||
name: 'OCR识别',
|
||
emoji: '📷',
|
||
gradientColors: [Color(0xFF1ABC9C), Color(0xFF48C9B0)],
|
||
category: ToolCategory.tool,
|
||
route: '/tool/ocr',
|
||
description: '图片文字识别',
|
||
apiPath: '/api/webapi/ocr',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 管理 ──
|
||
ToolItem(
|
||
id: 'xiehouyu',
|
||
name: '歇后语',
|
||
emoji: '😄',
|
||
gradientColors: [Color(0xFFFF9FF3), Color(0xFFF368E0)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/xiehouyu',
|
||
description: '歇后语大全',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'xiehouyu',
|
||
title: '歇后语',
|
||
emoji: '😄',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.xiehouyu,
|
||
showSearch: true,
|
||
presetKeywords: ['猪八戒', '哑巴', '铁公鸡', '老鼠', '孙悟空'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'riddle',
|
||
name: '谜语',
|
||
emoji: '🧩',
|
||
gradientColors: [Color(0xFF48DBFB), Color(0xFF0ABDE3)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/riddle',
|
||
description: '趣味谜语猜猜看',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'riddle',
|
||
title: '谜语',
|
||
emoji: '🧩',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.riddle,
|
||
showSearch: true,
|
||
presetKeywords: ['动物', '植物', '字谜', '成语', '水果'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'brainteaser',
|
||
name: '脑筋急转弯',
|
||
emoji: '🤔',
|
||
gradientColors: [Color(0xFFFFA502), Color(0xFFFFBE76)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/brainteaser',
|
||
description: '脑筋急转弯',
|
||
apiPath: '/api/hanzi/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'brainteaser',
|
||
title: '脑筋急转弯',
|
||
emoji: '🤔',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.brainteaser,
|
||
showSearch: true,
|
||
presetKeywords: ['什么', '为什么', '谁', '怎么', '哪里'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'couplet',
|
||
name: '对联大全',
|
||
emoji: '🏮',
|
||
gradientColors: [Color(0xFFFF3838), Color(0xFFFF6464)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/couplet',
|
||
description: '对联搜索·鉴赏',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'couplet',
|
||
title: '对联大全',
|
||
emoji: '🏮',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.couplet,
|
||
showSearch: true,
|
||
presetKeywords: ['春联', '福', '喜', '寿', '财'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'wisdom',
|
||
name: '名人名言',
|
||
emoji: '🌟',
|
||
gradientColors: [Color(0xFFC8D6E5), Color(0xFF8395A7)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/wisdom',
|
||
description: '名人名言录',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'wisdom',
|
||
title: '名人名言',
|
||
emoji: '🌟',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.wisdom,
|
||
showSearch: true,
|
||
presetKeywords: ['努力', '坚持', '梦想', '时间', '勇气'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'saying',
|
||
name: '谚语大全',
|
||
emoji: '📝',
|
||
gradientColors: [Color(0xFFA3CB38), Color(0xFFC7EA46)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/saying',
|
||
description: '民间谚语集',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'saying',
|
||
title: '谚语大全',
|
||
emoji: '📝',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.saying,
|
||
showSearch: true,
|
||
presetKeywords: ['天气', '农事', '健康', '学习', '做人'],
|
||
),
|
||
),
|
||
// TODO: 歌词大全 - 暂时隐藏,待内容完善后恢复
|
||
ToolItem(
|
||
id: 'lyric',
|
||
name: '歌词大全',
|
||
emoji: '🎵',
|
||
gradientColors: [Color(0xFF6C5CE7), Color(0xFFA29BFE)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/lyric',
|
||
description: '歌词搜索',
|
||
apiPath: '/api/hanzi/search',
|
||
isDeleted: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'lyric',
|
||
title: '歌词大全',
|
||
emoji: '🎵',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.lyric,
|
||
showSearch: true,
|
||
presetKeywords: ['月亮', '春天', '爱情', '故乡', '朋友'],
|
||
),
|
||
),
|
||
// TODO: 故事大全 - 暂时隐藏,待内容完善后恢复
|
||
ToolItem(
|
||
id: 'story',
|
||
name: '故事大全',
|
||
emoji: '📕',
|
||
gradientColors: [Color(0xFFE77F67), Color(0xFFCF6A5E)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/story',
|
||
description: '故事搜索阅读',
|
||
apiPath: '/api/hanzi/search',
|
||
isDeleted: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'story',
|
||
title: '故事大全',
|
||
emoji: '📕',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.story,
|
||
showSearch: true,
|
||
presetKeywords: ['公主', '王子', '龙', '魔法', '冒险'],
|
||
),
|
||
),
|
||
// TODO: 作文大全 - 暂时隐藏,待内容完善后恢复
|
||
ToolItem(
|
||
id: 'zuowen',
|
||
name: '作文大全',
|
||
emoji: '✍️',
|
||
gradientColors: [Color(0xFF786FA6), Color(0xFF9A8FBF)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/zuowen',
|
||
description: '优秀作文参考',
|
||
apiPath: '/api/hanzi/search',
|
||
isDeleted: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'zuowen',
|
||
title: '作文大全',
|
||
emoji: '✍️',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.zuowen,
|
||
showSearch: true,
|
||
presetKeywords: ['春天', '母亲', '成长', '梦想', '友情'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'why',
|
||
name: '十万个为什么',
|
||
emoji: '❓',
|
||
gradientColors: [Color(0xFF3DC1D3), Color(0xFF58D68D)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/why',
|
||
description: '知识百科问答',
|
||
apiPath: '/api/hanzi/search',
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'why',
|
||
title: '十万个为什么',
|
||
emoji: '❓',
|
||
listType: 'hanzi_search',
|
||
searchType: SearchType.why,
|
||
showSearch: true,
|
||
presetKeywords: ['天空', '海洋', '动物', '植物', '地球'],
|
||
),
|
||
),
|
||
ToolItem(
|
||
id: 'joke',
|
||
name: '笑话大全',
|
||
emoji: '😂',
|
||
gradientColors: [Color(0xFFFF9FF3), Color(0xFFF368E0)],
|
||
category: ToolCategory.fun,
|
||
route: '/tool/joke',
|
||
description: '笑话搜索·开心一刻',
|
||
apiPath: '/api/searchall/search',
|
||
isNew: true,
|
||
navConfig: ToolNavConfig.list(
|
||
toolId: 'joke',
|
||
title: '笑话大全',
|
||
emoji: '😂',
|
||
listType: 'searchall',
|
||
searchType: SearchType.joke,
|
||
showSearch: true,
|
||
presetKeywords: ['搞笑', '冷笑话', '段子', '老师', '小明'],
|
||
),
|
||
),
|
||
|
||
// ── 经典 ──
|
||
ToolItem(
|
||
id: 'classics',
|
||
name: '经典名句',
|
||
emoji: '📖',
|
||
gradientColors: [Color(0xFF8B4513), Color(0xFFD2691E)],
|
||
category: ToolCategory.hanzi,
|
||
route: '/classics',
|
||
description: '古籍名句精选',
|
||
isNew: true,
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 健康 ──
|
||
ToolItem(
|
||
id: 'health',
|
||
name: '健康生活',
|
||
emoji: '🏥',
|
||
gradientColors: [Color(0xFF00B894), Color(0xFF55EFC4)],
|
||
category: ToolCategory.life,
|
||
route: '/health',
|
||
description: '药品·草药·食物相克',
|
||
isNew: true,
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 游戏 ──
|
||
ToolItem(
|
||
id: 'game_center',
|
||
name: '文字迷',
|
||
emoji: '🎮',
|
||
gradientColors: [Color(0xFFE17055), Color(0xFFFDCB6E)],
|
||
category: ToolCategory.fun,
|
||
route: '/game',
|
||
description: '诗词填空·成语接龙·谜语',
|
||
isNew: true,
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 社区 ──
|
||
ToolItem(
|
||
id: 'article_square',
|
||
name: '文章广场',
|
||
emoji: '📝',
|
||
gradientColors: [Color(0xFF6C5CE7), Color(0xFFA29BFE)],
|
||
category: ToolCategory.fun,
|
||
route: '/articles',
|
||
description: '创作分享·阅读交流',
|
||
isNew: true,
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
|
||
// ── 工具 ──
|
||
ToolItem(
|
||
id: 'content_check',
|
||
name: '内容查重',
|
||
emoji: '🔍',
|
||
gradientColors: [Color(0xFF00B894), Color(0xFF55EFC4)],
|
||
category: ToolCategory.tool,
|
||
route: '/check',
|
||
description: '精确·模糊·相似度查重',
|
||
isNew: true,
|
||
isRecommended: true,
|
||
navConfig: ToolNavConfig.route(),
|
||
),
|
||
];
|