Browse Source

优化好友接口对接和跳转

master
王子贤 3 months ago
parent
commit
42b897bd39
2 changed files with 35 additions and 30 deletions
  1. 48
      lib/model/mine/friend_apply_data.dart
  2. 17
      lib/pages/mine/my_friend_page.dart

48
lib/model/mine/friend_apply_data.dart

@ -36,12 +36,12 @@ class FriendApplyData {
class Records { class Records {
String? id; String? id;
String? toUserId;
String? toMiId;
int? toUId;
String? toNickName;
String? toProfilePhoto;
int? toGenderCode;
String? fromUserId;
String? fromMiId;
int? fromUId;
String? fromNickName;
String? fromProfilePhoto;
int? fromGenderCode;
Null? applyMsg; Null? applyMsg;
int? status; int? status;
String? birthYear; String? birthYear;
@ -54,12 +54,12 @@ class Records {
Records( Records(
{this.id, {this.id,
this.toUserId,
this.toMiId,
this.toUId,
this.toNickName,
this.toProfilePhoto,
this.toGenderCode,
this.fromUserId,
this.fromMiId,
this.fromUId,
this.fromNickName,
this.fromProfilePhoto,
this.fromGenderCode,
this.applyMsg, this.applyMsg,
this.status, this.status,
this.birthYear, this.birthYear,
@ -72,12 +72,12 @@ class Records {
Records.fromJson(Map<String, dynamic> json) { Records.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
toUserId = json['toUserId'];
toMiId = json['toMiId'];
toUId = json['toUId'];
toNickName = json['toNickName'];
toProfilePhoto = json['toProfilePhoto'];
toGenderCode = json['toGenderCode'];
fromUserId = json['fromUserId'];
fromMiId = json['fromMiId'];
fromUId = json['fromUId'];
fromNickName = json['fromNickName'];
fromProfilePhoto = json['fromProfilePhoto'];
fromGenderCode = json['fromGenderCode'];
applyMsg = json['applyMsg']; applyMsg = json['applyMsg'];
status = json['status']; status = json['status'];
birthYear = json['birthYear']; birthYear = json['birthYear'];
@ -92,12 +92,12 @@ class Records {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['id'] = this.id;
data['toUserId'] = this.toUserId;
data['toMiId'] = this.toMiId;
data['toUId'] = this.toUId;
data['toNickName'] = this.toNickName;
data['toProfilePhoto'] = this.toProfilePhoto;
data['toGenderCode'] = this.toGenderCode;
data['fromUserId'] = this.fromUserId;
data['fromMiId'] = this.fromMiId;
data['fromUId'] = this.fromUId;
data['fromNickName'] = this.fromNickName;
data['fromProfilePhoto'] = this.fromProfilePhoto;
data['fromGenderCode'] = this.fromGenderCode;
data['applyMsg'] = this.applyMsg; data['applyMsg'] = this.applyMsg;
data['status'] = this.status; data['status'] = this.status;
data['birthYear'] = this.birthYear; data['birthYear'] = this.birthYear;

17
lib/pages/mine/my_friend_page.dart

@ -4,6 +4,7 @@ import 'package:dating_touchme_app/controller/mine/my_friend_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/mine/friend_data.dart'; import 'package:dating_touchme_app/model/mine/friend_data.dart';
import 'package:dating_touchme_app/pages/home/user_information_page.dart';
import 'package:easy_refresh/easy_refresh.dart'; import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -283,7 +284,9 @@ class _UserItemState extends State<UserItem> {
) )
], ],
), ),
);
).onTap((){
Get.to(() => UserInformationPage(miId: widget.item.miId ?? "", userId: widget.item.userId ?? ""));
});
} }
} }
@ -311,7 +314,7 @@ class _AddUserItemState extends State<AddUserItem> {
ClipRRect( ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(45.w)), borderRadius: BorderRadius.all(Radius.circular(45.w)),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: "${widget.item.toProfilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_170",
imageUrl: "${widget.item.fromProfilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_170",
width: 45.w, width: 45.w,
height: 45.w, height: 45.w,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -324,7 +327,7 @@ class _AddUserItemState extends State<AddUserItem> {
Row( Row(
children: [ children: [
Text( Text(
"${widget.item.toNickName}",
"${widget.item.fromNickName}",
style: TextStyle( style: TextStyle(
fontSize: 14.w, fontSize: 14.w,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
@ -336,11 +339,11 @@ class _AddUserItemState extends State<AddUserItem> {
height: 12.w, height: 12.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12.w)), borderRadius: BorderRadius.all(Radius.circular(12.w)),
color: widget.item.toGenderCode == 0 ? const Color.fromRGBO(237, 245, 255, 1) : const Color.fromRGBO(255, 237, 255, 1)
color: widget.item.fromGenderCode == 0 ? const Color.fromRGBO(237, 245, 255, 1) : const Color.fromRGBO(255, 237, 255, 1)
), ),
child: Center( child: Center(
child: Image.asset( child: Image.asset(
widget.item.toGenderCode == 0 ? Assets.imagesMale : Assets.imagesFemale,
widget.item.fromGenderCode == 0 ? Assets.imagesMale : Assets.imagesFemale,
width: 7.w, width: 7.w,
), ),
), ),
@ -449,6 +452,8 @@ class _AddUserItemState extends State<AddUserItem> {
}) })
], ],
), ),
);
).onTap((){
Get.to(() => UserInformationPage(miId: widget.item.fromMiId ?? "", userId: widget.item.fromUserId ?? ""));
});
} }
} }
Loading…
Cancel
Save