From 0751408802c35bda10dfe1d355fe89e86e9a7d5b Mon Sep 17 00:00:00 2001 From: CYH <13923927013@163.com> Date: Fri, 8 Dec 2023 09:33:34 +0800 Subject: [PATCH] =?UTF-8?q?1.3.7=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/keyboard.png | Bin 0 -> 4400 bytes ..._uikit_chat_history_message_list_item.dart | 14 +- .../tim_uikit_text_field.dart | 21 +- .../tim_uikit_text_field_layout/narrow.dart | 212 ++++++- circle_app/lib/app/chat/view.dart | 8 + .../lib/app/chat/widget/wish_dialog.dart | 5 +- circle_app/lib/app/circle/view.dart | 206 ++++--- .../lib/app/circle/widgets/discover.dart | 26 +- .../lib/app/circle/widgets/vicinity.dart | 1 + circle_app/lib/app/home/logic.dart | 35 +- .../tim_uikit_conversation.dart | 7 + .../lib/app/msg/sys_notify_list/view.dart | 2 +- circle_app/lib/app/msg/view.dart | 2 +- circle_app/lib/app/userinfo/logic.dart | 18 +- circle_app/lib/app/userinfo/view.dart | 380 ++++++------ .../common/Widgets/today_people_dialog.dart | 564 ++++++++++++++++++ .../lib/common/Widgets/unlock_wx_tip.dart | 2 +- circle_app/lib/common/const.dart | 5 +- circle_app/lib/network/api.dart | 3 + circle_app/lib/util/util.dart | 16 +- circle_app/pubspec.lock | 8 + circle_app/pubspec.yaml | 2 +- 23 files changed, 1189 insertions(+), 352 deletions(-) create mode 100644 circle_app/assets/images/msg/keyboard.png create mode 100644 circle_app/lib/common/Widgets/today_people_dialog.dart diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index da58d98..0bbfc96 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 28 - versionName "1.3.6" + versionCode 29 + versionName "1.3.7" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/assets/images/msg/keyboard.png b/circle_app/assets/images/msg/keyboard.png new file mode 100644 index 0000000000000000000000000000000000000000..c94598bc28467d759d26a4094ab3fac860d2d025 GIT binary patch literal 4400 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 U{c!w!_8-95z+C^8uFJ#!0ck8Ap8x;= literal 0 HcmV?d00001 diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart index a17a286..27c369a 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart @@ -450,9 +450,10 @@ class _TIMUIKItHistoryMessageListItemState String title = ''; if (info.containsKey('title')) { - var recommendCircleFriendData= info['title']; - + Map recommendCircleFriendData= info['title']; + + if (recommendCircleFriendData['is_follow_me'] && isFromSelf) { title = '对方喜欢了你'; } else if (recommendCircleFriendData['is_follow_to'] && !isFromSelf) { @@ -461,16 +462,17 @@ class _TIMUIKItHistoryMessageListItemState title = '你喜欢了TA'; } else if (recommendCircleFriendData['has_both_friend']) { title = '你们有共同喜欢的圈友'; - } else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) { + } else if (recommendCircleFriendData.containsKey('is_new_user') && !isFromSelf) { + title = '我刚来到这里哦'; + } else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) { title = '你喜欢的圈友也喜欢TA'; } else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { title = '很多圈友都喜欢TA'; - } else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { + } else if (recommendCircleFriendData['is_excellent_qz_leader'] && isFromSelf) { title = 'TA是乐园优秀圈主哦~'; - } else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { + } else if (recommendCircleFriendData['is_most_fans'] && isFromSelf) { title = '可能是你想认识的人'; } - } diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart index d92e786..77fc0fd 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart @@ -291,15 +291,14 @@ class _InputTextFieldState extends TIMUIKitState { bool isSendLoging = false; onSubmitted() async { - if (isSendLoging) { - return; - } if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); return; } + if (isSending) return; + isSending = true; bool isOK = await checkImStatus(); if (!isOK) { @@ -314,6 +313,7 @@ class _InputTextFieldState extends TIMUIKitState { if (text.isEmpty) { if (hintText.contains('说些什么吧~')) { showOKToast('请输入消息内容后发送'); + Future.delayed(Duration(seconds: 1), () {isSending = false;}); return; } else { if ((widget.currentConversation.lastMessage?.customElem ?? null) != @@ -321,6 +321,7 @@ class _InputTextFieldState extends TIMUIKitState { if (widget.currentConversation.lastMessage?.customElem!.extension == 'cardData') { sendHiText(); + isSending = false; } } else { var result = await TencentImSDKPlugin.v2TIMManager @@ -344,7 +345,7 @@ class _InputTextFieldState extends TIMUIKitState { showOKToast('请输入消息内容后发送'); } } - + Future.delayed(Duration(seconds: 1), () {isSending = false;}); return; } } @@ -369,12 +370,12 @@ class _InputTextFieldState extends TIMUIKitState { } else { bool isOK = await loadIsShowSendGiftDialogData(); if (!isOK) { + Future.delayed(Duration(seconds: 1), () {isSending = false;}); return; } - isSendLoging = true; var data = await DioManager.instance .post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2}); - isSendLoging = false; + List words = []; if (data['data']['code'] == 10000) { words = data['data']['words']; @@ -384,7 +385,7 @@ class _InputTextFieldState extends TIMUIKitState { } } } - + Future.delayed(Duration(seconds: 1), () {isSending = false;}); if (words.isEmpty) { var msgResult = await MessageUtils.handleMessageError( widget.model.sendTextMessage( @@ -395,7 +396,6 @@ class _InputTextFieldState extends TIMUIKitState { addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? ''); } else { - textEditingController.text = text; showOKToast('含违规词汇,无法发送'); return; } @@ -407,8 +407,10 @@ class _InputTextFieldState extends TIMUIKitState { goDownBottom(); _handleSendEditStatus("", false); + } else { showOKToast('请输入消息内容'); + isSending = false; } } @@ -454,6 +456,7 @@ class _InputTextFieldState extends TIMUIKitState { "sendTime": str, "to": widget.conversationID.split('_').last }); + isSending = false; } void goDownBottom() { @@ -818,7 +821,7 @@ class _InputTextFieldState extends TIMUIKitState { StreamSubscription? commentBlackEvent = null; bool isBlack = false; - + bool isSending = false; getBlack() async { final FriendshipServices _friendshipServices = serviceLocator(); 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 19bf1be..ccbb8a1 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 @@ -19,6 +19,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:get/get.dart'; import 'package:get/get_core/src/get_main.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:oktoast/oktoast.dart'; import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart'; import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart'; @@ -39,8 +40,11 @@ import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart'; import 'package:video_player/video_player.dart'; import 'package:video_thumbnail/video_thumbnail.dart'; +import '../../../../../common/Widgets/unlock_wx_tip.dart'; import '../../../../../util/eventBus.dart'; import '../../../../call_out/logic.dart'; +import '../../../../userinfo/logic.dart'; +import '../../../view.dart'; import '../../../widget/chat_circle_share_dialog.dart'; import '../../../widget/chat_gift_pannel.dart'; @@ -176,10 +180,16 @@ class _TIMTextFieldLayoutNarrowState bool showKeyboard = false; Function? setKeyboardHeight; double? bottomPadding; + UserBean? userInfoBean; + int unLockWxNum = 0; + var sub1; @override void initState() { super.initState(); + sub1 = EventBusManager.on().listen((event) { + loadUserData(); + }); if (widget.controller != null) { widget.controller?.addListener(() { final actionType = widget.controller?.actionType; @@ -196,7 +206,7 @@ class _TIMTextFieldLayoutNarrowState } }); } - + loadUserData(); getBlack(); } @@ -204,6 +214,7 @@ class _TIMTextFieldLayoutNarrowState @override void dispose() { + sub1.cancel(); print("TIMTextFieldLayoutNarrow解绑"); if (null != commentBlackEvent) { EventBusManager.cancelSubscription(commentBlackEvent!); @@ -314,7 +325,8 @@ class _TIMTextFieldLayoutNarrowState double _getBottomHeight() { if (showKeyboard) { - final currentKeyboardHeight = MediaQuery.of(context).viewInsets.bottom; + final currentKeyboardHeight = + MediaQuery.of(context).viewInsets.bottom + 10.sp; double originHeight = settingModel.keyboardHeight; if (currentKeyboardHeight != 0) { if (currentKeyboardHeight >= originHeight) { @@ -639,7 +651,7 @@ class _TIMTextFieldLayoutNarrowState : TextInputAction .send, onEditingComplete: () { - widget.onSubmitted(); + widget.onSubmitted(); if (showKeyboard) { widget.focusNode .requestFocus(); @@ -704,7 +716,9 @@ class _TIMTextFieldLayoutNarrowState widget.goDownBottom(); }, child: Image.asset( - getMsgImage('emoji'), + !showEmojiPanel + ? getMsgImage('emoji') + : getMsgImage('keyboard'), height: 24.sp, width: 24.sp, ), @@ -844,18 +858,24 @@ class _TIMTextFieldLayoutNarrowState ), if (!showKeyboard && !showEmojiPanel) Positioned( - top: 0, + top: 10.sp, child: Container( + // margin: EdgeInsets.only(bottom: 5.sp), padding: EdgeInsets.only(left: 10.sp, right: 10.sp), - height: 50.sp, + height: 28.sp, + // color: Colors.red, width: Get.width, - child: Row( + child: ListView( + scrollDirection: Axis.horizontal, children: [ chatActionWidget('hello', '打招呼', () async { - var reulst = await DioManager.instance.get(url: Api.msgRandOne); - String text = reulst['data']; + var reulst = + await DioManager.instance.get(url: Api.msgRandOne); + String text = reulst['data']; var result = await widget.model.sendTextMessage( - text: text, convID: widget.conversationID, convType: ConvType.c2c); + text: text, + convID: widget.conversationID, + convType: ConvType.c2c); }), chatActionWidget('wish', '许个愿', () { Get.bottomSheet( @@ -873,6 +893,8 @@ class _TIMTextFieldLayoutNarrowState isScrollControlled: true, enableDrag: false); }), + if (userInfoBean != null) + userInfoBean!.wx_num.isNotEmpty ? chatWxActionWidget() : chatWantWxActionWidget() ], ), ), @@ -903,8 +925,7 @@ class _TIMTextFieldLayoutNarrowState child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset( - getMsgImage(img), + Image.asset( getMsgImage(img), width: 20.sp, ), SizedBox( @@ -920,6 +941,123 @@ class _TIMTextFieldLayoutNarrowState ); } + + chatWantWxActionWidget() { + double textWidth = boundingTextSize(Get.context!, userInfoBean!.wx_num!, TextStyle(color: Colors.white, fontSize: 16.sp)).width; + return GestureDetector( + onTap: () async { + var result = await DioManager.instance.get(url: Api.noticeWxNum + userInfoBean!.id.toString(),); + if (result['code'] == 200) { + showOKToast('已提醒对方填写'); + } else { + showOKToast(result['msg']); + } + }, + child: Container( + width:105.sp, + height: 28.sp, + margin: EdgeInsets.only(right: 4.sp), + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(14.sp)), + child: Container( + decoration: BoxDecoration( + color: Color(0xFF423055), + borderRadius: BorderRadius.circular(14.sp)), + margin: EdgeInsets.all(1.sp), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 4.sp, + ), + Image.asset( + getDisCoverImage('wx'), + width: 20.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + '想要微信号', + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + + ], + )), + ), + ); + } + + chatWxActionWidget() { + double textWidth = boundingTextSize(Get.context!, userInfoBean!.wx_num!, TextStyle(color: Colors.white, fontSize: 16.sp)).width; + return GestureDetector( + onTap: () async { + if (unLockWxNum != 1) { + var result = await DioManager() + .post(url: Api.UnlockWx, params: {'targetUserId': userInfoBean!.id}); + if (result['code'] == 200) { + showToast('解锁成功'); + loadUserData(); + } else { + Get.bottomSheet(UnlockWxTip(userInfoBean!.id.toString(), userInfoBean!.avatar), + isScrollControlled: true, enableDrag: false) + .then((value) { + if (value != null) { + loadUserData(); + } + }); + } + } + }, + child: Container( + width: textWidth + (unLockWxNum != 1 ? 50.sp : 30.sp), + height: 28.sp, + margin: EdgeInsets.only(right: 4.sp), + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(14.sp)), + child: Container( + decoration: BoxDecoration( + color: Color(0xFF423055), + borderRadius: BorderRadius.circular(14.sp)), + margin: EdgeInsets.all(1.sp), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 4.sp, + ), + Image.asset( + getDisCoverImage('wx'), + width: 20.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + userInfoBean!.wx_num!, + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + if (unLockWxNum != 1) + SizedBox( + width: 4.sp, + ), + if (unLockWxNum != 1) + Image.asset( + getDisCoverImage('unclock_icon'), + width: 20.sp, + ) + ], + )), + ), + ); + } + Future checkImStatus() async { imStatusOK = await loadIsShowSendGiftDialogData(); if (imStatusOK == false) { @@ -947,12 +1085,17 @@ class _TIMTextFieldLayoutNarrowState return imStatusOK; } - loadIsShowSendGiftDialogData() async { - - var data = await DioManager.instance.get(url: Api.isShow_give_gift +widget.userId!.split('_').last); + loadIsShowSendGiftDialogData() async { + var data = await DioManager.instance + .get(url: Api.isShow_give_gift + widget.userId!.split('_').last); if (data['code'] == 200) { if (data['data']) { - Get.bottomSheet(SendGiftDialog(accid: widget.userId!,title: data['msg'],), isScrollControlled: true, + Get.bottomSheet( + SendGiftDialog( + accid: widget.userId!, + title: data['msg'], + ), + isScrollControlled: true, enableDrag: false); return false; } @@ -984,13 +1127,10 @@ class _TIMTextFieldLayoutNarrowState return isVip; } - addChatRecord(String msgContent,String msgId,String sendTime) async { - - + addChatRecord(String msgContent, String msgId, String sendTime) async { String str = DateTime.now().toString().split('.').first; - var data = - await DioManager.instance.post(url: Api.chatRecord, params: { + var data = await DioManager.instance.post(url: Api.chatRecord, params: { "content": msgContent, "msgId": msgId, "sendTime": str, @@ -1041,7 +1181,8 @@ class _TIMTextFieldLayoutNarrowState final Duration videoDuration = videoPlayerController!.value.duration; final double durationInSeconds = videoDuration.inSeconds.toDouble(); - V2TimValueCallback? msgresult = await widget.model.sendVideoMessage( + V2TimValueCallback? msgresult = + await widget.model.sendVideoMessage( videoPath: pickedFile.path, snapshotPath: thumbnailPath, // 在此处可用 @@ -1051,7 +1192,8 @@ class _TIMTextFieldLayoutNarrowState inputElement: context, ); - addChatRecord('[视频]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); + addChatRecord('[视频]', msgresult!.data!.msgID! ?? '', + msgresult!.data!.timestamp!.toString() ?? ''); if (imageSource == ImageSource.camera) { DioManager.instance.get(url: Api.getAddTrialCount + "2"); @@ -1103,13 +1245,14 @@ class _TIMTextFieldLayoutNarrowState final XFile? pickedFile = await _picker.pickImage( source: ImageSource.gallery, ); - var msgresult = await widget.model.sendImageMessage( + var msgresult = await widget.model.sendImageMessage( imagePath: pickedFile!.path, convID: widget.conversationID, convType: widget.conversationType, inputElement: context); - addChatRecord('[图片]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); + addChatRecord('[图片]', msgresult!.data!.msgID! ?? '', + msgresult!.data!.timestamp!.toString() ?? ''); var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3"); } catch (e) { print(e); @@ -1137,12 +1280,13 @@ class _TIMTextFieldLayoutNarrowState if (null == pickedFile) { return; } - var msgresult = await widget.model.sendImageMessage( + var msgresult = await widget.model.sendImageMessage( imagePath: pickedFile.path, convID: widget.conversationID, convType: widget.conversationType, inputElement: context); - addChatRecord('[图片]', msgresult!.data?.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); + addChatRecord('[图片]', msgresult!.data?.msgID! ?? '', + msgresult!.data!.timestamp!.toString() ?? ''); DioManager.instance.get(url: Api.getAddTrialCount + "1"); } catch (e) {} } @@ -1188,4 +1332,18 @@ class _TIMTextFieldLayoutNarrowState // } // } } + + void loadUserData() async { + var data = await DioManager.instance.get( + url: + "${Api.getUserInfoTA + widget.conversationID.split('_').last}/home"); + var bean = BaseResponse.fromJson( + data, (data) => ResponseBean.fromJson(data)); + + if (bean.isSuccess()) { + userInfoBean = bean.data.user; + unLockWxNum = bean.data.unLockWxNum; + setState(() {}); + } + } } diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index 7e5d597..120897e 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -42,6 +42,7 @@ class _ChatPageState extends State { User? userInfoBean; var sub; + var sub1; @override void initState() { // TODO: implement initState @@ -82,6 +83,8 @@ class _ChatPageState extends State { sendMessageRes.data?.customElem?.extension; //自定义extension } }); + + } Widget renderCustomStickerPanel({ @@ -244,3 +247,8 @@ class _ChatPageState extends State { } } } + + +class ChatLoadUserInfoData { + +} \ No newline at end of file diff --git a/circle_app/lib/app/chat/widget/wish_dialog.dart b/circle_app/lib/app/chat/widget/wish_dialog.dart index 91f6725..d35fe01 100644 --- a/circle_app/lib/app/chat/widget/wish_dialog.dart +++ b/circle_app/lib/app/chat/widget/wish_dialog.dart @@ -56,7 +56,10 @@ class _WishDialogState extends State { tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; } } - setState(() {}); + if (mounted) { + setState(() {}); + } + } } diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index f003104..38d65b3 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -16,8 +16,11 @@ import 'package:flutter_pickers/style/picker_style.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:get/get.dart'; +import 'package:gradient_borders/gradient_borders.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import '../../common/Widgets/today_people_dialog.dart'; +import '../../common/colors/app_color.dart'; import '../select_circle/logic.dart'; import '../userinfo/logic.dart'; import 'logic.dart'; @@ -39,7 +42,6 @@ class _CirclePageState extends State int currentIndex = 0; - final logic = Get.find(); final state = Get.find().state; @@ -50,15 +52,14 @@ class _CirclePageState extends State @override bool get wantKeepAlive => true; - - @override void initState() { super.initState(); currentIndex = Random().nextInt(3); _pageController = PageController(initialPage: currentIndex); - _tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex); + _tabController = + TabController(length: 3, vsync: this, initialIndex: currentIndex); _tabController.addListener(_handleTabChange); getContext = context; } @@ -71,7 +72,6 @@ class _CirclePageState extends State logic.update(); } - @override void dispose() { _tabController.removeListener(_handleTabChange); // 移除监听 @@ -88,55 +88,53 @@ class _CirclePageState extends State return Scaffold( backgroundColor: Colors.transparent, body: SafeArea( - child:Stack( - children: [ - Column(children: [ - Obx(() { - return navigatorItem(controller.statistics.value); - }), - // Text(controller.state.msg), - //组件使用 - ]), - Container( - margin: EdgeInsets.only(top: 45.sp), - child: TabBarView( - controller: _tabController, - // controller: _pageController, - // onPageChanged: (index) { - // _tabController.animateTo(index); - // print("index=" + index.toString()); - // }, - children: [ - LikeView(), - // circleList(controller), - Vicinity(controller), - Discover(0) - ], - ), - ), - // _tabController.index == 0 - // ? Positioned( - // bottom: 36.sp, - // right: 10.sp, - // child: GestureDetector( - // onTap: () async { - // List numbers = []; - // numbers.add(MyConfigData( - // logic.getCircleIndex().id.toString(), - // logic.getCircleIndex().title!, - // false)); - // var data = await Get.toNamed(AppRoutes.Call_out, - // arguments: {'numbers': numbers}); - // }, - // child: Image.asset( - // getCircleImage('send_msg'), - // width: 60.sp, - // ))) - // : Center() - ], - ) - ), - + child: Stack( + children: [ + Column(children: [ + Obx(() { + return navigatorItem(controller.statistics.value); + }), + // Text(controller.state.msg), + //组件使用 + ]), + Container( + margin: EdgeInsets.only(top: 45.sp), + child: TabBarView( + controller: _tabController, + // controller: _pageController, + // onPageChanged: (index) { + // _tabController.animateTo(index); + // print("index=" + index.toString()); + // }, + children: [ + LikeView(), + // circleList(controller), + Vicinity(controller), + Discover(0) + ], + ), + ), + // _tabController.index == 0 + // ? Positioned( + // bottom: 36.sp, + // right: 10.sp, + // child: GestureDetector( + // onTap: () async { + // List numbers = []; + // numbers.add(MyConfigData( + // logic.getCircleIndex().id.toString(), + // logic.getCircleIndex().title!, + // false)); + // var data = await Get.toNamed(AppRoutes.Call_out, + // arguments: {'numbers': numbers}); + // }, + // child: Image.asset( + // getCircleImage('send_msg'), + // width: 60.sp, + // ))) + // : Center() + ], + )), ); }); } @@ -550,7 +548,7 @@ class _CirclePageState extends State } else if (index == 0) { showOKToast('小主,换个方向滑动呗~'); } - + print(index.toString()); }, index: controller.state.index, @@ -623,7 +621,8 @@ class _CirclePageState extends State ), child: Container( margin: EdgeInsets.all(0.6.sp), - padding: EdgeInsets.only(left: 6.sp,right: 6.sp,top: 4.sp,bottom: 4.sp), + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(17.0), @@ -684,7 +683,7 @@ class _CirclePageState extends State TabBar( isScrollable: true, controller: _tabController, - labelPadding: EdgeInsets.symmetric(horizontal: 8.0.sp), + labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp), indicator: UnderlineTabIndicator( borderSide: BorderSide( color: const Color(0xFF00FFF4), @@ -701,7 +700,7 @@ class _CirclePageState extends State child: Text( '喜欢', style: TextStyle( - fontSize: 20.sp, + fontSize: 18.sp, ), ), ), @@ -709,7 +708,7 @@ class _CirclePageState extends State child: Text( '附近', style: TextStyle( - fontSize: 20.sp, + fontSize: 18.sp, ), ), ), @@ -717,7 +716,7 @@ class _CirclePageState extends State child: Text( '发现', style: TextStyle( - fontSize: 20.sp, + fontSize: 18.sp, ), ), ), @@ -746,13 +745,12 @@ class _CirclePageState extends State ], ), onTap: (index) { - if (currentIndex == index) { if (index == 2) { EventBusManager.fire(DiscovrScrollTap()); } else if (index == 1) { EventBusManager.fire(NearScrollTap()); - } else if (index == 0) { + } else if (index == 0) { EventBusManager.fire(ScrollToTop()); } return; @@ -763,34 +761,50 @@ class _CirclePageState extends State // duration: const Duration(milliseconds: 300), // 动画时长 // curve: Curves.ease, // 动画曲线 // ); - }, ), ], ), ), Positioned( - right: 0, - child: _tabController.index == 0 - ? GestureDetector( - onTap: () { - Get.toNamed(AppRoutes.Call_out); - }, - child: Image.asset( - getCircleImage('callout_icon'), - width: 75.sp, - ), - ) - : GestureDetector( - onTap: () { - _showBottomSheet(context); - }, - child: Image.asset( - getCircleImage('icon_screen'), - width: 30.sp, - ), - ), - ), + right: 0, + child: _tabController.index == 0 + ? GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.Call_out); + }, + child: Image.asset( + getCircleImage('callout_icon'), + width: 75.sp, + ), + ) + : Row( + children: [ + InkWell( + onTap: () { + Get.bottomSheet( + TodayPeopleDialog(), + isScrollControlled: true, + enableDrag: false, + ); + }, + child: Image.asset( + getMsgImage('heart_icon'), + width: 24.sp, + ), + ), + SizedBox(width: 8.sp,), + GestureDetector( + onTap: () { + _showBottomSheet(context); + }, + child: Image.asset( + getCircleImage('icon_screen'), + width: 30.sp, + ), + ), + ], + )), ], ), ); @@ -802,14 +816,18 @@ class _CirclePageState extends State backgroundColor: Colors.transparent, builder: (BuildContext context) { return ScreenBottomSheetDialog( - genderList: _tabController.index == 1 ? logic.genderList : logic.dis_genderList, - orientationList: _tabController.index == 1 ? logic.orientationList : logic.dis_orientationList, - roleList: _tabController.index == 1 ? logic.roleList : logic.dis_roleList, + genderList: _tabController.index == 1 + ? logic.genderList + : logic.dis_genderList, + orientationList: _tabController.index == 1 + ? logic.orientationList + : logic.dis_orientationList, + roleList: + _tabController.index == 1 ? logic.roleList : logic.dis_roleList, callback: (genderList, orientationList, roleList) { if (_tabController.index == 1) { _onRefresh(); } else { - List genders = []; logic.dis_genderList.forEach((element) { if (element.isSelect) { @@ -826,7 +844,8 @@ class _CirclePageState extends State if (element.isSelect) orientations.add(element.id); }); - EventBusManager.fire(OptionFindclass(genders,roles,orientations)); + EventBusManager.fire( + OptionFindclass(genders, roles, orientations)); } }, ); // Use your custom widget here @@ -1144,12 +1163,15 @@ class DefaultPickerStyle extends PickerStyle { } class DiscovrScrollTap {} + class NearScrollTap {} + class CircleScrollTap {} class OptionFindclass { - List? genderList;List? orientationList;List? roleList; - - OptionFindclass(this.genderList,this.orientationList,this.roleList); + List? genderList; + List? orientationList; + List? roleList; + OptionFindclass(this.genderList, this.orientationList, this.roleList); } diff --git a/circle_app/lib/app/circle/widgets/discover.dart b/circle_app/lib/app/circle/widgets/discover.dart index 633bf2c..1ca035e 100644 --- a/circle_app/lib/app/circle/widgets/discover.dart +++ b/circle_app/lib/app/circle/widgets/discover.dart @@ -17,6 +17,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:get/get.dart'; import 'package:get/utils.dart'; +import 'package:gradient_borders/gradient_borders.dart'; import 'package:intl/intl.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import '../../../../util/eventBus.dart'; @@ -312,19 +313,26 @@ class _DiscoverState extends State Container( clipBehavior: Clip.hardEdge, decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10.sp), - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage( - getCircleImage('open_vip_bg'), - ))), + color: Colors.black.withOpacity(0.25), + borderRadius: BorderRadius.circular(10.sp), + border: GradientBoxBorder( + gradient: + AppColor.mainVerLinearGradient, + width: 1.sp, + ), + // image: DecorationImage( + // fit: BoxFit.fill, + // image: AssetImage( + // getCircleImage('open_vip_bg'), + // )) + ), height: screenHeight, width: Get.width, child: ClipRRect( - borderRadius: BorderRadius.circular(18), - clipBehavior: Clip.hardEdge, + borderRadius: BorderRadius.circular(10), + // clipBehavior: Clip.hardEdge, child: Container( - padding: EdgeInsets.all(2.sp), + // padding: EdgeInsets.all(2.sp), child: Swiper( autoplay: user.images!.length == 1 ? false diff --git a/circle_app/lib/app/circle/widgets/vicinity.dart b/circle_app/lib/app/circle/widgets/vicinity.dart index 293c9b1..f672de0 100644 --- a/circle_app/lib/app/circle/widgets/vicinity.dart +++ b/circle_app/lib/app/circle/widgets/vicinity.dart @@ -491,6 +491,7 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin void _onRefresh() async { widget.logic.vicinityPage = 1; widget.logic.offset = 0; + widget.logic.getBanner(); widget.logic.getNearByList(); // logic.refreshController.refreshCompleted(); } diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index ee5de48..048c206 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -11,6 +11,7 @@ import 'package:circle_app/app/msg/logic.dart'; import 'package:circle_app/main.dart'; import 'package:circle_app/network/api.dart'; import 'package:circle_app/network/dio_manager.dart'; +import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/util/util.dart'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; @@ -23,6 +24,7 @@ import 'package:tencent_cloud_chat_uikit/data_services/message/message_services. import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; +import '../../common/Widgets/today_people_dialog.dart'; import '../../util/PaymentUtils.dart'; import '../../util/SharedPreferencesHelper.dart'; import '../../util/eventBus.dart'; @@ -53,6 +55,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { bool isUpdateVersion = false; + + String accountId = ''; @override void onClose() { // TODO: implement onClose @@ -319,8 +323,38 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { if (!coreInstance.isLoginSuccess) { var data = await DioManager.instance.get(url: Api.getIMInfo); if (data['code'] == 200) { + loginIM( data['data']['account_id'].toString(), data['data']['user_sig']); + accountId = data['data']['account_id'].toString(); + + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + var date = DateTime.now(); + var date2 = '${date.year}-${date.month}-${date.day}-${accountId}'; + String firspop = 'firspop-${accountId}'; + if (sp.preferences!.containsKey(firspop)) { + var lastDate = sp.preferences!.getString(firspop); + if (lastDate != date2) { + Future.delayed(Duration(seconds: 15), () { + if (Get.currentRoute != AppRoutes.Login) { + sp.preferences!.setString(firspop, date2); + Get.bottomSheet(TodayPeopleDialog(), isScrollControlled: true, + enableDrag: false,); + } + }); + } + } else { + Future.delayed(Duration(seconds: 15), () { + if (Get.currentRoute != AppRoutes.Login) { + sp.preferences!.setString(firspop, date2); + Get.bottomSheet(TodayPeopleDialog(),isScrollControlled: true, + enableDrag: false,); + } + }); + + + } + } } } @@ -349,7 +383,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { sharedPreferences.setString( SharedPreferencesHelper.firstLogin, '1'); - } loadMyCircleData() async { 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 ceca43f..97bdbbe 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -646,6 +646,7 @@ class _TIMConversationState extends TIMUIKitState { // ·你喜欢的圈友也喜欢TA80 // ·你们都在深圳留下过足迹70 // ·你们有2个共同的圈子:圈子名称、圈子名称60 + // ·我刚来到这里哦55 // ·可能是你想认识的人50 // ·很多圈友都喜欢TA40 // ·TA是乐园优秀圈主哦~30 @@ -680,6 +681,12 @@ class _TIMConversationState extends TIMUIKitState { } } } + if (titleList.length < 3) { + if (recommendCircleFriendData.containsKey('is_new_user')) { + titleList.add('我刚来到这里哦'); + } + } + if (titleList.length < 3) { if (recommendCircleFriendData['is_wanna_meet']) { titleList.add('很多圈友都喜欢TA'); diff --git a/circle_app/lib/app/msg/sys_notify_list/view.dart b/circle_app/lib/app/msg/sys_notify_list/view.dart index 2de154a..8e015ef 100644 --- a/circle_app/lib/app/msg/sys_notify_list/view.dart +++ b/circle_app/lib/app/msg/sys_notify_list/view.dart @@ -30,7 +30,7 @@ class Sys_notify_listPage extends StatelessWidget { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - centerTitle: "系统通知", + centerTitle: "官方通知", ), body: Container( width: Get.width, diff --git a/circle_app/lib/app/msg/view.dart b/circle_app/lib/app/msg/view.dart index 3688a2a..46ea920 100644 --- a/circle_app/lib/app/msg/view.dart +++ b/circle_app/lib/app/msg/view.dart @@ -436,7 +436,7 @@ class _MsgPageState extends State with AutomaticKeepAliveClientMixin { ), ClipOval( child: Image.network( - info['avatar'], + info['avatar_thumb'], fit: BoxFit.cover, width: 50.sp, height: 50.sp, diff --git a/circle_app/lib/app/userinfo/logic.dart b/circle_app/lib/app/userinfo/logic.dart index c62d14a..c9ef8f9 100644 --- a/circle_app/lib/app/userinfo/logic.dart +++ b/circle_app/lib/app/userinfo/logic.dart @@ -213,21 +213,29 @@ class UserinfoLogic extends GetxController { startCountdown(){ - timer = Timer.periodic(const Duration(seconds: 1), (t) { + timer = Timer.periodic(const Duration(seconds: 1), (t) async { if (countdown > 0) { countdown--; } else { - showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){ - setLike(); - }); - + bool isTip = await checkIsShowTip(); + if (isTip) { + showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){ + setLike(); + }); + } timer?.cancel(); // 倒计时结束,取消定时器 } }); } + Future checkIsShowTip() async { + var result = await DioManager.instance.get( + url: Api.popup + userId , + ); + return result['data']; + } Future fetchMyAlbum(String url) async { var myAlbumData = await DioManager.instance.get(url: url); diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index 74f0bbc..fd730dc 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -131,202 +131,198 @@ class MyTabbedScreenState extends State fit: BoxFit.cover, ), ), - child: Stack( - children: [ - Scaffold( - backgroundColor: Colors.transparent, - appBar: MyAppBar( - centerTitle: logic.userInfoBean != null - ? "${logic.userInfoBean!.nickname}" - : "个人主页", - actionWdiget: logic.isMe - ? GestureDetector( - onTap: () async { - await showAddWxPicker( + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: logic.userInfoBean != null + ? "${logic.userInfoBean!.nickname}" + : "个人主页", + actionWdiget: logic.isMe + ? GestureDetector( + onTap: () async { + await showAddWxPicker( + logic.userInfoBean!.wx_num!.isNotEmpty ?? false, + isHidden: logic.userInfoBean!.wx_num!.isNotEmpty ?? false, - isHidden: - logic.userInfoBean!.wx_num!.isNotEmpty ?? false, - isWxHidden: logic.userInfoBean!.hide_wx_num == 1, - ); - logic.fetchUserInfo(Api.getUserInfo); - }, - child: Stack( - alignment: Alignment.center, - children: [ - Container( - width: 101.sp, - height: 26.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12.sp), - gradient: LinearGradient( - colors: [ - Color(0xFF30FFD9), - Color(0xFFDD3DF4) - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), + isWxHidden: logic.userInfoBean!.hide_wx_num == 1, + ); + logic.fetchUserInfo(Api.getUserInfo); + }, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 101.sp, + height: 26.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12.sp), + gradient: LinearGradient( + colors: [ + Color(0xFF30FFD9), + Color(0xFFDD3DF4) + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, ), - Container( - width: 100.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.sp), - color: Color(0xFF240F3B)), - alignment: Alignment.center, - height: 24.sp, - child: Text( - '填写微信号', - style: TextStyle( - color: Colors.white, fontSize: 14.sp), - ), - ) - ], - ), - // Container( - // alignment: Alignment.center, - // // width: 90.sp, - // height: 24.sp, - // padding: - // EdgeInsets.only(left: 6.sp, right: 6.sp), - // decoration: BoxDecoration( - // color: AppColor.mainColor, - // borderRadius: - // BorderRadiusDirectional.circular( - // 11.sp)), - // child: Text( - // '填写微信号', - // style: TextStyle( - // color: Colors.white, fontSize: 13.sp), - // ), - // ), - ) - : logic.userInfoBean!= null ? logic.userInfoBean!.wx_num.isEmpty ? GestureDetector( - onTap: () { - logic.sendWhatToWx(); - }, - child: Stack( - alignment: Alignment.center, - children: [ - Container( - width: 101.sp, - height: 26.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12.sp), - gradient: LinearGradient( - colors: [ - Color(0xFF30FFD9), - Color(0xFFDD3DF4) - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, ), ), - ), - Container( - width: 100.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.sp), - color: Color(0xFF240F3B)), - alignment: Alignment.center, - height: 24.sp, - child: Text( - '想要微信号', - style: TextStyle( - color: Colors.white, fontSize: 14.sp), - ), - ) - ], - ), - ) : Container() : Container()), - body: Stack( - // fit: StackFit.expand, + Container( + width: 100.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(11.sp), + color: Color(0xFF240F3B)), + alignment: Alignment.center, + height: 24.sp, + child: Text( + '填写微信号', + style: TextStyle( + color: Colors.white, fontSize: 14.sp), + ), + ) + ], + ), + // Container( + // alignment: Alignment.center, + // // width: 90.sp, + // height: 24.sp, + // padding: + // EdgeInsets.only(left: 6.sp, right: 6.sp), + // decoration: BoxDecoration( + // color: AppColor.mainColor, + // borderRadius: + // BorderRadiusDirectional.circular( + // 11.sp)), + // child: Text( + // '填写微信号', + // style: TextStyle( + // color: Colors.white, fontSize: 13.sp), + // ), + // ), + ) + : logic.userInfoBean!= null ? logic.userInfoBean!.wx_num.isEmpty ? GestureDetector( + onTap: () { + logic.sendWhatToWx(); + }, + child: Stack( + alignment: Alignment.center, children: [ - Container( - height: Get.height, - width: Get.width, - // color: Colors.red, - child: - NestedScrollView( - controller: scrollController, - headerSliverBuilder: (context,isScrolled) { - return [ - SliverAppBar( - stretch: false, - elevation: 0, - primary: true, - pinned: true, - floating: true, - forceElevated: false, - toolbarHeight: 0, - foregroundColor: Colors.transparent, - backgroundColor: Colors.transparent, - expandedHeight: (!logic.isMe ? 372.sp : 312.sp) + (logic.userInfoBean != null - ? logic.userInfoBean!.wx_num!.isNotEmpty - ? 59.sp : 0 : 0), - bottom: PreferredSize( - preferredSize: Size(Get.width,40), - child: titleTab(logic), - ), - flexibleSpace: FlexibleSpaceBar( - expandedTitleScale: 1.0, - centerTitle: true, - title: buildContent(logic), - ), - ) - ]; - }, - body: contentWidget(logic), - // slivers: [ - // SliverAppBar( - // leadingWidth: 0, - // titleSpacing: 0, - // title: buildContent(logic), - // toolbarHeight: 500.sp, - // backgroundColor: Colors.transparent, - // ), - // SliverPadding( - // padding: EdgeInsets.zero, - // sliver: SliverList(delegate: - // SliverChildBuilderDelegate((context, index) { - // // if (index == 0) { - // // return buildContent(logic); - // // } - // return contentWidget(logic); - // },childCount: 1),)) - // - // // (delegate: (BuildContext context, int index) { - // // return contentWidget(logic); - // // }), - // - // // buildContent(logic), - // ] - )), - Positioned( - bottom: 27.sp, - width: Get.width, - child: _meInfoButton(logic), - ), - !logic.isShowAlbum && logic.isMe - ? Positioned( - bottom: 36.sp, - right: 10.sp, - child: GestureDetector( - onTap: () async { - List numbers = []; - - var data = await Get.toNamed(AppRoutes.Call_out, - arguments: {'numbers': numbers}); - }, - child: Image.asset( - getCircleImage('send_msg'), - width: 60.sp, - ))) - : Container() + Container( + width: 101.sp, + height: 26.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12.sp), + gradient: LinearGradient( + colors: [ + Color(0xFF30FFD9), + Color(0xFFDD3DF4) + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + ), + Container( + width: 100.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(11.sp), + color: Color(0xFF240F3B)), + alignment: Alignment.center, + height: 24.sp, + child: Text( + '想要微信号', + style: TextStyle( + color: Colors.white, fontSize: 14.sp), + ), + ) ], ), - ), - ], + ) : Container() : Container()), + body: Stack( + // fit: StackFit.expand, + children: [ + Container( + height: Get.height, + width: Get.width, + // color: Colors.red, + child: + NestedScrollView( + controller: scrollController, + headerSliverBuilder: (context,isScrolled) { + return [ + SliverAppBar( + stretch: false, + elevation: 0, + primary: true, + pinned: true, + floating: true, + forceElevated: false, + toolbarHeight: 0, + foregroundColor: Colors.transparent, + backgroundColor: Colors.transparent, + expandedHeight: 374.sp + (logic.userInfoBean != null + ? logic.userInfoBean!.wx_num!.isNotEmpty && logic.userId.toString().isNotEmpty + ? 59.sp : 0 : 0), + bottom: PreferredSize( + preferredSize: Size(Get.width,40), + child: titleTab(logic), + ), + flexibleSpace: FlexibleSpaceBar( + expandedTitleScale: 1.0, + centerTitle: true, + title: buildContent(logic), + ), + ) + ]; + }, + body: contentWidget(logic), + // slivers: [ + // SliverAppBar( + // leadingWidth: 0, + // titleSpacing: 0, + // title: buildContent(logic), + // toolbarHeight: 500.sp, + // backgroundColor: Colors.transparent, + // ), + // SliverPadding( + // padding: EdgeInsets.zero, + // sliver: SliverList(delegate: + // SliverChildBuilderDelegate((context, index) { + // // if (index == 0) { + // // return buildContent(logic); + // // } + // return contentWidget(logic); + // },childCount: 1),)) + // + // // (delegate: (BuildContext context, int index) { + // // return contentWidget(logic); + // // }), + // + // // buildContent(logic), + // ] + )), + Positioned( + bottom: 27.sp, + width: Get.width, + child: _meInfoButton(logic), + ), + !logic.isShowAlbum && logic.isMe + ? Positioned( + bottom: 36.sp, + right: 10.sp, + child: GestureDetector( + onTap: () async { + List numbers = []; + + var data = await Get.toNamed(AppRoutes.Call_out, + arguments: {'numbers': numbers}); + }, + child: Image.asset( + getCircleImage('send_msg'), + width: 60.sp, + ))) + : Container() + ], + ), ), ); } @@ -534,7 +530,7 @@ class MyTabbedScreenState extends State fontSize: 12.sp, color: logic.isOnline ? const Color(0xFF00FFF4) - : const Color(0xFF787575), + : const Color(0xFF00FFF4), ), ), ], @@ -564,7 +560,9 @@ class MyTabbedScreenState extends State logic.userInfoBean!.wx_num, logic.userInfoBean!.id.toString(), logic.userInfoBean!.avatar!, - () {}), + () { + logic. fetchUserInfo("${Api.getUserInfoTA + logic.userId}/home"); + }), ], )) : Container() diff --git a/circle_app/lib/common/Widgets/today_people_dialog.dart b/circle_app/lib/common/Widgets/today_people_dialog.dart new file mode 100644 index 0000000..a969fd8 --- /dev/null +++ b/circle_app/lib/common/Widgets/today_people_dialog.dart @@ -0,0 +1,564 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:gradient_borders/gradient_borders.dart'; + +import '../../app/circle/widgets/discover.dart'; +import '../../network/api.dart'; +import '../../network/dio_manager.dart'; +import '../../router/app_routers.dart'; +import '../../util/util.dart'; +import '../colors/app_color.dart'; + +class TodayPeopleDialog extends StatefulWidget { + @override + _TodayPeopleDialogState createState() => new _TodayPeopleDialogState(); +} + +class _TodayPeopleDialogState extends State { + // TODO: add state variables and methods + var recommendCircleFriendData = {}; + List chatImIdList = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + loadRecommendCircleFriendData(); + } + + void loadRecommendCircleFriendData() async { + var data = await DioManager.instance.get( + url: Api.chatRecommendFriend, + ); + + if (data['code'] == 200) { + recommendCircleFriendData = data['data'][0]; + setState(() {}); + } + } + + itemWidget() { + var info = {}; + + var user = Users.fromJson(recommendCircleFriendData['user']); + + // 对方喜欢了你100 + // ·你们有共同喜欢的圈友90 + // ·你喜欢的圈友也喜欢TA80 + // ·你们都在深圳留下过足迹70 + // ·你们有2个共同的圈子:圈子名称、圈子名称60 + // ·可能是你想认识的人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('我刚来到这里哦'); + } + } + + + 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]; + } + + List circleList = recommendCircleFriendData['interests']; + return Container( + 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: ''); + }, + 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, + ), + ) + ], + ), + ); + } + + circleInfoItem(var bean, int index) { + return GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.Signal_circle_list, + arguments: bean['id'].toString()); + }, + child: Container( + margin: EdgeInsets.only(right: 10.sp), + padding: EdgeInsets.only(left: 12.sp, right: 12.sp), + height: 72.sp, + width: 140.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.sp), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, + ), + ), + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 42.sp, + height: 42.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + gradient: const LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFF71F3F2), + Color(0xFFF558FF), + ], + stops: [0.0365, 0.9427], + ), + ), + padding: EdgeInsets.all(1.sp), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: CachedNetworkImage( + imageUrl: bean['image'], + width: 40.sp, + height: 40.sp, + memCacheHeight: 40, + memCacheWidth: 40, + fit: BoxFit.cover), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: 8.sp, + ), + // alignment: Alignment., + height: 72.sp, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + bean['title'], + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w600), + ), + SizedBox( + height: 4.sp, + ), + Text( + // "view_total" -> 21 + '${convertToTenThousand(bean['viewTotal'])}人看过', + textAlign: TextAlign.left, + style: TextStyle( + color: const Color(0xff03FEFB), + fontSize: 12.sp, + ), + ), + ], + ), + )), + ], + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return Scaffold( + backgroundColor: Colors.black.withOpacity(0.75), + body: recommendCircleFriendData.isNotEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(bottom: 16.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + 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, + ), + ], + ), + ), + itemWidget(), + Container( + height: 40.sp, + margin: EdgeInsets.only(top: 20.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + width: 100.sp, + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF392D53), + borderRadius: BorderRadius.circular(20.sp)), + child: Text( + '先不看了', + style: TextStyle( + color: Colors.white, fontSize: 15.sp), + ), + ), + ), + SizedBox( + width: 40.sp, + ), + GestureDetector( + onTap: () { + loadRecommendCircleFriendData(); + }, + child: Container( + width: 100.sp, + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: AppColor.mainHorLinearGradient, + borderRadius: BorderRadius.circular(20.sp)), + child: Text( + '换一位', + style: TextStyle( + color: Colors.white, fontSize: 15.sp), + )), + ) + ], + ), + ) + ], + ) + : Container()); + } +} diff --git a/circle_app/lib/common/Widgets/unlock_wx_tip.dart b/circle_app/lib/common/Widgets/unlock_wx_tip.dart index c515556..e246e70 100644 --- a/circle_app/lib/common/Widgets/unlock_wx_tip.dart +++ b/circle_app/lib/common/Widgets/unlock_wx_tip.dart @@ -170,7 +170,7 @@ class _UnlockWxTipState extends State { SmartDialog.showLoading(); String itemId = prices[selectedIndex].itemId!; if (Platform.isIOS ) { - IOSPayment.instance.iosPay(itemId,itemId,3,userId:widget.userId); + IOSPayment.instance.iosPay(itemId, prices[selectedIndex].id.toString(),3,userId:widget.userId); } else { unlockingPayment(prices[selectedIndex].id.toString(), (){ Get.back(); diff --git a/circle_app/lib/common/const.dart b/circle_app/lib/common/const.dart index 5d555d4..ff990cc 100644 --- a/circle_app/lib/common/const.dart +++ b/circle_app/lib/common/const.dart @@ -24,6 +24,7 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl, var result = await DioManager() .post(url: Api.UnlockWx, params: {'targetUserId': userId}); if (result['code'] == 200) { + showToast('解锁成功'); callBack(); } else { Get.bottomSheet(UnlockWxTip(userId, avatarUrl), @@ -35,8 +36,8 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl, }); } } else { - Clipboard.setData(ClipboardData(text: wx)); - showToast('微信号复制成功'); + // Clipboard.setData(ClipboardData(text: wx)); + // showToast('微信号复制成功'); } }, child: Container( diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index 5d4eb08..e2d067a 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -305,4 +305,7 @@ class Api { //想要微信 static const noticeWxNum = '/user-service/user/updateWxNum/notice/'; + + //是否弹窗 + static const popup = '/user-service/follow/popup/'; } \ No newline at end of file diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index 2148460..cee84c6 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'dart:ui'; +import 'package:circle_app/app/chat/view.dart'; import 'package:circle_app/app/circle/widgets/discover.dart'; import 'package:circle_app/app/userinfo/logic.dart'; import 'package:circle_app/common/values/values.dart'; @@ -17,6 +18,7 @@ import 'package:oktoast/oktoast.dart'; import 'package:path_provider/path_provider.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:video_compress/video_compress.dart'; import '../app/circle/logic.dart'; @@ -427,12 +429,17 @@ void navigateToInviteStrategy() { }); } -void navigateToCustomRoute(BannerItem bannerItem) { +void navigateToCustomRoute(BannerItem bannerItem) async { print(bannerItem.param); switch (bannerItem.type) { case 1: - Get.toNamed(AppRoutes.WebViewActivity, - arguments: {'title': "", "url": bannerItem.param.toString()}); + if (bannerItem.scene == 'internal') { + Get.toNamed(AppRoutes.WebViewActivity, + arguments: {'title': "", "url": bannerItem.param.toString()}); + } else { + await launch(bannerItem.param.toString(),forceSafariVC: false); + } + break; case 2: switch (bannerItem.scene) { @@ -477,6 +484,9 @@ unLockWxSuccessResult(String userId) { } else if (currentRoute == AppRoutes.UserInfoActivity) { var logic = Get.find(); logic.fetchUserInfo("${Api.getUserInfoTA + userId}/home"); + } else if (currentRoute == AppRoutes.Chat) { + EventBusManager.fire(ChatLoadUserInfoData()); + } } diff --git a/circle_app/pubspec.lock b/circle_app/pubspec.lock index cd8dde9..e89bc47 100644 --- a/circle_app/pubspec.lock +++ b/circle_app/pubspec.lock @@ -614,6 +614,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.3" + flutter_install_app: + dependency: "direct main" + description: + name: flutter_install_app + sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53" + url: "https://pub.dev" + source: hosted + version: "1.3.0" flutter_intl: dependency: "direct main" description: diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index 34ae355..490dd5d 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -90,7 +90,7 @@ dependencies: fluwx: ^3.8.1+1 event_bus: ^2.0.0 #安装apk -# flutter_install_app: 1.3.0 + flutter_install_app: 1.3.0 #闪屏页 flutter_native_splash: 2.2.16 #腾讯离线推送