|
|
@@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
|
|
|
import 'package:keyboard/base/base_view.dart';
|
|
|
+import 'package:keyboard/widget/markdown/markdown_viewer.dart';
|
|
|
|
|
|
import '../../../../data/bean/option_select_config.dart';
|
|
|
import '../../../../data/bean/option_select_item.dart';
|
|
|
import '../../../../resource/assets.gen.dart';
|
|
|
import '../../../../resource/colors.gen.dart';
|
|
|
import '../../../../resource/string.gen.dart';
|
|
|
+import '../../intimacy_analyse_upload/widget/upload_nine_grid.dart';
|
|
|
import '../../widget/option_select_widget.dart';
|
|
|
import '../../widget/step/upload_step_card.dart';
|
|
|
import '../../widget/step_card.dart';
|
|
|
@@ -46,6 +48,7 @@ class ConversationAnalysisView
|
|
|
/// 内容列表
|
|
|
Widget _buildContentList() {
|
|
|
Widget contentWidget;
|
|
|
+ // 上传页
|
|
|
if (controller.isUploadPage.value) {
|
|
|
contentWidget = Column(
|
|
|
children: [
|
|
|
@@ -57,6 +60,19 @@ class ConversationAnalysisView
|
|
|
SizedBox(height: 90.h),
|
|
|
],
|
|
|
);
|
|
|
+ } else if (controller.hasReport.value) {
|
|
|
+ // 已出结果
|
|
|
+ contentWidget = Column(
|
|
|
+ children: [
|
|
|
+ // 分析结果卡片
|
|
|
+ _buildAnalysisResultCard(),
|
|
|
+ SizedBox(height: 12.h),
|
|
|
+ // 分析结果Markdown卡片
|
|
|
+ _buildMarkdownAnalysisResultCard(),
|
|
|
+ // 距离底部有一定间距
|
|
|
+ SizedBox(height: 90.h),
|
|
|
+ ],
|
|
|
+ );
|
|
|
} else {
|
|
|
// 例子列表
|
|
|
contentWidget = Column(
|
|
|
@@ -129,6 +145,126 @@ class ConversationAnalysisView
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /// 分析结果卡片
|
|
|
+ Widget _buildAnalysisResultCard() {
|
|
|
+ return StepCard(
|
|
|
+ bgImageProvider: Assets.images.bgIntimacyAnalyseUploadCard.provider(),
|
|
|
+ stepTitle: StringName.intimacyAnalyseAnalysisResult,
|
|
|
+ topIconWidget: Assets.images.iconIntimacyAnalysisResultTop.image(
|
|
|
+ height: 63.h,
|
|
|
+ width: 103.w,
|
|
|
+ ),
|
|
|
+ contentWidget: Column(
|
|
|
+ children: [
|
|
|
+ // 图片九宫格
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w, right: 12.w),
|
|
|
+ padding: EdgeInsets.only(
|
|
|
+ left: 12.w,
|
|
|
+ top: 12.h,
|
|
|
+ right: 12.w,
|
|
|
+ bottom: 12.h,
|
|
|
+ ),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ borderRadius: BorderRadius.circular(16.r),
|
|
|
+ ),
|
|
|
+ child: UploadNineGrid(
|
|
|
+ mode: Mode.preview,
|
|
|
+ imageSrcList: ["", "", "", "", "", "", ""],
|
|
|
+ maxCount: 9,
|
|
|
+ spacing: 8.0,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 分析结果,Markdown文档卡片
|
|
|
+ Widget _buildMarkdownAnalysisResultCard() {
|
|
|
+ return Container(
|
|
|
+ width: double.maxFinite,
|
|
|
+ margin: EdgeInsets.only(left: 14.w, right: 14.w),
|
|
|
+ // 圆角背景
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ // 渐变背景
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ ColorName.bgIntimacyRelationColor1,
|
|
|
+ ColorName.bgIntimacyRelationColor2,
|
|
|
+ ],
|
|
|
+ begin: Alignment.centerLeft,
|
|
|
+ end: Alignment.centerRight,
|
|
|
+ ),
|
|
|
+ shape: BoxShape.rectangle,
|
|
|
+ border: Border.all(color: ColorName.white80, width: 1.w),
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(23.r)),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ // 左对齐
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ // 标题
|
|
|
+ Container(
|
|
|
+ width: double.maxFinite,
|
|
|
+ height: 20.h,
|
|
|
+ margin: EdgeInsets.only(top: 16.h),
|
|
|
+ child: Stack(
|
|
|
+ clipBehavior: Clip.none,
|
|
|
+ children: [
|
|
|
+ // 底部的横线
|
|
|
+ Positioned(
|
|
|
+ left: 15.w,
|
|
|
+ bottom: 0,
|
|
|
+ child: Container(
|
|
|
+ width: 96.w,
|
|
|
+ height: 7.h,
|
|
|
+ color: Color(0xFFCEB6FF),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ left: 0,
|
|
|
+ bottom: -2.h,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 14.w, top: 16.h),
|
|
|
+ child: Text(
|
|
|
+ StringName.intimacyAnalyseTaDemand,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ // Markdown内容
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(
|
|
|
+ left: 12.w,
|
|
|
+ top: 14.h,
|
|
|
+ right: 12.w,
|
|
|
+ bottom: 12.h,
|
|
|
+ ),
|
|
|
+ // 圆角背景
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ borderRadius: BorderRadius.circular(20.r),
|
|
|
+ ),
|
|
|
+ child: MarkdownViewer(
|
|
|
+ content: controller.reportData.value,
|
|
|
+ enableContentScroll: false,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
/// 上传截图例子卡片
|
|
|
Widget _buildChatRecordSampleCard() {
|
|
|
return StepCard(
|