|
|
@@ -19,6 +19,7 @@ import '../../../utils/string_format_util.dart';
|
|
|
import '../../../widget/actionbtn/action_btn.dart';
|
|
|
import '../../../widget/gradient_btn.dart';
|
|
|
import '../../../widget/gradient_text.dart';
|
|
|
+import '../../user_info/enums/gender_type.dart';
|
|
|
import '../widget/intimacy_analyse_report_widget.dart';
|
|
|
import '../widget/intimacy_user_widget.dart';
|
|
|
import '../widget/option_select_widget.dart';
|
|
|
@@ -281,7 +282,7 @@ class IntimacyAnalyseUploadPage
|
|
|
IntimacyAnalyseReportWidget(
|
|
|
// 分析结果
|
|
|
intimacyAnalyzeResult: controller.intimacyAnalyzeResult.value,
|
|
|
- unlock: controller.userInfo.value?.isMember ?? false,
|
|
|
+ unlock: controller.memberInfo.value?.isMember ?? false,
|
|
|
isReportCreating: controller.isResultGenerating.value,
|
|
|
),
|
|
|
],
|
|
|
@@ -291,65 +292,81 @@ class IntimacyAnalyseUploadPage
|
|
|
|
|
|
/// 预测方向结果
|
|
|
Widget _buildDirectionResult() {
|
|
|
- return Expanded(
|
|
|
- child: Container(
|
|
|
- padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.white,
|
|
|
- borderRadius: BorderRadius.circular(14.r),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- // 标题
|
|
|
- Text(
|
|
|
- StringName.intimacyAnalysePredictionDirection,
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black47,
|
|
|
- fontSize: 12.sp,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(height: 4.h),
|
|
|
- // 结果
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- // 图标
|
|
|
- Assets.images.iconDirectionResult.image(
|
|
|
- height: 14.w,
|
|
|
- width: 14.w,
|
|
|
+ return Obx(() {
|
|
|
+ // 当前用户的头像
|
|
|
+ String myAvatarUrl = controller.userInfo.value?.imageUrl ?? "";
|
|
|
+ // 对方用户的头像
|
|
|
+ String taAvatarUrl = controller.currentKeyboardInfo.value?.imageUrl ?? "";
|
|
|
+ // 当前用户的性别
|
|
|
+ GenderType? myGender = GenderType.fromType(
|
|
|
+ controller.userInfo.value?.gender,
|
|
|
+ );
|
|
|
+ // 对方用户的性别
|
|
|
+ GenderType? taGender = GenderType.fromType(
|
|
|
+ controller.currentKeyboardInfo.value?.gender,
|
|
|
+ );
|
|
|
+ return Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ borderRadius: BorderRadius.circular(14.r),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ // 标题
|
|
|
+ Text(
|
|
|
+ StringName.intimacyAnalysePredictionDirection,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black47,
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
),
|
|
|
- SizedBox(width: 2.w),
|
|
|
- // 结果文字
|
|
|
- Text(
|
|
|
- controller.currentDirectionOption.value,
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black80,
|
|
|
- fontSize: 13.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ SizedBox(height: 4.h),
|
|
|
+ // 结果
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ // 图标
|
|
|
+ Assets.images.iconDirectionResult.image(
|
|
|
+ height: 14.w,
|
|
|
+ width: 14.w,
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Expanded(child: SizedBox()),
|
|
|
- // 亲密关系头像
|
|
|
- IntimacyUserWidget(
|
|
|
- width: 60.w,
|
|
|
- height: 30.h,
|
|
|
- avatarSize: 30.0,
|
|
|
- avatarUrl1: '',
|
|
|
- avatarUrl2: '',
|
|
|
- avatarBorderWidth: 1.w,
|
|
|
- loveSize: 17.w,
|
|
|
- ),
|
|
|
- ],
|
|
|
+ SizedBox(width: 2.w),
|
|
|
+ // 结果文字
|
|
|
+ Text(
|
|
|
+ controller.currentDirectionOption.value,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
+ fontSize: 13.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Expanded(child: SizedBox()),
|
|
|
+ // 亲密关系头像
|
|
|
+ IntimacyUserWidget(
|
|
|
+ width: 60.w,
|
|
|
+ height: 30.h,
|
|
|
+ avatarSize: 30.0,
|
|
|
+ myAvatar: myAvatarUrl,
|
|
|
+ taAvatar: taAvatarUrl,
|
|
|
+ myGender: myGender,
|
|
|
+ taGender: taGender,
|
|
|
+ avatarBorderWidth: 1.w,
|
|
|
+ loveSize: 17.w,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- );
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/// Ai模型结果
|
|
|
@@ -471,109 +488,125 @@ class IntimacyAnalyseUploadPage
|
|
|
|
|
|
/// 推荐的亲密关系
|
|
|
Widget _buildRecommendIntimacy() {
|
|
|
- return Container(
|
|
|
- width: double.infinity,
|
|
|
- margin: EdgeInsets.only(left: 14.w, right: 14.w),
|
|
|
- // 圆角背景
|
|
|
- decoration: BoxDecoration(
|
|
|
- // 渐变背景
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- ColorName.bgIntimacyRelationColor1,
|
|
|
- ColorName.bgIntimacyRelationColor2,
|
|
|
- ],
|
|
|
- begin: Alignment.centerLeft,
|
|
|
- end: Alignment.centerRight,
|
|
|
+ return Obx(() {
|
|
|
+ // 当前用户的头像
|
|
|
+ String myAvatarUrl = controller.userInfo.value?.imageUrl ?? "";
|
|
|
+ // 对方用户的头像
|
|
|
+ String taAvatarUrl = controller.currentKeyboardInfo.value?.imageUrl ?? "";
|
|
|
+ // 当前用户的性别
|
|
|
+ GenderType? myGender = GenderType.fromType(
|
|
|
+ controller.userInfo.value?.gender,
|
|
|
+ );
|
|
|
+ // 对方用户的性别
|
|
|
+ GenderType? taGender = GenderType.fromType(
|
|
|
+ controller.currentKeyboardInfo.value?.gender,
|
|
|
+ );
|
|
|
+ return Container(
|
|
|
+ width: double.infinity,
|
|
|
+ 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)),
|
|
|
),
|
|
|
- shape: BoxShape.rectangle,
|
|
|
- border: Border.all(color: ColorName.white80, width: 1.w),
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(23.r)),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- SizedBox(width: 6.w),
|
|
|
- // 用户亲密头像
|
|
|
- IntimacyUserWidget(
|
|
|
- width: 68.w,
|
|
|
- height: 34.h,
|
|
|
- avatarSize: 34.0,
|
|
|
- avatarUrl1: '',
|
|
|
- avatarUrl2: '',
|
|
|
- avatarBorderWidth: 1.w,
|
|
|
- loveSize: 19.w,
|
|
|
- ),
|
|
|
- SizedBox(width: 4.w),
|
|
|
- Text(
|
|
|
- StringName.mySelf,
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black80,
|
|
|
- fontSize: 11.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ SizedBox(width: 6.w),
|
|
|
+ // 用户亲密头像
|
|
|
+ IntimacyUserWidget(
|
|
|
+ width: 68.w,
|
|
|
+ height: 34.h,
|
|
|
+ avatarSize: 34.0,
|
|
|
+ myAvatar: myAvatarUrl,
|
|
|
+ taAvatar: taAvatarUrl,
|
|
|
+ myGender: myGender,
|
|
|
+ taGender: taGender,
|
|
|
+ avatarBorderWidth: 1.w,
|
|
|
+ loveSize: 19.w,
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(width: 4.w),
|
|
|
- Text(
|
|
|
- StringName.and,
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black41,
|
|
|
- fontSize: 11.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ SizedBox(width: 4.w),
|
|
|
+ Text(
|
|
|
+ StringName.mySelf,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
+ fontSize: 11.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(width: 4.w),
|
|
|
- Text(
|
|
|
- controller.currentKeyboardInfo.value?.name ?? "",
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black80,
|
|
|
- fontSize: 11.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ SizedBox(width: 4.w),
|
|
|
+ Text(
|
|
|
+ StringName.and,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black41,
|
|
|
+ fontSize: 11.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(width: 5.w),
|
|
|
- GradientText(
|
|
|
- // 渐变颜色
|
|
|
- colors: [
|
|
|
- ColorName.intimacyRelationColor1,
|
|
|
- ColorName.intimacyRelationColor2,
|
|
|
- ],
|
|
|
- child: Text(
|
|
|
- StringName.intimacyRelation,
|
|
|
+ SizedBox(width: 4.w),
|
|
|
+ Text(
|
|
|
+ controller.currentKeyboardInfo.value?.name ?? "",
|
|
|
style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
fontSize: 11.sp,
|
|
|
fontWeight: FontWeight.w500,
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- // 切换按钮
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- controller.switchTaTest();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 9.w, vertical: 6.h),
|
|
|
- margin: EdgeInsets.only(right: 8.w, top: 8.h, bottom: 8.h),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.white,
|
|
|
- borderRadius: BorderRadius.circular(22.r),
|
|
|
- ),
|
|
|
- child: Text(
|
|
|
- StringName.intimacyAnalyseSwitchTaTest,
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black80,
|
|
|
- fontSize: 12.sp,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
+ SizedBox(width: 5.w),
|
|
|
+ GradientText(
|
|
|
+ // 渐变颜色
|
|
|
+ colors: [
|
|
|
+ ColorName.intimacyRelationColor1,
|
|
|
+ ColorName.intimacyRelationColor2,
|
|
|
+ ],
|
|
|
+ child: Text(
|
|
|
+ StringName.intimacyRelation,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 11.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ // 切换按钮
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.switchTaTest();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 9.w, vertical: 6.h),
|
|
|
+ margin: EdgeInsets.only(right: 8.w, top: 8.h, bottom: 8.h),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ borderRadius: BorderRadius.circular(22.r),
|
|
|
+ ),
|
|
|
+ child: Text(
|
|
|
+ StringName.intimacyAnalyseSwitchTaTest,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/// 底部操作按钮
|
|
|
@@ -601,7 +634,7 @@ class IntimacyAnalyseUploadPage
|
|
|
return SizedBox();
|
|
|
} else {
|
|
|
// 生成完成,判断是否已解锁
|
|
|
- bool isUnlock = controller.userInfo.value?.isMember ?? false;
|
|
|
+ bool isUnlock = controller.memberInfo.value?.isMember ?? false;
|
|
|
if (!isUnlock) {
|
|
|
// 未解锁,显示立即分析按钮
|
|
|
return Container(
|
|
|
@@ -696,7 +729,7 @@ class IntimacyAnalyseUploadPage
|
|
|
return Container(
|
|
|
padding: EdgeInsets.only(top: 13.h, bottom: 13.h),
|
|
|
child: GradientTextBtn.withUnlock(
|
|
|
- controller.userInfo.value?.isMember ?? false,
|
|
|
+ controller.memberInfo.value?.isMember ?? false,
|
|
|
text: StringName.nextStep,
|
|
|
color: ColorName.colorBrand,
|
|
|
onPressed: () {
|
|
|
@@ -713,7 +746,7 @@ class IntimacyAnalyseUploadPage
|
|
|
return Container(
|
|
|
padding: EdgeInsets.only(top: 7.h, bottom: 6.h),
|
|
|
child: GradientTextBtn.withUnlock(
|
|
|
- controller.userInfo.value?.isMember ?? false,
|
|
|
+ controller.memberInfo.value?.isMember ?? false,
|
|
|
text: StringName.intimacyAnalyseAnalysisNow,
|
|
|
color: ColorName.colorBrand,
|
|
|
desc: StringName.intimacyAnalyseAnalysisUseAiTip,
|
|
|
@@ -730,7 +763,7 @@ class IntimacyAnalyseUploadPage
|
|
|
/// 构建卡片列表
|
|
|
Widget _buildCardList() {
|
|
|
// 是否已解锁
|
|
|
- bool isUnlock = controller.userInfo.value?.isMember ?? false;
|
|
|
+ bool isUnlock = controller.memberInfo.value?.isMember ?? false;
|
|
|
return Obx(() {
|
|
|
// 上传页
|
|
|
if (controller.isUploadPage.value) {
|