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