|
|
@@ -80,6 +80,9 @@ class IntimacyAnalyseReportView
|
|
|
/// 亲密档案
|
|
|
Widget _buildIntimacyArchives() {
|
|
|
return Obx(() {
|
|
|
+ // 是否要显示添加档案的布局
|
|
|
+ bool isNeedShowAddProfileLayout = !controller.isLogin || controller.currentKeyboardInfo.value == null;
|
|
|
+
|
|
|
// 当前用户的头像
|
|
|
String myAvatarUrl = controller.userInfo.value?.imageUrl ?? "";
|
|
|
// 对方用户的头像
|
|
|
@@ -90,23 +93,108 @@ class IntimacyAnalyseReportView
|
|
|
GenderType? taGender = GenderType.fromType(
|
|
|
controller.currentKeyboardInfo.value?.gender,
|
|
|
);
|
|
|
- return IntimacyUserWidget(
|
|
|
- width: 200.w,
|
|
|
- height: 100.h,
|
|
|
- avatarSize: 96.0,
|
|
|
- myAvatar: myAvatarUrl,
|
|
|
- taAvatar: taAvatarUrl,
|
|
|
- myGender: myGender,
|
|
|
- taGender: taGender,
|
|
|
- avatarBorderWidth: 3.0,
|
|
|
- loveSize: 42.w,
|
|
|
+
|
|
|
+ double layoutWidth = 185.w;
|
|
|
+ return Stack(
|
|
|
+ children: [
|
|
|
+ IntimacyUserWidget(
|
|
|
+ width: layoutWidth,
|
|
|
+ height: 100.h,
|
|
|
+ avatarSize: 96.0,
|
|
|
+ myAvatar: myAvatarUrl,
|
|
|
+ taAvatar: taAvatarUrl,
|
|
|
+ myGender: myGender,
|
|
|
+ taGender: taGender,
|
|
|
+ avatarBorderWidth: 3.0,
|
|
|
+ loveSize: 42.w,
|
|
|
+ ),
|
|
|
+ isNeedShowAddProfileLayout
|
|
|
+ ? SizedBox(
|
|
|
+ width: layoutWidth,
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ children: [
|
|
|
+ // 自己
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w, top: 83.h),
|
|
|
+ child: _buildUserNameLabel(StringName.mySelf),
|
|
|
+ ),
|
|
|
+ // 添加
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(right: 12.w, top: 83.h),
|
|
|
+ child: _buildAddProfileLabel(
|
|
|
+ StringName.intimacyAnalyseAdd,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ): SizedBox.shrink(),
|
|
|
+ ],
|
|
|
);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /// 用户名称标签
|
|
|
+ Widget _buildUserNameLabel(String name) {
|
|
|
+ return Container(
|
|
|
+ padding: EdgeInsets.only(left: 22.w, right: 22.w, top: 3.h, bottom: 8.h),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: Assets.images.bgIntimacyAnalyseUserName.provider(),
|
|
|
+ fit: BoxFit.fill,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Text(
|
|
|
+ name,
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black80,
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 添加档案的按钮
|
|
|
+ Widget _buildAddProfileLabel(String name) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.jump2ProfilePage();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.only(
|
|
|
+ left: 22.w,
|
|
|
+ right: 22.w,
|
|
|
+ top: 3.h,
|
|
|
+ bottom: 8.h,
|
|
|
+ ),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: Assets.images.bgIntimacyAnalyseUserName.provider(),
|
|
|
+ fit: BoxFit.fill,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Text(
|
|
|
+ name,
|
|
|
+ style: TextStyle(
|
|
|
+ color: const Color(0xFF8651FF),
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
/// 亲密档案切换布局
|
|
|
Widget _buildIntimacyArchivesSwitchLayout() {
|
|
|
return Obx(() {
|
|
|
+ // 未登录,不显示
|
|
|
+ if (!controller.isLogin) {
|
|
|
+ return SizedBox.shrink();
|
|
|
+ }
|
|
|
+ String taName = controller.currentKeyboardInfo.value?.name ?? "";
|
|
|
return GestureDetector(
|
|
|
onTap: () {
|
|
|
controller.clickIntimacyArchivesSwitch();
|
|
|
@@ -116,7 +204,7 @@ class IntimacyAnalyseReportView
|
|
|
children: [
|
|
|
Text(
|
|
|
// 自己&对方的名称
|
|
|
- "${StringName.mySelf}${StringName.andSymbol}${controller.currentKeyboardInfo.value?.name ?? ""}",
|
|
|
+ "${StringName.mySelf}${StringName.andSymbol}$taName",
|
|
|
style: TextStyle(
|
|
|
color: ColorName.black80,
|
|
|
fontSize: 13.sp,
|