Jelajahi Sumber

[feat]增加人设缺省页

云天逵 7 bulan lalu
induk
melakukan
49713603dc

TEMPAT SAMPAH
assets/images/icon_character_custom_list_empty.webp


+ 6 - 1
assets/string/base/string.xml

@@ -431,7 +431,7 @@
     <string name="new_discount_unlock_now">立即解锁体验</string>
     <string name="privacy_title">隐私政策及权限说明</string>
     <string name="privacy_disagree">不同意</string>
-    <string name="privacy_disagree_and_exit">不同意并退出</string>
+    <string name="privacy_disagree_and_exit">狠心离开</string>
     <string name="privacy_agree">同意</string>
 
     <string name="custom_love_keyboard">定制恋爱键盘</string>
@@ -440,4 +440,9 @@
     <string name="intimacy_index">亲密指数</string>
 
     <string name="new_user_keyboard_generating">正在匹配...</string>
+
+    <string name="character_custom_list_empty">无定制人设历史记录</string>
+    <string name="character_custom_list_empty_btn_desc">立即定制人设  ></string>
+
+
 </resources>

+ 68 - 13
lib/module/character_custom/list/character_custom_list_page.dart

@@ -52,6 +52,9 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
                     SizedBox(height: 26.h),
                     Expanded(
                       child: Obx(() {
+                        if (controller.characterList.isEmpty) {
+                          return _buildCustomListEmpty();
+                        }
                         return EasyRefresh(
                           controller: controller.refreshController,
                           header: const ClassicHeader(),
@@ -116,7 +119,7 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
             StringName.characterCustomHistory,
             style: Styles.getTextStyleBlack204W500(17.sp),
           ),
-          SizedBox(width: 24.w,height: 24.w,),
+          SizedBox(width: 24.w, height: 24.w),
         ],
       ),
     );
@@ -203,7 +206,7 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
           colors: [Color(0xffebe6ff), Color(0xffffe6fe)],
         ),
       ),
-      child:ClipRRect(
+      child: ClipRRect(
         borderRadius: BorderRadius.circular(8.r),
         child: CachedNetworkImage(
           imageUrl: imageUrl ?? "",
@@ -212,10 +215,10 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
           fit: BoxFit.contain,
           errorWidget:
               (_, __, ___) => Assets.images.iconSystemKeyboard.image(
-            width: 60.r,
-            height: 60.r,
-            fit: BoxFit.contain,
-          ),
+                width: 60.r,
+                height: 60.r,
+                fit: BoxFit.contain,
+              ),
         ),
       ),
     );
@@ -273,13 +276,11 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
         margin: EdgeInsets.only(left: 8.w),
         decoration: BoxDecoration(
           borderRadius: BorderRadius.circular(50.r),
-          gradient:
-              const LinearGradient(
-                    colors: [Color(0xFF7D46FC), Color(0xFFBC87FF)],
-                    begin: Alignment.topLeft,
-                    end: Alignment.bottomRight,
-                  ),
-
+          gradient: const LinearGradient(
+            colors: [Color(0xFF7D46FC), Color(0xFFBC87FF)],
+            begin: Alignment.topLeft,
+            end: Alignment.bottomRight,
+          ),
         ),
         child: Row(
           mainAxisAlignment: MainAxisAlignment.center,
@@ -305,4 +306,58 @@ class CharacterCustomListPage extends BasePage<CharacterCustomListController> {
       ),
     );
   }
