From fb8e55630397e88ae0389856d708bd4835e9625a Mon Sep 17 00:00:00 2001 From: CYH <13923927013@163.com> Date: Fri, 15 Dec 2023 19:39:57 +0800 Subject: [PATCH] =?UTF-8?q?1.3.8=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circle_app/android/app/build.gradle | 4 +- circle_app/assets/images/msg/女.png | Bin 2768 -> 3404 bytes .../ios/Runner.xcodeproj/project.pbxproj | 6 +- .../tim_uikit_text_field.dart | 159 ++++ .../tim_uikit_text_field_layout/narrow.dart | 164 ++++ circle_app/lib/app/chat/view.dart | 2 +- .../lib/app/chat/widget/send_gift_dialog.dart | 62 +- .../lib/app/chat/widget/wish_dialog.dart | 19 +- circle_app/lib/app/circle/logic.dart | 23 +- .../lib/app/circle/widgets/discover.dart | 19 +- .../lib/app/circle/widgets/like_view.dart | 184 +++-- circle_app/lib/app/home/logic.dart | 5 + .../tim_uikit_conversation.dart | 778 ++++++++---------- circle_app/lib/app/swiper/view.dart | 39 +- circle_app/lib/app/userinfo/view.dart | 20 +- circle_app/lib/common/Widgets/genderview.dart | 4 +- .../common/Widgets/today_people_dialog.dart | 113 +-- circle_app/lib/util/util.dart | 75 ++ circle_app/pubspec.yaml | 2 +- 19 files changed, 1090 insertions(+), 588 deletions(-) diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index 0bbfc96..21e2297 100644 --- a/circle_app/android/app/build.gradle +++ b/circle_app/android/app/build.gradle @@ -71,8 +71,8 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion - versionCode 29 - versionName "1.3.7" + versionCode 30 + versionName "1.3.8" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/assets/images/msg/女.png b/circle_app/assets/images/msg/女.png index 97973d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LWrd3|OIsx{x z>?1FMgYmNBZ{?obu@sRUXv8kS<#s(x9x&?DBxsXt6aIE<3mMtq6t-^SKR%JWR_)#5 zfCLW2^8YZcsI;obb`R~n$e)kC5twWo-q+jg+mTSuK$GtSobJ?eRx3Qe=(&bJO#2_S WE9yxHS{*C^0000 { return imStatusOK; } + void _showReportDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.all(1.sp), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.sp), + child: Column( + children: [ + Center( + child: Text( + "是否解除拉黑", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + child: Image( + image: AssetImage(getMineImage("icon_dialog_black")), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "解除拉黑后,你将不屏蔽对方的任何信息", + textAlign: TextAlign.center, + style: TextStyle( + color: const Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: const Text( + "否", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 24.sp), + GestureDetector( + onTap: () async { + Get.back(); + var data = await DioManager.instance.post( + url: '${Api.setBlock + widget.conversationID.split('_').last}/block', params: {'status': '0'}); + var bean = BaseResponse.fromJson( + data, + (jsonData) => jsonData, + ); + if (bean.isSuccess()) { + final FriendshipServices _friendshipServices = + serviceLocator(); + isBlack = false; + } + showOKToast(bean.msg); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: const Text( + "是", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } + bool isSendLoging = false; onSubmitted() async { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index ccbb8a1..b556dbd 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -558,6 +558,7 @@ class _TIMTextFieldLayoutNarrowState onTap: () async { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } showKeyboard = showSendSoundText; @@ -768,6 +769,7 @@ class _TIMTextFieldLayoutNarrowState onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } getImageFile(); @@ -779,6 +781,7 @@ class _TIMTextFieldLayoutNarrowState onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } getTakeImageFile(); @@ -790,6 +793,7 @@ class _TIMTextFieldLayoutNarrowState onTap: () async { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } showGiftPannel(); @@ -803,6 +807,8 @@ class _TIMTextFieldLayoutNarrowState onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); + _showReportDialog(context); return; } getVideoFile(ImageSource.gallery); @@ -814,6 +820,7 @@ class _TIMTextFieldLayoutNarrowState onTap: () { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showReportDialog(context); return; } getVideoFile(ImageSource.camera); @@ -1333,6 +1340,163 @@ class _TIMTextFieldLayoutNarrowState // } } + void _showReportDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.all(1.sp), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.sp), + child: Column( + children: [ + Center( + child: Text( + "是否解除拉黑", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + child: Image( + image: AssetImage(getMineImage("icon_dialog_black")), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "解除拉黑后,你将不屏蔽对方的任何信息", + textAlign: TextAlign.center, + style: TextStyle( + color: const Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: const Text( + "否", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 24.sp), + GestureDetector( + onTap: () async { + Get.back(); + var data = await DioManager.instance.post( + url: '${Api.setBlock + widget.conversationID.split('_').last}/block', params: {'status': '0'}); + var bean = BaseResponse.fromJson( + data, + (jsonData) => jsonData, + ); + if (bean.isSuccess()) { + final FriendshipServices _friendshipServices = + serviceLocator(); + isBlack = false; + } + showOKToast(bean.msg); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: const Text( + "是", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } + void loadUserData() async { var data = await DioManager.instance.get( url: diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index 120897e..b5b0815 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -49,7 +49,7 @@ class _ChatPageState extends State { super.initState(); initEventBus(); loadMyInfo(); - // loadIsShowSendGiftDialogData(); + loadIsShowSendGiftDialogData(); } diff --git a/circle_app/lib/app/chat/widget/send_gift_dialog.dart b/circle_app/lib/app/chat/widget/send_gift_dialog.dart index 25cc154..29a594f 100644 --- a/circle_app/lib/app/chat/widget/send_gift_dialog.dart +++ b/circle_app/lib/app/chat/widget/send_gift_dialog.dart @@ -25,7 +25,7 @@ class _SendGiftDialogState extends State { String withStr = ''; int selectedIndex = -1; - + String tipStr = ''; @override void initState() { // TODO: implement initState @@ -43,6 +43,7 @@ class _SendGiftDialogState extends State { if (info['name'] == '浪漫告白') { selectedIndex = i ; giftId = info['id'].toString(); + tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; } } @@ -64,8 +65,8 @@ class _SendGiftDialogState extends State { constraints: BoxConstraints( maxHeight: 285.sp ), - margin: EdgeInsets.only(left: 15.sp,right: 15.sp), - padding: EdgeInsets.only(left: 15.sp,right: 15.sp), + margin: EdgeInsets.only(left: 10.sp,right: 10.sp), + padding: EdgeInsets.only(left: 10.sp,right: 10.sp), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.sp), gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]), @@ -85,14 +86,38 @@ class _SendGiftDialogState extends State { ), ), Container( - height: 102.sp, - margin: EdgeInsets.only(top: 12.sp,), + height: tipStr.isNotEmpty ? 145.sp : 122.sp, + margin: EdgeInsets.only(top: 12.sp), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.sp), gradient: LinearGradient( colors: [Color(0xFF132B40), Color(0xFF251240)])), - child: giftGridWidget(), + child: Column( + children: [ + if (tipStr.isNotEmpty) + Padding( + padding: EdgeInsets.only(top:6.sp), + child: Text( + '礼物送出后,获得$tipStr小时的消息置顶', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 12.sp, + fontWeight: FontWeight.w500), + ), + ), + giftGridWidget(), + ], + ), ), + // Container( + // height: 102.sp, + // margin: EdgeInsets.only(top: 12.sp,), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.sp), + // gradient: LinearGradient( + // colors: [Color(0xFF132B40), Color(0xFF251240)])), + // child: giftGridWidget(), + // ), Container( margin: EdgeInsets.only(top: 25.sp,), padding: EdgeInsets.only(left: 15.sp, right: 15.sp), @@ -169,9 +194,9 @@ class _SendGiftDialogState extends State { giftGridWidget() { return Container( width: Get.width, - height: 102.sp, + height: 120.sp, padding: - EdgeInsets.only(left: 10.sp, right: 10.sp, top: 10.sp, bottom: 10.sp), + EdgeInsets.only(left: 5.sp, right: 5.sp, top: 10.sp, bottom: 10.sp), child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: giftList.length, @@ -192,12 +217,12 @@ class _SendGiftDialogState extends State { onTap: () { selectedIndex = index; giftId = info['id'].toString(); - // tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; + tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; setState(() {}); }, child: Container( - height: 78.sp, - width: 78.sp, + height: 120.sp, + width: 75.sp, child: Stack( fit: StackFit.expand, children: [ @@ -207,9 +232,20 @@ class _SendGiftDialogState extends State { children: [ Image.network( info['icon'], - width: 65.sp, - height: 65.sp, + width: 60.sp, + height: 60.sp, ), + + Text(info['name'], + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)), + Text('${price.toInt()}小票', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)) ], ) ], diff --git a/circle_app/lib/app/chat/widget/wish_dialog.dart b/circle_app/lib/app/chat/widget/wish_dialog.dart index d35fe01..c229be3 100644 --- a/circle_app/lib/app/chat/widget/wish_dialog.dart +++ b/circle_app/lib/app/chat/widget/wish_dialog.dart @@ -66,7 +66,7 @@ class _WishDialogState extends State { giftGridWidget() { return Container( width: Get.width, - height: 102.sp, + height: 120.sp, padding: EdgeInsets.only(left: 10.sp, right: 10.sp, top: 10.sp, bottom: 10.sp), child: ListView.builder( @@ -93,8 +93,8 @@ class _WishDialogState extends State { setState(() {}); }, child: Container( - height: 78.sp, - width: 78.sp, + height: 120.sp, + width: 77.sp, child: Stack( fit: StackFit.expand, children: [ @@ -107,6 +107,16 @@ class _WishDialogState extends State { width: 65.sp, height: 65.sp, ), + Text(info['name'], + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)), + Text('${price.toInt()}小票', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)) ], ) ], @@ -153,7 +163,7 @@ class _WishDialogState extends State { style: TextStyle(color: Colors.white, fontSize: 15.sp), ), Container( - height: tipStr.isNotEmpty ? 125.sp : 102.sp, + height: tipStr.isNotEmpty ? 145.sp : 122.sp, margin: EdgeInsets.only(top: 12.sp), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.sp), @@ -228,7 +238,6 @@ class _WishDialogState extends State { return; } var info = giftList[selectedIndex]; - sendInventWishCustomMsg( widget.accId, jsonEncode(info), '邀请你许个愿'); }, diff --git a/circle_app/lib/app/circle/logic.dart b/circle_app/lib/app/circle/logic.dart index 8c2db5b..22e6610 100644 --- a/circle_app/lib/app/circle/logic.dart +++ b/circle_app/lib/app/circle/logic.dart @@ -303,7 +303,28 @@ class CircleLogic extends GetxController { } try { - vicinityList.addAll(bean.data.users); + + if (vicinityPage == 1) { + vicinityList.addAll(bean.data.users); + } else { + List info = []; + bean.data.users.forEach((element) { + bool isContain = false; + vicinityList.forEach((listInfo) { + + if (listInfo.id == element.id) { + isContain = true; + } + }); + if (!isContain) { + info.add(element); + } + }); + if (info.isNotEmpty) { + vicinityList.addAll(info); + } + } + vicinityPage = vicinityPage + 1; } on Exception {} update(); diff --git a/circle_app/lib/app/circle/widgets/discover.dart b/circle_app/lib/app/circle/widgets/discover.dart index 1ca035e..c6ee402 100644 --- a/circle_app/lib/app/circle/widgets/discover.dart +++ b/circle_app/lib/app/circle/widgets/discover.dart @@ -227,7 +227,24 @@ class _DiscoverState extends State list = dataList; refreshController.refreshCompleted(); } else { - list.addAll(dataList); + List info = []; + dataList.forEach((element) { + var user = Users.fromJson(element); + bool isContain = false; + list.forEach((listInfo) { + var user1 = Users.fromJson(listInfo); + if (user1.userId == user.userId) { + isContain = true; + } + }); + if (!isContain) { + info.add(element); + } + }); + if (info.isNotEmpty) { + list.addAll(info); + } + // list.addAll(dataList); } index = index + 1; diff --git a/circle_app/lib/app/circle/widgets/like_view.dart b/circle_app/lib/app/circle/widgets/like_view.dart index a254505..4e44669 100644 --- a/circle_app/lib/app/circle/widgets/like_view.dart +++ b/circle_app/lib/app/circle/widgets/like_view.dart @@ -72,7 +72,8 @@ class _LikeViewState extends State scroToTop = EventBusManager.on().listen((event) { // if (widget.logic.state.index == widget.index) { - var str = '{\"content\":{\"calloutId\":10453,\"interestId\":5},\"event\":3}'; + var str = + '{\"content\":{\"calloutId\":10453,\"interestId\":5},\"event\":3}'; var params = jsonDecode(str); scrollController.animateTo( 0.0, @@ -82,7 +83,7 @@ class _LikeViewState extends State }); likeRefreshSub = EventBusManager.on().listen((event) { // if (widget.logic.state.index == widget.index) { - refreshData(); + refreshData(); // } }); // widget.back(widget.createState()); @@ -142,8 +143,22 @@ class _LikeViewState extends State } if (dataList.isNotEmpty) { recomandMore = true; + List info = []; for (var element in dataList) { - recomanddlists.add(Lists.fromJson(element)); + Lists infos = Lists.fromJson(element); + + bool isContain = false; + recomanddlists.forEach((listInfo) { + if (listInfo.id == infos.id) { + isContain = true; + } + }); + if (!isContain) { + info.add(infos); + } + } + if (info.isNotEmpty) { + recomanddlists.addAll(info); } recomandPage++; } @@ -274,14 +289,11 @@ class _LikeViewState extends State } } if (!isContain) { - bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name)); + bean.chat!.users! + .add(Users(avatar: avatar, id: userId, nickname: name)); bean.chat!.count = bean.chat!.count + 1; - setState(() { - - }); + setState(() {}); } - - } } @@ -310,81 +322,81 @@ class _LikeViewState extends State return ClipRRect( borderRadius: BorderRadius.circular(10.sp), child: Container( - width: Get.width, - padding: EdgeInsets.only(left: 10.sp, right: 10.sp), - // margin: - // EdgeInsets.only(left: widget.index > 0 ? 4.sp : 0, right: 4.sp), - child: SmartRefresher( - controller: refreshController, - onRefresh: refreshData, - onLoading: loadMore, - enablePullUp: recomandMore, - child: ListView.builder( - physics: const AlwaysScrollableScrollPhysics(), - addAutomaticKeepAlives: false, - addRepaintBoundaries: false, - scrollDirection: Axis.vertical, - controller: scrollController, - itemCount: likeMore - ? lists.length - : lists.length + recomanddlists.length + 1, - itemBuilder: (context, index) { - if (lists.length - 1 >= index) { - var list = lists[index]; - if (list.isQueen!) { - return vipDynamicItem(list); - } else { - return normalDynamicItem(list); - } - } else if (!likeMore && - lists.length == index && - recomanddlists.isNotEmpty) { - return tipItem(); - } else if (index - lists.length < recomanddlists.length && - !likeMore) { - var list = recomanddlists[index - lists.length]; - if (list.isQueen!) { - return vipDynamicItem(list); - } else { - return normalDynamicItem(list); - } - } else { - if (recomandMore) return Container(); - return Container( - margin: EdgeInsets.only(top: likeMore ? 0 : 10.sp), - child: likeMore - ? loaddingWidget(likeMore) - : GestureDetector( - onTap: () { - var homeLogic = Get.find(); - homeLogic.tabController.animateTo(1, - duration: Duration(milliseconds: 0), - curve: Curves.ease); - homeLogic.updateIndex(1); - }, - child: Container( - margin: EdgeInsets.only(bottom: 10.sp), - child: Stack( - alignment: Alignment.center, - children: [ - Image.asset( - getLoginImage('start_bg'), - width: 180.sp, - ), - Text( - '查看更多圈子', - style: TextStyle( - color: Colors.white, - fontSize: 18.sp), - ) - ], + width: Get.width, + padding: EdgeInsets.only(left: 10.sp, right: 10.sp), + // margin: + // EdgeInsets.only(left: widget.index > 0 ? 4.sp : 0, right: 4.sp), + child: SmartRefresher( + controller: refreshController, + onRefresh: refreshData, + onLoading: loadMore, + enablePullUp: recomandMore, + child: ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + addAutomaticKeepAlives: false, + addRepaintBoundaries: false, + scrollDirection: Axis.vertical, + controller: scrollController, + itemCount: likeMore + ? lists.length + : lists.length + recomanddlists.length + 1, + itemBuilder: (context, index) { + if (lists.length - 1 >= index) { + var list = lists[index]; + if (list.isQueen!) { + return vipDynamicItem(list); + } else { + return normalDynamicItem(list); + } + } else if (!likeMore && + lists.length == index && + recomanddlists.isNotEmpty) { + return tipItem(); + } else if (index - lists.length < recomanddlists.length && + !likeMore) { + var list = recomanddlists[index - lists.length]; + if (list.isQueen!) { + return vipDynamicItem(list); + } else { + return normalDynamicItem(list); + } + } else { + if (recomandMore) return Container(); + return Container( + margin: EdgeInsets.only(top: likeMore ? 0 : 10.sp), + child: likeMore + ? loaddingWidget(likeMore) + : GestureDetector( + onTap: () { + var homeLogic = Get.find(); + homeLogic.tabController.animateTo(1, + duration: Duration(milliseconds: 0), + curve: Curves.ease); + homeLogic.updateIndex(1); + }, + child: Container( + margin: EdgeInsets.only(bottom: 10.sp), + child: Stack( + alignment: Alignment.center, + children: [ + Image.asset( + getLoginImage('start_bg'), + width: 180.sp, ), - ), - )); - } - }), - ), - )); + Text( + '查看更多圈子', + style: TextStyle( + color: Colors.white, + fontSize: 18.sp), + ) + ], + ), + ), + )); + } + }), + ), + )); } void _showTextContentDialog(BuildContext context, String msg, String title) { @@ -1261,7 +1273,8 @@ class _LikeViewState extends State bean['is_join'] = !bean['is_join']; if (recomanddlists.isNotEmpty) { recomanddlists.forEach((element) { - if (element.interest!['id'].toString() == bean['id'].toString()) { + if (element.interest!['id'].toString() == + bean['id'].toString()) { element.interest!['is_join'] = true; element.interest = element.interest!; } @@ -1270,7 +1283,8 @@ class _LikeViewState extends State if (lists.isNotEmpty) { lists.forEach((element) { - if (element.interest!['id'].toString() == bean['id'].toString()) { + if (element.interest!['id'].toString() == + bean['id'].toString()) { element.interest!['is_join'] = true; element.interest = element.interest!; } diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index 048c206..27c7b59 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -373,6 +373,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { logic.getMode(); } else if (index == 2) { final logic = Get.find(); + EventBusManager.fire(MsgRecommendCardRefresh()); logic.loadChatData(); } update(); @@ -439,4 +440,8 @@ class conTop { bool isTop; String conId; conTop(this.isTop,this.conId); +} + +class MsgRecommendCardRefresh { + } \ No newline at end of file diff --git a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart index 97bdbbe..316fc5c 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -170,11 +170,16 @@ class _TIMConversationState extends TIMUIKitState { // serviceLocator(); bool hasMore = true; List chatImIdList = []; - var recommendCircleFriendData = {}; + Map recommendCircleFriendData = {}; + + var sub; @override void initState() { super.initState(); + sub = EventBusManager.on().listen((event) { + loadRecommendCircleFriendData(); + }); loadRecommendCircleFriendData(); final controller = getController(); widget.scrollController!.addListener(() { @@ -392,6 +397,7 @@ class _TIMConversationState extends TIMUIKitState { @override void dispose() { super.dispose(); + sub.cancel(); } @override @@ -637,429 +643,371 @@ class _TIMConversationState extends TIMUIKitState { } recommendCircleFriendWidget() { - var info = {}; + try { + var info = {}; - var user = Users.fromJson(recommendCircleFriendData['user']); + var user = Users.fromJson(recommendCircleFriendData['user']); - // 对方喜欢了你100 - // ·你们有共同喜欢的圈友90 - // ·你喜欢的圈友也喜欢TA80 - // ·你们都在深圳留下过足迹70 - // ·你们有2个共同的圈子:圈子名称、圈子名称60 - // ·我刚来到这里哦55 - // ·可能是你想认识的人50 - // ·很多圈友都喜欢TA40 - // ·TA是乐园优秀圈主哦~30 + // 对方喜欢了你100 + // ·你们有共同喜欢的圈友90 + // ·你喜欢的圈友也喜欢TA80 + // ·你们都在深圳留下过足迹70 + // ·你们有2个共同的圈子:圈子名称、圈子名称60 + // ·我刚来到这里哦55 + // ·可能是你想认识的人50 + // ·很多圈友都喜欢TA40 + // ·TA是乐园优秀圈主哦~30 - var titleList = []; - if (recommendCircleFriendData['is_follow_me']) { - titleList.add('对方喜欢了你'); - } else if (recommendCircleFriendData['has_both_friend']) { - titleList.add('你们有共同喜欢的圈友'); - } else if (recommendCircleFriendData['has_friend_follow_to']) { - titleList.add('你喜欢的圈友也喜欢TA'); - } - if (titleList.length < 3) { - List citys = recommendCircleFriendData['both_cities']; - if (citys.isNotEmpty) { - titleList.add('你们都在${citys.first}留下过足迹'); - } - } - if (titleList.length < 3) { - List circles = recommendCircleFriendData['both_interests']; - if (circles.isNotEmpty) { - List both_interests = - recommendCircleFriendData['both_interests']; - List circleList = []; - both_interests.forEach((element) { - circleList.add(element['title']); - }); - if (circleList.isNotEmpty) { - titleList - .add('你们有${circleList.length}个共同的圈子:${circleList.join('、')}'); - } - } - } - if (titleList.length < 3) { - if (recommendCircleFriendData.containsKey('is_new_user')) { - titleList.add('我刚来到这里哦'); - } - } + info = checkCardReturnData(recommendCircleFriendData); - if (titleList.length < 3) { - if (recommendCircleFriendData['is_wanna_meet']) { - titleList.add('很多圈友都喜欢TA'); - } - } + List circleList = recommendCircleFriendData['interests']; - if (titleList.length < 3) { - if (recommendCircleFriendData['is_most_fans']) { - titleList.add('可能是你想认识的人'); - } - } + return Container( + padding: EdgeInsets.only(left: 15.sp, right: 15.sp), + child: Column(children: [ + Container( + margin: EdgeInsets.only(top: 20.sp), + child: Row( + children: [ + Expanded( + child: Container( + height: 2.sp, + color: Colors.white.withOpacity(0.5), + )), + Container( + width: 4.sp, + height: 4.sp, + margin: EdgeInsets.only(left: 15.sp, right: 15.sp), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white.withOpacity(0.5)), + ), + Expanded( + child: Container( + height: 2.sp, + color: Colors.white.withOpacity(0.5), + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.sp), + child: Row( + children: [ + Image.asset( + getMsgImage('heart_icon'), + width: 18.sp, + ), + SizedBox( + width: 4.sp, + ), + ShaderMask( + shaderCallback: (Rect bounds) { + return const LinearGradient( + begin: Alignment(0.0, -1.0), + end: Alignment.bottomCenter, + colors: [Color(0xff71F3F2), Color(0xffF657FF)], + ).createShader(Offset.zero & bounds.size); + }, + child: Text( + '圈友推荐', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w600, + color: Colors.white, + shadows: [ + Shadow( + color: Color(0xffF657FF), offset: Offset(0.0, -1)) + ]), + ), + ), + SizedBox( + width: 4.sp, + ), + Image.asset( + getMsgImage('heart_icon'), + width: 18.sp, + ), + Expanded(child: Container()), + InkWell( + onTap: () { + loadRecommendCircleFriendData(); + }, + child: Container( + child: Row( + children: [ + Icon( + Icons.refresh_sharp, + size: 18.sp, + color: AppColor.mainColor, + ), + SizedBox( + width: 4.sp, + ), + Text( + '换一位', + style: TextStyle( + color: AppColor.mainColor, fontSize: 15.sp), + ) + ], + ), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.sp), + width: Get.width, + // constraints: BoxConstraints(maxHeight: 230.sp), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)]), + borderRadius: BorderRadius.circular(8.sp), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, + ), + ), + padding: EdgeInsets.only(left: 12.sp, right: 12.sp,top: 10.sp), + child: Column( + children: [ + GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString()); + }, + child: Container( + child: Row( + children: [ + ClipOval( + child: Image.network( + recommendCircleFriendData['user']['avatar'], + width: 50.sp, + height: 50.sp, + fit: BoxFit.cover, + ), + ), + SizedBox( + width: 6.sp, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + user.nickname ?? '', + style: TextStyle( + fontSize: 16.sp, + color: Color(0XFFF7FAFA), + fontWeight: FontWeight.bold), + ), + SizedBox(height: 4.sp,), + Row( + children: [ + Container( + alignment: Alignment.center, + height: 18.sp, + padding: + EdgeInsets.only(left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(9.sp), + gradient: const LinearGradient( + begin: Alignment(0.25, 0.5), + end: Alignment(0.75, 0.5), + colors: [ + Color(0xff8DFFF8), + Color(0xffB5D3FF) + ])), + child: Text( + getAgeCOntent( + user!.gender ?? 0, + user!.age ?? 0, + user!.role ?? 0, + user!.orientation ?? 0), + style: TextStyle( + color: Colors.black, + fontSize: 12.sp, + ), + ), + ), + if (user.vip! > 0) + Container( + margin: EdgeInsets.only( + left: 4.sp, + ), + child: Image.asset( + getCircleImage( + user.vip == 1 ? 'vip' : 'year_vip'), + width: 36.sp, + ), + ), + ], + ), + ], + )), + GestureDetector( + onTap: () async { + if (!chatImIdList.contains(user.userId.toString())) { + await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']); + } - if (titleList.length < 3) { - if (recommendCircleFriendData['is_excellent_qz_leader']) { - titleList.add('TA是乐园优秀圈主哦~'); - } - } + pushChatPage(user.userId.toString(), recommendCircleFriendData['user']['imId'], user.nickname!); + }, + child: Container( + height: 25.sp, + padding: EdgeInsets.only(left: 6.sp,right: 6.sp), + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(12.5.sp)), + alignment: Alignment.center, + child: Text( + '聊一聊', + style: + TextStyle(color: Colors.white, fontSize: 15.sp), + ), + ), + ) + ], + ), + ), + ), + if (info.containsKey('desc')) + Container( + margin: EdgeInsets.only(top: 10.sp, right: 16.sp), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp), + width: 3, + height: 3, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.5), + color: Color(0xFF00FFF4)), + ), + Expanded( + child: Container( + child: Text( + info['desc'], + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ) + ], + ), + ), + if (info.containsKey('city')) + info['city'].toString().isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 10.sp), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp), + width: 3.sp, + height: 3.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.5.sp), + color: Color(0xFF00FFF4)), + ), + Expanded(child: Text( + info['city'], + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + )) + ], + ), + ) + : Container(), + if (info.containsKey('both_interests')) + Container( + margin: EdgeInsets.only(top: 10.sp, right: 16.sp), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp), + width: 3, + height: 3, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.5), + color: Color(0xFF00FFF4)), + ), + Expanded( + child: Container( + child: Text( + info['both_interests'], + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ) + ], + ), + ), - if (titleList.length >= 1) { - info['city'] = titleList.first; - } + Container( + margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + alignment: Alignment.centerLeft, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp, top: 10.sp), + width: 3, + height: 3, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.5), + color: Color(0xFF00FFF4)), + ), + Expanded( + child: Text( + '交友宣言:' + + recommendCircleFriendData['user']['signature'], + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + maxLines: 2, + overflow: TextOverflow.ellipsis, + )), + ])), + Image.asset( + getCircleImage('line'), + width: Get.width, + fit: BoxFit.fill, + ), - if (titleList.length >= 2) { - info['both_interests'] = titleList[1]; - } - - if (titleList.length >= 3) { - info['desc'] = titleList[2]; - } - - List circleList = recommendCircleFriendData['interests']; - - return Container( - padding: EdgeInsets.only(left: 15.sp, right: 15.sp), - child: Column(children: [ - Container( - margin: EdgeInsets.only(top: 20.sp), - child: Row( - children: [ - Expanded( - child: Container( - height: 2.sp, - color: Colors.white.withOpacity(0.5), - )), - Container( - width: 4.sp, - height: 4.sp, - margin: EdgeInsets.only(left: 15.sp, right: 15.sp), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.white.withOpacity(0.5)), - ), - Expanded( - child: Container( - height: 2.sp, - color: Colors.white.withOpacity(0.5), - )), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 16.sp), - child: Row( - children: [ - Image.asset( - getMsgImage('heart_icon'), - width: 18.sp, - ), - SizedBox( - width: 4.sp, - ), - ShaderMask( - shaderCallback: (Rect bounds) { - return const LinearGradient( - begin: Alignment(0.0, -1.0), - end: Alignment.bottomCenter, - colors: [Color(0xff71F3F2), Color(0xffF657FF)], - ).createShader(Offset.zero & bounds.size); - }, - child: Text( - '圈友推荐', - style: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w600, - color: Colors.white, - shadows: [ - Shadow( - color: Color(0xffF657FF), offset: Offset(0.0, -1)) - ]), - ), - ), - SizedBox( - width: 4.sp, - ), - Image.asset( - getMsgImage('heart_icon'), - width: 18.sp, - ), - Expanded(child: Container()), - InkWell( - onTap: () { - loadRecommendCircleFriendData(); - }, - child: Container( - child: Row( - children: [ - Icon( - Icons.refresh_sharp, - size: 18.sp, - color: AppColor.mainColor, - ), - SizedBox( - width: 4.sp, - ), - Text( - '换一位', - style: TextStyle( - color: AppColor.mainColor, fontSize: 15.sp), - ) - ], - ), - ), - ) - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 16.sp), - width: Get.width, - // constraints: BoxConstraints(maxHeight: 230.sp), - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [Color(0xFF4C3E5F), Color(0xFF324140)]), - borderRadius: BorderRadius.circular(8.sp), - border: GradientBoxBorder( - gradient: AppColor.mainVerLinearGradient, - width: 1.sp, - ), - ), - padding: EdgeInsets.only(left: 12.sp, right: 12.sp,top: 10.sp), - child: Column( - children: [ - GestureDetector( - onTap: () { - Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString()); - }, - child: Container( - child: Row( - children: [ - ClipOval( - child: Image.network( - recommendCircleFriendData['user']['avatar'], - width: 50.sp, - height: 50.sp, - fit: BoxFit.cover, - ), - ), - SizedBox( - width: 6.sp, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - user.nickname ?? '', - style: TextStyle( - fontSize: 16.sp, - color: Color(0XFFF7FAFA), - fontWeight: FontWeight.bold), - ), - SizedBox(height: 4.sp,), - Row( - children: [ - Container( - alignment: Alignment.center, - height: 18.sp, - padding: - EdgeInsets.only(left: 6.sp, right: 6.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(9.sp), - gradient: const LinearGradient( - begin: Alignment(0.25, 0.5), - end: Alignment(0.75, 0.5), - colors: [ - Color(0xff8DFFF8), - Color(0xffB5D3FF) - ])), - child: Text( - getAgeCOntent( - user!.gender ?? 0, - user!.age ?? 0, - user!.role ?? 0, - user!.orientation ?? 0), - style: TextStyle( - color: Colors.black, - fontSize: 12.sp, - ), - ), - ), - if (user.vip! > 0) - Container( - margin: EdgeInsets.only( - left: 4.sp, - ), - child: Image.asset( - getCircleImage( - user.vip == 1 ? 'vip' : 'year_vip'), - width: 36.sp, - ), - ), - ], - ), - ], - )), - GestureDetector( - onTap: () async { - if (!chatImIdList.contains(user.userId.toString())) { - await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']); - } - - pushChatPage(user.userId.toString(), recommendCircleFriendData['user']['imId'], user.nickname!); - }, - child: Container( - height: 25.sp, - padding: EdgeInsets.only(left: 6.sp,right: 6.sp), - decoration: BoxDecoration( - gradient: AppColor.mainVerLinearGradient, - borderRadius: BorderRadius.circular(12.5.sp)), - alignment: Alignment.center, - child: Text( - '聊一聊', - style: - TextStyle(color: Colors.white, fontSize: 15.sp), - ), - ), - ) - ], - ), - ), - ), - if (info.containsKey('desc')) - Container( - margin: EdgeInsets.only(top: 10.sp, right: 16.sp), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.sp), - width: 3, - height: 3, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5), - color: Color(0xFF00FFF4)), - ), - Expanded( - child: Container( - child: Text( - info['desc'], - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500, - ), - overflow: TextOverflow.ellipsis, - maxLines: 1, - ), - ), - ) - ], - ), - ), - if (info.containsKey('city')) - info['city'].toString().isNotEmpty - ? Container( - margin: EdgeInsets.only(top: 10.sp), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.sp), - width: 3.sp, - height: 3.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5.sp), - color: Color(0xFF00FFF4)), - ), - Expanded(child: Text( - info['city'], - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500), - )) - ], - ), - ) - : Container(), - if (info.containsKey('both_interests')) - Container( - margin: EdgeInsets.only(top: 10.sp, right: 16.sp), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.sp), - width: 3, - height: 3, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5), - color: Color(0xFF00FFF4)), - ), - Expanded( - child: Container( - child: Text( - info['both_interests'], - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500, - ), - overflow: TextOverflow.ellipsis, - maxLines: 1, - ), - ), - ) - ], - ), - ), - - Container( - margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), - alignment: Alignment.centerLeft, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(right: 5.sp, top: 10.sp), - width: 3, - height: 3, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1.5), - color: Color(0xFF00FFF4)), - ), - Expanded( - child: Text( - '交友宣言:' + - recommendCircleFriendData['user']['signature'], - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500), - maxLines: 2, - overflow: TextOverflow.ellipsis, - )), - ])), - Image.asset( - getCircleImage('line'), - width: Get.width, - fit: BoxFit.fill, - ), - - if (circleList.isNotEmpty) - Container( - height: 72.sp, - margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp), - width: Get.width, - child: ListView.builder(itemBuilder: (context,index) { - return circleInfoItem(circleList[index], index); - },itemCount: circleList.length,scrollDirection: Axis.horizontal,), - ) - ], - ), - ), - ])); + if (circleList.isNotEmpty) + Container( + height: 72.sp, + margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp), + width: Get.width, + child: ListView.builder(itemBuilder: (context,index) { + return circleInfoItem(circleList[index], index); + },itemCount: circleList.length,scrollDirection: Axis.horizontal,), + ) + ], + ), + ), + ])); + } catch (e) { + loadRecommendCircleFriendData(); + return Container(); + } } circleInfoItem(var bean, int index) { diff --git a/circle_app/lib/app/swiper/view.dart b/circle_app/lib/app/swiper/view.dart index 707887a..975766e 100644 --- a/circle_app/lib/app/swiper/view.dart +++ b/circle_app/lib/app/swiper/view.dart @@ -22,9 +22,23 @@ class SwiperPage extends StatefulWidget { class _SwiperPageState extends State { GlobalKey _globalKey = GlobalKey(); + + @override Widget build(BuildContext context) { return GetBuilder(builder: (logic) { + List imgList = []; + logic.imgList.forEach((element) { + imgList.add(CachedNetworkImage( + imageUrl: element, + + fit: BoxFit.cover, + height: Get.height, + width: Get.width, + )); + + }); + return Scaffold( appBar: null, backgroundColor: Colors.black87, @@ -41,6 +55,7 @@ class _SwiperPageState extends State { controller: logic.swiperController, index: logic.index, loop: false, + itemBuilder: (BuildContext context, int index) { // if (logic.index == index) { // return RepaintBoundary( @@ -89,20 +104,40 @@ class _SwiperPageState extends State { itemWidget(SwiperLogic logic,int index) { return Container( - width: double.infinity, + width: Get.width, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Stack( alignment: Alignment.center, children: [ + Container( // color: Colors.red, child: CachedNetworkImage( + // progressIndicatorBuilder: (context,str,progress) { + // return Container(); + // }, + placeholder: (context,str) { + print(str + '进度'); + if (Get.arguments['index'] == index) { + return Container( + // color: Colors.red, + child: CachedNetworkImage( + imageUrl: logic.imgList[index].toString(), + + fit: BoxFit.cover, + width: Get.width, + ), + ); + } else { + return Container(); + } + }, imageUrl: logic.imgList[index].toString().contains('?') ? logic.imgList[index].toString().split('?').first : logic.imgList[index].toString(), fit: BoxFit.cover, - width: double.infinity, + width: Get.width, ), ), Positioned( diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index fd730dc..4f63c86 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -228,10 +228,22 @@ class MyTabbedScreenState extends State color: Color(0xFF240F3B)), alignment: Alignment.center, height: 24.sp, - child: Text( - '想要微信号', - style: TextStyle( - color: Colors.white, fontSize: 14.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + getDisCoverImage('wx'), + width: 20.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + '想要微信号', + style: TextStyle( + color: Colors.white, fontSize: 13.sp), + ), + ], ), ) ], diff --git a/circle_app/lib/common/Widgets/genderview.dart b/circle_app/lib/common/Widgets/genderview.dart index 7e06c86..2a035d9 100644 --- a/circle_app/lib/common/Widgets/genderview.dart +++ b/circle_app/lib/common/Widgets/genderview.dart @@ -154,7 +154,7 @@ Widget getZN() { ), margin: EdgeInsets.only(left: 10.0.sp), child: Text( - "直男", + "男", style: TextStyle( color: const Color(0xFFF7FAFA), fontSize: 12.0.sp, @@ -176,7 +176,7 @@ Widget getNV() { ), margin: EdgeInsets.only(left: 10.0.sp), child: Text( - "真女", + "女", style: TextStyle( color: const Color(0xFFF7FAFA), fontSize: 12.0.sp, diff --git a/circle_app/lib/common/Widgets/today_people_dialog.dart b/circle_app/lib/common/Widgets/today_people_dialog.dart index a969fd8..9f66793 100644 --- a/circle_app/lib/common/Widgets/today_people_dialog.dart +++ b/circle_app/lib/common/Widgets/today_people_dialog.dart @@ -42,7 +42,7 @@ class _TodayPeopleDialogState extends State { itemWidget() { var info = {}; - var user = Users.fromJson(recommendCircleFriendData['user']); + // 对方喜欢了你100 // ·你们有共同喜欢的圈友90 @@ -54,71 +54,77 @@ class _TodayPeopleDialogState extends State { // ·TA是乐园优秀圈主哦~30 var titleList = []; + var user = Users.fromJson(recommendCircleFriendData['user']); + try { - if (recommendCircleFriendData['is_follow_me']) { - titleList.add('对方喜欢了你'); - } else if (recommendCircleFriendData['has_both_friend']) { - titleList.add('你们有共同喜欢的圈友'); - } else if (recommendCircleFriendData['has_friend_follow_to']) { - titleList.add('你喜欢的圈友也喜欢TA'); - } - if (titleList.length < 3) { - List citys = recommendCircleFriendData['both_cities']; - if (citys.isNotEmpty) { - titleList.add('你们都在${citys.first}留下过足迹'); + if (recommendCircleFriendData['is_follow_me']) { + titleList.add('对方喜欢了你'); + } else if (recommendCircleFriendData['has_both_friend']) { + titleList.add('你们有共同喜欢的圈友'); + } else if (recommendCircleFriendData['has_friend_follow_to']) { + titleList.add('你喜欢的圈友也喜欢TA'); } - } - if (titleList.length < 3) { - List circles = recommendCircleFriendData['both_interests']; - if (circles.isNotEmpty) { - List both_interests = - recommendCircleFriendData['both_interests']; - List circleList = []; - both_interests.forEach((element) { - circleList.add(element['title']); - }); - if (circleList.isNotEmpty) { - titleList - .add('你们有${circleList.length}个共同的圈子:${circleList.join('、')}'); + if (titleList.length < 3) { + List citys = recommendCircleFriendData['both_cities']; + if (citys.isNotEmpty) { + titleList.add('你们都在${citys.first}留下过足迹'); } } - } - - if (titleList.length < 3) { - if (recommendCircleFriendData.containsKey('is_new_user')) { - titleList.add('我刚来到这里哦'); + if (titleList.length < 3) { + List circles = recommendCircleFriendData['both_interests']; + if (circles.isNotEmpty) { + List both_interests = + recommendCircleFriendData['both_interests']; + List circleList = []; + both_interests.forEach((element) { + circleList.add(element['title']); + }); + if (circleList.isNotEmpty) { + titleList + .add('你们有${circleList.length}个共同的圈子:${circleList.join('、')}'); + } + } } - } - - if (titleList.length < 3) { - if (recommendCircleFriendData['is_wanna_meet']) { - titleList.add('很多圈友都喜欢TA'); + if (titleList.length < 3) { + if (recommendCircleFriendData.containsKey('is_new_user')) { + titleList.add('我刚来到这里哦'); + } } - } - if (titleList.length < 3) { - if (recommendCircleFriendData['is_most_fans']) { - titleList.add('可能是你想认识的人'); + + if (titleList.length < 3) { + if (recommendCircleFriendData['is_wanna_meet']) { + titleList.add('很多圈友都喜欢TA'); + } } - } - if (titleList.length < 3) { - if (recommendCircleFriendData['is_excellent_qz_leader']) { - titleList.add('TA是乐园优秀圈主哦~'); + if (titleList.length < 3) { + if (recommendCircleFriendData['is_most_fans']) { + titleList.add('可能是你想认识的人'); + } } - } - if (titleList.length >= 1) { - info['city'] = titleList.first; - } + if (titleList.length < 3) { + if (recommendCircleFriendData['is_excellent_qz_leader']) { + titleList.add('TA是乐园优秀圈主哦~'); + } + } - if (titleList.length >= 2) { - info['both_interests'] = titleList[1]; - } + if (titleList.length >= 1) { + info['city'] = titleList.first; + } - if (titleList.length >= 3) { - info['desc'] = titleList[2]; + if (titleList.length >= 2) { + info['both_interests'] = titleList[1]; + } + + if (titleList.length >= 3) { + info['desc'] = titleList[2]; + } + } catch (e) { + loadRecommendCircleFriendData(); + return Container(); } List circleList = recommendCircleFriendData['interests']; @@ -139,7 +145,8 @@ class _TodayPeopleDialogState extends State { children: [ GestureDetector( onTap: () { - Get.toNamed(AppRoutes.UserInfoActivity, arguments: ''); + + Get.toNamed(AppRoutes.UserInfoActivity, arguments: recommendCircleFriendData['user']['id'].toString()); }, child: Container( child: Row( diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index cee84c6..cfe10b0 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -26,6 +26,8 @@ import '../app/select_circle/logic.dart'; import '../network/dio_manager.dart'; import 'SharedPreferencesHelper.dart'; +List chatIdList = []; + class Util {} //获取图片 @@ -515,6 +517,8 @@ pushChatPage(String userId, String imId, String userName) { } createCustomMsg(String userId, String imId) async { + if (chatIdList.contains(imId)) return; + chatIdList.add(imId); //通过会话ID获取指定会话列表 V2TimValueCallback> getConversationListByConversaionIdsRes = await TencentImSDKPlugin @@ -772,3 +776,74 @@ sendInventWishCustomMsg(String userId, String data, String desc) async { } } + + +//判断卡片返回信息 +Map checkCardReturnData(Map recommendCircleFriendData) { + var titleList = []; + Map info = {}; + if (recommendCircleFriendData['is_follow_me']) { + titleList.add('对方喜欢了你'); + } else if (recommendCircleFriendData['has_both_friend']) { + titleList.add('你们有共同喜欢的圈友'); + } else if (recommendCircleFriendData['has_friend_follow_to']) { + titleList.add('你喜欢的圈友也喜欢TA'); + } + if (titleList.length < 3) { + List citys = recommendCircleFriendData['both_cities']; + if (citys.isNotEmpty) { + titleList.add('你们都在${citys.first}留下过足迹'); + } + } + if (titleList.length < 3) { + List circles = recommendCircleFriendData['both_interests']; + if (circles.isNotEmpty) { + List both_interests = + recommendCircleFriendData['both_interests']; + List circleList = []; + both_interests.forEach((element) { + circleList.add(element['title']); + }); + if (circleList.isNotEmpty) { + titleList + .add('你们有${circleList.length}个共同的圈子:${circleList.join('、')}'); + } + } + } + if (titleList.length < 3) { + if (recommendCircleFriendData.containsKey('is_new_user')) { + titleList.add('我刚来到这里哦'); + } + } + + if (titleList.length < 3) { + if (recommendCircleFriendData['is_wanna_meet']) { + titleList.add('很多圈友都喜欢TA'); + } + } + + if (titleList.length < 3) { + if (recommendCircleFriendData['is_most_fans']) { + titleList.add('可能是你想认识的人'); + } + } + + if (titleList.length < 3) { + if (recommendCircleFriendData['is_excellent_qz_leader']) { + titleList.add('TA是乐园优秀圈主哦~'); + } + } + + if (titleList.length >= 1) { + info['city'] = titleList.first; + } + + if (titleList.length >= 2) { + info['both_interests'] = titleList[1]; + } + + if (titleList.length >= 3) { + info['desc'] = titleList[2]; + } + return info; +} \ No newline at end of file diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index 490dd5d..0561589 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -89,7 +89,7 @@ dependencies: # 微信SDK插件 fluwx: ^3.8.1+1 event_bus: ^2.0.0 - #安装apk +# #安装apk flutter_install_app: 1.3.0 #闪屏页 flutter_native_splash: 2.2.16