bug页面

This commit is contained in:
Developer
2026-03-30 20:10:47 +08:00
parent 820d35fe16
commit ecffddbc6f
4 changed files with 473 additions and 63 deletions

View File

@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
---
## [1.3.6] - 2026-03-30
### 新增
- 🐛 **已知bug列表功能**
- 新增bug列表页面 `lib/views/profile/components/bug_list_page.dart`
- 从下到上弹出页面显示已知bug、解决方法和解决时间
- 支持下拉刷新和滚动查看,列表可下滑
- 显示bug优先级高/中/低)、状态(已解决/解决中/待解决)
- 显示影响用户范围、报告时间和预计解决时间
- 提供详细的解决方案描述
- 修改个人页面"已知bug"按钮点击事件从显示SnackBar改为弹出bug列表页面
- 文件:`lib/views/profile/profile_page.dart`
---
## [1.3.5] - 2026-03-30
### 新增
@@ -19,27 +34,7 @@ All notable changes to this project will be documented in this file.
---
## [1.3.4] - 2026-03-30
### 新增
- 🚀 **Flutter请求免验证码验证**
- 修改后端PHP代码 `ht/api.php`当img字段包含"Flutter"时自动跳过验证码验证
- 修改Flutter前端 `lib/views/profile/expand/manu-script.dart`,完全移除人机验证相关功能
- Flutter应用用户无需填写验证码简化投稿流程
- 保持非Flutter请求如浏览器仍需验证码验证的安全性
---
## [1.3.3] - 2026-03-30
### 修复
- 🐛 **验证码验证问题修复**
- 修复验证码填写正确但提交时仍显示"验证码错误"的问题
- 原因Flutter应用无法像浏览器那样自动维护PHP Session导致服务器无法验证验证码
- 解决方案:将验证码生成本地化,本地验证用户输入,提交时发送正确答案
- 文件:`lib/views/profile/expand/manu-script.dart`
---
## [1.3.2] - 2026-03-30
@@ -51,31 +46,8 @@ All notable changes to this project will be documented in this file.
- 平台字段自动获取设备类型并发送"设备类型 + Flutter"格式数据
- 修改"去投稿"按钮跳转逻辑,文件:`lib/views/profile/profile_page.dart`
### 修复
- 🐛 **投稿API网络请求修复**
- 修改HTTP客户端 `lib/utils/http/http_client.dart`,新增 `postForm` 方法支持 FormData 格式
- 修复验证码获取逻辑从API获取验证码而非本地生成
- 修复所有API调用使用正确的路径 `app/api.php` 和 FormData 数据格式
- 修复"网络请求失败2"错误
---
## [1.3.1] - 2026-03-29
### 修复
- 🐛 **服务器监控页面错误修复**
- 修复获取服务器数据失败的错误
- 添加模拟数据功能确保在无PHP服务器时也能正常显示
- 优化错误处理逻辑,提供更好的用户体验
- 文件:`server_monitor.html`
### 新增
- 📊 **服务器监控模拟数据**
- 添加 `getMockData()` 函数生成模拟服务器数据
- 模拟数据包括:服务器负载、内存使用、磁盘使用、运行时间、响应时间和网络延迟
- 当无法连接到PHP API时自动使用模拟数据
- 显示"模拟数据"状态标识
- 文件:`server_monitor.html`
---
@@ -154,27 +126,11 @@ All notable changes to this project will be documented in this file.
---
## [1.2.97] - 2026-03-29
### 新增
- 📱 **离线数据管理功能**
- 新增离线数据管理页面 `lib/views/profile/settings/offline-data.dart`
- 从服务器加载诗词数据到本地缓存
- 支持选择下载数量30/50/100/200条
- 显示实时下载进度条
- 数据保存在SharedPreferences中
- 缓存数据不会写入历史记录
- 提供清空缓存功能
- 优化"离线使用"按钮跳转逻辑
- 文件:`lib/views/profile/profile_page.dart`
---
## 软件特性功能
### 已开发完成
- <EFBFBD> **调试信息显示功能** - 功能设置页面添加"调试信息"开关、开启后主页显示操作反馈悬浮气泡、支持显示各种操作成功/失败状态、气泡显示2秒后自动消失、开关状态保存到SharedPreferences、调试信息默认关闭
- <EFBFBD><EFBFBD> **首页自动刷新功能** - 功能设置页面添加"自动刷新"开关、开启后首页诗句每5秒自动加载下一条、开关状态保存到SharedPreferences、自动刷新默认关闭、创建home-load.dart统一管理自动刷新逻辑
- 🐛 **已知bug列表功能** - 从下到上弹出页面显示已知bug、解决方法和解决时间、支持下拉刷新和滚动查看、显示bug优先级和状态、提供详细解决方案描述、显示影响用户范围和时间信息
- 📜 **投稿记录功能** - 投稿记录页面显示历史投稿列表、按时间倒序排列、支持展开查看详细信息、提供清空记录功能、投稿成功后自动保存到SharedPreferences、最多保存50条记录
- 🗳️ **投票功能完整实现** - 用户登录/注册、获取投票列表、投票详情、提交投票、投票结果展示、API服务基础URL修改、登录注册逻辑简化只需用户名、默认密码123456、自动注册登录、设备标识、投票页面调试功能、user_identifier增加Flutter后缀、setState调用安全修复添加mounted检查、投票登录状态持久化修复添加Cookie管理器支持PHP Session认证
- 🎨 **个人卡片标签栏布局优化** - 将标签栏区域一分为二,左侧区域可以点击展开/收起个人卡片
- 🎲 **题目随机化功能** - 进入答题页面时调用 fetch 接口获取新题,使用 Fisher-Yates 算法打乱题目 ID 顺序