+
+  Widget _buildCustomListEmpty() {
+    return Column(
+      children: [
+        SizedBox(height: 120.w),
+        Assets.images.iconCharacterCustomListEmpty.image(
+          width: 161.w,
+          height: 139.w,
+        ),
+        Text(
+          StringName.characterCustomListEmpty,
+          style: TextStyle(
+            color: Colors.black.withAlpha(178),
+            fontSize: 14.sp,
+            fontWeight: FontWeight.w400,
+          ),
+        ),
+        SizedBox(height: 47.w),
+        InkWell(
+          onTap: () {
+            controller.clickBack();
+          },
+          child: Container(
+            width: 162.w,
+            height: 48.w,
+            alignment: Alignment.center,
+            decoration: ShapeDecoration(
+              gradient: LinearGradient(
+                begin: Alignment.centerLeft,
+                end: Alignment.centerRight,
+                transform: GradientRotation(0.5),
+                colors: [const Color(0xFF7D46FC), const Color(0xFFBC87FF)],
+              ),
+              shape: RoundedRectangleBorder(
+                borderRadius: BorderRadius.circular(50.r),
+              ),
+              shadows: [
+                BoxShadow(
+                  color: Color(0x66BDA8C9),
+                  blurRadius: 10,
+                  offset: Offset(0, 4),
+                  spreadRadius: 0,
+                ),
+              ],
+            ),
+            child: Text(
+              StringName.characterCustomListEmptyBtnDesc,
+              style: Styles.getTextStyleWhiteW500(16.sp),
+            ),
+          ),
+        ),
+      ],
+    );
+  }
 }

+ 6 - 0
lib/resource/assets.gen.dart

@@ -440,6 +440,11 @@ class $AssetsImagesGen {
     'assets/images/icon_character_custom_detail_switch.webp',
   );
 
+  /// File path: assets/images/icon_character_custom_list_empty.webp
+  AssetGenImage get iconCharacterCustomListEmpty => const AssetGenImage(
+    'assets/images/icon_character_custom_list_empty.webp',
+  );
+
   /// File path: assets/images/icon_character_custom_plus.webp
   AssetGenImage get iconCharacterCustomPlus =>
       const AssetGenImage('assets/images/icon_character_custom_plus.webp');
@@ -1289,6 +1294,7 @@ class $AssetsImagesGen {
     iconCharacterCustomDetailLock,
     iconCharacterCustomDetailMale,
     iconCharacterCustomDetailSwitch,
+    iconCharacterCustomListEmpty,
     iconCharacterCustomPlus,
     iconCharacterCustomStepOneTitle,
     iconCharacterCustomStepThreeTitle,

+ 6 - 2
lib/resource/string.gen.dart

@@ -323,12 +323,14 @@ class StringName {
   static final String newDiscountUnlockNow = 'new_discount_unlock_now'.tr; // 立即解锁体验
   static final String privacyTitle = 'privacy_title'.tr; // 隐私政策及权限说明
   static final String privacyDisagree = 'privacy_disagree'.tr; // 不同意
-  static final String privacyDisagreeAndExit = 'privacy_disagree_and_exit'.tr; // 不同意并退出
+  static final String privacyDisagreeAndExit = 'privacy_disagree_and_exit'.tr; // 狠心离开
   static final String privacyAgree = 'privacy_agree'.tr; // 同意
   static final String customLoveKeyboard = 'custom_love_keyboard'.tr; // 定制恋爱键盘
   static final String goToLogin = 'go_to_login'.tr; // 去登录
   static final String intimacyIndex = 'intimacy_index'.tr; // 亲密指数
   static final String newUserKeyboardGenerating = 'new_user_keyboard_generating'.tr; // 正在匹配...
+  static final String characterCustomListEmpty = 'character_custom_list_empty'.tr; // 无定制人设历史记录
+  static final String characterCustomListEmptyBtnDesc = 'character_custom_list_empty_btn_desc'.tr; // 立即定制人设 >
 }
 class StringMultiSource {
   StringMultiSource._();
@@ -655,12 +657,14 @@ class StringMultiSource {
       'new_discount_unlock_now': '立即解锁体验',
       'privacy_title': '隐私政策及权限说明',
       'privacy_disagree': '不同意',
-      'privacy_disagree_and_exit': '不同意并退出',
+      'privacy_disagree_and_exit': '狠心离开',
       'privacy_agree': '同意',
       'custom_love_keyboard': '定制恋爱键盘',
       'go_to_login': '去登录',
       'intimacy_index': '亲密指数',
       'new_user_keyboard_generating': '正在匹配...',
+      'character_custom_list_empty': '无定制人设历史记录',
+      'character_custom_list_empty_btn_desc': '立即定制人设 >',
     },
   };
 }