This commit is contained in:
Developer
2026-03-31 03:48:14 +08:00
parent 62729615b7
commit 888363785b
26 changed files with 219 additions and 808 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import '../../constants/app_constants.dart';
import '../../utils/responsive_layout.dart';
/// 时间: 2026-03-25
/// 功能: 分类页面
@@ -14,27 +13,67 @@ class CategoryPage extends StatefulWidget {
State<CategoryPage> createState() => _CategoryPageState();
}
class _CategoryPageState extends State<CategoryPage> with SingleTickerProviderStateMixin {
class _CategoryPageState extends State<CategoryPage>
with SingleTickerProviderStateMixin {
late TabController _tabController;
final List<String> _tabCategories = ['场景分类', '朝代分类'];
static const sceneData = {
"节日": ["七夕节", "中秋节", "元宵节", "寒食节", "清明节", "端午节", "重阳节", "春节", "节日"],
"季节": ["三月", "二月", "冬天", "夏天", "春天", "春季", "秋天"],
"古籍": ["三国志", "三国演义", "三字经", "中庸", "列子", "史记", "后汉书", "吕氏春秋", "商君书", "围炉夜话", "增广贤文", "墨子", "孙子兵法", "孟子", "小窗幽记", "尚书", "左传", "幼学琼林", "庄子", "战国策", "文心雕龙", "易传", "晋书", "汉书", "淮南子", "礼记", "管子", "红楼梦", "老子", "荀子", "菜根谭", "警世通言", "论语", "资治通鉴", "韩非子", "鬼谷子", "古籍", "格言联璧"],
"古籍": [
"三国志",
"三国演义",
"三字经",
"中庸",
"列子",
"史记",
"后汉书",
"吕氏春秋",
"商君书",
"围炉夜话",
"增广贤文",
"墨子",
"孙子兵法",
"孟子",
"小窗幽记",
"尚书",
"左传",
"幼学琼林",
"庄子",
"战国策",
"文心雕龙",
"易传",
"晋书",
"汉书",
"淮南子",
"礼记",
"管子",
"红楼梦",
"老子",
"荀子",
"菜根谭",
"警世通言",
"论语",
"资治通鉴",
"韩非子",
"鬼谷子",
"古籍",
"格言联璧",
],
"情感": ["伤感", "励志", "友情", "思乡", "思念", "感恩", "爱国", "爱情", "离别"],
"景物": ["庐山", "泰山", "西湖", "长江", "黄河", "边塞", "田园", "山水", "夜景"],
"天文气象": ["写云", "写雨", "写雪", "写风", "星星", "月亮", "流星"],
"动植物": ["写鸟", "柳树", "桃花", "梅花", "竹子", "荷花", "菊花"],
"语言文学": ["对联", "谚语", "一言", "读书", "哲理"],
"其他": ["母亲", "老师", "户外", "礼物", ""]
"其他": ["母亲", "老师", "户外", "礼物", ""],
};
static const dynastyData = {
"主要朝代": ["唐代", "宋代", "元代", "明代", "清代"],
"古代朝代": ["南北朝", "五代", "隋代"],
"近现代": ["近现代", "用户投稿", "管理员测试"],
"其他": ["暂无朝代"]
"其他": ["暂无朝代"],
};
@override
@@ -51,21 +90,20 @@ class _CategoryPageState extends State<CategoryPage> with SingleTickerProviderSt
@override
Widget build(BuildContext context) {
final isDesktop = ResponsiveLayout.isDesktop(context);
final isTablet = ResponsiveLayout.isTablet(context);
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Column(
children: [
// 自定义标题栏
// Tab栏
Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TabBar(
controller: _tabController,
tabs: _tabCategories.map((category) => Tab(text: category)).toList(),
tabs: _tabCategories
.map((category) => Tab(text: category))
.toList(),
labelColor: AppConstants.primaryColor,
unselectedLabelColor: Colors.grey[600],
indicatorColor: AppConstants.primaryColor,
@@ -88,7 +126,10 @@ class _CategoryPageState extends State<CategoryPage> with SingleTickerProviderSt
);
}
Widget _buildCategoryGrid(Map<String, List<String>> data, String categoryType) {
Widget _buildCategoryGrid(
Map<String, List<String>> data,
String categoryType,
) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: ListView.builder(
@@ -96,7 +137,7 @@ class _CategoryPageState extends State<CategoryPage> with SingleTickerProviderSt
itemBuilder: (context, index) {
final category = data.keys.elementAt(index);
final items = data[category]!;
return Card(
margin: const EdgeInsets.only(bottom: 16.0),
elevation: 2,

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import '../../constants/app_constants.dart';
import '../../utils/responsive_layout.dart';
import '../../utils/http/http_client.dart';
import '../../models/poetry_model.dart';
import '../../controllers/load/locally.dart';

View File

@@ -23,14 +23,6 @@ class _RatePageState extends State<RatePage>
int _debugBarCount = 7;
bool _showDebugPanel = false;
// 活跃度阈值配置
final Map<String, int> _activityThresholds = {
'low': 1, // 1-5
'medium': 6, // 6-20
'high': 21, // 21-100
'veryHigh': 100, // 100+
};
// 模拟活跃度数据 (实际条数)
List<int> _weekData = [];
List<List<int>> _monthData = [];