Browse Source

对接动态接口

ios
王子贤 2 months ago
parent
commit
05c4b4e3e4
11 changed files with 780 additions and 262 deletions
  1. 67
      lib/controller/home/timeline_trend_controller.dart
  2. 91
      lib/model/home/trend_data.dart
  3. 3
      lib/network/api_urls.dart
  4. 7
      lib/network/home_api.dart
  5. 37
      lib/network/home_api.g.dart
  6. 24
      lib/pages/home/event_info.dart
  7. 12
      lib/pages/home/timeline_page.dart
  8. 243
      lib/pages/home/timeline_trend.dart
  9. 523
      lib/pages/home/user_information_page.dart
  10. 16
      lib/pages/mine/edit_info_page.dart
  11. 19
      lib/pages/mine/mine_page.dart

67
lib/controller/home/timeline_trend_controller.dart

@ -0,0 +1,67 @@
import 'package:dating_touchme_app/network/home_api.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import '../../model/home/trend_data.dart';
class TimelineTrendController extends GetxController {
final trendList = <Records>[].obs;
final page = 1.obs;
final size = 10.obs;
late final EasyRefreshController listRefreshController;
late final HomeApi _homeApi;
@override
void onInit() {
super.onInit();
listRefreshController = EasyRefreshController(
controlFinishRefresh: true,
controlFinishLoad: true,
);
// HomeApi
_homeApi = Get.find<HomeApi>();
getTrendData();
}
getTrendData() async {
try {
final response = await _homeApi.userPageOwnPostDynamic(
pageNum: page.value,
pageSize: size.value
);
if (response.data.isSuccess && response.data.data != null) {
final data = response.data.data?.records ?? [];
trendList.addAll(data);
if((data.length ?? 0) == size.value){
listRefreshController.finishLoad(IndicatorResult.success);
} else {
listRefreshController.finishLoad(IndicatorResult.noMore);
}
} else {
//
throw Exception(response.data.message ?? '获取数据失败');
}
} catch(e){
print('详情获取失败: $e');
SmartDialog.showToast('动态失败');
rethrow;
}
}
}

91
lib/model/home/trend_data.dart

