|
|
|
@ -89,14 +89,15 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
|
Widget _buildBody(bool isDarkMode) { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
_buildIntegralRow(isDarkMode), |
|
|
|
_buildTimeRangeSelector(isDarkMode), |
|
|
|
Expanded( |
|
|
|
child: SingleChildScrollView( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
_buildIntegralCard(isDarkMode), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
// _buildIntegralCard(isDarkMode), |
|
|
|
// SizedBox(height: 16.h), |
|
|
|
if (controller.selectedTabIndex.value == 0) |
|
|
|
_buildRealtimeStatsCard(isDarkMode), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
@ -115,6 +116,51 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildIntegralRow(bool isDarkMode) { |
|
|
|
return Obx(() { |
|
|
|
final _ = User.refreshTick.value; |
|
|
|
final u = User.instance; |
|
|
|
return Padding( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
child: Container( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2)), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Icon(Icons.translate, color: AppColors.primary, size: 20.sp), |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
'翻译积分', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
'${u.tradeintegral}/${u.tradetotalintegral}', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildTimeRangeSelector(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
margin: EdgeInsets.all(16.w), |
|
|
|
@ -424,92 +470,6 @@ class TranslationStatsView extends GetView<TranslationStatsController> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildIntegralCard(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Icon( |
|
|
|
Icons.stacked_line_chart, |
|
|
|
color: AppColors.primary, |
|
|
|
size: 20.sp, |
|
|
|
), |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Text( |
|
|
|
'积分统计', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
Obx(() { |
|
|
|
final _ = User.refreshTick.value; |
|
|
|
final u = User.instance; |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
_buildIntegralRow( |
|
|
|
'翻译', |
|
|
|
'${controller.formatNumber(u.tradeintegral)}/${controller.formatNumber(u.tradetotalintegral)}', |
|
|
|
Icons.translate, |
|
|
|
isDarkMode, |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
}), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildIntegralRow( |
|
|
|
String label, String value, IconData icon, bool isDarkMode) { |
|
|
|
return Row( |
|
|
|
children: [ |
|
|
|
Icon( |
|
|
|
icon, |
|
|
|
color: AppColors.primary, |
|
|
|
size: 18.sp, |
|
|
|
), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
label, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
value, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildApiCallRow( |
|
|
|
String label, int count, IconData icon, bool isDarkMode) { |
|
|
|
return Row( |
|
|
|
|