From 94cb289f4ccf701adab27d2cdcbec962e3420539 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Mon, 8 Dec 2025 20:01:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=95=86=E5=93=81=E9=A1=B5):=20?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=95=86=E5=93=81=E9=A1=B5=E8=84=9A=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=BF=BB=E8=AF=91=E6=96=87?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将商品页脚部分抽离为独立组件 GoodsFooterSection 更新多语言翻译中的版权信息和公司名称 修改 totalCount 为 totalQuota 以保持术语一致 添加内购客服QQ信息显示功能 --- lib/core/translations/language/ar_sa.dart | 3 +- lib/core/translations/language/de_de.dart | 3 +- lib/core/translations/language/en_us.dart | 6 +-- lib/core/translations/language/hi_in.dart | 3 +- lib/core/translations/language/it_it.dart | 3 +- lib/core/translations/language/ko_kr.dart | 3 +- lib/core/translations/language/pt_pt.dart | 3 +- lib/core/translations/language/ru_ru.dart | 3 +- lib/core/translations/language/zh_cn.dart | 8 +-- lib/core/translations/language/zh_hk.dart | 9 ++-- lib/modules/goods/views/goodsai_view.dart | 39 ++------------ lib/modules/goods/views/goodsmeet_view.dart | 51 ++++--------------- lib/modules/goods/views/goodstrans_view.dart | 51 ++++--------------- lib/modules/goods/views/goodsvip_view.dart | 41 ++------------- .../views/widgets/goods_footer_section.dart | 48 +++++++++++++++++ 15 files changed, 92 insertions(+), 182 deletions(-) create mode 100644 lib/modules/goods/views/widgets/goods_footer_section.dart diff --git a/lib/core/translations/language/ar_sa.dart b/lib/core/translations/language/ar_sa.dart index db74d7492..5208c374b 100644 --- a/lib/core/translations/language/ar_sa.dart +++ b/lib/core/translations/language/ar_sa.dart @@ -1188,8 +1188,7 @@ const Map arSA = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/de_de.dart b/lib/core/translations/language/de_de.dart index b07a82736..ccc28727f 100644 --- a/lib/core/translations/language/de_de.dart +++ b/lib/core/translations/language/de_de.dart @@ -909,8 +909,7 @@ const Map deDE = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index 320bc97ed..15c5c1829 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -189,7 +189,7 @@ const Map enUS = { // 商品页面(AI/翻译/会议) 'availablePackages': 'Available Packages', 'remainingQuota': 'Remaining Quota', - 'totalCount': 'Total Count', + 'totalQuota': 'Total Quota', 'remaining': 'Remaining', 'featureDescription': 'Feature Description', // AI 功能卡片 @@ -232,8 +232,8 @@ const Map enUS = { // 商品页通用页脚 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'iapCustomerServiceQQLabel': 'IAP customer service QQ: @qq', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // 会议商品页描述 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/hi_in.dart b/lib/core/translations/language/hi_in.dart index 2b7578a1b..187bc6c3e 100644 --- a/lib/core/translations/language/hi_in.dart +++ b/lib/core/translations/language/hi_in.dart @@ -877,8 +877,7 @@ const Map hiIN = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/it_it.dart b/lib/core/translations/language/it_it.dart index 743d63ff3..fece149d3 100644 --- a/lib/core/translations/language/it_it.dart +++ b/lib/core/translations/language/it_it.dart @@ -896,8 +896,7 @@ const Map itIT = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/ko_kr.dart b/lib/core/translations/language/ko_kr.dart index 948a00c07..5067aae43 100644 --- a/lib/core/translations/language/ko_kr.dart +++ b/lib/core/translations/language/ko_kr.dart @@ -813,8 +813,7 @@ const Map koKR = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/pt_pt.dart b/lib/core/translations/language/pt_pt.dart index f3113f40f..4404d9d2b 100644 --- a/lib/core/translations/language/pt_pt.dart +++ b/lib/core/translations/language/pt_pt.dart @@ -898,8 +898,7 @@ const Map ptPT = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/ru_ru.dart b/lib/core/translations/language/ru_ru.dart index a420b6848..95674fdc5 100644 --- a/lib/core/translations/language/ru_ru.dart +++ b/lib/core/translations/language/ru_ru.dart @@ -891,8 +891,7 @@ const Map ruRU = { "guideSmsEnd": "Message sent—voice control is convenient", // Goods pages common footer (placeholders) 'appNameProvider': 'App: VoiTrans · Provided by: VoiTrans', - 'moreInfoViewInSettingsAbout': 'For more info, go to Settings > About', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index 602d29489..2b5504527 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -183,7 +183,7 @@ const Map zhCN = { // 商品页面(AI/翻译/会议) 'availablePackages': '可购买套餐', 'remainingQuota': '剩余额度', - 'totalCount': '总次数', + 'totalQuota': '总额度', 'remaining': '剩余', 'featureDescription': '功能说明', // AI 功能卡片 @@ -225,9 +225,9 @@ const Map zhCN = { 'trans_003_desc': '含 1000 次翻译(语音/文本)', // 商品页通用页脚 - 'appNameProvider': '应用名称:VoiTrans · 服务提供:VoiTrans', - 'moreInfoViewInSettingsAbout': '更多信息请前往 设置 > 关于 查看', - 'copyrightVoiTrans': '© 2025 VoiTrans', + 'appNameProvider': '应用名称:Voitrans · 服务提供:Voitrans', + 'iapCustomerServiceQQLabel': '内购商品专属客服QQ:@qq', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // 会议商品页描述 'meetingHeaderDesc1': '录音转写、关键词检索与自动总结,提升会议效率。', diff --git a/lib/core/translations/language/zh_hk.dart b/lib/core/translations/language/zh_hk.dart index b1a13c479..535bb5f11 100644 --- a/lib/core/translations/language/zh_hk.dart +++ b/lib/core/translations/language/zh_hk.dart @@ -835,10 +835,11 @@ const Map zhHK = { "guideSmsInput": "Text Dad: I’ll be home for dinner", "guideSmsSend": "Lily will send the message", "guideSmsEnd": "Message sent—voice control is convenient", - // Goods pages common footer (placeholders) - 'appNameProvider': '應用名稱:VoiTrans · 服務提供:VoiTrans', - 'moreInfoViewInSettingsAbout': '更多信息請前往 設置 > 關於 查看', - 'copyrightVoiTrans': '© 2025 VoiTrans', + + // 商品页通用页脚 + 'appNameProvider': '應用名稱:Voitrans · 服務提供:Voitrans', + 'iapCustomerServiceQQLabel': '內购商品专属客服QQ:@qq', + 'copyrightVoitrans': '© 2025 Voitrans Technologies', // Meeting goods page (placeholders) 'meetingHeaderDesc1': '錄音轉寫、關鍵詞檢索與自動總結,提升會議效率。', diff --git a/lib/modules/goods/views/goodsai_view.dart b/lib/modules/goods/views/goodsai_view.dart index 4926f2049..74dac96bc 100644 --- a/lib/modules/goods/views/goodsai_view.dart +++ b/lib/modules/goods/views/goodsai_view.dart @@ -6,6 +6,7 @@ import '../../../data/models/goods.dart'; import '../../../data/models/user_Info.dart'; import '../controllers/goodsai_controller.dart'; import '../utils/goods_i18n.dart'; +import 'widgets/goods_footer_section.dart'; class GoodsaiView extends GetView { const GoodsaiView({super.key}); @@ -61,7 +62,7 @@ class GoodsaiView extends GetView { SizedBox(height: 16.h), _buildFeaturesSection(isDarkMode), SizedBox(height: 16.h), - _buildFooterSection(isDarkMode), + GoodsFooterSection(isDarkMode: isDarkMode), ], ); } @@ -212,7 +213,7 @@ class GoodsaiView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '${'totalCount'.tr}:$totalAi', + '${'totalQuota'.tr}:$totalAi', style: TextStyle( fontSize: 12.sp, color: isDarkMode ? Colors.white70 : Colors.grey[700], @@ -334,40 +335,6 @@ class GoodsaiView extends GetView { ); } - Widget _buildFooterSection(bool isDarkMode) { - final subColor = isDarkMode ? Colors.white60 : Colors.grey[600]; - return Padding( - padding: EdgeInsets.symmetric(vertical: 12.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: double.infinity, - child: Divider(color: isDarkMode ? Colors.white24 : Colors.black12), - ), - SizedBox(height: 8.h), - Text( - 'appNameProvider'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'moreInfoViewInSettingsAbout'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'copyrightVoiTrans'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - ], - ), - ); - } - Widget _buildFeatureCard( bool isDarkMode, { required IconData icon, diff --git a/lib/modules/goods/views/goodsmeet_view.dart b/lib/modules/goods/views/goodsmeet_view.dart index b33a36071..a32c306c5 100644 --- a/lib/modules/goods/views/goodsmeet_view.dart +++ b/lib/modules/goods/views/goodsmeet_view.dart @@ -5,6 +5,7 @@ import '../../../data/models/goods.dart'; import '../../../data/models/user_Info.dart'; import '../controllers/goodsmeet_controller.dart'; import '../utils/goods_i18n.dart'; +import 'widgets/goods_footer_section.dart'; class GoodsmeetView extends GetView { const GoodsmeetView({super.key}); @@ -64,7 +65,7 @@ class GoodsmeetView extends GetView { if (index == controller.items.length + 2) { return _buildFeaturesSection(isDarkMode); } - return _buildFooterSection(isDarkMode); + return GoodsFooterSection(isDarkMode: isDarkMode); }, ); }), @@ -195,7 +196,7 @@ class GoodsmeetView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '${'totalCount'.tr}:$totalAi', + '${'totalQuota'.tr}:$totalAi', style: TextStyle( fontSize: 12.sp, color: isDarkMode ? Colors.white70 : Colors.grey[700], @@ -256,12 +257,12 @@ class GoodsmeetView extends GetView { fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black, )), - SizedBox(height: 4.h), - Text(localizedGoodsDesc(item), - style: TextStyle( - fontSize: 12.sp, - color: isDarkMode ? Colors.white70 : Colors.grey[600], - )), + // SizedBox(height: 4.h), + // Text(localizedGoodsDesc(item), + // style: TextStyle( + // fontSize: 12.sp, + // color: isDarkMode ? Colors.white70 : Colors.grey[600], + // )), ], ), ), @@ -429,38 +430,4 @@ class GoodsmeetView extends GetView { ), ); } - - Widget _buildFooterSection(bool isDarkMode) { - final subColor = isDarkMode ? Colors.white60 : Colors.grey[600]; - return Padding( - padding: EdgeInsets.symmetric(vertical: 12.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: double.infinity, - child: Divider(color: isDarkMode ? Colors.white24 : Colors.black12), - ), - SizedBox(height: 8.h), - Text( - 'appNameProvider'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'moreInfoViewInSettingsAbout'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'copyrightVoiTrans'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - ], - ), - ); - } } diff --git a/lib/modules/goods/views/goodstrans_view.dart b/lib/modules/goods/views/goodstrans_view.dart index c7d8fee28..9ac127551 100644 --- a/lib/modules/goods/views/goodstrans_view.dart +++ b/lib/modules/goods/views/goodstrans_view.dart @@ -5,6 +5,7 @@ import '../../../data/models/goods.dart'; import '../../../data/models/user_Info.dart'; import '../controllers/goodstrans_controller.dart'; import '../utils/goods_i18n.dart'; +import 'widgets/goods_footer_section.dart'; class GoodstransView extends GetView { const GoodstransView({super.key}); @@ -63,7 +64,7 @@ class GoodstransView extends GetView { if (index == controller.items.length + 2) { return _buildFeaturesSection(isDarkMode); } - return _buildFooterSection(isDarkMode); + return GoodsFooterSection(isDarkMode: isDarkMode); }, ); }), @@ -194,7 +195,7 @@ class GoodstransView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '${'totalCount'.tr}:$totalAi', + '${'totalQuota'.tr}:$totalAi', style: TextStyle( fontSize: 12.sp, color: isDarkMode ? Colors.white70 : Colors.grey[700], @@ -255,12 +256,12 @@ class GoodstransView extends GetView { fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black, )), - SizedBox(height: 4.h), - Text(localizedGoodsDesc(item), - style: TextStyle( - fontSize: 12.sp, - color: isDarkMode ? Colors.white70 : Colors.grey[600], - )), + // SizedBox(height: 4.h), + // Text(localizedGoodsDesc(item), + // style: TextStyle( + // fontSize: 12.sp, + // color: isDarkMode ? Colors.white70 : Colors.grey[600], + // )), ], ), ), @@ -431,38 +432,4 @@ class GoodstransView extends GetView { ), ); } - - Widget _buildFooterSection(bool isDarkMode) { - final subColor = isDarkMode ? Colors.white60 : Colors.grey[600]; - return Padding( - padding: EdgeInsets.symmetric(vertical: 12.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: double.infinity, - child: Divider(color: isDarkMode ? Colors.white24 : Colors.black12), - ), - SizedBox(height: 8.h), - Text( - 'appNameProvider'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'moreInfoViewInSettingsAbout'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'copyrightVoiTrans'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - ], - ), - ); - } } diff --git a/lib/modules/goods/views/goodsvip_view.dart b/lib/modules/goods/views/goodsvip_view.dart index 94f1c5fb5..4cc881e3b 100644 --- a/lib/modules/goods/views/goodsvip_view.dart +++ b/lib/modules/goods/views/goodsvip_view.dart @@ -5,6 +5,7 @@ import '../../../data/models/goods.dart'; import '../../../data/models/user_Info.dart'; import '../controllers/goodsvip_controller.dart'; import '../utils/goods_i18n.dart'; +import 'widgets/goods_footer_section.dart'; class GoodsvipView extends GetView { const GoodsvipView({super.key}); @@ -68,7 +69,7 @@ class GoodsvipView extends GetView { } } - children.add(_buildFooterSection(isDarkMode)); + children.add(GoodsFooterSection(isDarkMode: isDarkMode)); content = ListView( key: ValueKey(userTick), padding: EdgeInsets.all(16.w), @@ -223,40 +224,6 @@ class GoodsvipView extends GetView { ); } - Widget _buildFooterSection(bool isDarkMode) { - final subColor = isDarkMode ? Colors.white60 : Colors.grey[600]; - return Padding( - padding: EdgeInsets.symmetric(vertical: 12.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: double.infinity, - child: Divider(color: isDarkMode ? Colors.white24 : Colors.black12), - ), - SizedBox(height: 8.h), - Text( - 'appNameProvider'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'moreInfoViewInSettingsAbout'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - SizedBox(height: 4.h), - Text( - 'copyrightVoiTrans'.tr, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 11.sp, color: subColor), - ), - ], - ), - ); - } - Widget _buildTypeHeader(UsageType type, bool isDarkMode) { final titles = { UsageType.AI: 'aiFunction'.tr, @@ -442,7 +409,7 @@ class GoodsvipView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '${'totalCount'.tr}:$total', + '${'totalQuota'.tr}:$total', style: TextStyle(fontSize: 12.sp, color: subColor), ), Text( @@ -701,7 +668,7 @@ class GoodsvipView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '${'totalCount'.tr}:$total', + '${'totalQuota'.tr}:$total', style: TextStyle(fontSize: 12.sp, color: subColor), ), Text( diff --git a/lib/modules/goods/views/widgets/goods_footer_section.dart b/lib/modules/goods/views/widgets/goods_footer_section.dart new file mode 100644 index 000000000..00a7afabf --- /dev/null +++ b/lib/modules/goods/views/widgets/goods_footer_section.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../../../data/models/appconfig.dart'; + +class GoodsFooterSection extends StatelessWidget { + final bool isDarkMode; + const GoodsFooterSection({super.key, required this.isDarkMode}); + + @override + Widget build(BuildContext context) { + final subColor = isDarkMode ? Colors.white60 : Colors.grey[600]; + final qq = AppConfig.env('iapCustomerServiceQQ') ?? ''; + return Padding( + padding: EdgeInsets.symmetric(vertical: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: double.infinity, + child: Divider(color: isDarkMode ? Colors.white24 : Colors.black12), + ), + SizedBox(height: 8.h), + Text( + 'appNameProvider'.tr, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 11.sp, color: subColor), + ), + SizedBox(height: 4.h), + if (qq.isNotEmpty) ...[ + Text( + 'iapCustomerServiceQQLabel'.trParams({'qq': qq}), + textAlign: TextAlign.center, + style: TextStyle(fontSize: 11.sp, color: subColor), + ), + SizedBox(height: 4.h), + ], + // SizedBox(height: 4.h), + Text( + 'copyrightVoitrans'.tr, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 11.sp, color: subColor), + ), + ], + ), + ); + } +}