Browse Source

refactor(界面): 重构VIP商品和设置页面的布局

- 简化VIP商品页面的使用类型排序,仅保留VIP类型
- 将设置页面的会员入口重构为分类导航栏样式
- 优化分类项的文本布局和样式
newdev_shunjiawei
lxm 10 months ago
parent
commit
768b309cd4
  1. 2
      lib/modules/goods/views/goodsvip_view.dart
  2. 115
      lib/modules/settings/views/settings_view.dart

2
lib/modules/goods/views/goodsvip_view.dart

@ -45,7 +45,7 @@ class GoodsvipView extends GetView<GoodsvipController> {
for (final g in controller.items) { for (final g in controller.items) {
grouped.putIfAbsent(g.usagetype, () => []).add(g); grouped.putIfAbsent(g.usagetype, () => []).add(g);
} }
final order = [UsageType.Vip, UsageType.Translation, UsageType.Meet]; final order = [UsageType.Vip];
final children = <Widget>[]; final children = <Widget>[];
children.add(_buildFeaturesSection(isDarkMode)); children.add(_buildFeaturesSection(isDarkMode));
children.add(SizedBox(height: 16.h)); children.add(SizedBox(height: 16.h));

115
lib/modules/settings/views/settings_view.dart

@ -243,59 +243,46 @@ class SettingsView extends GetView<SettingsController> {
), ),
], ],
), ),
child: InkWell( child: Row(
onTap: () => Get.toNamed(Routes.goodsvip), mainAxisAlignment: MainAxisAlignment.spaceAround,
borderRadius: BorderRadius.circular(16.r), children: [
child: Row( _buildCategoryItem(
children: [ icon: Icons.workspace_premium,
Container( label: 'premiumMember'.tr,
width: 42.w, iconBg: isDarkMode
height: 42.w, ? Colors.amber[900]!.withOpacity(0.3)
decoration: BoxDecoration( : Colors.amber[100]!,
color: isDarkMode iconColor: isDarkMode ? Colors.amber[300]! : Colors.amber[600]!,
? Colors.amber[900]!.withOpacity(0.3) onTap: () => Get.toNamed(Routes.goodsvip),
: Colors.amber[100]!, ),
borderRadius: BorderRadius.circular(21.r), _buildCategoryItem(
), icon: Icons.translate,
child: Icon( label: 'interpretation'.tr,
Icons.workspace_premium, iconBg: isDarkMode
size: 20.w, ? Colors.indigo[900]!.withOpacity(0.3)
color: isDarkMode ? Colors.amber[300]! : Colors.amber[600]!, : Colors.indigo[100]!,
), iconColor: isDarkMode ? Colors.indigo[300]! : Colors.indigo[600]!,
), onTap: () => Get.toNamed(Routes.goodstrade),
SizedBox(width: 12.w), ),
Expanded( _buildCategoryItem(
child: Column( icon: Icons.people,
crossAxisAlignment: CrossAxisAlignment.start, label: 'conferenceAssistant'.tr,
children: [ iconBg: isDarkMode
Text( ? Colors.pink[900]!.withOpacity(0.3)
'premiumMember'.tr, : Colors.pink[100]!,
style: TextStyle( iconColor: isDarkMode ? Colors.pink[300]! : Colors.pink[600]!,
fontSize: 16.sp, onTap: () => Get.toNamed(Routes.goodsmeet),
fontWeight: FontWeight.w600, ),
color: Colors.white, // _buildCategoryItem(
), // icon: Icons.smart_toy,
), // label: 'aiFunction'.tr,
SizedBox(height: 4.h), // iconBg: isDarkMode
Text( // ? Colors.teal[900]!.withOpacity(0.3)
'${'higherQuota'.tr} · ${'fastResponse'.tr}', // : Colors.teal[100]!,
style: TextStyle( // iconColor: isDarkMode ? Colors.teal[300]! : Colors.teal[600]!,
fontSize: 12.sp, // onTap: () => Get.toNamed(Routes.goodsai),
color: Colors.white70, // ),
), ],
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
),
Icon(
Icons.arrow_forward_ios,
size: 16.w,
color: Colors.white70,
),
],
),
), ),
); );
} }
@ -328,16 +315,20 @@ class SettingsView extends GetView<SettingsController> {
SizedBox(height: 8.h), SizedBox(height: 8.h),
SizedBox( SizedBox(
width: 72.w, width: 72.w,
child: Text( height: 32.h,
label, child: Center(
textAlign: TextAlign.center, child: Text(
style: TextStyle( label,
fontSize: 12.sp, textAlign: TextAlign.center,
fontWeight: FontWeight.w500, style: TextStyle(
color: Colors.white, fontSize: 12.sp,
fontWeight: FontWeight.w500,
color: Colors.white,
height: 1.2,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
), ),
], ],

Loading…
Cancel
Save