diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index 7ca6218..540d074 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 89 - versionName "2.4.4" + versionCode 92 + versionName "2.4.7" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/android/build.gradle b/circle_app/android/build.gradle index 6616767..5331b8d 100644 --- a/circle_app/android/build.gradle +++ b/circle_app/android/build.gradle @@ -26,7 +26,7 @@ allprojects { maven { url "https://storage.googleapis.com/download.flutter.io" } maven { url "https://jitpack.io" } maven { url 'https://mvn.getui.com/nexus/content/repositories/releases' } - maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" } +// maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" } maven { url 'https://repo1.maven.org/maven2/' } maven {url 'https://developer.huawei.com/repo/'} maven { url 'https://developer.hihonor.com/repo/' } diff --git a/circle_app/data/img/mine/bubble_icon.png b/circle_app/data/img/mine/bubble_icon.png new file mode 100644 index 0000000..5cf5d3c Binary files /dev/null and b/circle_app/data/img/mine/bubble_icon.png differ diff --git a/circle_app/data/img/mine/hand_icon.png b/circle_app/data/img/mine/hand_icon.png new file mode 100644 index 0000000..12a2b31 Binary files /dev/null and b/circle_app/data/img/mine/hand_icon.png differ diff --git a/circle_app/lib/circle_app/bill/view.dart b/circle_app/lib/circle_app/bill/view.dart index 516e7c2..3c90bcc 100644 --- a/circle_app/lib/circle_app/bill/view.dart +++ b/circle_app/lib/circle_app/bill/view.dart @@ -1,5 +1,6 @@ import 'package:circle_app/circle_app/userinfo/logic.dart'; import 'package:circle_app/commons/colors/app_color.dart'; +import 'package:circle_app/commons/widgets/base_tip_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -8,6 +9,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import '../../router/routers.dart'; import '../../utils/util.dart'; +import '../circle_list/logic.dart'; +import '../home/logic.dart'; import 'logic.dart'; class BillPage extends StatefulWidget { @@ -160,7 +163,42 @@ class _BillState extends State with SingleTickerProviderStateMixin { ), ), ) - : noResultWidget(); + : noResultWidget(tip:type == 2 ? "正在等待被填充~" : '',action: type == 3 ? '申请圈子代理人快速增加收入' : type == 1 ? '首充可送小票/经验值/会员' : '',callBack: () async { + if (type == 3) { + Get.until((route) { + return route.isFirst; + }); + var logic = Get.find(); + logic.updateIndex(1); + + LikeLogic likeLogic; + if (Get.isRegistered()) { + likeLogic = Get.find(); + if (likeLogic.mycircle.lists.isEmpty) { + await likeLogic.loadMyCircleData(); + } + if (likeLogic.mycircle.lists.isNotEmpty) { + likeLogic.currentIndex = 0; + + likeLogic.update(); + } + } else { + Future.delayed(Duration(milliseconds: 2500),() async { + likeLogic = Get.find(); + if (likeLogic.mycircle.lists.isEmpty) { + await likeLogic.loadMyCircleData(); + } + if (likeLogic.mycircle.lists.isNotEmpty) { + likeLogic.currentIndex = 0; + likeLogic.update(); + } + }); + } + + } else if (type == 1){ + showRechargeScreenDialog(''); + } + }); } onRefresh(int type, int page) async { @@ -290,7 +328,7 @@ class ListItemWidget extends StatelessWidget { type == 2 ? '-' + item.amount.toString() + '小票' : '+' + - '${type == 3 ? (item.amount * 0.01).toStringAsFixed(2) + '元' : item.amount.toString() + '小票'}', + '${type == 3 ? (item.amount).toString() + '小票' : item.amount.toString() + '小票'}', style: TextStyle( color: const Color(0xffefd84e), fontSize: 14.0.sp, diff --git a/circle_app/lib/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index 0d63c33..c82e267 100644 --- a/circle_app/lib/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -1251,7 +1251,7 @@ class _TIMTextFieldLayoutNarrowState var status = await checkCameraStatus(); if (!status) return; } else { - await requestStoragePermission(); + // await requestStoragePermission(); } XFile? pickedFile; @@ -1366,7 +1366,7 @@ class _TIMTextFieldLayoutNarrowState if (!isOK) { return; } - await requestStoragePermission(); + // await requestStoragePermission(); var status = await checkCameraStatus(); if (!status) return; try { diff --git a/circle_app/lib/circle_app/circle/logic.dart b/circle_app/lib/circle_app/circle/logic.dart index 9b5f884..23f42ba 100644 --- a/circle_app/lib/circle_app/circle/logic.dart +++ b/circle_app/lib/circle_app/circle/logic.dart @@ -22,6 +22,7 @@ import '../../commons/config.dart'; import '../../commons/widgets/refresh_list_manager.dart'; import '../../net/api.dart'; import '../../net/dio_manager.dart'; +import '../../utils/SharedPreferencesHelper.dart'; import '../../utils/eventBus.dart'; import '../../utils/newbie_guide_tip.dart'; import '../../utils/qiniu.dart'; @@ -219,12 +220,12 @@ final ScrollController nearScrollController = ScrollController(); loadCircleListData() async { var data = await DioManager.instance.get( - url: Api.getCircleInterests, params: {"page": page, 'page_size': 20}); + url: Api.getCircleInterests, params: {"page": page, 'page_size': 10}); var bean = BaseResponse.fromJson( data, (data) => InterestsBean.fromJson(data)); if (bean.data is InterestsBean && bean.isSuccess()) { circle = bean.data!; - if (circle.lists.length < 20) { + if (circle.lists.isEmpty) { isMore = false; } @@ -646,8 +647,14 @@ final ScrollController nearScrollController = ScrollController(); position = await getCurrentPosition(); await getCurrentCity(); } else if (isShowLocationDialogEd == false && isShowLocationDialog == false) { - isShowLocationDialogEd = true; - update(); + + SharedPreferencesHelper helper = + await SharedPreferencesHelper.getInstance(); + if (!(await helper.isShowNearLocation())) { + isShowLocationDialogEd = true; + update(); + } + } } } diff --git a/circle_app/lib/circle_app/circle/state.dart b/circle_app/lib/circle_app/circle/state.dart index ae2dfa5..fa33257 100644 --- a/circle_app/lib/circle_app/circle/state.dart +++ b/circle_app/lib/circle_app/circle/state.dart @@ -26,6 +26,8 @@ class Lists { int? userTop; String? create_time; String? at; + Map? topInteractType; + int? isInteract; Lists( {this.album, this.chat, this.content, this.id, this.isQueen, this.user}); @@ -46,10 +48,12 @@ class Lists { : null; showType = json['showType']; interest = json['interest'] ?? {}; + topInteractType = json['topInteractType'] ?? {}; create_time = json['createTime'] ?? json['create_time']; // "createTime" -> "2024-12-04 22:00" isQueen = json['is_queen']; userTop = json['userTop'] ?? 0; + isInteract = json['interactedType'] ?? 0; user = json['user'] != null ? new User.fromJson(json['user']) : null; } diff --git a/circle_app/lib/circle_app/circle/widgets/discover.dart b/circle_app/lib/circle_app/circle/widgets/discover.dart index 683a11d..eb6b9d0 100644 --- a/circle_app/lib/circle_app/circle/widgets/discover.dart +++ b/circle_app/lib/circle_app/circle/widgets/discover.dart @@ -417,11 +417,12 @@ class _DiscoverState extends State loadData(); } - _onLoading() { + _onLoading() async { if (isLoadMore) return; // if (refreshController.footerStatus == LoadStatus.loading) return; isLoadMore = true; - loadData(); + await loadData(); + isLoadMore = false; } @override diff --git a/circle_app/lib/circle_app/circle/widgets/info_list_view.dart b/circle_app/lib/circle_app/circle/widgets/info_list_view.dart index 567575a..faea304 100644 --- a/circle_app/lib/circle_app/circle/widgets/info_list_view.dart +++ b/circle_app/lib/circle_app/circle/widgets/info_list_view.dart @@ -34,6 +34,7 @@ import '../../../utils/cache_img.dart'; import '../../../utils/eventBus.dart'; import '../../circle_list/logic.dart'; import '../../circle_list/widgets/hug_tip.dart'; +import '../../circle_list/widgets/right_circle_iten.dart'; class InfoListView extends StatefulWidget { var logic; @@ -59,11 +60,20 @@ class InfoListViewState extends State with AutomaticKeepAliveClien bool isLoad = true; bool callOutMore = true; + bool isShowEmoji = false; var circleId = ''; List lists = []; double widgetWidth = 0.0; Map interestAgentMap = {}; + + List emojis = [ + "❤️", "🪢", "⛓️", "🕯️", "🔐", "🔔", "⭕️", "📏", "🪡", "🎭", + "👙", "👅", "🦶", "🧎", "⚔️", "🍌", "🦋", "🌼", "👏", "🤟", + "🙏", "🦴", "🐶", "👿", "👼", "👻", "🌹", "💌", "😘", "😍", + "🫣", "😂", "🤐", "😱", "🫥" +]; + @override void dispose() { // TODO: implement dispose @@ -262,7 +272,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien } Get.toNamed(Routes.Chat, arguments: con); } else if (data['code'] == 32104) { - showReportDialog(Get.context!, data['msg']); + showReportDialog(Get.context!, circleId); } } @@ -335,7 +345,6 @@ class InfoListViewState extends State with AutomaticKeepAliveClien bean.chat!.count = bean.chat!.count! + 1; widget.logic.update(); } - } } @@ -1015,6 +1024,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien ///至尊喊话 vipDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, style: TextStyle(color: Colors.white, fontSize: 14.sp), @@ -1343,50 +1353,99 @@ class InfoListViewState extends State with AutomaticKeepAliveClien ); }), ), - Container( - height: 30.sp, - padding: EdgeInsets.only(left: 5.sp, right: 10.sp), - margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp,bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000) - ), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( - width: 24 + 12.sp * widgets.length - 8.sp, - height: 24.sp, - child: Stack(children: widgets), - ) - : Container(), - SizedBox( - width: 4.sp, - ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), fontSize: 14.sp), - )), - GestureDetector( - onTap: () { - pushMsgPage(lists, widget.bean.id.toString(),); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( + width: 24 + 12.sp * widgets.length - 8.sp, + height: 24.sp, + child: Stack(children: widgets), + ) + : Container(), + SizedBox( + width: 2.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + widget.bean.id.toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 50.sp, + ), + ) + ], ), - ) - ], - ), + ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], ) ], ), @@ -1396,6 +1455,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien ///普通图文喊话 normalDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, style: TextStyle(color: Colors.white, fontSize: 14.sp), @@ -1721,51 +1781,99 @@ class InfoListViewState extends State with AutomaticKeepAliveClien ); })) : Container(), - Container( - height: 30.sp, - padding: EdgeInsets.only(left: 5.sp, right: 10.sp,), - margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 10.sp,bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( - width: 24 + 12.sp * widgets.length - 8.sp, - height: 24.sp, - child: Stack(children: widgets), - ) - : Container(), - SizedBox( - width: 4.sp, + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( + width: 24 + 12.sp * widgets.length - 8.sp, + height: 24.sp, + child: Stack(children: widgets), + ) + : Container(), + SizedBox( + width: 2.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + widget.bean.id.toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 50.sp, + ), + ) + ], + ), ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), fontSize: 14.sp), - )), - GestureDetector( - onTap: () async{ - pushMsgPage(lists, widget.bean.id.toString()); + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } - // }); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, - )) - ], - ), - ), + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 10.sp : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], + ) ], ), @@ -1780,6 +1888,121 @@ class InfoListViewState extends State with AutomaticKeepAliveClien )); } + OverlayEntry? _overlayEntry; + + void _showEmojiPicker(Lists list,int id,BuildContext context, Offset position) { + if (isShowEmoji) return; + isShowEmoji = true; + _overlayEntry = OverlayEntry( + builder: (context) => Stack( + children: [ + // 遮罩层,点击关闭 + Positioned.fill( + child: GestureDetector( + onTap: () { + _removeOverlay(); + isShowEmoji = false; + }, + child: Container( + color: Colors.black.withOpacity(0.3), + ), + ), + ), + // 表情选择器 + Positioned( + left: position.dx - 190.w, + top: position.dy - 60.sp, + child: Material( + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 气泡框 + Container( + width: 200.w, // 设置最大宽度,超出才会滚动 + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + spreadRadius: 2, + ), + ], + ), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: emojis.map((emoji) => Padding( + padding: EdgeInsets.symmetric(horizontal: 4), + child: _emojiButton(emoji,id,list), + )).toList(), + ),), + ), + // 底部倒三角形 + ], + ), + )), + Positioned( + left: position.dx - 12.w, + top: position.dy - 15, + child: CustomPaint( + size: Size(20, 10), + painter: TrianglePainter(), + ), + ) + ], + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + + } + + Widget _emojiButton(String emoji,int id,Lists list) { + return GestureDetector( + onTap: () async { + print("选择了表情: $emoji"); + _removeOverlay(); + isShowEmoji = false; + + int index = emojis.indexOf(emoji) + 1; + var result = await DioManager.instance.post(url: Api.interactEmoji,params: { + "calloutId": id, + "type": index + }); + if (result['code'] == 200) { + var data = await DioManager.instance.get(url: Api.signCalloutDetail,params: { + 'id':id, + }); + if (data['code'] == 200) { + Lists bean =Lists.fromJson(data['data']); + index = lists.indexOf(list); + lists[index] = bean; + if (mounted) { + setState(() { + + }); + } + } + } + }, + child: Text( + emoji, + style: TextStyle(fontSize: 25), + ), + ); + } + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + } + + circleInfoItem() { return ClipRRect( borderRadius: BorderRadius.circular( diff --git a/circle_app/lib/circle_app/circle/widgets/like_view.dart b/circle_app/lib/circle_app/circle/widgets/like_view.dart index 4f63ed7..cb02cf9 100644 --- a/circle_app/lib/circle_app/circle/widgets/like_view.dart +++ b/circle_app/lib/circle_app/circle/widgets/like_view.dart @@ -33,6 +33,7 @@ import '../../../utils/cache_img.dart'; import '../../../utils/time_format.dart'; import '../../circle_list/logic.dart'; import '../../circle_list/view.dart'; +import '../../circle_list/widgets/right_circle_iten.dart'; import '../../msg/recommend_circle_friend_item.dart'; import '../../world_call_out/view.dart'; import 'package:intl/intl.dart'; @@ -77,6 +78,14 @@ class _LikeViewState extends State List likelist = []; + List emojis = [ + "❤️", "🪢", "⛓️", "🕯️", "🔐", "🔔", "⭕️", "📏", "🪡", "🎭", + "👙", "👅", "🦶", "🧎", "⚔️", "🍌", "🦋", "🌼", "👏", "🤟", + "🙏", "🦴", "🐶", "👿", "👼", "👻", "🌹", "💌", "😘", "😍", + "🫣", "😂", "🤐", "😱", "🫥" +]; OverlayEntry? _overlayEntry; + bool isShowEmoji = false; + @override void dispose() { // TODO: implement dispose @@ -844,6 +853,7 @@ class _LikeViewState extends State ///至尊喊话 vipDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Text descText = Text( lists.content!, style: TextStyle(color: Colors.white, fontSize: 17.sp), @@ -1137,58 +1147,151 @@ class _LikeViewState extends State ); }), ), - Container( - height: 30.sp, - padding: EdgeInsets.only(left: 5.sp, right: 10.sp), - margin: EdgeInsets.only(top: picHeight == 0 ? 15.sp : 5.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( + // Container( + // height: 30.sp, + // padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + // margin: EdgeInsets.only(top: picHeight == 0 ? 15.sp : 5.sp), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(15.sp), + // color: Color(0x33000000)), + // child: Row( + // children: [ + // widgets.isNotEmpty + // ? SizedBox( + // width: 24 + 12.sp * widgets.length - 8.sp, + // height: 24.sp, + // child: Stack(children: widgets), + // ) + // : Container(), + // SizedBox( + // width: 4.sp, + // ), + // widgets.isNotEmpty + // ? Expanded( + // child: Text( + // '${lists.chat!.count!}位圈友已私聊', + // style: TextStyle( + // color: Colors.white.withOpacity(0.75), + // fontSize: 14.sp), + // )) + // : Expanded( + // child: Text( + // '赶紧成为第一位私聊ta的圈友吧', + // style: TextStyle( + // color: Colors.white.withOpacity(0.75), + // fontSize: 14.sp), + // )), + // GestureDetector( + // onTap: () { + // pushMsgPage( + // lists, + // lists.interest!['id'].toString(), + // ); + // // pushHomePage( + // // lists, widget.bean.id.toString()); + // }, + // child: Image.asset( + // getCircleImage('chat'), + // width: 60.sp, + // ), + // ) + // ], + // ), + // ), + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( width: 24 + 12.sp * widgets.length - 8.sp, height: 24.sp, child: Stack(children: widgets), ) - : Container(), - SizedBox( - width: 4.sp, - ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () { - pushMsgPage( - lists, - lists.interest!['id'].toString(), - ); - // pushHomePage( - // lists, widget.bean.id.toString()); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + lists.interest!['id'].toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + ), + ) + ], ), - ) - ], - ), - ), + ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 5.sp : 0.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], + ), Container( margin: EdgeInsets.only(bottom: 10.sp, top: 5.sp), child: circleInfoItem(lists.interest, lists, index), @@ -1202,6 +1305,7 @@ class _LikeViewState extends State ///普通图文喊话 normalDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Text descText = Text( lists.content!, style: TextStyle(color: Colors.white, fontSize: 17.sp), @@ -1485,57 +1589,99 @@ class _LikeViewState extends State ); })) : Container(), - Container( - height: 30.sp, - padding: EdgeInsets.only( - left: 5.sp, - right: 10.sp, - ), - margin: - EdgeInsets.only(top: picHeight == 0 ? 15.sp : 5.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( + + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( width: 24 + 12.sp * widgets.length - 8.sp, height: 24.sp, child: Stack(children: widgets), ) - : Container(), - SizedBox( - width: 4.sp, + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + lists.interest!['id'].toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + ), + ) + ], + ), ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () async { - pushMsgPage( - lists, lists.interest!['id'].toString()); + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } - // }); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, - )) - ], - ), + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 5.sp : 0.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], ), Container( margin: EdgeInsets.only(bottom: 10.sp, top: 5.sp), @@ -1549,6 +1695,125 @@ class _LikeViewState extends State ); } + void _showEmojiPicker(Lists list,int id,BuildContext context, Offset position) { + if (isShowEmoji) return; + isShowEmoji = true; + _overlayEntry = OverlayEntry( + builder: (context) => Stack( + children: [ + // 遮罩层,点击关闭 + Positioned.fill( + child: GestureDetector( + onTap: () { + _removeOverlay(); + isShowEmoji = false; + }, + child: Container( + color: Colors.black.withOpacity(0.3), + ), + ), + ), + // 表情选择器 + Positioned( + left: position.dx - 190.w, + top: position.dy - 60.sp, + child: Material( + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 气泡框 + Container( + width: 200.w, // 设置最大宽度,超出才会滚动 + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + spreadRadius: 2, + ), + ], + ), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: emojis.map((emoji) => Padding( + padding: EdgeInsets.symmetric(horizontal: 4), + child: _emojiButton(emoji,id,list), + )).toList(), + ),), + ), + // 底部倒三角形 + ], + ), + )), + Positioned( + left: position.dx - 12.w, + top: position.dy - 15, + child: CustomPaint( + size: Size(20, 10), + painter: TrianglePainter(), + ), + ) + ], + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + + } + + Widget _emojiButton(String emoji,int id,Lists list) { + return GestureDetector( + onTap: () async { + print("选择了表情: $emoji"); + _removeOverlay(); + isShowEmoji = false; + + int index = emojis.indexOf(emoji) + 1; + var result = await DioManager.instance.post(url: Api.interactEmoji,params: { + "calloutId": id, + "type": index + }); + if (result['code'] == 200) { + var data = await DioManager.instance.get(url: Api.signCalloutDetail,params: { + 'id':id, + }); + if (data['code'] == 200) { + Lists bean =Lists.fromJson(data['data']); + if (lists.contains(list)) { + index = lists.indexOf(list); + lists[index] = bean; + } else { + index = recomanddlists.indexOf(list); + recomanddlists[index] = bean; + } + if (mounted) { + setState(() { + + }); + } + } + } + }, + child: Text( + emoji, + style: TextStyle(fontSize: 25), + ), + ); + } + + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + } + + tipItem() { bool showTitle = lists.isEmpty; return GetBuilder(builder: (logic) { diff --git a/circle_app/lib/circle_app/circle/widgets/play_video_view.dart b/circle_app/lib/circle_app/circle/widgets/play_video_view.dart index 7d7f2db..5af71c0 100644 --- a/circle_app/lib/circle_app/circle/widgets/play_video_view.dart +++ b/circle_app/lib/circle_app/circle/widgets/play_video_view.dart @@ -10,6 +10,7 @@ import 'package:video_player/video_player.dart'; import '../../../commons/widgets/video_share_dialog.dart'; import '../../../net/api.dart'; import '../../../net/dio_manager.dart'; +import '../../../utils/cache_img.dart'; import '../../userinfo/logic.dart'; import '../../world_call_out/world_data.dart'; import 'controller/physics.dart'; @@ -20,8 +21,9 @@ class PlayVideoView extends StatefulWidget { String url; String callOutId; String userId; - - PlayVideoView(this.url, this.callOutId, this.userId, {Key? key}) + String imid; + Map chat; + PlayVideoView(this.url, this.callOutId, this.userId,this.chat,this.imid, {Key? key}) : super(key: key); @override State createState() => _PlayVideoViewState(); @@ -75,10 +77,12 @@ class _PlayVideoViewState extends State 'id': int.parse(widget.callOutId), 'user': { 'id': int.parse(widget.userId), + 'imId': widget.imid, }, 'album': [ {'type': 2, 'url': widget.url} - ] + ], + 'chat':widget.chat }); userList = [list]; @@ -213,6 +217,28 @@ class _PlayVideoViewState extends State scrollDirection: Axis.vertical, itemCount: _videoListController.videoCount, itemBuilder: (context, i) { + + WorldLists lists = userList[i]; + + List widgets = []; + int index = 0; + for (var element in lists.chat!.users!) { + widgets.add(Positioned( + left: 12.sp * index, + child: circleWidget(element.avatar!, element.id.toString(), width: 24), + )); + index++; + } + if (widgets.isNotEmpty) { + widgets.add(Positioned( + left: 12.sp * lists.chat!.users!.length, + child: Image.asset( + getCircleImage('more'), + width: 24.sp, + ))); + } + + // 拼一个视频组件出来 var player = _videoListController.playerOfIndex(i)!; var data = player.videoInfo!; @@ -267,6 +293,62 @@ class _PlayVideoViewState extends State // backgroundColor: Colors.black)), ), )), + Positioned(bottom: 5.sp + MediaQuery.of(context).padding.bottom,child: Container( + height: 30.sp, + width: Get.width - 20.sp, + padding: EdgeInsets.only( + left: 5.sp, + right: 5.sp, + ), + // margin: EdgeInsets.only( + // top: picHeight > 0 ? 5.sp : 10.sp, bottom: 10.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Colors.white.withOpacity(0.15)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( + width: 24 + 12.sp * widgets.length - 8.sp, + height: 24.sp, + child: Stack(children: widgets), + ) + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 14.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的圈友吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 14.sp), + )), + GestureDetector( + onTap: () async { + if (player.controller.value.isPlaying) { + await player.pause(); + } + setState(() {}); + pushChatPage(lists.user!.id!.toString(), + lists.user!.imId!.toString(), lists.user!.nickname ?? ''); + + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + )) + ], + ), + ),) ], ), ); @@ -349,4 +431,29 @@ class _PlayVideoViewState extends State ), ); } + + circleWidget(String url, String userId, {double width = 24}) { + return GestureDetector( + onTap: () async { + // pushUserHome(userId); + }, + child: Stack( + alignment: Alignment.center, + children: [ + Image.asset( + getCircleImage('avatar_bg'), + width: width.sp, + ), + ClipOval( + child: CachedImg( + imageUrl: url ?? + "https://qiniuyun.leyuan666.com/quanzi/avatar/default.png", + width: (width - 1).sp, + height: (width - 1).sp, + fit: BoxFit.cover, + ), + ) + ], + )); + } } diff --git a/circle_app/lib/circle_app/circle/widgets/video_item.dart b/circle_app/lib/circle_app/circle/widgets/video_item.dart index e6be690..6690b70 100644 --- a/circle_app/lib/circle_app/circle/widgets/video_item.dart +++ b/circle_app/lib/circle_app/circle/widgets/video_item.dart @@ -1,11 +1,15 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:circle_app/circle_app/circle/widgets/play_video_view.dart'; +import 'package:circle_app/circle_app/world_call_out/world_data.dart'; import 'package:circle_app/utils/util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import '../../../net/api.dart'; +import '../../../net/dio_manager.dart'; import '../../../utils/cache_img.dart'; +import '../logic.dart'; class VideoItemWidget extends StatefulWidget { String url; @@ -17,17 +21,26 @@ class VideoItemWidget extends StatefulWidget { } class _VideoItemWidgetState extends State { + bool isPush = false; + @override Widget build(BuildContext context) { return Container( - // color: Colors.red, - width: Get.width - 120.sp, alignment: Alignment.topLeft, child: GestureDetector( - onTap: () { - Get.to(PlayVideoView(widget.url,widget.callOutId,widget.userId)); + onTap: () async { + if (isPush) return; + var data = await DioManager.instance.get(url: Api.signCalloutDetail,params: { + 'id':widget.callOutId, + }); + if (data['code'] == 200) { + WorldLists bean = WorldLists.fromJson(data['data']); + Get.to( + PlayVideoView(widget.url, widget.callOutId, widget.userId,bean.chat!.toJson(),bean.user!.imId!)); + } + isPush = false; }, child: IntrinsicWidth( child: Stack( diff --git a/circle_app/lib/circle_app/circle_list/logic.dart b/circle_app/lib/circle_app/circle_list/logic.dart index bd1ffdd..356e988 100644 --- a/circle_app/lib/circle_app/circle_list/logic.dart +++ b/circle_app/lib/circle_app/circle_list/logic.dart @@ -46,12 +46,8 @@ class LikeLogic extends GetxController { int pageType = 0; - List genderList = [ - MyConfigData('0', '全部', true) - ]; - List newgenderList = [ - MyConfigData('0', '全部', true) - ]; + List genderList = [MyConfigData('0', '全部', true)]; + List newgenderList = [MyConfigData('0', '全部', true)]; bool isNewPeople = false; @@ -77,19 +73,19 @@ class LikeLogic extends GetxController { sub = EventBusManager.on().listen((event) { changeCircle(event.param); }); - await loadMyInfo(); + rightCtr.addListener(() { - if (rightCtr.position.pixels == - rightCtr.position.maxScrollExtent) { + if (rightCtr.position.pixels == rightCtr.position.maxScrollExtent) { loadMore(); } }); + loadMyInfo(); - await initGerder(); - loadInviteData(); + // loadInviteData(); loadCircleListData(); loadMyCircleData(); loadCircleTypeData(); + initGerder(); } @override @@ -101,8 +97,7 @@ class LikeLogic extends GetxController { } initGerder() async { - var data1 = - await DioManager.instance.get(url: Api.getConfig, params: {}); + var data1 = await DioManager.instance.get(url: Api.getConfig, params: {}); var bean1 = BaseResponse.fromJson( data1, (data1) => ConfigBean.fromJson(data1)); @@ -113,7 +108,6 @@ class LikeLogic extends GetxController { if (int.parse(key) < 3) { genderList.add(MyConfigData(key, value, true)); newgenderList.add(MyConfigData(key, value, true)); - } }); // roleList.clear(); @@ -132,51 +126,36 @@ class LikeLogic extends GetxController { if (bean.isSuccess()) { if (isFirst) { isFirst = false; - // int type = getUserType( - // ( bean.data!.user.createTime?.isNotEmpty ?? false) - // ? bean.data!.user.createTime! - // : DateTime.now().toString()); - // if (type == 2) { - // currentIndex = -1; - // isNewPeople = true; - // } else { - // currentIndex = -2; - // } - // } - // - // if (!isLoadNewData && tabController == null) { isLoadNewData = true; + isLoad = false; update(); } - - } else { - isLoadFial = true; - showOKToast('网络不流畅哦,请检查网络情况'); + } else { + // isLoadFial = true; + // showOKToast('网络不流畅哦,请检查网络情况'); } update(); } loadData() { - loadInviteData(); + // loadInviteData(); loadCircleListData(); loadMyCircleData(); loadCircleTypeData(); } loadInviteData() async { + var data = await DioManager.instance.get(url: Api.inviteMainPage); + if (data['code'] == 200) { + Autogenerated result = Autogenerated.fromJson(data); - var data = await DioManager.instance.get(url: Api.inviteMainPage); - if (data['code'] == 200) { - Autogenerated result = Autogenerated.fromJson(data); - - homeData = result.data; - - } + homeData = result.data; + } } loadCircleListData() async { var data = await DioManager.instance.get( - url: Api.getCircleInterests, params: {"page": page, 'page_size': 20}); + url: Api.getCircleInterests, params: {"page": page, 'page_size': 10}); var bean = BaseResponse.fromJson( data, (data) => InterestsBean.fromJson(data)); if (bean.code == 200) { @@ -187,8 +166,8 @@ class LikeLogic extends GetxController { circle.lists.addAll(bean.data!.lists); } - isLoad = false; - if (bean.data!.lists.length < 20) { + + if (bean.data!.lists.length == 0) { isMore = false; } update(); @@ -199,8 +178,7 @@ class LikeLogic extends GetxController { } loadMyCircleData() async { - var data = await DioManager.instance - .get(url: Api.getMyCircleAll); + var data = await DioManager.instance.get(url: Api.getMyCircleAll); // var bean = BaseResponse.fromJson( // data, (data) => InterestsBean.fromJson(data)); @@ -215,7 +193,7 @@ class LikeLogic extends GetxController { }); mycircle.lists = infoList; if (currentIndex >= mycircle.lists.length - 1) { - currentIndex = mycircle.lists.length -1; + currentIndex = mycircle.lists.length - 1; } loadCalloutsNew(); @@ -232,13 +210,11 @@ class LikeLogic extends GetxController { loadMore() { if (isMore) { - page = page + 1; + page = page + 1; loadCircleListData(); } } - - void relaodData() { page = 1; isMore = true; @@ -247,12 +223,11 @@ class LikeLogic extends GetxController { loadMyMore() { if (isMyMore) { - myPage = myPage + 1; + myPage = myPage + 1; loadMyCircleData(); } } - void relaodCircleTypeData() { loadCircleTypeData(); } @@ -274,16 +249,15 @@ class LikeLogic extends GetxController { } }); - relaodMyData(); } showOKToast(bean.msg); } - setTopCircle(String interest_id,bool isStatus) async { + setTopCircle(String interest_id, bool isStatus) async { var data = await DioManager.instance.post( url: Api.circleTop, - params: {"interestId": interest_id,'isTop' :isStatus ? 1 : 0}); + params: {"interestId": interest_id, 'isTop': isStatus ? 1 : 0}); var bean = BaseResponse.fromJson(data, (data) => data); if (bean.code == 200) { relaodMyData(); @@ -291,15 +265,13 @@ class LikeLogic extends GetxController { showOKToast(bean.msg); } - loadCalloutsNew() async { List idList = []; mycircle.lists.forEach((element) { - idList.add(element.id.toString()); + idList.add(element.id.toString()); }); - var data = await DioManager.instance.post( - url:Api.calloutsNew, - params: {"interestIds":idList}); + var data = await DioManager.instance + .post(url: Api.calloutsNew, params: {"interestIds": idList}); if (data['code'] == 200) { hasNewList.clear(); @@ -323,7 +295,8 @@ class LikeLogic extends GetxController { loadCircleTypeData() async { var data = await DioManager.instance.get( - url:Api.categoriesList,); + url: Api.categoriesList, + ); if (data['code'] == 200) { categoriesList = data['data']; update(); @@ -336,7 +309,6 @@ class LikeLogic extends GetxController { mycircle.lists.forEach((element) { if (element.id.toString() == param) { changeIndex = mycircle.lists.indexOf(element); - } }); currentIndex = changeIndex; @@ -344,8 +316,7 @@ class LikeLogic extends GetxController { } } - class ChangeCircleIndex { String param; -ChangeCircleIndex(this.param); -} \ No newline at end of file + ChangeCircleIndex(this.param); +} diff --git a/circle_app/lib/circle_app/circle_list/view.dart b/circle_app/lib/circle_app/circle_list/view.dart index ee4b120..3e8acaa 100644 --- a/circle_app/lib/circle_app/circle_list/view.dart +++ b/circle_app/lib/circle_app/circle_list/view.dart @@ -44,6 +44,9 @@ class _CircleListPageState extends State int currentIndex = 1; + + + List tipList = [ '总有一个小众圈子适合你', '每一种情趣都值得被尊重', @@ -67,6 +70,15 @@ class _CircleListPageState extends State void initState() { // TODO: implement initState super.initState(); + logic.tabController = TabController( + length: 3, + vsync: this, + initialIndex: 1); + logic.tabController!.addListener(() { + // logic.tabIndex = logic.tabController!.index; + // currentIndex = logic.tabController!.index; + logic.update(); + }); } @override @@ -110,18 +122,6 @@ class _CircleListPageState extends State logic.update(); } - if (logic.isLoadNewData && logic.tabController == null) { - logic.tabController = TabController( - length: 3, - vsync: this, - initialIndex: 1); - logic.tabController!.addListener(() { - // logic.tabIndex = logic.tabController!.index; - // currentIndex = logic.tabController!.index; - logic.update(); - }); - logic.update(); - } return logic.isLoadFial ? noResultWidget( diff --git a/circle_app/lib/circle_app/circle_list/widgets/all_circle_item.dart b/circle_app/lib/circle_app/circle_list/widgets/all_circle_item.dart index 7948647..eec1842 100644 --- a/circle_app/lib/circle_app/circle_list/widgets/all_circle_item.dart +++ b/circle_app/lib/circle_app/circle_list/widgets/all_circle_item.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:circle_app/circle_app/circle_list/widgets/right_circle_iten.dart'; import 'package:circle_app/utils/eventBus.dart'; import 'package:flutter/material.dart'; import 'dart:async'; @@ -59,6 +60,13 @@ class _AllCircleItemState extends State Map interestAgentMap = {}; List visibleItems = []; + List emojis = [ + "❤️", "🪢", "⛓️", "🕯️", "🔐", "🔔", "⭕️", "📏", "🪡", "🎭", + "👙", "👅", "🦶", "🧎", "⚔️", "🍌", "🦋", "🌼", "👏", "🤟", + "🙏", "🦴", "🐶", "👿", "👼", "👻", "🌹", "💌", "😘", "😍", + "🫣", "😂", "🤐", "😱", "🫥" +]; OverlayEntry? _overlayEntry; + bool isScrolling = false; Timer? _timer; @@ -66,7 +74,7 @@ class _AllCircleItemState extends State var sub; var sub1; bool isLoadCircleInfo = false; - + bool isShowEmoji = false; int callOut = 0; @override @@ -432,7 +440,7 @@ class _AllCircleItemState extends State ), HideText( text: interest.intro + interest.intro, - maxWidth: Get.width * 0.5 - 5.sp, + maxWidth: Get.width * 0.5 - 9.sp, additionText: '进圈逛逛', maxLines: 2, style: TextStyle( @@ -621,6 +629,7 @@ class _AllCircleItemState extends State ///至尊喊话 vipDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, @@ -751,7 +760,7 @@ class _AllCircleItemState extends State // margin: EdgeInsets.only(top: 5.sp,right: 5.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp), alignment: Alignment.center, - height: 28.sp, + height: 24.sp, decoration: BoxDecoration( color: Color.fromRGBO(52, 41, 67, 1), borderRadius: BorderRadius.only( @@ -763,7 +772,7 @@ class _AllCircleItemState extends State (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0, 4) + '...' : (lists.user!.city ?? '外星'), - style: TextStyle(color: Colors.white, fontSize: 15.sp), + style: TextStyle(color: Colors.white, fontSize: 14.sp), ), ) ], @@ -1024,55 +1033,96 @@ class _AllCircleItemState extends State }), ), ), - Container( - height: 30.sp, - padding: EdgeInsets.only(left: 5.sp, right: 10.sp), - margin: EdgeInsets.only( - top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( width: 24 + 12.sp * widgets.length - 8.sp, height: 24.sp, child: Stack(children: widgets), ) - : Container(), - SizedBox( - width: 4.sp, - ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () { - pushMsgPage( - lists, - '', - ); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage(lists, ''); + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + ), + ) + ], ), - ) - ], - ), + ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 5.sp : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], ), if (lists.interest?.isNotEmpty ?? false) Container( @@ -1088,6 +1138,7 @@ class _AllCircleItemState extends State ///普通图文喊话 normalDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, @@ -1218,7 +1269,7 @@ class _AllCircleItemState extends State // margin: EdgeInsets.only(top: 5.sp,right: 5.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp), alignment: Alignment.center, - height: 28.sp, + height: 24.sp, decoration: BoxDecoration( color: Color.fromRGBO(52, 41, 67, 1), borderRadius: BorderRadius.only( @@ -1230,7 +1281,7 @@ class _AllCircleItemState extends State (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0, 4) + '...' : (lists.user!.city ?? '外星'), - style: TextStyle(color: Colors.white, fontSize: 15.sp), + style: TextStyle(color: Colors.white, fontSize: 14.sp), ), ) ], @@ -1450,54 +1501,95 @@ class _AllCircleItemState extends State ); })) : Container(), - Container( - height: 30.sp, - padding: EdgeInsets.only( - left: 5.sp, - right: 10.sp, - ), - margin: EdgeInsets.only( - top: picHeight > 0 ? 5.sp : 10.sp, bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( width: 24 + 12.sp * widgets.length - 8.sp, height: 24.sp, child: Stack(children: widgets), ) - : Container(), - SizedBox( - width: 4.sp, + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage(lists, ''); + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + ), + ) + ], + ), ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () async { - pushMsgPage(lists, ''); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, - )) - ], - ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + _showEmojiPicker(lists,lists.id!,context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp, bottom: (lists.topInteractType!['userCount'] ?? 0) > 0 ? 5.sp : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 ? lists.isInteract! - 1 : type] ?? '❤', + style: + TextStyle(color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: + TextStyle(color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], ), if (lists.interest?.isNotEmpty ?? false) Container( @@ -1518,9 +1610,124 @@ class _AllCircleItemState extends State )); } + void _showEmojiPicker(Lists list,int id,BuildContext context, Offset position) { + if (isShowEmoji) return; + isShowEmoji = true; + _overlayEntry = OverlayEntry( + builder: (context) => Stack( + children: [ + // 遮罩层,点击关闭 + Positioned.fill( + child: GestureDetector( + onTap: () { + _removeOverlay(); + isShowEmoji = false; + }, + child: Container( + color: Colors.black.withOpacity(0.3), + ), + ), + ), + // 表情选择器 + Positioned( + left: position.dx - 190.w, + top: position.dy - 60.sp, + child: Material( + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 气泡框 + Container( + width: 200.w, // 设置最大宽度,超出才会滚动 + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + spreadRadius: 2, + ), + ], + ), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: emojis.map((emoji) => Padding( + padding: EdgeInsets.symmetric(horizontal: 4), + child: _emojiButton(emoji,id,list), + )).toList(), + ),), + ), + // 底部倒三角形 + ], + ), + )), + Positioned( + left: position.dx - 12.w, + top: position.dy - 15, + child: CustomPaint( + size: Size(20, 10), + painter: TrianglePainter(), + ), + ) + ], + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + + } + + Widget _emojiButton(String emoji,int id,Lists list) { + return GestureDetector( + onTap: () async { + print("选择了表情: $emoji"); + _removeOverlay(); + isShowEmoji = false; + + int index = emojis.indexOf(emoji) + 1; + var result = await DioManager.instance.post(url: Api.interactEmoji,params: { + "calloutId": id, + "type": index + }); + if (result['code'] == 200) { + var data = await DioManager.instance.get(url: Api.signCalloutDetail,params: { + 'id':id, + }); + if (data['code'] == 200) { + Lists bean =Lists.fromJson(data['data']); + index = lists.indexOf(list); + lists[index] = bean; + if (mounted) { + setState(() { + + }); + } + } + } + }, + child: Text( + emoji, + style: TextStyle(fontSize: 25), + ), + ); + } + + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + } + circleWidget(String url, String userId, {double width = 24}) { return GestureDetector( - onTap: () async {}, + onTap: () async { + pushUserHome(userId); + }, child: Stack( alignment: Alignment.center, children: [ @@ -1710,4 +1917,9 @@ class _AllCircleItemState extends State logic.update(); } } + + + void pushUserHome(String userId) { + Get.toNamed(Routes.UserInfoPage, arguments: userId); + } } diff --git a/circle_app/lib/circle_app/circle_list/widgets/apply_for_an_agent_dialog.dart b/circle_app/lib/circle_app/circle_list/widgets/apply_for_an_agent_dialog.dart new file mode 100644 index 0000000..9cb9cec --- /dev/null +++ b/circle_app/lib/circle_app/circle_list/widgets/apply_for_an_agent_dialog.dart @@ -0,0 +1,188 @@ +import 'package:circle_app/net/dio_manager.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:oktoast/oktoast.dart'; + +import '../../../commons/Widgets/base_tip_widget.dart'; +import '../../../commons/colors/app_color.dart'; +import '../../../net/api.dart'; +import '../../../router/routers.dart'; +import '../../../utils/util.dart'; + +class ApplyForAnAgentDialog extends StatefulWidget { + int circleId; + ApplyForAnAgentDialog({super.key,required this.circleId}); + + @override + _ApplyForAnAgentDialogState createState() => + new _ApplyForAnAgentDialogState(); + +} + +class _ApplyForAnAgentDialogState extends State { + // TODO: add state variables and methods + String msg = ''; + String price = ''; + @override + void initState() { + // TODO: implement initState + super.initState(); + loadContentData(); + } + + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return Dialog( + backgroundColor: Colors.transparent, + insetPadding:EdgeInsets.only(left: 20.sp,right: 20.sp), + child: Container( + height: 270.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: AppColor.bgColor, + borderRadius: BorderRadius.circular(12.0.sp), + // gradient: const LinearGradient( + // colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // ), + ), + ), + // Container( + // margin: EdgeInsets.all(1.sp), + // child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,), + // ), + Container( + margin: EdgeInsets.only(top: 12.sp), + child: Column( + children: [ + Center( + child: Text( + "申请体验圈子代理人权益", + style: + TextStyle(color: Colors.white, fontSize: 18.sp), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + top: 0.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: SingleChildScrollView( + child: Text( + msg, + textAlign: TextAlign.left, + style: TextStyle( + color: const Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + ), + ), + Row( + // mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + + GestureDetector( + onTap: () { + Get.back(); + Get.toNamed(Routes.InvitePage); + }, + child: Container( + width: 130.w, + alignment: Alignment.center, + height: 40.sp, + margin: EdgeInsets.only(bottom: 16.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.sp), + gradient: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + child: const Text( + "前往邀请", + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + ), + ), + ), + GestureDetector( + onTap: () { + loadBuyInterestAgentData(); + }, + child: Container( + width: 130.w, + height: 40.sp, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 16.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.sp), + gradient: AppColor + .tagVerLinearGradient, + ), + child: Text( + "快速体验(${price})", + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ), + ), + ); + } + + void loadContentData() async { + var result = await DioManager.instance.get(url: Api.agentRights); + if (result['code'] == 10000) { + msg = result['content']; + await loadbuyInterestAgentPriceData(); + if (mounted) { + setState(() { + + }); + } + } + } + + loadbuyInterestAgentPriceData() async { + var result = await DioManager.instance.get(url: Api.buyInterestAgentPrice); + if (result['code'] == 200) { + price = result['data']; + } + } + + loadBuyInterestAgentData() async { + var result = await DioManager.instance.post(url: Api.buyInterestAgent,params: {'id':widget.circleId}); + if (result['code'] == 200) { + showOKToast('购买成功'); + Get.back(result: '1'); + } else if (result['code'] == 31201) { + showRechargeScreenDialog('buyInterestAgent'); + } + + } + + +} diff --git a/circle_app/lib/circle_app/circle_list/widgets/right_circle_iten.dart b/circle_app/lib/circle_app/circle_list/widgets/right_circle_iten.dart index dccf585..0891a76 100644 --- a/circle_app/lib/circle_app/circle_list/widgets/right_circle_iten.dart +++ b/circle_app/lib/circle_app/circle_list/widgets/right_circle_iten.dart @@ -36,7 +36,9 @@ import '../../../utils/SharedPreferencesHelper.dart'; import '../../../utils/cache_img.dart'; import '../../../utils/eventBus.dart'; import '../../circle_list/logic.dart'; +import '../../home/logic.dart'; import '../view.dart'; +import 'apply_for_an_agent_dialog.dart'; class RightCircleItem extends StatefulWidget { var logic; @@ -78,15 +80,19 @@ class _RightCircleItemState extends State int callRightOut = 0; + bool isLoadCirciInfo = false; + // TODO: add state variables and methods @override void dispose() { // TODO: implement dispose super.dispose(); + _tabController.removeListener(_handleTabChange); + scrollController.dispose(); + _tabController.dispose(); circleMoreInfoSub?.cancel(); sub.cancel(); - sub.cancel(); } @override @@ -98,9 +104,10 @@ class _RightCircleItemState extends State setState(() {}); }); - circleMoreInfoSub = EventBusManager.on().listen((event) { - if (event.type == _tabController.index + 1 && event.circleId == widget.bean.id && widget.logic.currentIndex == 0) { + if (event.type == _tabController.index + 1 && + event.circleId == widget.bean.id && + widget.logic.currentIndex == 0) { if (event.type == 1) { callLeftOut++; } else if (event.type == 2) { @@ -117,8 +124,6 @@ class _RightCircleItemState extends State _tabController = TabController(length: 2, vsync: this, initialIndex: 0); _tabController.addListener(_handleTabChange); - - scrollController.addListener(() { if (scrollController.position.pixels == scrollController.position.maxScrollExtent) { @@ -139,14 +144,13 @@ class _RightCircleItemState extends State } loadWelfareListData() async { - var data = await DioManager.instance - .post(url:Api.welfareList,params: {'interestId':circleId,'page':1,'pageSize':10}); + var data = await DioManager.instance.post( + url: Api.welfareList, + params: {'interestId': circleId, 'page': 1, 'pageSize': 10}); if (data['code'] == 200) { welfareList = data['data'] ?? []; if (mounted) { - setState(() { - - }); + setState(() {}); } } } @@ -165,11 +169,14 @@ class _RightCircleItemState extends State } } } - + // loadCircleInfo() async { + if (isLoadCirciInfo) return; + isLoadCirciInfo = true; var data = await DioManager.instance.get( url: "/up-service/interest/$circleId", ); + isLoadCirciInfo = false; if (data["code"] == 200) { widget.bean = Circle.fromJson(data['data']); if (mounted) { @@ -178,11 +185,8 @@ class _RightCircleItemState extends State } } - - - void getWelfareDetailData(String id,int index) async { - var result = - await DioManager.instance.get(url: Api.getWelfareDetail+id); + void getWelfareDetailData(String id, int index) async { + var result = await DioManager.instance.get(url: Api.getWelfareDetail + id); if (result['code'] == 200) { // "hasReceive" -> 1 if (result['data']['hasReceive'] == 1) { @@ -197,9 +201,10 @@ class _RightCircleItemState extends State } return; } - Get.bottomSheet(LuckyBagDialog(result['data']),isScrollControlled:true).then((value) async { + Get.bottomSheet(LuckyBagDialog(result['data']), isScrollControlled: true) + .then((value) async { var result = - await DioManager.instance.get(url: Api.getWelfareDetail+id); + await DioManager.instance.get(url: Api.getWelfareDetail + id); if (result['code'] == 200) { // "hasReceive" -> 1 if (result['data']['hasReceive'] == 1) { @@ -245,13 +250,22 @@ class _RightCircleItemState extends State await refreshCircleData(); } if (widget.bean.is_limit && widget.bean.amount > 0) { - Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}); + Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: { + 'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new', + 'bean': jsonEncode({ + 'id': widget.bean.id.toString(), + 'amount': widget.bean.amount.toString(), + 'oldAmount': widget.bean.oldAmount.toString(), + 'iosItem': widget.bean.ios_item + }) + }); // return; } else { - Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}); + Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: { + 'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new', + }); } - } circleWidget(String url, String userId, {double width = 24}) { @@ -321,10 +335,10 @@ class _RightCircleItemState extends State height: 30.sp, child: Row( children: [ - circlrPeopleInfoWidget(widgets,widget.bean), + circlrPeopleInfoWidget(widgets, widget.bean), Spacer(), GestureDetector( - //加入圈子 + //加入圈子 onTap: () async { if (widget.bean.isJoin) { Get.bottomSheet( @@ -342,7 +356,7 @@ class _RightCircleItemState extends State alignment: Alignment.center, children: [ Opacity( - opacity: 0.5, + opacity: 0.15, child: Image.asset( getCircleImage('add'), width: 60.sp, @@ -351,7 +365,8 @@ class _RightCircleItemState extends State Text( !widget.bean.isJoin ? '申请加入' : '分享有奖', style: TextStyle( - color: Colors.white, fontSize: 12.sp), + color: Colors.white, + fontSize: 12.sp), ) ], )) @@ -380,100 +395,161 @@ class _RightCircleItemState extends State ), ), if (interestAgentMap.isNotEmpty) - Container( - margin: EdgeInsets.only(top: 5.sp), - decoration: BoxDecoration( - color: AppColor.bgColor, - borderRadius: BorderRadius.circular(8.sp)), - height: 40.sp, - padding: EdgeInsets.only(left: 8.sp, right: 8.sp), - child: Row( - children: [ - Text( - '今日圈子代理人:', - style: TextStyle(color: Colors.white, fontSize: 13.sp), - ), - GestureDetector( - onTap: () { - if (interestAgentMap.isNotEmpty) { - Get.toNamed(Routes.UserInfoPage, - arguments: interestAgentMap['user']['id'].toString()); - } - }, - child: Text( - interestAgentMap.isNotEmpty - ? interestAgentMap['user']['nickname'] - : '', - style: - TextStyle(color: AppColor.mainColor, fontSize: 13.sp), - ), - ), - SizedBox( - width: 4.sp, - ), - Image.asset( - getMineImage('bi_icon1'), - width: 20.sp, - ), - Text( - '${convertToThousand(interestAgentMap.isNotEmpty ? interestAgentMap['rewardCoin'] : 0)}', - style: TextStyle(color: Colors.white, fontSize: 13.sp), - ), - Expanded(child: Container()), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - addUmengTag('点击圈子打赏'); - showSendMoneyDialog(interestAgentMap['id'].toString()); - // Get.toNamed(AppRoutes.Invite); - }, - child: Container( + Row( + children: [ + Container( + width: 25.sp, + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 5.sp), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + getCircleImage('normal_bg'), + )), + + // color: AppColor.bgColor.withOpacity(0.5), + borderRadius: BorderRadius.circular(8.sp)), + height: 40.sp, + padding: EdgeInsets.only(left: 8.sp, right: 8.sp), + child: Row( + children: [ + Container( + height: 20.sp, + width: 20.sp, + margin: EdgeInsets.only(right: 4.sp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17.0), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - ), - color: const Color(0xFF392D53), - ), - child: Container( - margin: EdgeInsets.all(0.6.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), - color: const Color(0xFF392D53), - ), - child: Row( - children: [ - Image.asset( - getMsgImage('gift'), - width: 14.sp, - ), - SizedBox( - width: 2.sp, - ), - Text( - "打赏", - style: TextStyle( - fontSize: 12.sp, - color: Colors.white, - ), - ), - ], - ), + border: Border.all( + color: AppColor.mainColor, width: 1.sp), + borderRadius: BorderRadius.circular(10.sp)), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + HomeLogic homeLogic = Get.find(); + if (homeLogic.agentManualStr.isEmpty) { + await homeLogic.loadManualata(); + } + String msg = homeLogic.agentManualStr; + showAgentManualDialog(context, msg); + }, + child: Icon( + Icons.question_mark_outlined, + color: AppColor.mainColor, + size: 15.w, + )), + ), + Text( + '代理人', + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + Text( + ':', + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + GestureDetector( + onTap: () { + if (interestAgentMap.isNotEmpty) { + Get.toNamed(Routes.UserInfoPage, + arguments: + interestAgentMap['user']['id'].toString()); + } + }, + child: Text( + interestAgentMap.isNotEmpty + ? interestAgentMap['user']['nickname'] + .toString() + .length > + 4 + ? interestAgentMap['user']['nickname'] + .toString() + .substring(0, 4) + + '..' + : interestAgentMap['user']['nickname'] + : '', + style: TextStyle( + color: AppColor.mainColor, fontSize: 13.sp), ), ), - ), - ], - ) - ], - ), + SizedBox( + width: 4.sp, + ), + Image.asset( + getMineImage('bi_icon1'), + width: 20.sp, + ), + Text( + '${convertToThousand(interestAgentMap.isNotEmpty ? interestAgentMap['rewardCoin'] : 0)}', + style: TextStyle(color: Colors.white, fontSize: 13.sp), + ), + Spacer(), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + addUmengTag('点击圈子打赏'); + showSendMoneyDialog( + interestAgentMap['id'].toString()); + // Get.toNamed(AppRoutes.Invite); + }, + child: Container( + margin: EdgeInsets.only(left: 6.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + ), + color: Color(0xFF392D53).withOpacity(0.25), + ), + child: Container( + margin: EdgeInsets.all(0.6.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), + color: const Color(0xFF392D53), + ), + child: Row( + children: [ + Image.asset( + getMsgImage('gift'), + width: 14.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + "打赏", + style: TextStyle( + fontSize: 12.sp, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + Container( + width: 25.sp, + ) + // Expanded(child: Container()), + ], ), ], ); @@ -575,8 +651,6 @@ class _RightCircleItemState extends State } List urlList = widget.bean.lastJoinUsers; - - List widgets = []; int i = 0; // print(urlList); @@ -603,7 +677,7 @@ class _RightCircleItemState extends State child: Container( width: Get.width, child: Stack( - alignment: Alignment.topCenter, + alignment: Alignment.topCenter, children: [ ClipRRect( borderRadius: BorderRadius.circular(10.sp), @@ -619,12 +693,13 @@ class _RightCircleItemState extends State height: Get.height, width: Get.width, margin: EdgeInsets.only(top: 72.sp), - child: NotificationListener( + child: NotificationListener( onNotification: (notification) { if (notification is OverscrollNotification && notification.overscroll < -15) { // 下拉刷新时禁用NestedScrollView的滚动 - if (refreshController.headerStatus != RefreshStatus.refreshing && + if (refreshController.headerStatus != + RefreshStatus.refreshing && scrollController.offset == 0) { count++; if (count == 2) { @@ -655,11 +730,11 @@ class _RightCircleItemState extends State return [ if (!isScrolled) - SliverToBoxAdapter( - child: circleTiitleWidget( - urlList, - widgets, - )), + SliverToBoxAdapter( + child: circleTiitleWidget( + urlList, + widgets, + )), SliverPersistentHeader( pinned: true, delegate: MySliverAppBarDelegate( @@ -684,17 +759,20 @@ class _RightCircleItemState extends State TabBar( isScrollable: true, controller: _tabController, - labelPadding: EdgeInsets.symmetric( - horizontal: 5.0.sp), + labelPadding: + EdgeInsets.symmetric( + horizontal: 5.0.sp), indicator: UnderlineTabIndicator( borderSide: BorderSide( - color: const Color(0xFF00FFF4), + color: + const Color(0xFF00FFF4), ), ), indicatorColor: const Color(0xFF00FFF4), indicatorWeight: 2.sp, - labelColor: const Color(0xFF00FFF4), + labelColor: + const Color(0xFF00FFF4), unselectedLabelColor: const Color(0xB3FFFFFF), indicatorSize: @@ -726,9 +804,11 @@ class _RightCircleItemState extends State fontSize: 18.sp, shadows: [ Shadow( - color: const Color(0xFFF657FF) - .withOpacity(0.5), - offset: Offset(0, -2), // 阴影偏移 + color: + const Color(0xFFF657FF) + .withOpacity(0.5), + offset: + Offset(0, -2), // 阴影偏移 blurRadius: 3, // 阴影模糊半径 // spreadRadius: 0 ), @@ -763,8 +843,10 @@ class _RightCircleItemState extends State alignment: Alignment.center, decoration: BoxDecoration( borderRadius: - BorderRadius.circular(17.0), - color: const Color(0xFF392D53), + BorderRadius.circular( + 17.0), + color: + const Color(0xFF392D53), border: GradientBoxBorder( gradient: AppColor .mainVerLinearGradient, @@ -914,158 +996,201 @@ class _RightCircleItemState extends State ), )), // Spacer(), - welfareList.length > 0 ? Container( - margin: EdgeInsets.only(right: 0.sp), - width: 160.sp, - height: 30.sp, - alignment: Alignment.centerRight, - child: CarouselSlider.builder( - options: CarouselOptions( - height: 30.0, - autoPlay: welfareList.length > 1, // 启用自动播放 - enlargeCenterPage: true, - autoPlayInterval: const Duration(seconds: 5), - aspectRatio: 1.0, - viewportFraction: 1.0), - itemBuilder: - (BuildContext context, int index, int realIndex) { - Map data = welfareList[index]; - String action = ''; - String tip = ''; - int type = 0; - action = '领取'; - tip = '发了福袋'; - return Container( - width: 170.sp, + welfareList.length > 0 + ? Container( + margin: EdgeInsets.only(right: 0.sp), + width: 160.sp, + height: 30.sp, alignment: Alignment.centerRight, - child: IntrinsicWidth( - child: Container( - // padding: EdgeInsets.only(left: 5.sp), - // width: 170.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color.fromRGBO(25, 10, 31, 1.0), - border: GradientBoxBorder( - gradient: - AppColor.mainVerLinearGradient, - width: 1.sp, - ), - ), - // image: DecorationImage( - // fit: BoxFit.fill, - // image: AssetImage(getCircleImage('normal_bg')))), - child:InkWell( - onTap: () { - getWelfareDetailData( - data['id'].toString(),index); - }, - child: Container( - margin: EdgeInsets.only(left: 5.sp, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // ClipOval(child: CachedImg(imageUrl: data['user']['avatar'],fit: BoxFit.cover,width: 20.sp,height: 20.sp,)), - // SizedBox(width: 2.sp,), - GestureDetector( - onTap: () { - Get.toNamed(Routes.UserInfoPage, - arguments: - data['user']['id'].toString(),parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new'}); - }, - child: Text( - (data['user']['nickname'] ?? '') - .toString() - .length > - 4 - ? data['user']['nickname'] - .toString() - .substring(0, 4) + - '..' - : data['user']['nickname'], - style: TextStyle( - color: AppColor.mainColor, - fontSize: 13.sp, - fontWeight: FontWeight.w500), + child: CarouselSlider.builder( + options: CarouselOptions( + height: 30.0, + autoPlay: + welfareList.length > 1, // 启用自动播放 + enlargeCenterPage: true, + autoPlayInterval: + const Duration(seconds: 5), + aspectRatio: 1.0, + viewportFraction: 1.0), + itemBuilder: (BuildContext context, + int index, int realIndex) { + Map data = welfareList[index]; + String action = ''; + String tip = ''; + int type = 0; + action = '领取'; + tip = '发了福袋'; + return Container( + width: 170.sp, + alignment: Alignment.centerRight, + child: IntrinsicWidth( + child: Container( + // padding: EdgeInsets.only(left: 5.sp), + // width: 170.sp, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(15.sp), + color: Color.fromRGBO( + 25, 10, 31, 1.0), + border: GradientBoxBorder( + gradient: AppColor + .mainVerLinearGradient, + width: 1.sp, + ), + ), + // image: DecorationImage( + // fit: BoxFit.fill, + // image: AssetImage(getCircleImage('normal_bg')))), + child: InkWell( + onTap: () { + getWelfareDetailData( + data['id'].toString(), + index); + }, + child: Container( + margin: EdgeInsets.only( + left: 5.sp, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + // ClipOval(child: CachedImg(imageUrl: data['user']['avatar'],fit: BoxFit.cover,width: 20.sp,height: 20.sp,)), + // SizedBox(width: 2.sp,), + GestureDetector( + onTap: () { + Get.toNamed( + Routes.UserInfoPage, + arguments: + data['user'] + ['id'] + .toString(), + parameters: { + 'source': widget + .index == + 0 + ? 'callout_list_hot' + : 'callout_list_new' + }); + }, + child: Text( + (data['user']['nickname'] ?? + '') + .toString() + .length > + 4 + ? data['user'][ + 'nickname'] + .toString() + .substring( + 0, 4) + + '..' + : data['user'] + ['nickname'], + style: TextStyle( + color: AppColor + .mainColor, + fontSize: 13.sp, + fontWeight: + FontWeight + .w500), + ), + ), + Container( + margin: EdgeInsets.only( + right: 6.sp), + child: Text( + tip, + style: TextStyle( + color: + Colors.white, + fontSize: 13.sp, + fontWeight: + FontWeight + .w500), + )), + + Container( + alignment: + Alignment.center, + height: 30.sp, + padding: EdgeInsets.only( + left: 4.sp, + right: 4.sp), + decoration: BoxDecoration( + gradient: AppColor + .tagVerLinearGradient, + borderRadius: + BorderRadius + .circular( + 12.sp)), + child: Text( + action, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp), + ), + ) + ], ), ), - Container( - margin: EdgeInsets.only(right: 6.sp), - child: Text( - tip, - style: TextStyle( - color: Colors.white, - fontSize: 13.sp, - fontWeight: FontWeight.w500), - )), - - Container( - alignment: Alignment.center, - height: 30.sp, - padding: EdgeInsets.only( - left: 4.sp, right: 4.sp), - decoration: BoxDecoration( - gradient: - AppColor.tagVerLinearGradient, - borderRadius: - BorderRadius.circular(12.sp)), - child: Text( - action, - style: TextStyle( - color: Colors.white, fontSize: 14.sp), - ), - ) - ], + ), ), ), - ), - ), + ); + }, + itemCount: welfareList.length, ), - ); - }, - itemCount: welfareList.length, - ), - ) : GestureDetector( - onTap: () { - Get.toNamed(Routes.Send_lucky_bag,arguments: int.parse(circleId))! - .then((value) { - if (value != null) { - loadWelfareListData(); - } - } ); - }, - child: Container( - // padding: EdgeInsets.only(left: 5.sp,right: 5.sp), - width: 120.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: [ - Image.asset( - getBaseImage('fu_icon'), - width: 20.sp, - ), - SizedBox( - width: 2.sp, - ), - Text( - '发福袋涨人气', - style: TextStyle(color: Colors.white, fontSize: 13.sp), - ) - ], - )), - ), - ) + ) + : GestureDetector( + onTap: () { + Get.toNamed(Routes.Send_lucky_bag, + arguments: int.parse(circleId))! + .then((value) { + if (value != null) { + loadWelfareListData(); + } + }); + }, + child: Container( + // padding: EdgeInsets.only(left: 5.sp,right: 5.sp), + width: 120.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: [ + Image.asset( + getBaseImage('fu_icon'), + width: 20.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + '发福袋涨人气', + style: TextStyle( + color: Colors.white, + fontSize: 13.sp), + ) + ], + )), + ), + ) ], ), )), @@ -1075,7 +1200,6 @@ class _RightCircleItemState extends State getCircleImage('circle_line'), width: Get.width, )), - if (Get.currentRoute == Routes.Home) Positioned( bottom: 36.sp, @@ -1092,41 +1216,52 @@ class _RightCircleItemState extends State getCircleImage('send_msg'), width: 70.sp, ))), - if (Get.currentRoute == Routes.Home && _tabController.index == 0 && callLeftOut > 3) - Positioned(top: 70.sp,child: InkWell(onTap: () { - scrollController.animateTo(0, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); - // EventBusManager.fire(RightScrollViewIsEnd(true)); - refreshController.requestRefresh(); - EventBusManager.fire( - RightRefreshContrller(_tabController.index)); - Future.delayed(Duration(milliseconds: 250),() { - refreshController.refreshCompleted(); - }); - - callLeftOut = 0; - if (mounted) { - setState(() { - - }); - } - },child: MoreDynamicTip())), - if (Get.currentRoute == Routes.Home && _tabController.index == 1 && callRightOut > 3) - Positioned(top: 70.sp,child: InkWell(onTap: () { - scrollController.animateTo(0, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); - refreshController.requestRefresh(); - EventBusManager.fire( - RightRefreshContrller(_tabController.index)); - Future.delayed(Duration(milliseconds: 250),() { - refreshController.refreshCompleted(); - }); - callRightOut = 0; - if (mounted) { - setState(() { - - }); - } - },child: MoreDynamicTip())) + if (Get.currentRoute == Routes.Home && + _tabController.index == 0 && + callLeftOut > 3) + Positioned( + top: 70.sp, + child: InkWell( + onTap: () { + scrollController.animateTo(0, + duration: Duration(milliseconds: 250), + curve: Curves.easeInOut); + // EventBusManager.fire(RightScrollViewIsEnd(true)); + refreshController.requestRefresh(); + EventBusManager.fire( + RightRefreshContrller(_tabController.index)); + Future.delayed(Duration(milliseconds: 250), () { + refreshController.refreshCompleted(); + }); + callLeftOut = 0; + if (mounted) { + setState(() {}); + } + }, + child: MoreDynamicTip())), + if (Get.currentRoute == Routes.Home && + _tabController.index == 1 && + callRightOut > 3) + Positioned( + top: 70.sp, + child: InkWell( + onTap: () { + scrollController.animateTo(0, + duration: Duration(milliseconds: 250), + curve: Curves.easeInOut); + refreshController.requestRefresh(); + EventBusManager.fire( + RightRefreshContrller(_tabController.index)); + Future.delayed(Duration(milliseconds: 250), () { + refreshController.refreshCompleted(); + }); + callRightOut = 0; + if (mounted) { + setState(() {}); + } + }, + child: MoreDynamicTip())) ], ))); } @@ -1290,106 +1425,19 @@ class _RightCircleItemState extends State } Get.toNamed(Routes.Chat, arguments: con); } else if (data['code'] == 32104) { - showReportDialog(Get.context!, data['msg']); + showReportDialog(Get.context!, circleId); } } - void showReportDialog(BuildContext context, String msg) { + void showReportDialog(BuildContext context, String circleId) { showDialog( context: context, builder: (BuildContext context) { - return Dialog( - backgroundColor: Colors.transparent, - child: Container( - height: 200.sp, - padding: const EdgeInsets.all(1.0), - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: AppColor.bgColor, - borderRadius: BorderRadius.circular(12.0.sp), - // gradient: const LinearGradient( - // colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], - // begin: Alignment.topCenter, - // end: Alignment.bottomCenter, - // ), - ), - ), - // Container( - // margin: EdgeInsets.all(1.sp), - // child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,), - // ), - Container( - margin: EdgeInsets.only(top: 12.sp), - child: Column( - children: [ - Center( - child: Text( - "申请代理提示", - style: - TextStyle(color: Colors.white, fontSize: 16.sp), - ), - ), - Container( - margin: EdgeInsets.only( - top: 12.sp, left: 14.sp, right: 14.sp), - alignment: Alignment.center, - child: Text( - msg, - textAlign: TextAlign.left, - style: TextStyle( - color: const Color(0xCCF7FAFA), fontSize: 16.sp), - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Get.back(); - Get.toNamed(Routes.InvitePage); - }, - child: Container( - margin: EdgeInsets.only(top: 16.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, - ), - ), - ), - ) - ], - ) - ], - ), - ) - ], - ), - ), - ); + return ApplyForAnAgentDialog(circleId: int.parse(circleId)); }, - ); + ).then((value) { + loadInterestAgent(); + }); } void showSendMoneyDialog(String userId) { @@ -1439,6 +1487,44 @@ class _RightCircleListWidgetState extends State Map interestAgentMap = {}; List visibleItems = []; + List emojis = [ + "❤️", + "🪢", + "⛓️", + "🕯️", + "🔐", + "🔔", + "⭕️", + "📏", + "🪡", + "🎭", + "👙", + "👅", + "🦶", + "🧎", + "⚔️", + "🍌", + "🦋", + "🌼", + "👏", + "🤟", + "🙏", + "🦴", + "🐶", + "👿", + "👼", + "👻", + "🌹", + "💌", + "😘", + "😍", + "🫣", + "😂", + "🤐", + "😱", + "🫥" + ]; + bool isScrolling = false; Timer? _timer; @@ -1446,6 +1532,9 @@ class _RightCircleListWidgetState extends State var sub; var sub1; bool isLoadCircleInfo = false; + + bool isShowEmoji = false; + @override void dispose() { // TODO: implement dispose @@ -1473,7 +1562,6 @@ class _RightCircleListWidgetState extends State StreamSubscription? cicleInfoRefresh = null; StreamSubscription? scroToTop = null; - @override void initState() { // TODO: implement initState @@ -1500,7 +1588,6 @@ class _RightCircleListWidgetState extends State } }); - scrollController.addListener(() { if (scrollController.offset <= 0) { // EventBusManager.fire(RightScrollViewScrollTop()); @@ -1533,12 +1620,9 @@ class _RightCircleListWidgetState extends State }); } - - void isScrollingListener() { if (scrollController.hasClients && - scrollController.position.isScrollingNotifier - .hasListeners) { + scrollController.position.isScrollingNotifier.hasListeners) { isScrolling = scrollController.position.isScrollingNotifier.value; if (isScrolling) { isScrolling = true; @@ -1575,19 +1659,6 @@ class _RightCircleListWidgetState extends State } - loadCircleInfo() async { - var data = await DioManager.instance.get( - url: "/up-service/interest/$circleId", - ); - if (data["code"] == 200) { - widget.bean = Circle.fromJson(data['data']); - isLoadCircleInfo = true; - if (mounted) { - setState(() {}); - } - } - } - loadCallOutListData() async { var data = await DioManager.instance.get( url: widget.type == 0 @@ -1648,8 +1719,9 @@ class _RightCircleListWidgetState extends State } void pushOtherPeopleHomePage(String userId) { - Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new'}); - + Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: { + 'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new' + }); } void pushHomePage(Lists bean, String cicleId) async { @@ -1658,7 +1730,12 @@ class _RightCircleListWidgetState extends State if (bean.user!.id == userId) { Get.toNamed(Routes.UserInfoPage); } else { - Get.toNamed(Routes.UserInfoPage, arguments: bean.user!.id!.toString(),parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new'}); + Get.toNamed(Routes.UserInfoPage, + arguments: bean.user!.id!.toString(), + parameters: { + 'source': + widget.index == 0 ? 'callout_list_hot' : 'callout_list_new' + }); } }); } @@ -1731,9 +1808,9 @@ class _RightCircleListWidgetState extends State @override Widget build(BuildContext context) { - if (widget.bean.image.isEmpty && !isLoadCircleInfo) { - loadCircleInfo(); - } + // if (widget.bean.image.isEmpty && !isLoadCircleInfo) { + // loadCircleInfo(); + // } List urlList = widget.bean.lastJoinUsers; List widgets = []; int i = 0; @@ -1756,64 +1833,66 @@ class _RightCircleListWidgetState extends State return !callOutMore && lists.isEmpty ? noResultWidget() - :NotificationListener( - onNotification: (notification) { - if (notification is OverscrollNotification && - notification.overscroll < -5) { - if (isEnd) { - isEnd = false; - widget.scrollController.animateTo(0, - duration: Duration(milliseconds: 200), - curve: Curves.easeIn); - setState(() {}); - } - } + : NotificationListener( + onNotification: (notification) { + if (notification is OverscrollNotification && + notification.overscroll < -5) { + if (isEnd) { + isEnd = false; + widget.scrollController.animateTo(0, + duration: Duration(milliseconds: 200), + curve: Curves.easeIn); + setState(() {}); + } + } - return true; - }, - child: SmartRefresher( - controller: refreshController, - // onRefresh: refreshData, - enablePullDown: false, - onLoading: loadMore, - enablePullUp: true, - child: ListView.builder( - physics: !isEnd ? NeverScrollableScrollPhysics() : ClampingScrollPhysics(), - addAutomaticKeepAlives: false, - addRepaintBoundaries: false, - scrollDirection: Axis.vertical, - controller: scrollController, - itemCount: lists.length, - shrinkWrap: true, - itemBuilder: (context, index) { - if (widget.type == 0) { - scrollController.position.isScrollingNotifier - .addListener(isScrollingListener); - } - Lists list = lists[index]; - if (list.isQueen!) { - return VisibilityDetector( - key: Key(index.toString()), - onVisibilityChanged: (visibilityInfo) { - _onVisibilityChanged( - index, - visibilityInfo.visibleFraction > 0.0, - ); - }, - child:vipDynamicItem(list)); - } else { - return VisibilityDetector( - key: Key(index.toString()), - onVisibilityChanged: (visibilityInfo) { - _onVisibilityChanged( - index, - visibilityInfo.visibleFraction > 0.0, - ); - }, - child:normalDynamicItem(list)); - } - })), - ); + return true; + }, + child: SmartRefresher( + controller: refreshController, + // onRefresh: refreshData, + enablePullDown: false, + onLoading: loadMore, + enablePullUp: true, + child: ListView.builder( + physics: !isEnd + ? NeverScrollableScrollPhysics() + : ClampingScrollPhysics(), + addAutomaticKeepAlives: false, + addRepaintBoundaries: false, + scrollDirection: Axis.vertical, + controller: scrollController, + itemCount: lists.length, + shrinkWrap: true, + itemBuilder: (context, index) { + if (widget.type == 0) { + scrollController.position.isScrollingNotifier + .addListener(isScrollingListener); + } + Lists list = lists[index]; + if (list.isQueen!) { + return VisibilityDetector( + key: Key(index.toString()), + onVisibilityChanged: (visibilityInfo) { + _onVisibilityChanged( + index, + visibilityInfo.visibleFraction > 0.0, + ); + }, + child: vipDynamicItem(list)); + } else { + return VisibilityDetector( + key: Key(index.toString()), + onVisibilityChanged: (visibilityInfo) { + _onVisibilityChanged( + index, + visibilityInfo.visibleFraction > 0.0, + ); + }, + child: normalDynamicItem(list)); + } + })), + ); } void _onVisibilityChanged(int index, bool visible) async { @@ -1827,9 +1906,9 @@ class _RightCircleListWidgetState extends State } } - ///至尊喊话 vipDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, @@ -1891,7 +1970,6 @@ class _RightCircleListWidgetState extends State } else { picHeight = picWidth; } - } } else { picHeight = 200.sp; @@ -1920,16 +1998,15 @@ class _RightCircleListWidgetState extends State ), )); }); - atWidget = - Container( - padding: EdgeInsets.only(left: 10.sp, right: 10.sp, top: 5.sp), - child: Row( - children: [ - Wrap( - children: atList, - ), - ], - )); + atWidget = Container( + padding: EdgeInsets.only(left: 10.sp, right: 10.sp, top: 5.sp), + child: Row( + children: [ + Wrap( + children: atList, + ), + ], + )); } // double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight; @@ -1961,7 +2038,7 @@ class _RightCircleListWidgetState extends State // margin: EdgeInsets.only(top: 5.sp,right: 5.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp), alignment: Alignment.center, - height: 28.sp, + height: 24.sp, decoration: BoxDecoration( color: Color.fromRGBO(52, 41, 67, 1), borderRadius: BorderRadius.only( @@ -1973,7 +2050,7 @@ class _RightCircleListWidgetState extends State (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0, 4) + '...' : (lists.user!.city ?? '外星'), - style: TextStyle(color: Colors.white, fontSize: 15.sp), + style: TextStyle(color: Colors.white, fontSize: 14.sp), ), ) ], @@ -2042,8 +2119,11 @@ class _RightCircleListWidgetState extends State padding: EdgeInsets.all(2.sp), child: ClipRRect( borderRadius: BorderRadius.circular(30.sp), - child: Image.network(lists.user!.avatar_thumb!, - width: 40.sp, height: 40.sp, fit: BoxFit.cover), + child: Image.network( + lists.user!.avatar_thumb!, + width: 40.sp, + height: 40.sp, + fit: BoxFit.cover), ), ), if ((lists.user!.onlineFlag ?? '').isNotEmpty) @@ -2051,13 +2131,15 @@ class _RightCircleListWidgetState extends State bottom: 0, child: Container( height: 20.sp, - padding: - EdgeInsets.only(left: 4.sp, right: 4.sp), + padding: EdgeInsets.only( + left: 4.sp, right: 4.sp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.sp), + borderRadius: + BorderRadius.circular(10.sp), color: AppColor.bgColor, border: GradientBoxBorder( - gradient: AppColor.mainVerLinearGradient, + gradient: + AppColor.mainVerLinearGradient, width: 1.sp, ), ), @@ -2070,7 +2152,6 @@ class _RightCircleListWidgetState extends State fontSize: 10.sp, ), ))) - ], )), Expanded( @@ -2148,144 +2229,233 @@ class _RightCircleListWidgetState extends State child: picHeight == 200.sp ? ClipRRect( borderRadius: BorderRadius.circular(6.sp), - child: VideoItemWidget(lists.album![0].url!,lists.id!.toString(),lists.user!.id.toString())) - : picHeight == 250 ? GestureDetector( - onTap: () async { - var imgList = []; - for (var element in lists.album!) { - imgList.add(element.url!); - } - Map params = {}; - if (widget.bean.is_limit && widget.bean.amount > 0) { - await refreshCircleData(); - } - if (widget.bean.is_limit && widget.bean.amount > 0) { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}; - - // return; - } else { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}; - } - - - Get.toNamed(Routes.SwiperPage, - arguments: { - 'imaglist': imgList, - 'index': 0, - 'userId':lists.user?.id!.toString() - },parameters: params); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(6.sp), - child: CachedImg( - imageUrl: lists.album!.first.url!, - fit: BoxFit.cover, - ), - ), - ) : GridView.builder( - controller: GridScrollController, - itemCount: lists.album!.length, - scrollDirection: Axis.vertical, - physics: const NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, //横轴三个子widget - crossAxisSpacing: 8.sp, - mainAxisSpacing: 8.sp, - childAspectRatio: 0.6 //宽高比为1时,子widget - ), - itemBuilder: (contentxt, currentIndex) { - Album album = lists.album![currentIndex]; - return GestureDetector( + child: VideoItemWidget( + lists.album![0].url!, + lists.id!.toString(), + lists.user!.id.toString())) + : picHeight == 250 + ? GestureDetector( onTap: () async { - - if (widget.bean.is_limit && widget.bean.amount > 0) { - await refreshCircleData(); - } - - var imgList = []; for (var element in lists.album!) { imgList.add(element.url!); } Map params = {}; - if (widget.bean.is_limit && widget.bean.amount > 0) { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}; + if (widget.bean.is_limit && + widget.bean.amount > 0) { + await refreshCircleData(); + } + if (widget.bean.is_limit && + widget.bean.amount > 0) { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + 'bean': jsonEncode({ + 'id': widget.bean.id.toString(), + 'amount': widget.bean.amount.toString(), + 'oldAmount': + widget.bean.oldAmount.toString(), + 'iosItem': widget.bean.ios_item + }) + }; // return; } else { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}; + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + }; } - Get.toNamed(Routes.SwiperPage, arguments: { 'imaglist': imgList, - 'index': currentIndex, - 'userId':lists.user?.id!.toString() - },parameters: params); + 'index': 0, + 'userId': lists.user?.id!.toString() + }, + parameters: params); }, child: ClipRRect( borderRadius: BorderRadius.circular(6.sp), child: CachedImg( - imageUrl: album.url!, + imageUrl: lists.album!.first.url!, fit: BoxFit.cover, ), ), - ); - }), + ) + : GridView.builder( + controller: GridScrollController, + itemCount: lists.album!.length, + scrollDirection: Axis.vertical, + physics: const NeverScrollableScrollPhysics(), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, //横轴三个子widget + crossAxisSpacing: 8.sp, + mainAxisSpacing: 8.sp, + childAspectRatio: 0.6 //宽高比为1时,子widget + ), + itemBuilder: (contentxt, currentIndex) { + Album album = lists.album![currentIndex]; + return GestureDetector( + onTap: () async { + if (widget.bean.is_limit && + widget.bean.amount > 0) { + await refreshCircleData(); + } + + var imgList = []; + for (var element in lists.album!) { + imgList.add(element.url!); + } + Map params = {}; + if (widget.bean.is_limit && + widget.bean.amount > 0) { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + 'bean': jsonEncode({ + 'id': widget.bean.id.toString(), + 'amount': + widget.bean.amount.toString(), + 'oldAmount': widget.bean.oldAmount + .toString(), + 'iosItem': widget.bean.ios_item + }) + }; + + // return; + } else { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + }; + } + + Get.toNamed(Routes.SwiperPage, + arguments: { + 'imaglist': imgList, + 'index': currentIndex, + 'userId': lists.user?.id!.toString() + }, + parameters: params); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(6.sp), + child: CachedImg( + imageUrl: album.url!, + fit: BoxFit.cover, + ), + ), + ); + }), ), ), - Container( - height: 30.sp, - padding: EdgeInsets.only(left: 5.sp, right: 10.sp), - margin: EdgeInsets.only( - top: picHeight > 0 ? 5.sp : 5.sp, bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( - width: 24 + 12.sp * widgets.length - 8.sp, - height: 24.sp, - child: Stack(children: widgets), + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( + width: 24 + 12.sp * widgets.length - 8.sp, + height: 24.sp, + child: Stack(children: widgets), + ) + : Container(), + SizedBox( + width: 4.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 14.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 14.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + widget.bean.id.toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 60.sp, + ), ) - : Container(), - SizedBox( - width: 4.sp, - ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () { - pushMsgPage( - lists, - widget.bean.id.toString(), - ); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, + ], ), - ) - ], - ), + ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + _showEmojiPicker( + lists, lists.id!, context, details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only( + left: 10.sp, + bottom: + (lists.topInteractType!['userCount'] ?? 0) > 0 + ? 10.sp + : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 + ? lists.isInteract! - 1 + : type] ?? + '❤', + style: TextStyle( + color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: TextStyle( + color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], ) ], ), @@ -2295,6 +2465,8 @@ class _RightCircleListWidgetState extends State ///普通图文喊话 normalDynamicItem(Lists lists) { + int type = (lists.topInteractType?['type'] ?? 1) - 1; + Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text( lists.content!, @@ -2338,7 +2510,6 @@ class _RightCircleListWidgetState extends State } else { picHeight = picWidth; } - } } else { picHeight = 200.sp; @@ -2385,16 +2556,15 @@ class _RightCircleListWidgetState extends State ), )); }); - atWidget = - Container( - padding: EdgeInsets.only(bottom: 5.sp), - child: Row( - children: [ - Wrap( - children: atList, - ), - ], - )); + atWidget = Container( + padding: EdgeInsets.only(bottom: 5.sp), + child: Row( + children: [ + Wrap( + children: atList, + ), + ], + )); } return Container( @@ -2423,7 +2593,7 @@ class _RightCircleListWidgetState extends State // margin: EdgeInsets.only(top: 5.sp,right: 5.sp), padding: EdgeInsets.only(left: 15.sp, right: 15.sp), alignment: Alignment.center, - height: 28.sp, + height: 24.sp, decoration: BoxDecoration( color: Color.fromRGBO(52, 41, 67, 1), borderRadius: BorderRadius.only( @@ -2435,7 +2605,7 @@ class _RightCircleListWidgetState extends State (lists.user!.city ?? '外星').length > 4 ? (lists.user!.city ?? '外星').substring(0, 4) + '...' : (lists.user!.city ?? '外星'), - style: TextStyle(color: Colors.white, fontSize: 15.sp), + style: TextStyle(color: Colors.white, fontSize: 14.sp), ), ) ], @@ -2502,7 +2672,8 @@ class _RightCircleListWidgetState extends State width: 41.sp, height: 41.sp, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.5.sp), + borderRadius: + BorderRadius.circular(20.5.sp), gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -2516,8 +2687,11 @@ class _RightCircleListWidgetState extends State padding: EdgeInsets.all(2.sp), child: ClipRRect( borderRadius: BorderRadius.circular(30.sp), - child: Image.network(lists.user!.avatar_thumb!, - width: 40.sp, height: 40.sp, fit: BoxFit.cover), + child: Image.network( + lists.user!.avatar_thumb!, + width: 40.sp, + height: 40.sp, + fit: BoxFit.cover), ), ), if ((lists.user!.onlineFlag ?? '').isNotEmpty) @@ -2525,13 +2699,15 @@ class _RightCircleListWidgetState extends State bottom: 0, child: Container( height: 20.sp, - padding: - EdgeInsets.only(left: 4.sp, right: 4.sp), + padding: EdgeInsets.only( + left: 4.sp, right: 4.sp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.sp), + borderRadius: + BorderRadius.circular(10.sp), color: AppColor.bgColor, border: GradientBoxBorder( - gradient: AppColor.mainVerLinearGradient, + gradient: AppColor + .mainVerLinearGradient, width: 1.sp, ), ), @@ -2622,143 +2798,243 @@ class _RightCircleListWidgetState extends State child: picHeight == 200.sp ? ClipRRect( borderRadius: BorderRadius.circular(6.sp), - child: VideoItemWidget(lists.album![0].url!,lists.id!.toString(),lists.user!.id.toString())) - : picHeight == 250 ? GestureDetector( - onTap: () async { - var imgList = []; - for (var element in lists.album!) { - imgList.add(element.url!); - } - Map params = {}; - if (widget.bean.is_limit && widget.bean.amount > 0) { - await refreshCircleData(); - } - if (widget.bean.is_limit && widget.bean.amount > 0) { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}; - - // return; - } else { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}; - } - - - Get.toNamed(Routes.SwiperPage, - arguments: { - 'imaglist': imgList, - 'index': 0, - 'userId':lists.user?.id!.toString() - },parameters: params); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(6.sp), - child: CachedImg( - imageUrl: lists.album!.first.url!, - fit: BoxFit.cover, - ), - ), - ) : GridView.builder( - controller: GridScrollController, - itemCount: lists.album!.length, - physics: const NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, //横轴三个子widget - crossAxisSpacing: 4.sp, - mainAxisSpacing: 4.sp, - childAspectRatio: - ratio //宽高比为1时,子widget - ), - itemBuilder: (contentxt, currentIndex) { - Album album = lists.album![currentIndex]; - return GestureDetector( + child: VideoItemWidget( + lists.album![0].url!, + lists.id!.toString(), + lists.user!.id.toString())) + : picHeight == 250 + ? GestureDetector( onTap: () async { var imgList = []; for (var element in lists.album!) { imgList.add(element.url!); } Map params = {}; - if (widget.bean.is_limit && widget.bean.amount > 0) { + if (widget.bean.is_limit && + widget.bean.amount > 0) { await refreshCircleData(); } - if (widget.bean.is_limit && widget.bean.amount > 0) { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}; + if (widget.bean.is_limit && + widget.bean.amount > 0) { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + 'bean': jsonEncode({ + 'id': widget.bean.id.toString(), + 'amount': + widget.bean.amount.toString(), + 'oldAmount': widget.bean.oldAmount + .toString(), + 'iosItem': widget.bean.ios_item + }) + }; // return; } else { - params = {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}; + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + }; } - Get.toNamed(Routes.SwiperPage, arguments: { 'imaglist': imgList, - 'index': currentIndex, - 'userId':lists.user?.id!.toString() - },parameters: params); + 'index': 0, + 'userId': + lists.user?.id!.toString() + }, + parameters: params); }, child: ClipRRect( borderRadius: BorderRadius.circular(6.sp), child: CachedImg( - imageUrl: album.url!, + imageUrl: lists.album!.first.url!, fit: BoxFit.cover, ), ), - ); - })) - : Container(), - Container( - height: 30.sp, - padding: EdgeInsets.only( - left: 5.sp, - right: 10.sp, - ), - margin: EdgeInsets.only( - top: picHeight > 0 ? 5.sp : 10.sp, bottom: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.sp), - color: Color(0x33000000)), - child: Row( - children: [ - widgets.isNotEmpty - ? SizedBox( - width: 24 + 12.sp * widgets.length - 8.sp, - height: 24.sp, - child: Stack(children: widgets), - ) - : Container(), - SizedBox( - width: 4.sp, - ), - widgets.isNotEmpty - ? Expanded( - child: Text( - '${lists.chat!.count!}位圈友已私聊', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )) - : Expanded( - child: Text( - '赶紧成为第一位私聊ta的圈友吧', - style: TextStyle( - color: Colors.white.withOpacity(0.75), - fontSize: 14.sp), - )), - GestureDetector( - onTap: () async { - pushMsgPage(lists, widget.bean.id.toString()); + ) + : GridView.builder( + controller: GridScrollController, + itemCount: lists.album!.length, + physics: + const NeverScrollableScrollPhysics(), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, //横轴三个子widget + crossAxisSpacing: 4.sp, + mainAxisSpacing: 4.sp, + childAspectRatio: + ratio //宽高比为1时,子widget + ), + itemBuilder: (contentxt, currentIndex) { + Album album = + lists.album![currentIndex]; + return GestureDetector( + onTap: () async { + var imgList = []; + for (var element in lists.album!) { + imgList.add(element.url!); + } + Map params = {}; + if (widget.bean.is_limit && + widget.bean.amount > 0) { + await refreshCircleData(); + } + if (widget.bean.is_limit && + widget.bean.amount > 0) { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + 'bean': jsonEncode({ + 'id': + widget.bean.id.toString(), + 'amount': widget.bean.amount + .toString(), + 'oldAmount': widget + .bean.oldAmount + .toString(), + 'iosItem': + widget.bean.ios_item + }) + }; - // }); - }, - child: Image.asset( - getCircleImage('chat'), - width: 60.sp, - )) - ], - ), - ), + // return; + } else { + params = { + 'source': widget.index == 0 + ? 'callout_list_hot' + : 'callout_list_new', + }; + } + + Get.toNamed(Routes.SwiperPage, + arguments: { + 'imaglist': imgList, + 'index': currentIndex, + 'userId': + lists.user?.id!.toString() + }, + parameters: params); + }, + child: ClipRRect( + borderRadius: + BorderRadius.circular(6.sp), + child: CachedImg( + imageUrl: album.url!, + fit: BoxFit.cover, + ), + ), + ); + })) + : Container(), + Row( + children: [ + Expanded( + child: Container( + height: 30.sp, + padding: EdgeInsets.only(left: 5.sp, right: 10.sp), + margin: EdgeInsets.only( + top: picHeight > 0 ? 5.sp : 5.sp, bottom: 5.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.sp), + color: Color(0x33000000)), + child: Row( + children: [ + widgets.isNotEmpty + ? SizedBox( + width: 24 + 12.sp * widgets.length - 8.sp, + height: 24.sp, + child: Stack(children: widgets), + ) + : Container(), + SizedBox( + width: 2.sp, + ), + widgets.isNotEmpty + ? Expanded( + child: Text( + '${lists.chat!.count!}位圈友已私聊', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )) + : Expanded( + child: Text( + '赶紧成为第一位私聊ta的人吧', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 13.sp), + )), + GestureDetector( + onTap: () { + pushMsgPage( + lists, + widget.bean.id.toString(), + ); + }, + child: Image.asset( + getCircleImage('chat'), + width: 50.sp, + ), + ) + ], + ), + ), + ), + GestureDetector( + onTapUp: (TapUpDetails details) { + if (lists.isInteract! > 0) { + showOKToast('这个喊话已经点过了哦'); + return; + } + + _showEmojiPicker(lists, lists.id!, context, + details.globalPosition); + }, + child: Container( + margin: EdgeInsets.only( + left: 10.sp, + bottom: + (lists.topInteractType!['userCount'] ?? 0) > 0 + ? 10.sp + : 5.sp), + // height: 40.sp, + alignment: Alignment.center, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + height: 43.sp, + ), + Text( + emojis[lists.isInteract! > 0 + ? lists.isInteract! - 1 + : type] ?? + '❤', + style: TextStyle( + color: Colors.white, fontSize: 20.sp), + ), + if ((lists.topInteractType!['userCount'] ?? 0) > + 0) + Positioned( + bottom: 0, + child: Text( + '${lists.topInteractType!['userCount']}', + style: TextStyle( + color: Colors.white, fontSize: 10.sp), + ), + ), + ], + ), + ), + ), + ], + ) ], ), ), @@ -2865,7 +3141,7 @@ class _RightCircleListWidgetState extends State alignment: Alignment.center, children: [ Opacity( - opacity: 0.5, + opacity: 0.15, child: Image.asset( getCircleImage('add'), width: 60.sp, @@ -2882,19 +3158,141 @@ class _RightCircleListWidgetState extends State )); } + OverlayEntry? _overlayEntry; + + void _showEmojiPicker( + Lists list, int id, BuildContext context, Offset position) { + if (isShowEmoji) return; + isShowEmoji = true; + _overlayEntry = OverlayEntry( + builder: (context) => Stack( + children: [ + // 遮罩层,点击关闭 + Positioned.fill( + child: GestureDetector( + onTap: () { + _removeOverlay(); + isShowEmoji = false; + }, + child: Container( + color: Colors.black.withOpacity(0.3), + ), + ), + ), + // 表情选择器 + Positioned( + left: position.dx - 230.w, + top: position.dy - 60.sp, + child: Material( + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 气泡框 + Container( + width: 240.w, // 设置最大宽度,超出才会滚动 + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + spreadRadius: 2, + ), + ], + ), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: emojis + .map((emoji) => Padding( + padding: + EdgeInsets.symmetric(horizontal: 4), + child: _emojiButton(emoji, id, list), + )) + .toList(), + ), + ), + ), + // 底部倒三角形 + ], + ), + )), + Positioned( + left: position.dx - 12.w, + top: position.dy - 18.w, + child: CustomPaint( + size: Size(20.w, 10.w), + painter: TrianglePainter(), + ), + ) + ], + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + } + + Widget _emojiButton(String emoji, int id, Lists list) { + return GestureDetector( + onTap: () async { + print("选择了表情: $emoji"); + _removeOverlay(); + isShowEmoji = false; + + int index = emojis.indexOf(emoji) + 1; + var result = await DioManager.instance.post( + url: Api.interactEmoji, params: {"calloutId": id, "type": index}); + if (result['code'] == 200) { + var data = await DioManager.instance + .get(url: Api.signCalloutDetail, params: { + 'id': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + index = lists.indexOf(list); + lists[index] = bean; + if (mounted) { + setState(() {}); + } + } + } + }, + child: Text( + emoji, + style: TextStyle(fontSize: 25), + ), + ); + } + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + } pushUserHome(String userId) async { if (widget.bean.is_limit && widget.bean.amount > 0) { await refreshCircleData(); } if (widget.bean.is_limit && widget.bean.amount > 0) { - Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new','bean':jsonEncode({'id':widget.bean.id.toString(),'amount':widget.bean.amount.toString(),'oldAmount':widget.bean.oldAmount.toString(),'iosItem':widget.bean.ios_item})}); + Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: { + 'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new', + 'bean': jsonEncode({ + 'id': widget.bean.id.toString(), + 'amount': widget.bean.amount.toString(), + 'oldAmount': widget.bean.oldAmount.toString(), + 'iosItem': widget.bean.ios_item + }) + }); // return; } else { - Get.toNamed(Routes.UserInfoPage, arguments: userId,parameters: {'source':widget.index == 0 ? 'callout_list_hot' : 'callout_list_new',}); + Get.toNamed(Routes.UserInfoPage, arguments: userId, parameters: { + 'source': widget.index == 0 ? 'callout_list_hot' : 'callout_list_new', + }); } - } circleWidget(String url, String userId, {double width = 24}) { @@ -3136,4 +3534,23 @@ class MySliverAppBarDelegate extends SliverPersistentHeaderDelegate { } } +// 自定义三角形 +class TrianglePainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + var paint = Paint() + ..color = Colors.white + ..style = PaintingStyle.fill; + var path = Path(); + path.moveTo(0, 0); + path.lineTo(size.width / 2, size.height); + path.lineTo(size.width, 0); + path.close(); + + canvas.drawPath(path, paint); + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) => false; +} diff --git a/circle_app/lib/circle_app/help/view.dart b/circle_app/lib/circle_app/help/view.dart index fb097a0..135c95a 100644 --- a/circle_app/lib/circle_app/help/view.dart +++ b/circle_app/lib/circle_app/help/view.dart @@ -30,7 +30,7 @@ class HelpPage extends StatelessWidget { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - centerTitle: '帮助与反馈', + centerTitle: '客服与反馈', actionWdiget: const Text( "我的反馈", style: TextStyle(color: Colors.white), diff --git a/circle_app/lib/circle_app/home/logic.dart b/circle_app/lib/circle_app/home/logic.dart index eabfd50..2e06388 100644 --- a/circle_app/lib/circle_app/home/logic.dart +++ b/circle_app/lib/circle_app/home/logic.dart @@ -86,6 +86,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { String inviteCode = ''; + String agentManualStr = ''; + var link = ''; @override void onClose() async { @@ -132,13 +134,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { addMsgListener(); - checkVersion(); + loadMyCircleData(); initWxApi(); awaitShowTodayDialog(); - awaitShowLikeRecomandDialog(); + // awaitShowLikeRecomandDialog(); } void addMsgListener() { @@ -572,7 +574,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { void onReady() async { // TODO: implement onReady super.onReady(); - + checkVersion(); FlutterNativeSplash.remove(); final logic = Get.find(); logic.loadCirclePeopleData(); @@ -803,7 +805,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { } void awaitShowTodayDialog() { - Future.delayed(Duration(seconds: 5), () async { + Future.delayed(Duration(seconds: 30), () async { SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); if (await sp.isFirstAutoMatch()) { var data = await DioManager.instance.get( @@ -859,6 +861,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { if (Get.currentRoute.contains(Routes.Chat) ) return; EventBusManager.fire(MsgTipClass(text, msgID, userInfo)); } + + loadManualata() async { + var data = await DioManager.instance.get(url: Api.agentManual); + if (data['code'] == 10000) { + agentManualStr = data['content']; + } + } } class conTop { diff --git a/circle_app/lib/circle_app/home/view.dart b/circle_app/lib/circle_app/home/view.dart index 48d1d72..0fdb08e 100644 --- a/circle_app/lib/circle_app/home/view.dart +++ b/circle_app/lib/circle_app/home/view.dart @@ -200,7 +200,7 @@ class _HomePageState extends State children: [ const CirclePage(), CircleListPage(), - WorldCallOutPage(), + WorldCallOutPage(), MsgPage(), MinefragmentPage() ], @@ -307,8 +307,9 @@ class _HomePageState extends State isSelected ? getTabbarImage('${image}_selected') : getTabbarImage('${image}_normal'), - width: 30.sp, - height: 30.sp, + width: 29.sp, + height: 29.sp, + fit: BoxFit.fill, excludeFromSemantics: true, gaplessPlayback: true, diff --git a/circle_app/lib/circle_app/invite/view.dart b/circle_app/lib/circle_app/invite/view.dart index 76351fd..8959e24 100644 --- a/circle_app/lib/circle_app/invite/view.dart +++ b/circle_app/lib/circle_app/invite/view.dart @@ -72,12 +72,11 @@ class _InvitePageState extends State child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - diyTitleWdiget: Container( width: Get.width, // color: Colors.red, child: Row( -mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Theme( data: ThemeData( @@ -90,15 +89,15 @@ mainAxisAlignment: MainAxisAlignment.center, }, controller: _tabController, tabs: tabs, - labelPadding: EdgeInsets.only(left: 8.sp,right: 8.sp), - indicatorPadding: - EdgeInsets.only(left: 20.sp, right: 20.sp, bottom: 10.sp), + labelPadding: EdgeInsets.only(left: 8.sp, right: 8.sp), + indicatorPadding: EdgeInsets.only( + left: 20.sp, right: 20.sp, bottom: 10.sp), isScrollable: true, indicatorSize: TabBarIndicatorSize.label, labelColor: AppColor.mainColor, unselectedLabelColor: Color(0xCCF7FAFA), - labelStyle: - TextStyle(fontSize: 18.sp, fontWeight: FontWeight.w500), + labelStyle: TextStyle( + fontSize: 18.sp, fontWeight: FontWeight.w500), ), ), ], @@ -117,11 +116,36 @@ mainAxisAlignment: MainAxisAlignment.center, alignment: Alignment.center, height: 30.sp, // width: 62.sp, - child: Image.asset( - getMineImage('invite_right_icon'), - width: 62.sp, - fit: BoxFit.fill, - ), + child: Container( + height: 24.sp, + margin: EdgeInsets.all(0.6.sp), + padding: EdgeInsets.only( + left: 6.sp, + right: 6.sp, + ), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(17.0), + color: const Color(0xFF392D53), + border: GradientBoxBorder( + gradient: AppColor + .mainVerLinearGradient, + width: 1.sp, + ), + ), + child: Row( + children: [ + Text( + "邀请攻略", + style: TextStyle( + fontSize: 12.sp, + color: Colors.white, + ), + ), + ], + ), + ) ), ); }, @@ -725,8 +749,9 @@ mainAxisAlignment: MainAxisAlignment.center, height: 42.sp, margin: EdgeInsets.only(top: 35.sp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.sp), - gradient: AppColor.mainVerLinearGradient,), + borderRadius: BorderRadius.circular(21.sp), + gradient: AppColor.mainVerLinearGradient, + ), alignment: Alignment.center, child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -734,10 +759,12 @@ mainAxisAlignment: MainAxisAlignment.center, Image( image: AssetImage(getMineImage("invite_icon")), // width: 22.sp, - height:22.sp, + height: 22.sp, color: Colors.white, ), - SizedBox(width: 4.sp,), + SizedBox( + width: 4.sp, + ), Text( '邀请圈友赚钱', style: TextStyle( @@ -774,26 +801,33 @@ mainAxisAlignment: MainAxisAlignment.center, Get.toNamed(Routes.Chat, arguments: con); }, child: Container( - width: 150.sp, - height: 42.sp, - margin: EdgeInsets.only(top: 35.sp), - decoration: BoxDecoration( + width: 150.sp, + height: 42.sp, + margin: EdgeInsets.only(top: 35.sp), + decoration: BoxDecoration( borderRadius: BorderRadius.circular(21.sp), - gradient: AppColor.mainVerLinearGradient,), - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.perm_identity_outlined,size: 22.sp,color: Colors.white,), - SizedBox(width: 4.sp,), - Text( - homeLogic.inventStr.contains('赚') ? '联系客服结算' : '联系客服', - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w600), - ), - ])), + gradient: AppColor.mainVerLinearGradient, + ), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.perm_identity_outlined, + size: 22.sp, + color: Colors.white, + ), + SizedBox( + width: 4.sp, + ), + Text( + homeLogic.inventStr.contains('赚') ? '联系客服结算' : '联系客服', + style: TextStyle( + color: Colors.white, + fontSize: 16, + fontWeight: FontWeight.w600), + ), + ])), ), ), ), @@ -801,8 +835,6 @@ mainAxisAlignment: MainAxisAlignment.center, ); } - - myTitileWidget() { return Container( height: 41.sp, @@ -922,7 +954,6 @@ mainAxisAlignment: MainAxisAlignment.center, ); } - buildSegment() { return Container( margin: EdgeInsets.only(top: 15.sp), @@ -1067,13 +1098,13 @@ titileWidget() { } rowWidget( - String str1, - String str2, - String str3, - String str4, - String str5, - String userId, - ) { + String str1, + String str2, + String str3, + String str4, + String str5, + String userId, +) { return Container( height: 41.sp, // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), @@ -1137,8 +1168,6 @@ rowWidget( ); } - - infoText(String info, [Color color = const Color(0xFFF7FAFA)]) { return Center( child: Text( @@ -1268,7 +1297,6 @@ void showCodePicker(InviteLogic logic) { enableDrag: false); } - class InventDescItem extends StatefulWidget { const InventDescItem({super.key}); @@ -1292,15 +1320,15 @@ class _InventDescItemState extends State { Container( height: 42.sp, margin: - EdgeInsets.only(left: 0.sp, right: 0.sp, top: 10.sp), + EdgeInsets.only(left: 0.sp, right: 0.sp, top: 10.sp), decoration: BoxDecoration( color: Color(0xFF211C37), borderRadius: BorderRadius.circular(8.sp) - // image: DecorationImage( - // image: AssetImage(getMineImage("invite_sys_bg")), - // fit: BoxFit.fill, - // ), - ), + // image: DecorationImage( + // image: AssetImage(getMineImage("invite_sys_bg")), + // fit: BoxFit.fill, + // ), + ), child: Swiper( physics: NeverScrollableScrollPhysics(), autoplayDelay: 1500, @@ -1360,7 +1388,7 @@ class _InventDescItemState extends State { width: 100.sp, height: 50.sp, decoration: BoxDecoration( - color: AppColor.mainColor.withOpacity(0.35), + color: AppColor.mainColor.withOpacity(0.35), borderRadius: BorderRadius.circular(6.sp)), child: Stack( alignment: Alignment.center, @@ -1418,7 +1446,7 @@ class _InventDescItemState extends State { width: 100.sp, height: 50.sp, decoration: BoxDecoration( - color: AppColor.mainColor.withOpacity(0.35), + color: AppColor.mainColor.withOpacity(0.35), borderRadius: BorderRadius.circular(6.sp)), child: Stack( alignment: Alignment.center, @@ -1476,7 +1504,7 @@ class _InventDescItemState extends State { width: 100.sp, height: 50.sp, decoration: BoxDecoration( - color: AppColor.mainColor.withOpacity(0.35), + color: AppColor.mainColor.withOpacity(0.35), borderRadius: BorderRadius.circular(6.sp)), child: Stack( alignment: Alignment.center, @@ -1518,7 +1546,6 @@ class _InventDescItemState extends State { ], ), ), - SizedBox( height: 12.sp, ), @@ -1571,9 +1598,14 @@ class _InventDescItemState extends State { borderRadius: BorderRadius.circular(6.sp)), child: Column(children: [ Container( - margin: EdgeInsets.only(top: 12.sp), - child:Text('微乐园推广大使榜',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp,fontWeight: FontWeight.bold),) - ), + margin: EdgeInsets.only(top: 12.sp), + child: Text( + '微乐园推广大使榜', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 15.sp, + fontWeight: FontWeight.bold), + )), Expanded( child: Container( margin: EdgeInsets.only( @@ -1582,52 +1614,48 @@ class _InventDescItemState extends State { decoration: BoxDecoration( color: Color(0x99363542), borderRadius: - BorderRadiusDirectional.circular(4.sp), + BorderRadiusDirectional.circular(4.sp), border: Border.all( color: Color(0x99363542), width: 1.sp)), child: logic.allInveiteData.isEmpty && - logic.selectedIndex == 1 + logic.selectedIndex == 1 ? noResultWidget() : ListView.builder( - // controller: logic.contentScrollController, - physics: NeverScrollableScrollPhysics(), - itemBuilder: - (BuildContext context, int index) { + // controller: logic.contentScrollController, + physics: NeverScrollableScrollPhysics(), + itemBuilder: + (BuildContext context, int index) { if (index == 0) { return titileWidget(); } - if (logic.allInveiteData - .length + - 1 == - index) { - return Container( - margin: EdgeInsets.only( - top: 4.sp, - left: 5.sp, - right: 5.sp), - child: Text( - '温馨提示:仅展示前${logic.allInveiteData.length}名,上榜的推广大使还能获得微乐园APP官方定制的精美礼品一份哦~', - style: TextStyle( - color: Colors.white - .withOpacity(0.75), - fontSize: 13.sp), - ), - ); + if (logic.allInveiteData.length + 1 == + index) { + return Container( + margin: EdgeInsets.only( + top: 4.sp, + left: 5.sp, + right: 5.sp), + child: Text( + '温馨提示:仅展示前${logic.allInveiteData.length}名,上榜的推广大使还能获得微乐园APP官方定制的精美礼品一份哦~', + style: TextStyle( + color: Colors.white + .withOpacity(0.75), + fontSize: 13.sp), + ), + ); } - var data = logic - .allInveiteData[index - 1]; + var data = + logic.allInveiteData[index - 1]; return rowWidget( - data['nickname'], - data['inviteCount'] - .toString(), - data['vipDaysStr'] - .toString() + - '天', - '${data['directProfitStr']}票', - '${data['rebateStr']}票', - data['userId'].toString()); + data['nickname'], + data['inviteCount'].toString(), + data['vipDaysStr'].toString() + '天', + '${data['directProfitStr']}票', + '${data['rebateStr']}票', + data['userId'].toString()); }, - itemCount: logic.allInveiteData.length + 2))), + itemCount: + logic.allInveiteData.length + 2))), ])), SizedBox( height: 60.sp + MediaQuery.of(context).padding.bottom, @@ -1658,69 +1686,75 @@ class _InventDescItemState extends State { decoration: BoxDecoration( gradient: AppColor.mainVerLinearGradient, borderRadius: BorderRadius.circular(21.sp)), - child: - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image( - image: AssetImage(getMineImage("invite_icon")), - // width: 22.sp, - height:22.sp, - color: Colors.white, - ), - SizedBox(width: 4.sp,), - Text( - '邀请圈友赚钱', - style: - TextStyle(color: Colors.white, fontSize: 15.sp), - ), - ], + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("invite_icon")), + // width: 22.sp, + height: 22.sp, + color: Colors.white, ), + SizedBox( + width: 4.sp, + ), + Text( + '邀请圈友赚钱', + style: + TextStyle(color: Colors.white, fontSize: 15.sp), + ), + ], + ), ), ), // if (logic.isShow) - GestureDetector( - onTap: () { - logic.sendApply(); - var con; - if (kDebugMode) { - con = V2TimConversation( - conversationID: "c2c_qpqz_dev_10_102", - userID: "qpqz_dev_10_102", - showName: "测试乐园客服", - type: 1); - } else { - con = V2TimConversation( - conversationID: "c2c_qpqz_prod_10_102", - userID: "qpqz_prod_10_102", - showName: "乐园客服", - type: 1); - } - Get.toNamed(Routes.Chat, arguments: con); - }, - child: Container( - alignment: Alignment.center, - width: 150.sp, - height: 42.sp, - decoration: BoxDecoration( - gradient: AppColor.mainVerLinearGradient, - borderRadius: BorderRadius.circular(21.sp), - ), - child: - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.stars,size: 22.sp,color: Colors.white,), - SizedBox(width: 4.sp,), - Text( - '申请成为大使', - style: TextStyle( - color: Colors.white, fontSize: 15.sp), - ), - ], - ), + GestureDetector( + onTap: () { + logic.sendApply(); + var con; + if (kDebugMode) { + con = V2TimConversation( + conversationID: "c2c_qpqz_dev_10_102", + userID: "qpqz_dev_10_102", + showName: "测试乐园客服", + type: 1); + } else { + con = V2TimConversation( + conversationID: "c2c_qpqz_prod_10_102", + userID: "qpqz_prod_10_102", + showName: "乐园客服", + type: 1); + } + Get.toNamed(Routes.Chat, arguments: con); + }, + child: Container( + alignment: Alignment.center, + width: 150.sp, + height: 42.sp, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(21.sp), ), - ) + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.stars, + size: 22.sp, + color: Colors.white, + ), + SizedBox( + width: 4.sp, + ), + Text( + '申请成为大使', + style: + TextStyle(color: Colors.white, fontSize: 15.sp), + ), + ], + ), + ), + ) ], ), )) @@ -1757,7 +1791,7 @@ class _InventDescItemState extends State { ], ), Container( - margin: EdgeInsets.only(left: 10.sp, top: 10.sp,right: 10.sp), + margin: EdgeInsets.only(left: 10.sp, top: 10.sp, right: 10.sp), child: Text( desc, style: TextStyle( @@ -1831,12 +1865,12 @@ class _InventDescItemState extends State { } myRowWidget( - String str1, - String str2, - String str3, - String str4, - String userId, - ) { + String str1, + String str2, + String str3, + String str4, + String userId, + ) { return Container( height: 41.sp, // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), @@ -1898,4 +1932,3 @@ class _InventDescItemState extends State { isScrollControlled: true, enableDrag: false); } } - diff --git a/circle_app/lib/circle_app/login/login/logic.dart b/circle_app/lib/circle_app/login/login/logic.dart index 38904d1..1f26404 100644 --- a/circle_app/lib/circle_app/login/login/logic.dart +++ b/circle_app/lib/circle_app/login/login/logic.dart @@ -61,7 +61,7 @@ class LoginLogic extends GetxController { } - if (sharedPreferences!.containsKey(SharedPreferencesHelper.firstLogin)) { + if (sharedPreferences!.containsKey(SharedPreferencesHelper.firstLogin) && pwd.isNotEmpty) { loginType = 1; pwdEditingController.text = pwd; } diff --git a/circle_app/lib/circle_app/minefragment/logic.dart b/circle_app/lib/circle_app/minefragment/logic.dart index 12e8eff..ca7c73b 100644 --- a/circle_app/lib/circle_app/minefragment/logic.dart +++ b/circle_app/lib/circle_app/minefragment/logic.dart @@ -78,6 +78,8 @@ class MinefragmentLogic extends GetxController { AssetsDataData? myAssest; + bool isShowserveTip = false; + @override void onReady() { // TODO: implement onReady @@ -94,6 +96,9 @@ class MinefragmentLogic extends GetxController { } else { isProxy = false; } + + isShowserveTip = sp.getBool(SharedPreferencesHelper.serveTip) ?? true; + loadRelationTypeFirstListData(); checkShowPositiveFeedBack(); getMode(); @@ -109,6 +114,10 @@ class MinefragmentLogic extends GetxController { loadDyanmicListData(); } + setSpServeTip() async { + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + sp.setBool(SharedPreferencesHelper.serveTip, false); + } loadData() { getMode(); @@ -209,7 +218,7 @@ class MinefragmentLogic extends GetxController { var data = await DioManager.instance.get(url: Api.getVisitorMsgs,); if (data['code'] == 200) { - recent_visit_count_new = data['data']['unreadCount'] ?? 0; + recent_visit_count_new = data['data']['newVisitorCount'] ?? 0; } update(); } diff --git a/circle_app/lib/circle_app/minefragment/mine_func_item.dart b/circle_app/lib/circle_app/minefragment/mine_func_item.dart index 30a0916..035f5c3 100644 --- a/circle_app/lib/circle_app/minefragment/mine_func_item.dart +++ b/circle_app/lib/circle_app/minefragment/mine_func_item.dart @@ -524,7 +524,7 @@ class _MineFuncItemState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '帮助与反馈', + '客服与反馈', style: TextStyle(color: Colors.white,fontSize: 14.sp), ), SizedBox(width: 4.sp), diff --git a/circle_app/lib/circle_app/minefragment/view.dart b/circle_app/lib/circle_app/minefragment/view.dart index 2e7ec47..0f776c2 100644 --- a/circle_app/lib/circle_app/minefragment/view.dart +++ b/circle_app/lib/circle_app/minefragment/view.dart @@ -257,8 +257,9 @@ class _MinefragmentPageState extends State ), ), GestureDetector( - onTap:() { - Get.toNamed(Routes.GiftShopPage,arguments: ''); + onTap: () { + Get.toNamed(Routes.GiftShopPage, + arguments: ''); }, child: Container( height: 18.sp, @@ -314,7 +315,9 @@ class _MinefragmentPageState extends State alignment: Alignment.center, height: 22.sp, child: Text( - (logic.myInfoBean?.contact?.isEmpty ?? true) ? '填写微信赚钱': '设置联系方式', + (logic.myInfoBean?.contact?.isEmpty ?? true) + ? '填写微信赚钱' + : '设置联系方式', style: TextStyle( color: Colors.white, fontSize: 13.sp), ), @@ -367,31 +370,85 @@ class _MinefragmentPageState extends State isShowMenu = false; logic.update(); }), - Positioned(bottom: 20.sp,right: 15.sp,child: InkWell( - onTap: () { - Get.toNamed(Routes.HelpPage); - }, - child: Container( - height: 50.sp, - width: 50.sp, - decoration: BoxDecoration( - gradient: AppColor.mainVerLinearGradient, - borderRadius: BorderRadius.circular(25.sp) - ), + if (logic.isShowserveTip) + Positioned( + child: Container( + width: Get.width, + height: Get.height, + color: Colors.black.withOpacity(0.7), + child: Stack( + children: [ + Positioned( + bottom: 130.sp, + right: 30.sp, + child: Stack( + alignment: Alignment.center, + children: [ + Image.asset( + getMineImage('bubble_icon'), + width: 174.sp, + ), + Container(margin: EdgeInsets.only(bottom: 10.sp),child: Text('产品反馈或在线客服',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.bold),)) + ], + )), + Positioned( + bottom: 95.sp, + right: 40.sp, + child: Image.asset( + getMineImage('hand_icon'), + width: 32.sp, + )), + ], + ), + )), + Positioned( + bottom: 20.sp, + right: 15.sp, + child: InkWell( + onTap: () { + Get.toNamed(Routes.HelpPage); + logic.isShowserveTip = false; + logic.setSpServeTip(); + logic.update(); + }, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( - getMineImage('cs_icon'), - width: 40.sp, - height: 40.sp, - color: Colors.white, + Container( + height: 50.sp, + width: 50.sp, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(25.sp)), + child: Center( + child: Image.asset( + getMineImage('cs_icon'), + width: 40.sp, + height: 40.sp, + color: Colors.white, + ), + ), ), + Container( + margin: EdgeInsets.only(top: 4.sp), + child: Text( + '客服与反馈', + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w600, + color: Colors.white, + shadows: [ + Shadow( + color: Colors.black, + offset: Offset(0.0, -1)) + ] + ), + )) ], ), ), - ),) + ), ], ); } @@ -484,7 +541,8 @@ class _MinefragmentPageState extends State child: Container( height: 22.sp, alignment: Alignment.center, - padding: EdgeInsets.only(left: 5.sp, right: 5.sp), + padding: + EdgeInsets.only(left: 5.sp, right: 5.sp), decoration: BoxDecoration( color: AppColor.mainBgColor, borderRadius: BorderRadius.circular(4.sp)), @@ -524,15 +582,14 @@ class _MinefragmentPageState extends State ), ), if ((logic.userInfoBean?.mark ?? 0) > 0) - SizedBox(width: 8.sp), + SizedBox(width: 8.sp), if ((logic.userInfoBean?.mark ?? 0) > 0) - UserTagWidget(logic.userInfoBean!.mark!), - if (logic.isAuth) - SizedBox(width: 4.sp), + UserTagWidget(logic.userInfoBean!.mark!), + if (logic.isAuth) SizedBox(width: 4.sp), if (logic.isAuth) Image( image: AssetImage(getMineImage("auth")), - height:18.sp, + height: 18.sp, ), ], ), @@ -581,11 +638,11 @@ class _MinefragmentPageState extends State ), ), if (interests.isNotEmpty) - Container( - height: 50.sp, - margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp), - child: _buildInterestsListView(interests), - ), + Container( + height: 50.sp, + margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp), + child: _buildInterestsListView(interests), + ), _friendsRow(logic), Container( height: 70.sp, @@ -826,35 +883,35 @@ class _MinefragmentPageState extends State ), ) : GestureDetector( - onTap: () { - showTimeRecordDialog(logic.myInfoBean!); - }, - child: Container( - margin: EdgeInsets.only(left: 10.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - padding: EdgeInsets.symmetric( - vertical: 2.sp, - horizontal: 12.sp, - ), - child: Text( - '记录时光', - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - ), + onTap: () { + showTimeRecordDialog(logic.myInfoBean!); + }, + child: Container( + margin: EdgeInsets.only(left: 10.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.symmetric( + vertical: 2.sp, + horizontal: 12.sp, + ), + child: Text( + '记录时光', + style: const TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), ], ), ); @@ -871,7 +928,7 @@ class _MinefragmentPageState extends State ), ), child: Container( - margin: EdgeInsets.only(left: 24.sp,right: 5.sp), + margin: EdgeInsets.only(left: 24.sp, right: 5.sp), child: Center( child: Text( controller.userInfoBean != null @@ -2496,7 +2553,6 @@ class _MinefragmentPageState extends State ), ), ), - if (logic.userInfoBean?.avatarNonhuman == 0) Positioned( bottom: 0, diff --git a/circle_app/lib/circle_app/msg/logic.dart b/circle_app/lib/circle_app/msg/logic.dart index 896b32f..5576929 100644 --- a/circle_app/lib/circle_app/msg/logic.dart +++ b/circle_app/lib/circle_app/msg/logic.dart @@ -38,6 +38,8 @@ class MsgLogic extends GetxController { List visitorMsgs = []; List bannerList = []; + bool isMsgCountLoad = false; + @override void onInit() { // TODO: implement onInit @@ -200,6 +202,8 @@ class MsgLogic extends GetxController { } void getVisitorMsgsData() async { + if (isMsgCountLoad) return; + isMsgCountLoad = true; var data = await DioManager.getInstance().get(url: Api.getVisitorMsgs); if (data["code"] == 200) { @@ -208,6 +212,7 @@ class MsgLogic extends GetxController { await loadVisitorTotalData(); await loadInterestedInMeUsersData(); } + isMsgCountLoad = false; update(); } diff --git a/circle_app/lib/circle_app/msg/sys_notify_list/view.dart b/circle_app/lib/circle_app/msg/sys_notify_list/view.dart index b01e964..b42ac5a 100644 --- a/circle_app/lib/circle_app/msg/sys_notify_list/view.dart +++ b/circle_app/lib/circle_app/msg/sys_notify_list/view.dart @@ -209,7 +209,7 @@ class Sys_notify_listPage extends StatelessWidget { width: 20.sp, ), Text( - '帮助与反馈', + '客服与反馈', style: TextStyle( color: Colors.white, fontSize: 15.sp), @@ -371,7 +371,7 @@ class Sys_notify_listPage extends StatelessWidget { Text( info['ta']['nickname'] ?? '', style: const TextStyle( - color: Colors.white70, + color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold), ), @@ -392,7 +392,7 @@ class Sys_notify_listPage extends StatelessWidget { child: Text( info['msg'], style: - TextStyle(color: Colors.white54, fontSize: 14.sp), + TextStyle(color: Colors.white, fontSize: 14.sp), ), ), SizedBox( diff --git a/circle_app/lib/circle_app/quick/logic.dart b/circle_app/lib/circle_app/quick/logic.dart index 187eaed..038d4ab 100644 --- a/circle_app/lib/circle_app/quick/logic.dart +++ b/circle_app/lib/circle_app/quick/logic.dart @@ -126,7 +126,7 @@ class QuickLogic extends GetxController { var data = await DioManager.instance.post(url: Api.queryQuickChatUserV2, params: { 'page': type == 1 ? page : page1, - 'pageSize': 20, + 'pageSize': 10, 'sortType': type, 'wantMeet': wantMeet, "lat": position?.latitude ?? 0, diff --git a/circle_app/lib/commons/widgets/online_recommand_dialog.dart b/circle_app/lib/commons/widgets/online_recommand_dialog.dart index 73e2e29..aa7e846 100644 --- a/circle_app/lib/commons/widgets/online_recommand_dialog.dart +++ b/circle_app/lib/commons/widgets/online_recommand_dialog.dart @@ -55,7 +55,7 @@ class _OnlineRecommandDialogState extends State { decoration: BoxDecoration( color: AppColor.bgColor, borderRadius: BorderRadius.circular(10.sp)), - margin: EdgeInsets.only(left: 30.sp, right: 30.sp), + margin: EdgeInsets.only(left: widget.userList.length == 3 ? 5 : 30.sp, right: widget.userList.length == 3 ? 5 : 15.sp), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -322,6 +322,7 @@ class _OnlineRecommandDialogState extends State { Container( margin: EdgeInsets.only( left: 4.sp, + top: 4.sp, ), child: Image.asset( getCircleImage(item.vip == 1 ? 'vip' : 'year_vip'), diff --git a/circle_app/lib/commons/widgets/unlock_wx_tip.dart b/circle_app/lib/commons/widgets/unlock_wx_tip.dart index b82d05c..0c2dd77 100644 --- a/circle_app/lib/commons/widgets/unlock_wx_tip.dart +++ b/circle_app/lib/commons/widgets/unlock_wx_tip.dart @@ -58,7 +58,7 @@ class _UnlockWxTipState extends State { Container( margin: EdgeInsets.only(left: 20.sp, right: 20.sp), padding: EdgeInsets.all(15.sp), - height: Platform.isAndroid ? (!widget.isMore ? 230.sp : 460.sp) : (!widget.isMore ? 190.sp :430.sp) , + height: Platform.isAndroid ? (!widget.isMore ? 190.sp : 310.sp + (prices.length > 0 ? prices.length * 50.sp - 50.sp : 0.sp)) : (!widget.isMore ? 190.sp :280.sp + (prices.length > 0 ? prices.length * 50.sp - 50.sp : 0.sp)) , // 460.sp : 430.sp, decoration: BoxDecoration( color: const Color(0xFF393949), @@ -129,7 +129,7 @@ class _UnlockWxTipState extends State { ), ), // SizedBox(height: 20.0.sp), - if (Platform.isAndroid) + if (Platform.isAndroid && widget.isMore) Container( margin: EdgeInsets.only(top: 0.sp, bottom: 20.sp), child: Row( @@ -437,8 +437,17 @@ class _UnlockWxTipState extends State { var data = Autogenerated.fromJson(result); if (data.prices != null) { prices = data.prices!; - - + if (wxInfo['price'] != null) { + List pricesList = []; + pricesList.add(prices.first); + prices.forEach((element) { + print('当前价格:${element.curPrice!} 需支付价格:${wxInfo['price'] * 0.01}'); + if (element.curPrice! > wxInfo['price'] * 0.01 && !pricesList.contains(element)) { + pricesList.add(element); + } + }); + prices = pricesList; + } } } if (mounted) { @@ -468,7 +477,7 @@ class _UnlockWxTipState extends State { Get.back(result: 1); } else { showOKToast(result['msg']); - if (result['code'] == 10081) { + if (result['code'] == 10081 || result['code'] == 31201) { showRechargeScreenDialog('unlock_contact'); } } diff --git a/circle_app/lib/commons/widgets/wx_edit_dialog.dart b/circle_app/lib/commons/widgets/wx_edit_dialog.dart index 555bf1d..8d470de 100644 --- a/circle_app/lib/commons/widgets/wx_edit_dialog.dart +++ b/circle_app/lib/commons/widgets/wx_edit_dialog.dart @@ -16,9 +16,9 @@ import '../../../utils/util.dart'; class WxEditDialog extends StatefulWidget { String phone; - WxEditDialog(this.phone,{super.key}); + WxEditDialog(this.phone, {super.key}); @override - _WxEditDialogState createState() => _WxEditDialogState(); + _WxEditDialogState createState() => _WxEditDialogState(); } class _WxEditDialogState extends State { @@ -33,10 +33,13 @@ class _WxEditDialogState extends State { Map wxStatusInfo = {}; + String content = ''; + @override void initState() { // TODO: implement initState super.initState(); + loadDescData(); loadMyWxInfoData(); loadWxStatus(); // updateWxText(); @@ -58,8 +61,8 @@ class _WxEditDialogState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - padding: EdgeInsets.only(left: 15.sp,right: 15.sp), - height: 455.sp, + padding: EdgeInsets.only(left: 15.sp, right: 15.sp), + height: 520.sp, margin: EdgeInsets.only(left: 15.sp, right: 15.sp), decoration: BoxDecoration( image: DecorationImage( @@ -81,7 +84,7 @@ class _WxEditDialogState extends State { child: Text( '联系方式设置', style: TextStyle( - // color: AppColor.mainColor, + // color: AppColor.mainColor, color: Colors.white, fontSize: 18.sp, shadows: const [ @@ -92,7 +95,7 @@ class _WxEditDialogState extends State { ), )), Container( - margin: EdgeInsets.only(bottom: 10.sp,top: 15.sp), + margin: EdgeInsets.only(bottom: 10.sp, top: 15.sp), // height: 30.sp, child: Row( children: [ @@ -104,75 +107,86 @@ class _WxEditDialogState extends State { child: Row( children: [ Image.asset( - getMineImage(type == 1 ? 'phone_icon' : type == 3 ? 'qq' : 'wx'), + getMineImage(type == 1 + ? 'phone_icon' + : type == 3 + ? 'qq' + : 'wx'), width: 40.sp, ), Container( - margin: EdgeInsets.only(left: 4.sp,right: 4.sp), - child: Icon(Icons.change_circle,color: AppColor.mainColor,size: 30.sp,)), + margin: EdgeInsets.only( + left: 4.sp, right: 4.sp), + child: Icon( + Icons.change_circle, + color: AppColor.mainColor, + size: 30.sp, + )), ], ), ), ), - Expanded(child: Container( + Expanded( + child: Container( margin: EdgeInsets.only(right: 15.sp), decoration: BoxDecoration( color: Color(0xFF260C3E), borderRadius: BorderRadius.circular(10.sp), border: GradientBoxBorder( - gradient: - AppColor.mainVerLinearGradient, + gradient: AppColor.mainVerLinearGradient, width: 1.sp, ), ), child: TextField( - controller: - wxEditingController, + controller: wxEditingController, maxLength: 20, style: TextStyle( - color: Colors.white, - fontSize: 16.sp), + color: Colors.white, fontSize: 16.sp), decoration: InputDecoration( hintText: '请输入真实的联系方式', hintStyle: TextStyle( - color: Colors.white70, - fontSize: 14.sp), + color: Colors.white70, fontSize: 14.sp), border: InputBorder.none, counterText: '', - contentPadding: - EdgeInsets.only( - left: 14.sp)), + contentPadding: EdgeInsets.only(left: 14.sp)), ), )), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if (wxInfo.containsKey('hideContact')) { - wxInfo['hideContact'] = wxInfo['hideContact'] == 0 ? 1 : 0; - - } else { - wxInfo['hideContact'] = 0; - - } - showOKToast(wxInfo['hideContact'] == 1 ? '已对其他人隐藏联系方式' : '已对其他人展示联系方式(需要解锁)'); - setState(() { - - }); - - }, + behavior: HitTestBehavior.opaque, + onTap: () { + if (wxInfo.containsKey('hideContact')) { + wxInfo['hideContact'] = + wxInfo['hideContact'] == 0 ? 1 : 0; + } else { + wxInfo['hideContact'] = 0; + } + showOKToast(wxInfo['hideContact'] == 1 + ? '已对其他人隐藏联系方式' + : '已对其他人展示联系方式(需要解锁)'); + setState(() {}); + }, child: Column( children: [ - Image.asset(getMineImage(wxInfo.containsKey('hideContact') ? wxInfo['hideContact'] == 1 ? 'no_show_icon' : 'show_icon' : 'show_icon'),width: 30.sp,), + Image.asset( + getMineImage( + wxInfo.containsKey('hideContact') + ? wxInfo['hideContact'] == 1 + ? 'no_show_icon' + : 'show_icon' + : 'show_icon'), + width: 30.sp, + ), //已隐藏 显示中 Text( wxInfo.containsKey('hideContact') ? wxInfo['hideContact'] == 1 - ? '已隐藏' - : '显示中' + ? '已隐藏' + : '显示中' : '显示中', style: TextStyle( - color: Color(0xCCFFFFFF).withOpacity(0.5), fontSize: 14.sp), + color: + Color(0xCCFFFFFF).withOpacity(0.5), + fontSize: 14.sp), ) ], )) @@ -185,31 +199,23 @@ class _WxEditDialogState extends State { color: Color(0xFF260C3E), borderRadius: BorderRadius.circular(10.sp), border: GradientBoxBorder( - gradient: - AppColor.mainVerLinearGradient, + gradient: AppColor.mainVerLinearGradient, width: 1.sp, ), ), - child: TextField( - controller: - descEditingController, + child: TextField( + controller: descEditingController, maxLength: 30, - style: TextStyle( - color: Colors.white, - fontSize: 16.sp), + style: TextStyle(color: Colors.white, fontSize: 16.sp), // keyboardType: TextInputType.phone, decoration: InputDecoration( hintText: '请输入解锁引导语', hintStyle: TextStyle( - color: Colors.white70, - fontSize: 14.sp), + color: Colors.white70, fontSize: 14.sp), border: InputBorder.none, counterText: '', - contentPadding: - EdgeInsets.only( - left: 14.sp)), + contentPadding: EdgeInsets.only(left: 14.sp)), ), - ), Container( margin: EdgeInsets.only(top: 10.sp), @@ -220,13 +226,19 @@ class _WxEditDialogState extends State { width: 18.sp, height: 18.sp, ), - SizedBox(width: 2.sp,), - Text('设置解锁价格',style: TextStyle(color: Color(0xCCFFFFFF),fontSize: 14.sp),), + SizedBox( + width: 2.sp, + ), + Text( + '设置解锁价格', + style: TextStyle( + color: Color(0xCCFFFFFF), fontSize: 14.sp), + ), SizedBox( width: 60.sp, height: 30.sp, child: Container( - margin: EdgeInsets.only(left: 5.sp,right: 5.sp), + margin: EdgeInsets.only(left: 5.sp, right: 5.sp), decoration: BoxDecoration( color: Color(0xFF260C3E), borderRadius: BorderRadius.circular(10.sp), @@ -238,20 +250,17 @@ class _WxEditDialogState extends State { ), child: Row( children: [ - Expanded(child: TextField( - controller: - moneyEditingController, + Expanded( + child: TextField( + controller: moneyEditingController, maxLength: 4, textAlign: TextAlign.center, style: TextStyle( - color: Colors.white, - fontSize: 14.sp), + color: Colors.white, fontSize: 14.sp), keyboardType: TextInputType.phone, inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, + FilteringTextInputFormatter.digitsOnly, ], - decoration: InputDecoration( hintText: '', isCollapsed: true, @@ -260,31 +269,39 @@ class _WxEditDialogState extends State { fontSize: 14.sp), border: InputBorder.none, counterText: '', - contentPadding: - EdgeInsets.only( - left: 6.sp,right: 6.sp,bottom: 0,top: 0)), + contentPadding: EdgeInsets.only( + left: 6.sp, + right: 6.sp, + bottom: 0, + top: 0)), )) ], ), - ), ), - Text('元',style: TextStyle(color: Color(0xCCFFFFFF),fontSize: 14.sp),), Text( - '(解锁收益都归您)', + '元', style: TextStyle( - color: Color(0xCCFFFFFF).withOpacity(0.5), fontSize: 14.sp), + color: Color(0xCCFFFFFF), fontSize: 14.sp), + ), + Text( + '(可填10-520)', + style: TextStyle( + color: Color(0xCCFFFFFF).withOpacity(0.5), + fontSize: 14.sp), ) ], ), ), Container( margin: EdgeInsets.only(top: 10.sp), - child: Text('温馨提示:\n' - + '1、为了维护站内的社交环境,若检测到为不实的联系方式,或以非社交为目的的其他非法用途,会第一时间将您账号封禁,并扣除相关奖励;\n' - + '2、解锁引导语可以让更多的人愿意解锁您的联系方式,让您赚更多的钱;\n' - + '3、每个人解锁后,您都可以得到设置价格的钱,收益无上限哦;\n' - + '4、此外,还可获得几重奖励。',style: TextStyle(color: Color(0xCCFFFFFF).withOpacity(0.5),fontSize: 14.sp),), + child: Text( + '温馨提示:\n' + '${content}', + style: TextStyle( + height: 1.5, + color: Color(0xCCFFFFFF).withOpacity(0.5), + fontSize: 14.sp), + ), ), Container( margin: EdgeInsets.only(top: 10.sp), @@ -299,7 +316,8 @@ class _WxEditDialogState extends State { height: 30.sp, width: 100.sp, alignment: Alignment.center, - padding: EdgeInsets.only(left: 10.sp, right: 10.sp), + padding: + EdgeInsets.only(left: 10.sp, right: 10.sp), margin: EdgeInsets.only(bottom: 10.sp), decoration: BoxDecoration( color: Colors.grey.withOpacity(0.7), @@ -320,12 +338,16 @@ class _WxEditDialogState extends State { if (wxEditingController.text.length == 11) { RegExp exp = RegExp( r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); - isPass = exp.hasMatch(wxEditingController.text); + isPass = + exp.hasMatch(wxEditingController.text); } - if (wxEditingController.text.isNotEmpty && !isPass) { - RegExp wxReg = RegExp(r'^[-_a-zA-Z][-_a-zA-Z0-9]{5,19}$'); - if (!wxReg.hasMatch(wxEditingController.text)) { + if (wxEditingController.text.isNotEmpty && + !isPass) { + RegExp wxReg = RegExp( + r'^[-_a-zA-Z][-_a-zA-Z0-9]{5,19}$'); + if (!wxReg + .hasMatch(wxEditingController.text)) { showOKToast('请输入正确的微信号'); return; } @@ -340,7 +362,8 @@ class _WxEditDialogState extends State { if (wxEditingController.text.length == 11) { RegExp exp = RegExp( r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); - isPass = exp.hasMatch(wxEditingController.text); + isPass = + exp.hasMatch(wxEditingController.text); } if (!isPass) { showOKToast('请输入正确的手机号'); @@ -348,37 +371,42 @@ class _WxEditDialogState extends State { } } - if (moneyEditingController.text.isNotEmpty) { - if (int.parse(moneyEditingController.text) <= 0) { + if (int.parse(moneyEditingController.text) <= + 0) { showOKToast('请设置联系方式解锁金额大于零'); return; - } else if (int.parse(moneyEditingController.text) > 300 || int.parse(moneyEditingController.text) < 10) { - showOKToast('请设置联系方式解锁金额在10元~300元之间'); + } else if (int.parse( + moneyEditingController.text) > + 520 || + int.parse(moneyEditingController.text) < + 10) { + showOKToast('请填写解锁金额在10元-520元之间'); return; } } - - if (wxInfo.containsKey('10034')) { showOKToast(wxInfo['10034']); return; } else if (wxInfo.containsKey('10595')) { showOKToast(wxInfo['10595']); } - Map params = { "guideText": descEditingController.text, - "hideContact": wxInfo.containsKey('hideContact') ? wxInfo['hideContact'] : 0, - - 'contactType':type, - "contact": wxEditingController.text}; + Map params = { + "guideText": descEditingController.text, + "hideContact": wxInfo.containsKey('hideContact') + ? wxInfo['hideContact'] + : 0, + 'contactType': type, + "contact": wxEditingController.text + }; if (moneyEditingController.text.isNotEmpty) { params['price'] = moneyEditingController.text; } - - var result = await DioManager().postBody(url: Api.confset,params: params); + var result = await DioManager() + .postBody(url: Api.confset, params: params); if (result['code'] == 200) { showOKToast('已设置成功,快去邀请圈友解锁呗~'); Get.back(); @@ -390,13 +418,13 @@ class _WxEditDialogState extends State { height: 30.sp, width: 100.sp, alignment: Alignment.center, - padding: EdgeInsets.only(left: 10.sp, right: 10.sp), + padding: + EdgeInsets.only(left: 10.sp, right: 10.sp), margin: EdgeInsets.only(bottom: 10.sp), decoration: BoxDecoration( - // color: const Color(0xFFFF4D7C), - borderRadius: BorderRadius.circular(20), - gradient: AppColor.mainVerLinearGradient - ), + // color: const Color(0xFFFF4D7C), + borderRadius: BorderRadius.circular(20), + gradient: AppColor.mainVerLinearGradient), child: Text( '确认', style: TextStyle( @@ -408,7 +436,6 @@ class _WxEditDialogState extends State { ], ), ), - ], ), ), @@ -432,20 +459,21 @@ class _WxEditDialogState extends State { void updateWxText() async { if (widget.phone.isNotEmpty) { - SharedPreferences sharedPreferences =await SharedPreferences.getInstance(); - String loginPhone = await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE)??""; + SharedPreferences sharedPreferences = + await SharedPreferences.getInstance(); + String loginPhone = await sharedPreferences + .getString(SharedPreferencesHelper.LOGINPHONE) ?? + ""; wxEditingController.text = loginPhone; type = 1; wxInfo['hideContact'] = 0; - setState(() { - - }); + setState(() {}); } } void loadMyWxInfoData() async { var data = - await DioManager.instance.get(url: Api.mycontactConf, params: {}); + await DioManager.instance.get(url: Api.mycontactConf, params: {}); if (data['code'] == 200) { wxInfo = data['data']; @@ -454,18 +482,20 @@ class _WxEditDialogState extends State { } else { wxEditingController.text = wxInfo['contact'] ?? ''; type = wxInfo['contactType'] ?? 2; - wxInfo['hideContact'] = wxInfo['hideContact'] == null ? 0 : wxInfo['hideContact']; + wxInfo['hideContact'] = + wxInfo['hideContact'] == null ? 0 : wxInfo['hideContact']; descEditingController.text = wxInfo['guideText'] ?? ''; - moneyEditingController.text = wxInfo['price'] != null ? wxInfo['price'].toString() : ''; - setState(() { - - }); + moneyEditingController.text = + wxInfo['price'] != null ? wxInfo['price'].toString() : ''; + setState(() {}); } } } void loadWxStatus() async { - var result = await DioManager.getInstance().get(url: Api.updateWxNumState,); + var result = await DioManager.getInstance().get( + url: Api.updateWxNumState, + ); if (result['code'] == 10034) { wxInfo['10034'] = result['msg']; } else if (result['code'] == 10595) { @@ -487,9 +517,7 @@ class _WxEditDialogState extends State { onPressed: () { Navigator.pop(context); type = 1; - setState(() { - - }); + setState(() {}); }, child: Text('手机号'), ), @@ -497,9 +525,7 @@ class _WxEditDialogState extends State { onPressed: () { Navigator.pop(context); type = 3; - setState(() { - - }); + setState(() {}); }, child: Text('QQ'), ), @@ -507,9 +533,7 @@ class _WxEditDialogState extends State { onPressed: () { Navigator.pop(context); type = 2; - setState(() { - - }); + setState(() {}); }, child: Text('微信'), ), @@ -525,4 +549,13 @@ class _WxEditDialogState extends State { isScrollControlled: true); } + void loadDescData() async { + var data = await DioManager.instance.get(url: Api.contactGuide,); + if (data['code'] == 10000) { + content = data['content']; + if (mounted) { + setState(() {}); + } + } + } } diff --git a/circle_app/lib/net/api.dart b/circle_app/lib/net/api.dart index f4a6697..9a78235 100644 --- a/circle_app/lib/net/api.dart +++ b/circle_app/lib/net/api.dart @@ -379,7 +379,7 @@ class Api { static const wahtWxNum = '/user-service/user/updateWxNum/notice/'; //小票解锁微信 - static const balanceUnlockWX = '/user-service/contact/unlock/balance'; + static const balanceUnlockWX = '/user-service/contact/unlock/balanceV2'; //获取用户解锁微信号设置信息 static const wxNumConfig = '/user-service/contact/user/conf/get/'; @@ -683,5 +683,23 @@ class Api { //单个喊话详情 static var signCalloutDetail = '/up-service/callout/id'; - + + //联系方式弹窗引导文案 + static var contactGuide = '/user-service/content/popup/contact/guide'; + + //喊话互动 + static var interactEmoji = '/up-service/callout/interact/emoji'; + + //圈子代理人说明 + static var agentManual = '/user-service/content/popup/interest/agent/manual'; + + //代理人权益 + static var agentRights = '/user-service/content/popup/interest/agent/rights'; + + //圈子代理人价格 + static var buyInterestAgentPrice = '/mall-service/mall/wallet/trade/buyInterestAgent/price'; + + //购买圈子代理人 + static var buyInterestAgent = '/mall-service/mall/wallet/trade/buyInterestAgent'; + } diff --git a/circle_app/lib/net/dio_manager.dart b/circle_app/lib/net/dio_manager.dart index 65329e6..b4d6fc0 100644 --- a/circle_app/lib/net/dio_manager.dart +++ b/circle_app/lib/net/dio_manager.dart @@ -4,6 +4,7 @@ import 'dart:math'; import 'package:circle_app/router/routers.dart'; import 'package:circle_app/utils/util.dart'; import 'package:dio/dio.dart'; +import 'package:dio/io.dart'; import 'package:flutter_bugly/flutter_bugly.dart'; import '../utils/SharedPreferencesHelper.dart'; @@ -36,6 +37,11 @@ class DioManager { return _instance!; } + static CancelToken _globalCancelToken = CancelToken(); // 添加全局CancelToken + + // 存储每个请求的 CancelToken + Map _cancelTokens = {}; + Dio? _dio; DioManager._init() { @@ -47,21 +53,30 @@ class DioManager { connectTimeout: const Duration(seconds: 15), // 接收数据的最长时限 receiveTimeout: const Duration(seconds: 15), + )); _dio!.interceptors.add(LogInterceptor( responseBody: true, )); - _dio!.interceptors.add(ConnectivityInterceptor()); + _dio!.interceptors.add(TimingInterceptor()); // 添加拦截器 + // _dio?.httpClientAdapter = IOHttpClientAdapter() + // ..createHttpClient = () { + // // 设置最大连接数 + // HttpClient client = HttpClient(); + // client.idleTimeout = Duration(seconds: 15); // 连接池的空闲超时 + // client.maxConnectionsPerHost = 15; // 设置同一主机的最大连接数为 15 + // return client; + // }; } setDioTimeOut(int time) { - _dio!.options.connectTimeout = Duration(milliseconds: time); + _dio?.options.connectTimeout = Duration(milliseconds: time); } setDioBaseUrl(String url) { if (url != _dio!.options.baseUrl && _dio!.options.baseUrl == Api.testBaseUrl) - _dio!.options = BaseOptions( + _dio?.options = BaseOptions( // 请求基地址 baseUrl: url, // 连接服务器超时时间,单位是毫秒 @@ -71,12 +86,25 @@ class DioManager { ); } + + cancelAllRequest() { + // _globalCancelToken.cancel("用户登出,取消所有请求"); + // _globalCancelToken = CancelToken(); // 重新初始化 CancelToken 以便后续请求 + } + + // 生成请求 Key(根据 URL 和参数) + String _generateRequestKey(String url, Map? params) { + return "$url-${params?.toString() ?? ''}"; + } + + + setReceiveTimeout (int time) { _dio!.options = BaseOptions( // 请求基地址 baseUrl: _dio!.options!.baseUrl, // 连接服务器超时时间,单位是毫秒 - connectTimeout: const Duration(seconds: 30), + connectTimeout: const Duration(seconds: 15), // 接收数据的最长时限 receiveTimeout: Duration(seconds: time), ); @@ -240,6 +268,20 @@ class DioManager { } print(">>>>>$params"); + // 如果没有提供 CancelToken,则使用全局的 + cancelToken ??= _globalCancelToken; + + String key = _generateRequestKey(url, params ?? {}); + + // 如果该请求已经存在,则取消上一个 + if (_cancelTokens.containsKey(key)) { + _cancelTokens[key]!.cancel("重复请求,取消上一个"); + } + + // 创建新的 CancelToken + cancelToken = CancelToken(); + _cancelTokens[key] = cancelToken; + /// 不同请求方法,不同的请求参数,按实际项目需求分. /// 这里 get 是 queryParameters,其它用 data. FormData 也是 data @@ -247,7 +289,7 @@ class DioManager { switch (method) { case DioMethod.get: response = await _dio! - .request(url, queryParameters: params, options: options); + .request(url, queryParameters: params, options: options,cancelToken: cancelToken); break; case DioMethod.post: response = await _dio!.post(url, @@ -259,11 +301,11 @@ class DioManager { break; case DioMethod.put: response = - await _dio!.put(url, data: json.encode(params), options: options); + await _dio!.put(url, data: json.encode(params), options: options,cancelToken: cancelToken); break; case DioMethod.delete: response = await _dio! - .delete(url, queryParameters: params, options: options); + .delete(url, queryParameters: params, options: options,cancelToken: cancelToken); break; default: // 如果有formData参数,说明是传文件,忽略params的参数 @@ -278,6 +320,9 @@ class DioManager { data: params, cancelToken: cancelToken, options: options); } } + + // 请求完成后移除 token + _cancelTokens.remove(key); // json转model String jsonStr = json.encode(response.data); Map responseMap = json.decode(jsonStr); @@ -305,6 +350,18 @@ class DioManager { } return responseMap; } on DioException catch (e) { + if (e.type == DioExceptionType.cancel) return {'code': 500, 'msg': ''}; + print("请求失败: ${e.message}"); + print("请求URL: ${e.requestOptions.uri}"); + print("请求Headers: ${e.requestOptions.headers}"); + print("请求数据: ${e.requestOptions.data}"); + print("错误类型: ${e.type}"); // 检查 DioErrorType + // 获取连接池信息(仅适用于 Dart 原生 HttpClient) + // final adapter = _dio!.httpClientAdapter as IOHttpClientAdapter; + // HttpClient client = adapter.createHttpClient!(); + // print("最大连接数: ${client.maxConnectionsPerHost}"); + + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { return {'code': 500, 'msg': ''}; @@ -432,3 +489,36 @@ class QnTokenData { ); } } + + +class TimingInterceptor extends Interceptor { + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + options.extra["startTime"] = DateTime.now(); // 记录开始时间 + super.onRequest(options, handler); + } + + @override + void onResponse(Response response, ResponseInterceptorHandler handler) { + DateTime startTime = response.requestOptions.extra["startTime"]; + DateTime endTime = DateTime.now(); + Duration duration = endTime.difference(startTime); + + print("请求 URL: ${response.requestOptions.uri}"); + print("请求耗时: ${duration.inMilliseconds} ms"); + + super.onResponse(response, handler); + } + + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + DateTime startTime = err.requestOptions.extra["startTime"]; + DateTime endTime = DateTime.now(); + Duration duration = endTime.difference(startTime); + + print("请求失败 URL: ${err.requestOptions.uri}"); + print("请求失败耗时: ${duration.inMilliseconds} ms"); + + super.onError(err, handler); + } +} diff --git a/circle_app/lib/utils/SharedPreferencesHelper.dart b/circle_app/lib/utils/SharedPreferencesHelper.dart index ee4b60b..20816ee 100644 --- a/circle_app/lib/utils/SharedPreferencesHelper.dart +++ b/circle_app/lib/utils/SharedPreferencesHelper.dart @@ -40,6 +40,10 @@ class SharedPreferencesHelper { static const fraudPreventionTip = 'fraudPreventionTip'; + static const nearTip = 'nearTip'; + + static const serveTip = 'serveTip'; + static SharedPreferencesHelper? _instance; static SharedPreferences? _preferences; @@ -217,6 +221,22 @@ class SharedPreferencesHelper { preferences!.setBool(SettingStatus, status); } + Future isShowNearLocation() async { + String time = await preferences!.getString(nearTip) ?? ''; + if (time.isNotEmpty) { + DateTime dateTime = DateTime.parse(time); + bool isShow = !isSameDay(dateTime,DateTime.now()); + if (isShow) { + preferences!.setString(nearTip, DateTime.now().toString()); + } + return isShow; + } else { + preferences!.setString(nearTip, DateTime.now().toString()); + } + return true; + } + + bool isSameDay(DateTime time1, DateTime time2) { return time1.year == time2.year && diff --git a/circle_app/lib/utils/util.dart b/circle_app/lib/utils/util.dart index f34c041..fbe2b1c 100644 --- a/circle_app/lib/utils/util.dart +++ b/circle_app/lib/utils/util.dart @@ -7,6 +7,7 @@ import 'package:circle_app/circle_app/chat/logic.dart'; import 'package:circle_app/circle_app/chat/view.dart'; import 'package:circle_app/circle_app/circle/view.dart'; import 'package:circle_app/circle_app/circle/widgets/discover.dart'; +import 'package:circle_app/circle_app/circle_list/widgets/apply_for_an_agent_dialog.dart'; import 'package:circle_app/circle_app/userinfo/logic.dart'; import 'package:circle_app/circle_app/world_call_out/logic.dart'; import 'package:circle_app/commons/Widgets/base_tip_widget.dart'; @@ -114,6 +115,7 @@ const bgImage = DecorationImage( bool isShowToast = false; ///弹窗文本提示 msg: 提示内容 showOKToast(String msg) { + if (msg.isEmpty) return; if (isShowToast) return; isShowToast = true; int seconds = msg.length > 15 ? 5 : msg.length > 10 ? 3 : 2; @@ -186,7 +188,7 @@ noResultWidget({String tip = '正在等待被填充~',Function? callBack, String children: [ Image.asset( getBaseImage('no_result'), - width: 200.sp, + width: 200.sp, ), SizedBox( height: 8.sp, @@ -196,7 +198,7 @@ noResultWidget({String tip = '正在等待被填充~',Function? callBack, String tip, style: TextStyle(color: Color(0xffdbdbdb), fontSize: 15.sp), ), - if (callBack != null) + if (callBack != null && action.isNotEmpty) GestureDetector( onTap: () { callBack(); @@ -204,7 +206,7 @@ noResultWidget({String tip = '正在等待被填充~',Function? callBack, String child: Container( margin: EdgeInsets.only(top: 10.sp), height: 42.sp, - width: 160.sp, + width: action.length > 6 ? 200.sp : 160.sp, alignment: Alignment.center, // padding: EdgeInsets.only(left: 4.sp,right: 4.sp), decoration: BoxDecoration( @@ -274,6 +276,7 @@ String convertToThousand(int number) { } pushLoginPage() async { + DioManager.getInstance().cancelAllRequest(); await logoutIM(); SharedPreferencesHelper.getInstance().then((sharedPreferences) { String loginPhone = @@ -293,6 +296,7 @@ pushLoginPage() async { sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1'); sharedPreferences.setString(SharedPreferencesHelper.UPDATEONE, updateone); sharedPreferences.setString(SharedPreferencesHelper.UPDATE, update); + sharedPreferences.setBool(SharedPreferencesHelper.serveTip, false); sharedPreferences.setStringList(tipList); }); @@ -412,6 +416,125 @@ String getRoleContent(int number) { } } +void showAgentManualDialog(BuildContext context,String msg) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 470.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: AppColor.bgColor, + borderRadius: BorderRadius.circular(12.0.sp), + // gradient: const LinearGradient( + // colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // ), + ), + ), + // Container( + // margin: EdgeInsets.all(1.sp), + // child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,), + // ), + Container( + margin: EdgeInsets.only(top: 12.sp), + child: Column( + children: [ + Center( + child: Text( + "圈子代理人说明", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + msg, + textAlign: TextAlign.left, + style: TextStyle( + color: const Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + width: 130.w, + alignment: Alignment.center, + height: 40.sp, + margin: EdgeInsets.only(top: 16.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.sp), + gradient: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + child: const Text( + "我知道了", + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + ), + ), + ), + // GestureDetector( + // onTap: () { + // Get.back(); + // Get.toNamed(Routes.InvitePage); + // }, + // child: Container( + // width: 130.w, + // height: 40.sp, + // alignment: Alignment.center, + // margin: EdgeInsets.only(top: 16.sp), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(20.sp), + // gradient: AppColor.mainVerLinearGradient, + // ), + // child: const Text( + // "快速体验(98元/月)", + // style: TextStyle( + // color: Colors.white, + // fontSize: 14, + // ), + // ), + // ), + // ), + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); +} + typedef void MyCallback(String path); // Future compressVideo( @@ -723,21 +846,24 @@ Widget circlrPeopleInfoWidget(List widgets,Circle bean) { height: 30.sp, width: 30.0.sp + 15.sp * (widgets.length - 1.sp), - child: Stack( + child: IgnorePointer( + ignoring: true, // true 表示忽略手势,组件不可点击 + child:Stack( alignment: Alignment.center, children: widgets, - ), + )), ), SizedBox( - width: 4.sp, + width: 0.sp, ), + Text( '${convertToTenThousand(bean.joinTotal)}圈友加入', style: TextStyle( - color: Colors.white, fontSize: 12.sp), + color: Colors.white, fontSize: 15.sp), ), SizedBox( - width: 4.sp, + width: 2.sp, ), Image.asset(getCircleImage('more_icon'),width: 20.sp,), ], @@ -1739,105 +1865,15 @@ void sendApplyToAgentData(var circleId) async { } Get.toNamed(Routes.Chat, arguments: con); } else if (data['code'] == 32104) { - showReportDialog(Get.context!,data['msg']); + showReportDialog(Get.context!,circleId); } } -void showReportDialog(BuildContext context,String msg) { +void showReportDialog(BuildContext context,String circleId) { showDialog( context: context, builder: (BuildContext context) { - return Dialog( - backgroundColor: Colors.transparent, - child: Container( - height: 200.sp, - padding: const EdgeInsets.all(1.0), - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: AppColor.bgColor, - borderRadius: BorderRadius.circular(12.0.sp), - // gradient: const LinearGradient( - // colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], - // begin: Alignment.topCenter, - // end: Alignment.bottomCenter, - // ), - ), - ), - // Container( - // margin: EdgeInsets.all(1.sp), - // child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,), - // ), - Container( - margin: EdgeInsets.only(top: 12.sp), - child: Column( - children: [ - Center( - child: Text( - "申请代理提示", - style: - TextStyle(color: Colors.white, fontSize: 16.sp), - ), - ), - Container( - margin: EdgeInsets.only( - top: 12.sp, left: 14.sp, right: 14.sp), - alignment: Alignment.center, - child: Text( - msg, - textAlign: TextAlign.left, - style: TextStyle( - color: const Color(0xCCF7FAFA), fontSize: 16.sp), - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - GestureDetector( - onTap: () { - Get.back(); - Get.toNamed(Routes.InvitePage); - }, - child: Container( - margin: EdgeInsets.only(top: 16.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, - ), - ), - ), - ) - ], - ) - ], - ), - ) - ], - ), - ), - ); + return ApplyForAnAgentDialog(circleId: int.parse('${circleId}')); }, ); } diff --git a/circle_app/lib/view/notice.dart b/circle_app/lib/view/notice.dart index 573d7ac..82f0ee0 100644 --- a/circle_app/lib/view/notice.dart +++ b/circle_app/lib/view/notice.dart @@ -47,7 +47,7 @@ void showFloatingButtonOverlay(BuildContext context, String nickname, child: AnimatedContainer( duration: const Duration(milliseconds: 500), curve: Curves.easeInOut, - height: showMessage ? 85 : 0, + height: showMessage ? 75 : 0, child: Container( width: Get.width - 16, // margin: EdgeInsets.only(top:10.sp),