فهرست منبع

feat: 隐藏 Current Identily 菜单和 Expiry Date 菜单

f-dev 1 هفته پیش
والد
کامیت
cea0096544
1فایلهای تغییر یافته به همراه60 افزوده شده و 91 حذف شده
  1. 60 91
      lib/app/modules/setting/views/setting_view.dart

+ 60 - 91
lib/app/modules/setting/views/setting_view.dart

@@ -9,14 +9,14 @@ import 'package:flashlink/app/base/base_view.dart';
 import 'package:flashlink/app/constants/assets.dart';
 import 'package:flashlink/app/dialog/all_dialog.dart';
 import 'package:flashlink/app/widgets/click_opacity.dart';
-import 'package:flashlink/app/widgets/ix_image.dart';
+// import 'package:flashlink/app/widgets/ix_image.dart';
 import 'package:flashlink/config/theme/theme_extensions/theme_extension.dart';
 import 'package:flashlink/utils/device_manager.dart';
 import 'package:flashlink/utils/misc.dart';
 
 import '../../../../utils/formater.dart';
-import '../../../constants/enums.dart';
-import '../../../data/sp/ix_sp.dart';
+// import '../../../constants/enums.dart';
+// import '../../../data/sp/ix_sp.dart';
 import '../../../../config/theme/dark_theme_colors.dart';
 // import '../../../../config/translations/localization_service.dart';
 import '../../../../config/translations/strings_enum.dart';
@@ -129,40 +129,39 @@ class SettingView extends BaseView<SettingController> {
             children: [
               if (!controller.apiController.isGuest ||
                   controller.apiController.isPremium)
-                _buildSettingItem(
-                  icon: IconFont.icon29,
-                  iconColor: Get.reactiveTheme.shadowColor,
-                  title: _getUserAccount().isNotEmpty
-                      ? _getUserAccount()
-                      : Strings.currentUser.tr,
-                  trailing: Row(
-                    children: [
-                      IXImage(
-                        source: controller.apiController.userLevel == 3
-                            ? controller.apiController.remainTimeSeconds > 0
-                                  ? Assets.premium
-                                  : Assets.premiumExpired
-                            : controller.apiController.userLevel == 9999
-                            ? Assets.test
-                            : Assets.free,
-                        width: controller.apiController.userLevel == 3
-                            ? 92.w
-                            : 92.w,
-                        height: 28.w,
-                        sourceType: ImageSourceType.asset,
-                      ),
-                      4.horizontalSpace,
-                      Icon(
-                        IconFont.icon02,
-                        size: 20.w,
-                        color: Get.reactiveTheme.hintColor,
-                      ),
-                    ],
-                  ),
-                  onTap: () {
-                    Get.toNamed(Routes.ACCOUNT);
-                  },
-                ),
+                // _buildSettingItem(
+                //   icon: IconFont.icon29,
+                //   iconColor: Get.reactiveTheme.shadowColor,
+                //   title: _getUserAccount().isNotEmpty
+                //       ? _getUserAccount()
+                //       : Strings.currentUser.tr,
+                //   trailing: Row(
+                //     children: [
+                //       IXImage(
+                //         source: controller.apiController.userLevel == 3
+                //             ? controller.apiController.remainTimeSeconds > 0
+                //                   ? Assets.premium
+                //                   : Assets.premiumExpired
+                //             : controller.apiController.userLevel == 9999
+                //             ? Assets.test
+                //             : Assets.free,
+                //         width: 92.w,
+                //         height: 28.w,
+                //         sourceType: ImageSourceType.asset,
+                //       ),
+                //       4.horizontalSpace,
+                //       Icon(
+                //         IconFont.icon02,
+                //         size: 20.w,
+                //         color: Get.reactiveTheme.hintColor,
+                //       ),
+                //     ],
+                //   ),
+                //   onTap: () {
+                //     Get.toNamed(Routes.ACCOUNT);
+                //   },
+                // ),
+                const SizedBox.shrink(),
               _buildDivider(),
               _buildSettingItem(
                 icon: IconFont.icon14,
@@ -195,54 +194,24 @@ class SettingView extends BaseView<SettingController> {
               // 根据用户类型显示不同的时间信息
               if (controller.apiController.isPremium) ...[
                 // _buildSettingItem(
-                //   icon: IconFont.icon23,
+                //   disableFeedback: true,
+                //   icon: IconFont.icon30,
                 //   iconColor: Get.reactiveTheme.shadowColor,
-                //   title: Strings.myPreCode.tr,
-                //   trailing: Row(
-                //     mainAxisSize: MainAxisSize.min,
-                //     children: [
-                //       Text(
-                //         '123***ADZ',
-                //         style: TextStyle(
-                //           fontSize: 13.sp,
-                //           color: Get.reactiveTheme.hintColor,
-                //         ),
-                //       ),
-                //       SizedBox(width: 4.w),
-                //       Icon(
-                //         IconFont.icon02,
-                //         size: 20.w,
-                //         color: Get.reactiveTheme.hintColor,
-                //       ),
-                //     ],
+                //   title: Strings.validTerm.tr,
+                //   trailing: Text(
+                //     controller.apiController.remainTimeSeconds > 0
+                //         ? controller.apiController.validTermText
+                //         : Strings.expired.tr,
+                //     style: TextStyle(
+                //       fontSize: 13.sp,
+                //       color: controller.apiController.remainTimeSeconds > 0
+                //           ? Get.reactiveTheme.primaryColor
+                //           : Colors.red,
+                //       fontWeight: FontWeight.w500,
+                //     ),
                 //   ),
-                //   onTap: () {
-                //     // TODO: 跳转到Pre Code页面
-                //     Get.toNamed(Routes.PRECODE);
-                //   },
+                //   onTap: () {},
                 // ),
-                // _buildDivider(),
-                _buildSettingItem(
-                  disableFeedback: true,
-                  icon: IconFont.icon30,
-                  iconColor: Get.reactiveTheme.shadowColor,
-                  title: Strings.validTerm.tr,
-                  trailing: Text(
-                    controller.apiController.remainTimeSeconds > 0
-                        ? controller.apiController.validTermText
-                        : Strings.expired.tr,
-                    style: TextStyle(
-                      fontSize: 13.sp,
-                      color: controller.apiController.remainTimeSeconds > 0
-                          ? Get.reactiveTheme.primaryColor
-                          : Colors.red,
-                      fontWeight: FontWeight.w500,
-                    ),
-                  ),
-                  onTap: () {
-                    // TODO: 跳转到有效期详情页面
-                  },
-                ),
               ] else ...[
                 // _buildSettingItem(
                 //   icon: IconFont.icon30,
@@ -782,14 +751,14 @@ class SettingView extends BaseView<SettingController> {
     );
   }
 
-  /// 获取用户账号显示文本
-  String _getUserAccount() {
-    final user = IXSP.getUser();
-    if (user == null) return '';
+  // /// 获取用户账号显示文本
+  // String _getUserAccount() {
+  //   final user = IXSP.getUser();
+  //   if (user == null) return '';
 
-    if (user.memberLevel == MemberLevel.normal.level) {
-      return user.account?.username ?? '';
-    }
-    return '';
-  }
+  //   if (user.memberLevel == MemberLevel.normal.level) {
+  //     return user.account?.username ?? '';
+  //   }
+  //   return '';
+  // }
 }