diff --git a/assets/images/no_more_timeline.png b/assets/images/no_more_timeline.png new file mode 100644 index 0000000..32e96f7 Binary files /dev/null and b/assets/images/no_more_timeline.png differ diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 7298eb2..6ef31cd 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -162,6 +162,7 @@ class Assets { static const String imagesMore = 'assets/images/more.png'; static const String imagesMoreIcon = 'assets/images/more_icon.png'; static const String imagesMyWalletBg = 'assets/images/my_wallet_bg.png'; + static const String imagesNoMoreTimeline = 'assets/images/no_more_timeline.png'; static const String imagesOnlineIcon = 'assets/images/online_icon.png'; static const String imagesOnlineMsgIcon = 'assets/images/online_msg_icon.png'; static const String imagesPhoneChecked = 'assets/images/phone_checked.png'; diff --git a/lib/pages/home/real_home_timeline_item.dart b/lib/pages/home/real_home_timeline_item.dart index 6c5b01a..8e44056 100644 --- a/lib/pages/home/real_home_timeline_item.dart +++ b/lib/pages/home/real_home_timeline_item.dart @@ -1,7 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dating_touchme_app/config/emoji_config.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/post_data.dart'; +import 'package:dating_touchme_app/pages/home/timeline_info.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -204,10 +206,11 @@ class _RealHomeTimelineItemState extends State { children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(23.w)), - child: Image.asset( - Assets.imagesUserAvatar, + child: CachedNetworkImage( + imageUrl: widget.item.profilePhoto ?? "", width: 23.w, height: 23.w, + fit: BoxFit.cover, ), ), SizedBox(width: 3.w,), @@ -230,20 +233,22 @@ class _RealHomeTimelineItemState extends State { Row( children: [ Image.asset( - (false) ? Assets.imagesLikeActive : Assets.imagesLikeIcon, + (widget.item.isLiked ?? false) ? Assets.imagesLikeActive : Assets.imagesLikeIcon, width: 14.w, height: 12.w, ), SizedBox(width: 6.w,), Text( - "${23}", + "${widget.item.likeCount ?? 0}", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(144, 144, 144, .6) ), ) ], - ) + ).onTap((){ + likePost(); + }) ], ) ], @@ -251,7 +256,16 @@ class _RealHomeTimelineItemState extends State { ) ], ), - ), + ).onTap((){ + Get.to(() => TimelineInfo(id: widget.item.id ?? "",))?.then((e){ + widget.item.likeCount = e.likeCount; + widget.item.isLiked = e.isLiked; + widget.item.commentCount = e.commentCount; + setState(() { + + }); + }); + }), ); } } diff --git a/lib/pages/home/test_page.dart b/lib/pages/home/test_page.dart index 640f790..c78f6c2 100644 --- a/lib/pages/home/test_page.dart +++ b/lib/pages/home/test_page.dart @@ -32,7 +32,7 @@ class TestPage extends StatelessWidget { vertical: 40.w, horizontal: 12.w ), - child: Column( + child: controller.testData.value.id != null ? Column( children: [ if(controller.resultTitle.value == "") ...[ Container( @@ -255,7 +255,7 @@ class TestPage extends StatelessWidget { }) ] ], - ), + ) : Container(), ); }, ), diff --git a/lib/pages/home/timeline_trend.dart b/lib/pages/home/timeline_trend.dart index a509961..539578c 100644 --- a/lib/pages/home/timeline_trend.dart +++ b/lib/pages/home/timeline_trend.dart @@ -119,7 +119,7 @@ class _TrendItemState extends State { widgets.add( Text( textPart, - style: TextStyle(fontSize: 14.sp, color: Colors.black), + style: TextStyle(fontSize: 11.w, color: Colors.black), ), ); } @@ -134,8 +134,8 @@ class _TrendItemState extends State { padding: EdgeInsets.symmetric(horizontal: 0), child: Image.asset( emoji.path, - width: 24.w, - height: 24.w, + width: 18.w, + height: 18.w, fit: BoxFit.contain, ), ), @@ -152,7 +152,7 @@ class _TrendItemState extends State { widgets.add( Text( textPart, - style: TextStyle(fontSize: 14.sp, color: Colors.black), + style: TextStyle(fontSize: 11.sp, color: Colors.black), ), ); } @@ -183,14 +183,15 @@ class _TrendItemState extends State { Text( widget.item.nickName ?? "", style: TextStyle( - fontSize: 13.w, - fontWeight: FontWeight.w500 + fontSize: 12.w, + fontWeight: FontWeight.w500, + color: const Color.fromRGBO(144, 144, 144, 1) ), ), if(widget.item.operationType == 1)Text( "赞了你的动态", style: TextStyle( - fontSize: 11.w, + fontSize: 13.w, fontWeight: FontWeight.w500 ), ), @@ -199,15 +200,16 @@ class _TrendItemState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 11.w, + fontSize: 13.w, fontWeight: FontWeight.w500 ), ), + SizedBox(height: 15.w,), Text( widget.item.createTime ?? "", style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(51, 51, 51, .6), + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, .6), fontWeight: FontWeight.w500 ), ) @@ -221,12 +223,15 @@ class _TrendItemState extends State { padding: EdgeInsets.all(10.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.w)), - color: const Color.fromRGBO(0, 0, 0, .2) + color: const Color.fromRGBO(240, 240, 240, 1) ), child: !widget.item.content!.contains('[emoji:') ? Text( widget.item.content ?? "", overflow: TextOverflow.ellipsis, - maxLines: 3, + maxLines: 4, + style: TextStyle( + fontSize: 11.w + ), ) : ClipRect( child: Wrap( crossAxisAlignment: WrapCrossAlignment.center, diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 91bc1ca..3249b59 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -321,7 +321,12 @@ class UserInformationPage extends StatelessWidget { ), 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" : ""))}", + "${ + 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(120, 140, 255, 1) @@ -369,7 +374,7 @@ class UserInformationPage extends StatelessWidget { ), SizedBox(height: 8.w,), Text( - (miId == GlobalData().userData!.id && GlobalData().userData!.auditDescribeInfo != null && GlobalData().userData!.auditDescribeInfo != "") ? (GlobalData().userData!.auditDescribeInfo ?? "") : (controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。"), + (miId == GlobalData().userData!.id && GlobalData().userData!.auditDescribeInfo != null && GlobalData().userData!.auditDescribeInfo != "") ? (GlobalData().userData!.auditDescribeInfo ?? "") : (controller.userData.value.describeInfo ?? "好的生活方式,是和一群志同道合的人一起奔跑。"), style: TextStyle( fontSize: 14.w, color: const Color.fromRGBO(144, 144, 144, 1) @@ -431,12 +436,24 @@ class UserInformationPage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('暂无数据'), + Image.asset( + Assets.imagesNoMoreTimeline, + width: 90.w, + height: 112.w, + ), + SizedBox(height: 5.w,), + Text( + "暂无动态", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(186, 186, 186, 1) + ), + ) ], ), ) ], - if(controller.tab.value == 1 && controller.resultTitle.value != "") ...[ + if(controller.tab.value == 1) ...[ Stack( clipBehavior: Clip.none, children: [ @@ -466,7 +483,7 @@ class UserInformationPage extends StatelessWidget { right: -9.w, top: 35.w, child: Text( - "${controller.resultTitle.value ?? ""}", + "${controller.resultTitle.value != "" ? controller.resultTitle.value : "????"}", style: TextStyle( fontSize: 24.w, color: const Color.fromRGBO(117, 98, 249, 1), @@ -486,7 +503,7 @@ class UserInformationPage extends StatelessWidget { height: 52.w, ), Text( - "${controller.resultData.value["优势"][0]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][0] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -507,7 +524,7 @@ class UserInformationPage extends StatelessWidget { height: 52.w, ), Text( - "${controller.resultData.value["优势"][1]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][1] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -528,7 +545,7 @@ class UserInformationPage extends StatelessWidget { height: 52.w, ), Text( - "${controller.resultData.value["优势"][2]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][2] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -549,7 +566,7 @@ class UserInformationPage extends StatelessWidget { height: 52.w, ), Text( - "${controller.resultData.value["优势"][3]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][3] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -561,14 +578,6 @@ class UserInformationPage extends StatelessWidget { ], ) ], - if(controller.tab.value == 1 && controller.resultTitle.value == "") ...[ - Text( - "暂无数据", - style: TextStyle( - fontSize: 16.w - ), - ) - ] ], ); } diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index 60e19ed..d4c3d76 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -744,7 +744,7 @@ class _EditInfoPageState extends State { // SetItem(label: "公司", showRequired: false,), - InkWell( + if(false) InkWell( onTap: () { TDPicker.showMultiPicker(context, title: '', onConfirm: (selected) { diff --git a/lib/pages/mine/mine_page.dart b/lib/pages/mine/mine_page.dart index 9ff03f6..bb7c1fa 100644 --- a/lib/pages/mine/mine_page.dart +++ b/lib/pages/mine/mine_page.dart @@ -228,7 +228,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ // width: 44.w, // height: 16.w, // ) - Container( + if(false) Container( width: 32.w, height: 16.w, decoration: BoxDecoration( @@ -248,7 +248,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ Text( "ID:${controller.userId.value ?? ""}", style: TextStyle( - fontSize: 10.w, + fontSize: 12.w, color: const Color.fromRGBO(51, 51, 51, 1), fontWeight: FontWeight.w500 ), @@ -285,7 +285,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ), ), SizedBox(height: 16.w,), - Container( + if(false)Container( height: 57.w, padding: EdgeInsets.only( top: 11.w, @@ -334,12 +334,24 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('暂无数据'), + Image.asset( + Assets.imagesNoMoreTimeline, + width: 90.w, + height: 112.w, + ), + SizedBox(height: 5.w,), + Text( + "暂无动态", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(186, 186, 186, 1) + ), + ) ], ), ) ], - if(controller.tab.value == 1 && controller.resultTitle.value != "") ...[ + if(controller.tab.value == 1) ...[ Stack( clipBehavior: Clip.none, children: [ @@ -369,7 +381,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ right: 2.w, top: 35.w, child: Text( - "${controller.resultTitle.value ?? ""}", + "${controller.resultTitle.value != "" ? controller.resultTitle.value : "????"}", style: TextStyle( fontSize: 24.w, color: const Color.fromRGBO(117, 98, 249, 1), @@ -389,7 +401,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ height: 52.w, ), Text( - "${controller.resultData.value["优势"][0]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][0] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -410,7 +422,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ height: 52.w, ), Text( - "${controller.resultData.value["优势"][1]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][1] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -431,7 +443,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ height: 52.w, ), Text( - "${controller.resultData.value["优势"][2]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][2] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -452,7 +464,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ height: 52.w, ), Text( - "${controller.resultData.value["优势"][3]}", + "${controller.resultTitle.value != "" ? controller.resultData.value["优势"][3] : "???"}", style: TextStyle( fontSize: 14.w, color: Colors.white @@ -464,14 +476,6 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ], ) ], - if(controller.tab.value == 1 && controller.resultTitle.value == "") ...[ - Text( - "暂无数据", - style: TextStyle( - fontSize: 16.w - ), - ) - ] ], ); }