@ -0,0 +1,91 @@
class TrendData {
List<Records>? records;
int? total;
int? size;
int? current;
int? pages;
TrendData({this.records, this.total, this.size, this.current, this.pages});
TrendData.fromJson(Map<String, dynamic> json) {
if (json['records'] != null) {
records = <Records>[];
json['records'].forEach((v) {
records!.add(new Records.fromJson(v));
});
}
total = json['total'];
size = json['size'];
current = json['current'];
pages = json['pages'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.records != null) {
data['records'] = this.records!.map((v) => v.toJson()).toList();
}
data['total'] = this.total;
data['size'] = this.size;
data['current'] = this.current;
data['pages'] = this.pages;
return data;
}
}
class Records {
String? postId;
int? operationType;
String? postCommentContent;
String? userId;
String? miId;
String? nickName;
String? profilePhoto;
String? content;
String? mediaUrls;
String? topicTags;
String? createTime;
Records(
{this.postId,
this.operationType,
this.postCommentContent,
this.userId,
this.miId,
this.nickName,
this.profilePhoto,
this.content,
this.mediaUrls,
this.topicTags,
this.createTime});
Records.fromJson(Map<String, dynamic> json) {
postId = json['postId'];
operationType = json['operationType'];
postCommentContent = json['postCommentContent'];
userId = json['userId'];
miId = json['miId'];
nickName = json['nickName'];
profilePhoto = json['profilePhoto'];
content = json['content'];
mediaUrls = json['mediaUrls'];
topicTags = json['topicTags'];
createTime = json['createTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['postId'] = this.postId;
data['operationType'] = this.operationType;
data['postCommentContent'] = this.postCommentContent;
data['userId'] = this.userId;
data['miId'] = this.miId;
data['nickName'] = this.nickName;
data['profilePhoto'] = this.profilePhoto;
data['content'] = this.content;
data['mediaUrls'] = this.mediaUrls;
data['topicTags'] = this.topicTags;
data['createTime'] = this.createTime;
return data;
}
}

3
lib/network/api_urls.dart

@ -137,6 +137,9 @@ class ApiUrls {
static const String userPageAuthorPost =
'dating-agency-service/user/page/author-post';
static const String userPageOwnPostDynamic =
'dating-agency-service/user/page/own-post-dynamic';
// API端点
static const String listMatchmakerProduct =
'dating-agency-mall/user/page/product/by/matchmaker';

7
lib/network/home_api.dart

@ -2,6 +2,7 @@ import 'package:dating_touchme_app/model/home/event_data.dart';
import 'package:dating_touchme_app/model/home/event_list_data.dart' hide Records;
import 'package:dating_touchme_app/model/home/post_comment_data.dart' hide Records;
import 'package:dating_touchme_app/model/home/post_data.dart';
import 'package:dating_touchme_app/model/home/trend_data.dart' hide Records;
import 'package:dating_touchme_app/network/api_urls.dart';
import 'package:dating_touchme_app/network/response_model.dart';
import 'package:retrofit/retrofit.dart';
@ -74,4 +75,10 @@ abstract class HomeApi {
Future<HttpResponse<BaseResponse<EventData>>> userGetSiteActivityDetails({
@Query('id') required String id,
});
@GET(ApiUrls.userPageOwnPostDynamic)
Future<HttpResponse<BaseResponse<TrendData>>> userPageOwnPostDynamic({
@Query('pageNum') required int pageNum,
@Query('pageSize') required int pageSize,
});
}

37
lib/network/home_api.g.dart

@ -385,6 +385,43 @@ class _HomeApi implements HomeApi {
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<TrendData>>> userPageOwnPostDynamic({
required int pageNum,
required int pageSize,
}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{
r'pageNum': pageNum,
r'pageSize': pageSize,
};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<HttpResponse<BaseResponse<TrendData>>>(
Options(method: 'GET', headers: _headers, extra: _extra)
.compose(
_dio.options,
'dating-agency-service/user/page/own-post-dynamic',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late BaseResponse<TrendData> _value;
try {
_value = BaseResponse<TrendData>.fromJson(
_result.data!,
(json) => TrendData.fromJson(json as Map<String, dynamic>),
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||

24
lib/pages/home/event_info.dart

@ -281,6 +281,30 @@ class EventInfo extends StatelessWidget {
),
),
),
bottomNavigationBar: Container(
height: 60.w,
color: Colors.white,
child: Center(
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
color: Colors.grey,
),
child: Center(
child: Text(
"活动已结束",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
),
),
) : Container();
},
);

12
lib/pages/home/timeline_page.dart

@ -3,6 +3,7 @@ import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/pages/home/recommend_window.dart';
import 'package:dating_touchme_app/pages/home/send_timeline.dart';
import 'package:dating_touchme_app/pages/home/timeline_trend.dart';
import 'package:dating_touchme_app/pages/home/timeline_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -99,6 +100,17 @@ class _TimelinePageState extends State<TimelinePage>
preferredSize: Size.fromHeight(4),
child: SizedBox(height: 4),
),
actions: [
Container(
margin: EdgeInsets.only(right: 15),
child: Icon(
Icons.email_outlined,
size: 19,
),
).onTap((){
Get.to(() => TimelineTrend());
})
],
);
}

243
lib/pages/home/timeline_trend.dart

@ -0,0 +1,243 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/config/emoji_config.dart';
import 'package:dating_touchme_app/controller/home/timeline_trend_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/home/trend_data.dart';
import 'package:dating_touchme_app/pages/home/timeline_info.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class TimelineTrend extends StatelessWidget {
const TimelineTrend({super.key});
@override
Widget build(BuildContext context) {
return GetX<TimelineTrendController>(
init: TimelineTrendController(),
builder: (controller){
return Scaffold(
appBar: PageAppbar(title: "互动通知"),
body: EasyRefresh(
header: const ClassicHeader(
dragText: '下拉刷新',
armedText: '释放刷新',
readyText: '刷新中...',
processingText: '刷新中...',
processedText: '刷新完成',
failedText: '刷新失败',
noMoreText: '没有更多数据',
showMessage: false
),
footer: ClassicFooter(
dragText: '上拉加载',
armedText: '释放加载',
readyText: '加载中...',
processingText: '加载中...',
processedText: '加载完成',
failedText: '加载失败',
noMoreText: '没有更多数据',
showMessage: false
),
//
onRefresh: () async {
print('推荐列表下拉刷新被触发');
controller.page.value = 1;
controller.trendList.clear();
await controller.getTrendData();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
},
//
onLoad: () async {
print('推荐列表上拉加载被触发, hasMore: ');
controller.page.value += 1;
controller.getTrendData();
},
child: ListView.separated(
// 使
// padding AppBar
padding: EdgeInsets.only(left: 12, right: 12),
itemBuilder: (context, index){
if (controller.trendList.isEmpty) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('暂无数据'),
],
),
);
}
return TrendItem(item: controller.trendList[index]);
},
separatorBuilder: (context, index) {
//
// if (controller.postList.isEmpty) {
// return const SizedBox.shrink();
// }
return const SizedBox(height: 12);
},
itemCount: controller.trendList.isEmpty ? 1 : controller.trendList.length,
),
),
);
},
);
}
}
class TrendItem extends StatefulWidget {
final Records item;
const TrendItem({super.key, required this.item});
@override
State<TrendItem> createState() => _TrendItemState();
}
class _TrendItemState extends State<TrendItem> {
/// +
List<Widget> buildInputContentWidgets() {
final List<Widget> widgets = [];
final text = widget.item.content ?? "";
final RegExp emojiRegex = RegExp(r'\[emoji:(\d+)\]');
int lastMatchEnd = 0;
final matches = emojiRegex.allMatches(text);
for (final match in matches) {
//
if (match.start > lastMatchEnd) {
final textPart = text.substring(lastMatchEnd, match.start);
widgets.add(
Text(
textPart,
style: TextStyle(fontSize: 14.sp, color: Colors.black),
),
);
}
//
final emojiId = match.group(1);
if (emojiId != null) {
final emoji = EmojiConfig.getEmojiById(emojiId);
if (emoji != null) {
widgets.add(
Padding(
padding: EdgeInsets.symmetric(horizontal: 0),
child: Image.asset(
emoji.path,
width: 24.w,
height: 24.w,
fit: BoxFit.contain,
),
),
);
}
}
lastMatchEnd = match.end;
}
//
if (lastMatchEnd < text.length) {
final textPart = text.substring(lastMatchEnd);
widgets.add(
Text(
textPart,
style: TextStyle(fontSize: 14.sp, color: Colors.black),
),
);
}
return widgets;
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(40.w)),
child: CachedNetworkImage(
imageUrl: widget.item.profilePhoto ?? "",
width: 40.w,
height: 40.w,
fit: BoxFit.cover,
),
),
SizedBox(width: 15.w,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.item.nickName ?? "",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
),
),
if(widget.item.operationType == 1)Text(
"赞了你的动态",
style: TextStyle(
fontSize: 11.w,
fontWeight: FontWeight.w500
),
),
if(widget.item.operationType == 2)Text(
widget.item.postCommentContent ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11.w,
fontWeight: FontWeight.w500
),
),
Text(
widget.item.createTime ?? "",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(51, 51, 51, .6),
fontWeight: FontWeight.w500
),
)
],
)
],
),
Container(
width: 80.w,
height: 80.w,
padding: EdgeInsets.all(10.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8.w)),
color: const Color.fromRGBO(0, 0, 0, .2)
),
child: !widget.item.content!.contains('[emoji:') ? Text(
widget.item.content ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 3,
) : ClipRect(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: buildInputContentWidgets(),
),
),
)
],
).onTap((){
Get.to(() => TimelineInfo(id: widget.item.postId ?? ""));
});
}
}

