Browse Source

[feat]亲密度分析,截图回复-识图回复Tab,增加回复语气卡片

hezihao 7 months ago
parent
commit
f493ccfcbb

BIN
assets/images/icon_action_copy.webp


+ 2 - 0
assets/string/base/string.xml

@@ -286,7 +286,9 @@
     <string name="intimacy_analyse_ta_demand">TA现在的需求</string>
     <string name="intimacy_analyse_ta_demand">TA现在的需求</string>
     <string name="intimacy_analyse_re_upload">重新上传</string>
     <string name="intimacy_analyse_re_upload">重新上传</string>
     <string name="intimacy_analyse_get_reply">获取回复</string>
     <string name="intimacy_analyse_get_reply">获取回复</string>
+    <string name="intimacy_analyse_reply_tone">回复语气:</string>
 
 
+    <string name="retry">再试试</string>
     <string name="next_step">下一步</string>
     <string name="next_step">下一步</string>
     <string name="recently">最近</string>
     <string name="recently">最近</string>
 
 

+ 7 - 0
lib/module/intimacy_analyse/screenshot_reply/scan_image_reply/scan_image_reply_controller.dart

@@ -22,6 +22,13 @@ class ScanImageReplyController extends BaseController {
   /// 当前应用的Ai模型
   /// 当前应用的Ai模型
   Rx<String> currentReplyMode = '评论模式'.obs;
   Rx<String> currentReplyMode = '评论模式'.obs;
 
 
+  /// 回复语气列表
+  RxList<String> replyToneList = <String>[
+    "真好",
+    "真好看",
+    "真的很好看~",
+  ].obs;
+
   @override
   @override
   void onReady() {
   void onReady() {
     super.onReady();
     super.onReady();

+ 169 - 1
lib/module/intimacy_analyse/screenshot_reply/scan_image_reply/scan_image_reply_view.dart

@@ -40,6 +40,9 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
               SizedBox(height: 14.h),
               SizedBox(height: 14.h),
               // 选项卡片
               // 选项卡片
               _buildOptionCard(),
               _buildOptionCard(),
+              SizedBox(height: 14.h),
+              // 回复语气列表卡片
+              _buildReplyToneListCard(),
               // 距离底部有一定间距
               // 距离底部有一定间距
               SizedBox(height: 90.h),
               SizedBox(height: 90.h),
             ],
             ],
@@ -225,6 +228,171 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
     );
     );
   }
   }
 
 