View File

@@ -0,0 +1,453 @@
/// 时间: 2026-03-30
/// 功能: 已知bug列表页面
/// 介绍: 显示应用已知bug、解决方法和解决时间的底部弹窗页面
/// 最新变化: 新增bug列表页面支持下拉刷新和滚动查看
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../constants/app_constants.dart';
class BugListPage extends StatefulWidget {
const BugListPage({super.key});
@override
State<BugListPage> createState() => _BugListPageState();
}
class _BugListPageState extends State<BugListPage> {
// 模拟bug数据
final List<Map<String, dynamic>> _bugs = [
{
'id': 1,
'title': '诗词答题页面偶现卡顿',
'description': '在快速切换诗词题目时,页面可能出现短暂卡顿现象',
'severity': 'medium', // high, medium, low
'status': 'pending', // pending, in_progress, resolved
'solution': '优化页面渲染逻辑减少不必要的widget重建',
'resolveTime': '2026-04-15',
'reportTime': '2026-03-25',
'affectedUsers': '部分用户',
},
{
'id': 2,
'title': '历史记录加载缓慢',
'description': '当历史记录数量较多时,加载速度较慢',
'severity': 'high',
'status': 'in_progress',
'solution': '实现分页加载和本地缓存优化',
'resolveTime': '2026-04-10',
'reportTime': '2026-03-20',
'affectedUsers': '大量用户',
},
{
'id': 3,
'title': '主题切换不生效',
'description': '在某些设备上切换主题后,界面颜色没有立即更新',
'severity': 'low',
'status': 'resolved',
'solution': '修复主题状态管理问题,强制刷新界面',
'resolveTime': '2026-03-28',
'reportTime': '2026-03-15',
'affectedUsers': '少数用户',
},
{
'id': 4,
'title': '收藏夹同步失败',
'description': '网络不稳定时,收藏夹数据同步可能失败',
'severity': 'medium',
'status': 'pending',
'solution': '增加重试机制和离线缓存功能',
'resolveTime': '2026-04-20',
'reportTime': '2026-03-22',
'affectedUsers': '部分用户',
},
{
'id': 5,
'title': '字体大小设置异常',
'description': '调整字体大小后,部分页面文字显示不完整',
'severity': 'low',
'status': 'resolved',
'solution': '优化字体大小适配逻辑,确保所有页面正确显示',
'resolveTime': '2026-03-26',
'reportTime': '2026-03-18',
'affectedUsers': '少数用户',
},
];
final ScrollController _scrollController = ScrollController();
bool _isRefreshing = false;
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
Color _getSeverityColor(String severity) {
switch (severity) {
case 'high':
return Colors.red;
case 'medium':
return Colors.orange;
case 'low':
return Colors.green;
default:
return Colors.grey;
}
}
String _getSeverityText(String severity) {
switch (severity) {
case 'high':
return '';
case 'medium':
return '';
case 'low':
return '';
default:
return '未知';
}
}
Color _getStatusColor(String status) {
switch (status) {
case 'resolved':
return Colors.green;
case 'in_progress':
return Colors.blue;
case 'pending':
return Colors.orange;
default:
return Colors.grey;
}
}
String _getStatusText(String status) {
switch (status) {
case 'resolved':
return '已解决';
case 'in_progress':
return '解决中';
case 'pending':
return '待解决';
default:
return '未知';
}
}
Future<void> _refresh() async {
setState(() {
_isRefreshing = true;
});
// 模拟网络请求延迟
await Future.delayed(const Duration(seconds: 1));
setState(() {
_isRefreshing = false;
});
HapticFeedback.lightImpact();
}
@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
child: Column(
children: [
// 顶部拖拽条和标题
_buildHeader(),
// bug列表
Expanded(
child: RefreshIndicator(
onRefresh: _refresh,
color: AppConstants.primaryColor,
child: ListView.builder(
controller: _scrollController,
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(16),
itemCount: _bugs.length,
itemBuilder: (context, index) {
final bug = _bugs[index];
return _buildBugItem(bug);
},
),
),
),
],
),
);
}
Widget _buildHeader() {
return Column(
children: [
// 拖拽条
Container(
width: 40,
height: 4,
margin: const EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(2),
),
),
// 标题栏
Container(
padding: const EdgeInsets.all(16),
child: Row(
children: [
Icon(
Icons.bug_report,
color: AppConstants.primaryColor,
size: 24,
),
const SizedBox(width: 12),
Expanded(
child: Text(
'已知问题列表',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: AppConstants.primaryColor,
),
),
),
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('关闭'),
),
],
),
),
const Divider(height: 1),
],
);
}
Widget _buildBugItem(Map<String, dynamic> bug) {
return Container(
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey[200]!),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 5,
offset: const Offset(0, 2),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 顶部信息行
Container(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 标题和状态标签
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
bug['title'] ?? '未知问题',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
),
const SizedBox(width: 8),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
color: _getStatusColor(bug['status']).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: _getStatusColor(bug['status']),
width: 1,
),
),
child: Text(
_getStatusText(bug['status']),
style: TextStyle(
fontSize: 12,
color: _getStatusColor(bug['status']),
fontWeight: FontWeight.w500,
),
),
),
],
),
const SizedBox(height: 8),
// 问题描述
Text(
bug['description'] ?? '暂无描述',
style: const TextStyle(
fontSize: 14,
color: Colors.black54,
height: 1.4,
),
),
const SizedBox(height: 12),
// 严重程度和影响用户
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 6,
vertical: 2,
),
decoration: BoxDecoration(
color: _getSeverityColor(bug['severity']).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.priority_high,
size: 12,
color: _getSeverityColor(bug['severity']),
),
const SizedBox(width: 4),
Text(
'${_getSeverityText(bug['severity'])}优先级',
style: TextStyle(
fontSize: 11,
color: _getSeverityColor(bug['severity']),
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(width: 12),
Icon(
Icons.people,
size: 14,
color: Colors.grey[600],
),
const SizedBox(width: 4),
Text(
bug['affectedUsers'] ?? '未知用户',
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
],
),
],
),
),
// 分割线
const Divider(height: 1),
// 解决方案区域
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.grey[50],
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(12),
bottomRight: Radius.circular(12),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.lightbulb_outline,
color: AppConstants.primaryColor,
size: 16,
),
const SizedBox(width: 8),
Text(
'解决方案',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: AppConstants.primaryColor,
),
),
],
),
const SizedBox(height: 8),
Text(
bug['solution'] ?? '暂无解决方案',
style: const TextStyle(
fontSize: 13,
color: Colors.black54,
height: 1.4,
),
),
const SizedBox(height: 12),
// 时间信息
Row(
children: [
Icon(
Icons.schedule,
size: 14,
color: Colors.grey[600],
),
const SizedBox(width: 4),
Text(
'预计解决: ${bug['resolveTime'] ?? '待定'}',
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
const SizedBox(width: 16),
Icon(
Icons.report,
size: 14,
color: Colors.grey[600],
),
const SizedBox(width: 4),
Text(
'报告时间: ${bug['reportTime'] ?? '未知'}',
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
],
),
],
),
),
],
),
);
}
}
// 显示bug列表的底部弹窗方法
void showBugListBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isScrollControlled: true, // 允许弹窗占据全屏高度
builder: (context) => Container(
height: MediaQuery.of(context).size.height * 0.85, // 设置弹窗高度为屏幕的85%
child: const BugListPage(),
),
);
}

View File

@@ -29,6 +29,7 @@ import 'guide/app-data.dart';
import 'theme/app-diy.dart';
import 'expand/vote.dart';
import 'expand/manu-script.dart';
import 'components/bug_list_page.dart';
class ProfilePage extends StatefulWidget {
const ProfilePage({super.key});
@@ -630,9 +631,9 @@ class _ProfilePageState extends State<ProfilePage>
() => _navigateToLearnUsPage(),
),
_buildSettingsItem(
'商务合作',
'已知bug',
Icons.cleaning_services,
() => _showSnackBar('商务合作'),
() => showBugListBottomSheet(context),
),
_buildSettingsItem(
'关闭退出',