523
lib/pages/home/user_information_page.dart

@ -1,11 +1,13 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/controller/global.dart';
import 'package:dating_touchme_app/controller/home/user_information_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/home/marriage_data.dart';
import 'package:dating_touchme_app/pages/home/report_page.dart';
import 'package:dating_touchme_app/pages/home/timeline_item.dart';
import 'package:dating_touchme_app/pages/message/chat_page.dart';
import 'package:dating_touchme_app/pages/mine/edit_info_page.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -99,9 +101,9 @@ class UserInformationPage extends StatelessWidget {
fit: BoxFit.cover,
),
Positioned(
left: 15.w,
left: 120.w,
top: 310.w,
width: 345.w,
width: 240.w,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
@ -180,259 +182,273 @@ class UserInformationPage extends StatelessWidget {
controller.page.value += 1;
await controller.getPostList();
},
child: SingleChildScrollView(
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
padding: EdgeInsets.only(top: 361.w),
child: Container(
width: 375.w,
padding: EdgeInsets.only(
top: 31.w,
left: 15.w,
right: 24.w
),
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(23.w)
),
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
controller.userData.value.nickName ?? "",
style: TextStyle(
fontSize: 22.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w600
child: DraggableScrollableSheet(
initialChildSize: 0.57, //
minChildSize: 0.57, //
maxChildSize: 1,
builder: (context, scrollController) {
return SingleChildScrollView(
clipBehavior: Clip.none,
controller: scrollController,
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 375.w,
padding: EdgeInsets.only(
top: 31.w,
left: 15.w,
right: 24.w
),
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(23.w)
),
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
controller.userData.value.nickName ?? "",
style: TextStyle(
fontSize: 22.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w600
),
),
),
SizedBox(width: 13.w,),
if(controller.myUserData.value?.genderCode == 0) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(255, 237, 255, 1)
SizedBox(width: 13.w,),
if(controller.myUserData.value?.genderCode == 0) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(255, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesFemale,
width: 8.w,
height: 8.w,
),
SizedBox(width: 2.w,),
Text(
"${
controller.calculateAge(
(controller.userData.value.birthDate != null && controller.userData.value.birthDate!.isNotEmpty) ?
(controller.userData.value.birthDate ?? "") : controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ?
"${controller.userData.value.birthYear}-01-01" : "")
}",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(255, 66, 236, 1)
),
)
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesFemale,
width: 8.w,
height: 8.w,
),
SizedBox(width: 2.w,),
Text(
"${
controller.calculateAge(
(controller.userData.value.birthDate != null && controller.userData.value.birthDate!.isNotEmpty) ?
(controller.userData.value.birthDate ?? "") : controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ?
"${controller.userData.value.birthYear}-01-01" : "")
}",
SizedBox(width: 3.w,),
Container(
width: 33.w,
height: 13.w,
margin: EdgeInsets.only(right: 2.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(234, 255, 219, 1)
),
child: Center(
child: Text(
"在线",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(255, 66, 236, 1)
color: const Color.fromRGBO(38, 199, 124, 1)
),
)
],
),
),
SizedBox(width: 3.w,),
Container(
width: 33.w,
height: 13.w,
margin: EdgeInsets.only(right: 2.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(234, 255, 219, 1)
),
child: Center(
child: Text(
"在线",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(38, 199, 124, 1)
),
),
),
),
SizedBox(width: 4.w,),
if (controller.userData.value.identityCard != "" && controller.userData.value.identityCard != null) Container(
width: 43.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(246, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesRealName,
width: 8.w,
height: 7.w,
),
SizedBox(width: 2.w,),
Text(
"实名",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(160, 92, 255, 1)
SizedBox(width: 4.w,),
if (controller.userData.value.identityCard != "" && controller.userData.value.identityCard != null) Container(
width: 43.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(246, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesRealName,
width: 8.w,
height: 7.w,
),
)
],
),
),
SizedBox(width: 4.w,),
if(controller.myUserData.value?.genderCode == 1) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(237, 245, 255, 1)
SizedBox(width: 2.w,),
Text(
"实名",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(160, 92, 255, 1)
),
)
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesMale,
width: 8.w,
height: 8.w,
),
SizedBox(width: 2.w,),
Text(
"${controller.calculateAge(controller.userData.value.birthDate ?? (controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? "${controller.userData.value.birthYear}-01-01" : ""))}",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(120, 140, 255, 1)
SizedBox(width: 4.w,),
if(controller.myUserData.value?.genderCode == 1) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(237, 245, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesMale,
width: 8.w,
height: 8.w,
),
)
],
SizedBox(width: 2.w,),
Text(
"${controller.calculateAge(controller.userData.value.birthDate ?? (controller.userData.value.birthYear != null && controller.userData.value.birthYear!.isNotEmpty ? "${controller.userData.value.birthYear}-01-01" : ""))}",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(120, 140, 255, 1)
),
)
],
),
),
),
],
],
),
//
// Container(
// width: 63.w,
// height: 27.w,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(Radius.circular(27.w)),
// color: const Color.fromRGBO(117, 98, 249, .1)
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// Assets.imagesPlayer,
// width: 15.w,
// height: 15.w,
// ),
// SizedBox(width: 4.w,),
// Image.asset(
// Assets.imagesVoice,
// width: 15.w,
// height: 13.w,
// ),
// SizedBox(width: 4.w,),
// Text(
// "6'",
// style: TextStyle(
// fontSize: 11.w,
// color: const Color.fromRGBO(117, 98, 249, 1)
// ),
// )
// ],
// ),
// )
],
),
SizedBox(height: 8.w,),
Text(
controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。",
style: TextStyle(
fontSize: 14.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
//
// Container(
// width: 63.w,
// height: 27.w,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(Radius.circular(27.w)),
// color: const Color.fromRGBO(117, 98, 249, .1)
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// Assets.imagesPlayer,
// width: 15.w,
// height: 15.w,
// ),
// SizedBox(width: 4.w,),
// Image.asset(
// Assets.imagesVoice,
// width: 15.w,
// height: 13.w,
// ),
// SizedBox(width: 4.w,),
// Text(
// "6'",
// style: TextStyle(
// fontSize: 11.w,
// color: const Color.fromRGBO(117, 98, 249, 1)
// ),
// )
// ],
// ),
// )
],
),
SizedBox(height: 8.w,),
Text(
controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。",
style: TextStyle(
fontSize: 14.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
SizedBox(height: 11.w,),
Wrap(
spacing: 12.w,
runSpacing: 12.w,
children: [
...controller.tagList.map((e){
return TagItem(label: e);
}),
],
),
SizedBox(height: 16.w,),
if ((controller.userData.value.provinceName?.isNotEmpty ?? false)) Text(
"IP属地:${controller.userData.value.provinceName}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
SizedBox(height: 11.w,),
Wrap(
spacing: 12.w,
runSpacing: 12.w,
children: [
...controller.tagList.map((e){
return TagItem(label: e);
}),
],
),
),
Text(
"趣恋恋ID:${userId}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
SizedBox(height: 16.w,),
if ((controller.userData.value.provinceName?.isNotEmpty ?? false)) Text(
"IP属地:${controller.userData.value.provinceName}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
),
SizedBox(height: 10.w,),
if(controller.postList.isNotEmpty) Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"动态",
style: TextStyle(
fontSize: 18.w
),
)
],
),
SizedBox(height: 10.w,),
...controller.postList.map((e){
return TimelineItem(item: e);
})
],
),
),
),
Positioned(
left: 15.w,
top: 301.w,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(90.w)),
child: Container(
width: 90.w,
height: 90.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(90.w)),
border: Border.all(width: 3.w, color: Colors.white)
),
child: CachedNetworkImage(
imageUrl: "${controller.userData.value.profilePhoto}?x-oss-process=image/format,webp",
width: 84.w,
height: 84.w,
fit: BoxFit.cover,
Text(
"趣恋恋ID:${userId}",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Container(
height: 1,
color: const Color.fromRGBO(144, 144, 144, 1),
margin: EdgeInsets.symmetric(vertical: 15.w),
),
if(controller.postList.isNotEmpty) Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"动态",
style: TextStyle(
fontSize: 18.w
),
)
],
),
SizedBox(height: 10.w,),
...controller.postList.map((e){
return TimelineItem(item: e);
})
],
),
),
),
)
],
),
Positioned(
left: 15.w,
top: -60.w,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(90.w)),
child: Container(
width: 90.w,
height: 90.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(90.w)),
border: Border.all(width: 3.w, color: Colors.white)
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(84.w)),
child: CachedNetworkImage(
imageUrl: "${controller.userData.value.profilePhoto}?x-oss-process=image/format,webp",
width: 84.w,
height: 84.w,
fit: BoxFit.cover,
),
),
),
),
)
],
),
);
},
),
),
Positioned(
@ -465,7 +481,7 @@ class UserInformationPage extends StatelessWidget {
),
),
),
PopupMenuButton<String>(
if(miId != GlobalData().userData!.id) PopupMenuButton<String>(
tooltip: "",
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
@ -500,6 +516,37 @@ class UserInformationPage extends StatelessWidget {
),
), //
),
if(miId == GlobalData().userData!.id) Container(
height: 31.w,
padding: EdgeInsets.symmetric(horizontal: 10.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(62.w)),
color: const Color.fromRGBO(51, 51, 51, .5)
),
child: Row(
children: [
Image.asset(
Assets.imagesEdit,
width: 10.w,
height: 10.w,
color: Colors.white,
),
SizedBox(width: 4.w,),
Text(
"修改资料",
style: TextStyle(
fontSize: 12.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
],
),
).onTap((){
Get.to(() => EditInfoPage())?.then((e){
controller.getUserData();
});
})
],
),
),