+  /// 回复语气列表卡片
+  Widget _buildReplyToneListCard() {
+    return Container(
+      margin: EdgeInsets.only(left: 12.w, right: 12.w),
+      decoration: BoxDecoration(
+        // 渐变背景
+        gradient: LinearGradient(
+          colors: [Color(0xFFEFE9FF), Color(0xFFFBFAFF)],
+          begin: Alignment.topCenter,
+          end: Alignment.bottomCenter,
+        ),
+        borderRadius: BorderRadius.all(Radius.circular(20.r)),
+      ),
+      child: Column(
+        children: [
+          Container(
+            margin: EdgeInsets.only(top: 10.h, bottom: 18.h),
+            child: Column(
+              children: [
+                Row(
+                  children: [
+                    Expanded(
+                      child: Row(
+                        children: [
+                          // 回复语气的标题
+                          SizedBox(
+                            width: 80.w,
+                            height: 40.h,
+                            child: Stack(
+                              children: [
+                                // 底部的横线
+                                Positioned(
+                                  left: 15.w,
+                                  bottom: 10.h,
+                                  child: Container(
+                                    width: 57.w,
+                                    height: 7.h,
+                                    color: Color(0xFFCEB6FF),
+                                  ),
+                                ),
+                                Positioned(
+                                  left: 0,
+                                  bottom: 0,
+                                  child: Container(
+                                    margin: EdgeInsets.only(
+                                      left: 16.w,
+                                      bottom: 10.h,
+                                    ),
+                                    child: // 标题
+                                        Text(
+                                      StringName.intimacyAnalyseReplyTone,
+                                      style: TextStyle(
+                                        color: ColorName.black80,
+                                        fontSize: 14.sp,
+                                        fontWeight: FontWeight.w700,
+                                      ),
+                                    ),
+                                  ),
+                                ),
+                              ],
+                            ),
+                          ),
+                          // 回复内容
+                          Text(
+                            "😁 键盘侠",
+                            style: TextStyle(
+                              color: ColorName.black80,
+                              fontSize: 14.sp,
+                              fontWeight: FontWeight.w500,
+                            ),
+                          ),
+                        ],
+                      ),
+                    ),
+                    // 重试按钮
+                    _buildRetryBtn(),
+                    SizedBox(width: 10.w),
+                  ],
+                ),
+                // 回复语气列表
+                for (var replyTone in controller.replyToneList)
+                  _buildReplyToneListItem(replyTone),
+              ],
+            ),
+          ),
+        ],
+      ),
+    );
+  }
+
+  /// 重试按钮
+  Widget _buildRetryBtn() {
+    return Container(
+      padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 8.h),
+      decoration: BoxDecoration(
+        // 渐变背景
+        gradient: LinearGradient(
+          colors: [ColorName.purpleGradient3, ColorName.purpleGradient4],
+          begin: Alignment.centerLeft,
+          end: Alignment.centerRight,
+        ),
+        borderRadius: BorderRadius.all(Radius.circular(30.r)),
+      ),
+      child: Text(
+        StringName.retry,
+        style: TextStyle(
+          color: ColorName.white,
+          fontSize: 14.sp,
+          fontWeight: FontWeight.w400,
+        ),
+      ),
+    );
+  }
+
+  /// 回复语气列表条目
+  Widget _buildReplyToneListItem(String replyTone) {
+    return Container(
+      margin: EdgeInsets.only(left: 12.w, right: 12.w, top: 10.h),
+      decoration: BoxDecoration(
+        color: ColorName.white,
+        borderRadius: BorderRadius.circular(16.r),
+        boxShadow: [
+          BoxShadow(
+            // 阴影颜色
+            color: Color(0x61D2D2D2),
+            // 模糊半径(值越大越模糊)
+            blurRadius: 3.8,
+            // 阴影扩散范围(正值为扩大,负值为缩小)
+            spreadRadius: 1,
+            // 阴影偏移量(x, y)
+            offset: Offset(0, 2),
+          ),
+        ],
+      ),
+      child: Row(
+        children: [
+          // 文字
+          Expanded(
+            child: Container(
+              margin: EdgeInsets.only(left: 21.w, top: 12.h, bottom: 12.h),
+              child: Text(
+                replyTone,
+                maxLines: 1,
+                style: TextStyle(
+                  overflow: TextOverflow.ellipsis,
+                  color: ColorName.black80,
+                  fontSize: 14.sp,
+                  fontWeight: FontWeight.w500,
+                ),
+              ),
+            ),
+          ),
+          // 图标
+          Container(
+            margin: EdgeInsets.only(right: 14.w),
+            child: Assets.images.iconActionCopy.image(
+              width: 18.w,
+              height: 18.w,
+            ),
+          ),
+        ],
+      ),
+    );
+  }
+
   /// 构建一行选择选项行
   /// 构建一行选择选项行
   Widget _buildOptionRow(OptionSelectConfig config) {
   Widget _buildOptionRow(OptionSelectConfig config) {
     return Column(
     return Column(
@@ -407,7 +575,7 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
         ),
         ),
         child: ActionBtn(
         child: ActionBtn(
           leftBtn: _buildReplyModelSwitchBtn(),
           leftBtn: _buildReplyModelSwitchBtn(),
-          spaceWidget: SizedBox(width: 10.w,),
+          spaceWidget: SizedBox(width: 10.w),
           rightBtn: _buildGetReplayBtn(),
           rightBtn: _buildGetReplayBtn(),
         ),
         ),
       );
       );

+ 1 - 1
lib/module/intimacy_analyse/widget/step_card.dart

@@ -181,7 +181,7 @@ class StepCard extends StatelessWidget {
               // 超过时显示省略号
               // 超过时显示省略号
               overflow: TextOverflow.ellipsis,
               overflow: TextOverflow.ellipsis,
               // 最多多少行
               // 最多多少行
-              maxLines: 2,
+              maxLines: 1,
               style: TextStyle(
               style: TextStyle(
                 fontSize: 12.sp,
                 fontSize: 12.sp,
                 fontWeight: FontWeight.w400,
                 fontWeight: FontWeight.w400,

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

@@ -215,6 +215,10 @@ class $AssetsImagesGen {
   AssetGenImage get iconAboutArrowLeft =>
   AssetGenImage get iconAboutArrowLeft =>
       const AssetGenImage('assets/images/icon_about_arrow_left.webp');
       const AssetGenImage('assets/images/icon_about_arrow_left.webp');
 
 
+  /// File path: assets/images/icon_action_copy.webp
+  AssetGenImage get iconActionCopy =>
+      const AssetGenImage('assets/images/icon_action_copy.webp');
+
   /// File path: assets/images/icon_add_prediction_direction.webp
   /// File path: assets/images/icon_add_prediction_direction.webp
   AssetGenImage get iconAddPredictionDirection =>
   AssetGenImage get iconAddPredictionDirection =>
       const AssetGenImage('assets/images/icon_add_prediction_direction.webp');
       const AssetGenImage('assets/images/icon_add_prediction_direction.webp');
@@ -958,6 +962,7 @@ class $AssetsImagesGen {
     bgTicketDialogPrices2,
     bgTicketDialogPrices2,
     gifDiscountUnlockButton,
     gifDiscountUnlockButton,
     iconAboutArrowLeft,
     iconAboutArrowLeft,
+    iconActionCopy,
     iconAddPredictionDirection,
     iconAddPredictionDirection,
     iconAiModel,
     iconAiModel,
     iconAlipayPayment,
     iconAlipayPayment,

+ 4 - 0
lib/resource/string.gen.dart

@@ -202,6 +202,8 @@ class StringName {
   static final String intimacyAnalyseTaDemand = 'intimacy_analyse_ta_demand'.tr; // TA现在的需求
   static final String intimacyAnalyseTaDemand = 'intimacy_analyse_ta_demand'.tr; // TA现在的需求
   static final String intimacyAnalyseReUpload = 'intimacy_analyse_re_upload'.tr; // 重新上传
   static final String intimacyAnalyseReUpload = 'intimacy_analyse_re_upload'.tr; // 重新上传
   static final String intimacyAnalyseGetReply = 'intimacy_analyse_get_reply'.tr; // 获取回复
   static final String intimacyAnalyseGetReply = 'intimacy_analyse_get_reply'.tr; // 获取回复
+  static final String intimacyAnalyseReplyTone = 'intimacy_analyse_reply_tone'.tr; // 回复语气:
+  static final String retry = 'retry'.tr; // 再试试
   static final String nextStep = 'next_step'.tr; // 下一步
   static final String nextStep = 'next_step'.tr; // 下一步
   static final String recently = 'recently'.tr; // 最近
   static final String recently = 'recently'.tr; // 最近
   static final String addHobbies = 'add_hobbies'.tr; // 添加爱好
   static final String addHobbies = 'add_hobbies'.tr; // 添加爱好
@@ -411,6 +413,8 @@ class StringMultiSource {
       'intimacy_analyse_ta_demand': 'TA现在的需求',
       'intimacy_analyse_ta_demand': 'TA现在的需求',
       'intimacy_analyse_re_upload': '重新上传',
       'intimacy_analyse_re_upload': '重新上传',
       'intimacy_analyse_get_reply': '获取回复',
       'intimacy_analyse_get_reply': '获取回复',
+      'intimacy_analyse_reply_tone': '回复语气:',
+      'retry': '再试试',
       'next_step': '下一步',
       'next_step': '下一步',
       'recently': '最近',
       'recently': '最近',
       'add_hobbies': '添加爱好',
       'add_hobbies': '添加爱好',