16
lib/pages/mine/edit_info_page.dart

@ -226,21 +226,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
init: EditInfoController(),
builder: (controller) {
return Scaffold(
appBar: PageAppbar(title: "编辑资料", right: Container(
margin: EdgeInsets.only(right: 14.w),
child: InkWell(
onTap: (){
controller.goPreview();
},
child: Text(
"预览",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(144, 144, 144, 1),
),
),
),
),),
appBar: PageAppbar(title: "编辑资料"),
backgroundColor: const Color.fromRGBO(243, 243, 243, 1.0),
body: SingleChildScrollView(

19
lib/pages/mine/mine_page.dart

@ -4,6 +4,7 @@ import 'package:dating_touchme_app/controller/mine/mine_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/model/mine/user_count_data.dart';
import 'package:dating_touchme_app/network/user_api.dart';
import 'package:dating_touchme_app/pages/home/user_information_page.dart';
import 'package:dating_touchme_app/pages/mine/edit_info_page.dart';
import 'package:dating_touchme_app/pages/mine/my_friend_page.dart';
import 'package:dating_touchme_app/pages/mine/vip_page.dart';
@ -198,24 +199,24 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
),
InkWell(
onTap: (){
Get.to(() => EditInfoPage());
Get.to(() => UserInformationPage(miId: controller.userData.value?.id ?? "", userId: GlobalData().userId ?? ""));
},
child: Row(
children: [
Image.asset(
Assets.imagesEdit,
width: 10.w,
height: 10.w,
),
SizedBox(width: 4.w,),
Text(
"编辑资料",
"查看",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(55, 57, 72, 1),
fontWeight: FontWeight.w500
),
)
),
SizedBox(width: 4.w,),
Image.asset(
Assets.imagesArrow,
width: 10.w,
height: 10.w,
),
],
),
)

Loading…
Cancel
Save