diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index 5941416..94612e7 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 53 - versionName "2.0.3" + versionCode 54 + versionName "2.0.4" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/assets/images/base/vip_fun_10.png b/circle_app/assets/images/base/vip_fun_10.png new file mode 100644 index 0000000..b1528f5 Binary files /dev/null and b/circle_app/assets/images/base/vip_fun_10.png differ diff --git a/circle_app/assets/images/base/vip_fun_11.png b/circle_app/assets/images/base/vip_fun_11.png new file mode 100644 index 0000000..e5dd991 Binary files /dev/null and b/circle_app/assets/images/base/vip_fun_11.png differ diff --git a/circle_app/assets/images/base/vip_fun_12.png b/circle_app/assets/images/base/vip_fun_12.png new file mode 100644 index 0000000..435f368 Binary files /dev/null and b/circle_app/assets/images/base/vip_fun_12.png differ diff --git a/circle_app/assets/images/base/vip_fun_13.png b/circle_app/assets/images/base/vip_fun_13.png new file mode 100644 index 0000000..a66df0d Binary files /dev/null and b/circle_app/assets/images/base/vip_fun_13.png differ diff --git a/circle_app/assets/images/base/vip_fun_14.png b/circle_app/assets/images/base/vip_fun_14.png new file mode 100644 index 0000000..d55ccb6 Binary files /dev/null and b/circle_app/assets/images/base/vip_fun_14.png differ diff --git a/circle_app/ios/Podfile b/circle_app/ios/Podfile index c16ed11..10c3ffa 100644 --- a/circle_app/ios/Podfile +++ b/circle_app/ios/Podfile @@ -35,6 +35,7 @@ target 'Runner' do end post_install do |installer| + installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| diff --git a/circle_app/ios/Podfile.lock b/circle_app/ios/Podfile.lock index 0359ca2..26d2d3d 100644 --- a/circle_app/ios/Podfile.lock +++ b/circle_app/ios/Podfile.lock @@ -372,6 +372,6 @@ SPEC CHECKSUMS: webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69 -PODFILE CHECKSUM: 48885d6cc54a7ccad9a8dd51c559ea15517bfe2c +PODFILE CHECKSUM: 38cc5bc9e8e4f24e1c8c8bd48fa64fcc54bc522e COCOAPODS: 1.11.3 diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart index 27c369a..71e9d9f 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_history_message_list_item.dart @@ -871,8 +871,6 @@ class _TIMUIKItHistoryMessageListItemState width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], @@ -947,8 +945,6 @@ class _TIMUIKItHistoryMessageListItemState imageUrl: bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index 8b1a969..5048ab3 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -40,6 +40,7 @@ class _ChatPageState extends State { void dispose() { // TODO: implement dispose sub.cancel(); + sub1.cancel(); super.dispose(); } @@ -139,6 +140,9 @@ class _ChatPageState extends State { sendMessageRes.data?.customElem?.extension; //自定义extension } }); + sub1 = EventBusManager.on().listen((event) async { + _timuiKitChatController.refreshCurrentHistoryList(); + }); } Widget renderCustomStickerPanel( diff --git a/circle_app/lib/app/chat/widget/chat_circle_share_dialog.dart b/circle_app/lib/app/chat/widget/chat_circle_share_dialog.dart index dbd212e..9243c1f 100644 --- a/circle_app/lib/app/chat/widget/chat_circle_share_dialog.dart +++ b/circle_app/lib/app/chat/widget/chat_circle_share_dialog.dart @@ -161,8 +161,7 @@ class _ChatCircleShareDialogState extends State { imageUrl: bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, + fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/app/chat/widget/welcome_dialog.dart b/circle_app/lib/app/chat/widget/welcome_dialog.dart new file mode 100644 index 0000000..435f7e0 --- /dev/null +++ b/circle_app/lib/app/chat/widget/welcome_dialog.dart @@ -0,0 +1,301 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:gradient_borders/box_borders/gradient_box_border.dart'; + +import '../../../common/Widgets/base_tip_widget.dart'; +import '../../../common/colors/app_color.dart'; +import '../../../network/api.dart'; +import '../../../network/dio_manager.dart'; +import '../../../util/util.dart'; + +class WelcomeDialog extends StatefulWidget { + Function callBack; + String userId; + + WelcomeDialog({super.key,required this.userId,required this.callBack}); + @override + _WelcomeDialogState createState() => new _WelcomeDialogState(); + +} + +class _WelcomeDialogState extends State { + // TODO: add state variables and methods + List giftList = []; + String giftId = ''; + String withStr = ''; + int selectedIndex = -1; + + TextEditingController descController = TextEditingController(); + + String tipStr = ''; + @override + void initState() { + // TODO: implement initState + super.initState(); + loadGiftData(); + } + + void loadGiftData() async { + var result = await DioManager.instance.get(url: Api.giftList); + if (result['code'] == 200) { + giftList = result['data']; + + // for (int i= 0; i< giftList.length; i++) { + // var info = giftList[i]; + // if (info['name'] == '浪漫告白') { + // selectedIndex = i ; + // giftId = info['id'].toString(); + // tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; + // } + // } + + setState(() {}); + } + } + + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Scaffold( + backgroundColor: Colors.transparent, + resizeToAvoidBottomInset: false, + body: Center( + child: Container( + constraints: BoxConstraints( + maxHeight: 345.sp + ), + margin: EdgeInsets.only(left: 10.sp,right: 10.sp), + padding: EdgeInsets.only(left: 10.sp,right: 10.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.sp), + gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]), + border: GradientBoxBorder( + gradient: + AppColor.mainVerLinearGradient, + width: 1.sp, + ), + ), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 18.sp), + child: Text( + '❤️赠送礼物更容易获得对方的好感❤️', + style: TextStyle(color: Colors.white, fontSize: 15.sp), + ), + ), + Container( + height: tipStr.isNotEmpty ? 145.sp : 122.sp, + margin: EdgeInsets.only(top: 12.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.sp), + gradient: LinearGradient( + colors: [Color(0xFF132B40), Color(0xFF251240)])), + child: Column( + children: [ + if (tipStr.isNotEmpty) + Padding( + padding: EdgeInsets.only(top:6.sp), + child: Text( + '礼物送出后,获得$tipStr小时的消息置顶', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 12.sp, + fontWeight: FontWeight.w500), + ), + ), + giftGridWidget(), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.sp), + decoration: BoxDecoration( + color: Color(0xFF260C3E), + borderRadius: BorderRadius.circular(10.sp), + border: GradientBoxBorder( + gradient: + AppColor.mainVerLinearGradient, + width: 1.sp, + ), + ), + child: TextField( + controller: + descController, + maxLength: 20, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp), + decoration: InputDecoration( + hintText: '输入欢迎内容,TA回复后就可以继续聊天啦', + hintStyle: TextStyle( + color: Colors.white70, + fontSize: 14.sp), + border: InputBorder.none, + counterText: '', + contentPadding: + EdgeInsets.only( + left: 14.sp)), + ), + ), + // Container( + // height: 102.sp, + // margin: EdgeInsets.only(top: 12.sp,), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.sp), + // gradient: LinearGradient( + // colors: [Color(0xFF132B40), Color(0xFF251240)])), + // child: giftGridWidget(), + // ), + Container( + margin: EdgeInsets.only(top: 25.sp,), + padding: EdgeInsets.only(left: 15.sp, right: 15.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + height: 42.sp, + width: 136.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.sp), + color: Color(0x26FFFFFF) + ), + alignment: Alignment.center, + child: Text( + '放弃', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ), + ), + ), + GestureDetector( + onTap: () async { + if (descController.text.isEmpty) { + showOKToast('请输入欢迎内容,TA回复后就可以继续聊天啦'); + } else { + Map params = {'userId':widget.userId,'msg':descController.text}; + if (selectedIndex >= 0) { + params['giftId'] = giftId; + } + + var result = await DioManager.instance.post(url: Api.sayHelloV2,params: params); + if (result['code'] == 200) { + showOKToast('已成功欢迎,TA回复后就可以在消息列表继续聊天啦~'); + widget.callBack(); + Get.back(); + } else if (result['code'] == 31201) { + showOKToast(result['msg']); + showRechargeScreenDialog(); + } + } + }, + child: Container( + height: 42.sp, + width: 136.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.sp), + gradient: AppColor.mainVerLinearGradient + ), + child: Text( + '欢迎', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ), + ), + ), + ], + ), + ) + ], + ), + ), + ), + ), + ); + } + + + giftGridWidget() { + return Container( + width: Get.width, + height: 120.sp, + padding: + EdgeInsets.only(left: 5.sp, right: 5.sp, top: 10.sp, bottom: 10.sp), + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: giftList.length, + itemBuilder: (context, index) { + // Replace the placeholders with the actual item widgets + return giftItemWidget(giftList[index], index); + }, + ), + ); + } + + giftItemWidget(Map info, int index) { + bool isSelected = giftId.contains(info['id'].toString()); + double price = info['price']; + + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (selectedIndex == index) { + selectedIndex = -1; + tipStr = ''; + giftId = ''; + } else { + selectedIndex = index; + giftId = info['id'].toString(); + tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; + } + + setState(() {}); + }, + child: Container( + height: 120.sp, + width: 75.sp, + child: Stack( + fit: StackFit.expand, + children: [ + isSelected ? Image.asset(getMsgImage('gift_bg')) : Container(), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.network( + info['icon'], + width: 60.sp, + height: 60.sp, + ), + + Text(info['name'], + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)), + Text('${price.toInt()}小票', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + fontWeight: FontWeight.w500)) + ], + ) + ], + ), + ), + ); + } +} diff --git a/circle_app/lib/app/circle/logic.dart b/circle_app/lib/app/circle/logic.dart index 8722bb9..a4e6c88 100644 --- a/circle_app/lib/app/circle/logic.dart +++ b/circle_app/lib/app/circle/logic.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:circle_app/app/chat/widget/welcome_dialog.dart'; import 'package:circle_app/app/likelist/logic.dart'; import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/main.dart'; @@ -54,6 +55,8 @@ class CircleLogic extends GetxController { bool isNewPeopleMore = true; + bool isNewPeopleRed = false; + int flush = 0; bool isMore = true; int myVip = -1; @@ -336,6 +339,8 @@ class CircleLogic extends GetxController { int offset = 0; int deep = 0; + int chargeFreeNum = 0; + int chargeType = 0; List vicinityList = []; int pageIndex = 1; @@ -381,7 +386,8 @@ class CircleLogic extends GetxController { offset = bean.data.offset; deep = bean.data.deep; } catch (Exception) {} - + chargeFreeNum = bean.data.chargeFreeNum; + chargeType = bean.data.chargeType; myVip = bean.data.isVip ? 1 : 0; if (vicinityPage == 1) { cityName = bean.data.city; @@ -689,17 +695,19 @@ class CircleLogic extends GetxController { } void snedHelloData(int id,int index) async { - var data = await DioManager.instance.post(url: Api.sayHello + id.toString(),); - if (data['code'] == 200) { - + Get.bottomSheet(WelcomeDialog(userId: id.toString(),callBack:() { newPeopleList.removeAt(index); - update(); if (newPeopleList.length < 5) { onLoading(); } - showOKToast('已成功欢迎,TA回复后就可以在消息列表继续聊天啦~'); - } + }),isScrollControlled: true,); + // var data = await DioManager.instance.post(url: Api.sayHello + id.toString(),); + // if (data['code'] == 200) { + // + + // showOKToast('已成功欢迎,TA回复后就可以在消息列表继续聊天啦~'); + // } } void snedHelloMoreData() async { var data = await DioManager.instance.post(url: Api.sayHelloMore,); @@ -719,6 +727,8 @@ class VicinityBean { int offset; bool isVip; int deep; + int chargeFreeNum; + int chargeType; List users; VicinityBean( @@ -726,6 +736,8 @@ class VicinityBean { required this.users, required this.isVip, required this.offset, + required this.chargeFreeNum, + required this.chargeType, required this.deep}); factory VicinityBean.fromJson(Map json) { @@ -736,6 +748,8 @@ class VicinityBean { users: lists, isVip: json['isVip'] ?? false, city: json['city'], + chargeType: json['chargeType'], + chargeFreeNum: json['chargeFreeNum'], offset: json['offset'], deep: json['deep']); } diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index c20557f..86b6d44 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -77,6 +77,10 @@ class _CirclePageState extends State // 比如根据当前选中的标签执行其他操作 // int currentIndex = .toString()); logic.isShowCircle = _tabController.index == 0; + if (_tabController.indexIsChanging != 0) { + logic.isNewPeopleRed = false; + } + logic.update(); } @@ -110,11 +114,6 @@ class _CirclePageState extends State margin: EdgeInsets.only(top: 45.sp), child: TabBarView( controller: _tabController, - // controller: _pageController, - // onPageChanged: (index) { - // _tabController.animateTo(index); - // print("index=" + index.toString()); - // }, children: [ NewPeople(), // circleList(controller), @@ -123,25 +122,6 @@ class _CirclePageState extends State ], ), ), - // _tabController.index == 0 - // ? Positioned( - // bottom: 36.sp, - // right: 10.sp, - // child: GestureDetector( - // onTap: () async { - // List numbers = []; - // numbers.add(MyConfigData( - // logic.getCircleIndex().id.toString(), - // logic.getCircleIndex().title!, - // false)); - // var data = await Get.toNamed(AppRoutes.Call_out, - // arguments: {'numbers': numbers}); - // }, - // child: Image.asset( - // getCircleImage('send_msg'), - // width: 60.sp, - // ))) - // : Center() ], )), ); @@ -696,8 +676,8 @@ class _CirclePageState extends State //padding: EdgeInsets.symmetric(horizontal: 10.sp), height: 27.sp, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, + child: Stack( + alignment: Alignment.center, children: [ TabBar( isScrollable: true, @@ -782,6 +762,18 @@ class _CirclePageState extends State // ); }, ), + if (logic.isNewPeopleRed) + Positioned( + left: 42.5.sp, + top: 0.sp, + child: Container( + height: 10.sp, + width: 10.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red, + ), + )) ], ), ), @@ -796,14 +788,6 @@ class _CirclePageState extends State }, child: Container( padding: EdgeInsets.only(left: 2.sp,right: 2.sp), - // height: 26.sp, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(13.sp), - // border: GradientBoxBorder( - // gradient: AppColor.mainVerLinearGradient, - // width: 1.sp, - // ), - // ), child: Row( children: [ Image.asset( diff --git a/circle_app/lib/app/circle/widgets/discover.dart b/circle_app/lib/app/circle/widgets/discover.dart index d3dbfff..35a0823 100644 --- a/circle_app/lib/app/circle/widgets/discover.dart +++ b/circle_app/lib/app/circle/widgets/discover.dart @@ -305,6 +305,7 @@ class _DiscoverState extends State onPointerDown: getPointDownListenerInHorizontal(), onPointerUp: getPointUpListenerInHorizontal(), child: SmartRefresher( + footer: DiyLoadFooter(noDataText: '只展示一些精选过的圈友哦~',), onRefresh: refreshData, controller: refreshController, onLoading: _onLoading, @@ -379,18 +380,19 @@ class _DiscoverState extends State itemBuilder: (BuildContext context, int index) { return GestureDetector( onTap: () { - List imgList = []; - user.images!.forEach((element) { - imgList.add(element); - }); - - Get.toNamed(AppRoutes.Swiper, - arguments: { - 'imaglist': imgList, - 'index': index, - 'userId':user.userId.toString() - - }); + Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString()); + // List imgList = []; + // user.images!.forEach((element) { + // imgList.add(element); + // }); + // + // Get.toNamed(AppRoutes.Swiper, + // arguments: { + // 'imaglist': imgList, + // 'index': index, + // 'userId':user.userId.toString() + // + // }); }, child: CachedNetworkImage( imageUrl: user.images![index], diff --git a/circle_app/lib/app/circle/widgets/info_list_view.dart b/circle_app/lib/app/circle/widgets/info_list_view.dart index c8f54b9..84eea2f 100644 --- a/circle_app/lib/app/circle/widgets/info_list_view.dart +++ b/circle_app/lib/app/circle/widgets/info_list_view.dart @@ -497,8 +497,6 @@ class InfoListViewState extends State with AutomaticKeepAliveClien imageUrl:widget.bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit:BoxFit.cover ) , ) : Container(), @@ -1129,8 +1127,8 @@ class InfoListViewState extends State with AutomaticKeepAliveClien width: 40.sp, height: 40.sp, fit: BoxFit.cover, - memCacheHeight: 40, - memCacheWidth: 40, + // + // , ), ) ], @@ -1356,8 +1354,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien imageUrl:widget.bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, + fit:BoxFit.cover ), ), @@ -1475,8 +1472,6 @@ class InfoListViewState extends State with AutomaticKeepAliveClien width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], diff --git a/circle_app/lib/app/circle/widgets/like_view.dart b/circle_app/lib/app/circle/widgets/like_view.dart index 0de878c..7cc25d7 100644 --- a/circle_app/lib/app/circle/widgets/like_view.dart +++ b/circle_app/lib/app/circle/widgets/like_view.dart @@ -1011,8 +1011,6 @@ class _LikeViewState extends State width: 40.sp, height: 40.sp, fit: BoxFit.cover, - memCacheHeight: 40, - memCacheWidth: 40, ), ) ], @@ -1329,8 +1327,6 @@ class _LikeViewState extends State imageUrl: bean['image'], width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), @@ -1451,8 +1447,6 @@ class _LikeViewState extends State width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], diff --git a/circle_app/lib/app/circle/widgets/new_people.dart b/circle_app/lib/app/circle/widgets/new_people.dart index afe3a04..6fd6428 100644 --- a/circle_app/lib/app/circle/widgets/new_people.dart +++ b/circle_app/lib/app/circle/widgets/new_people.dart @@ -60,6 +60,7 @@ class _NewPeopleState extends State { return GetBuilder(builder: (logic) { return logic.newPeopleList.isNotEmpty ? SmartRefresher( controller: logic.peopleRefreshController, + footer: DiyLoadFooter(noDataText: '只展示最近几天加入我们的圈友哦~',), onRefresh: logic.onRefresh, onLoading: logic.onLoading, enablePullUp: true, @@ -99,6 +100,7 @@ class _NewPeopleItemState extends State { Widget ListItem(VicinityItemBean item, int index) { return GestureDetector( onTap: () { + showOKToast('点击“👏欢迎”,对方回复您后就可以在消息列表进行聊天互动啦~'); // Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); }, child: Container( diff --git a/circle_app/lib/app/circle/widgets/vicinity.dart b/circle_app/lib/app/circle/widgets/vicinity.dart index 0215d75..a173a41 100644 --- a/circle_app/lib/app/circle/widgets/vicinity.dart +++ b/circle_app/lib/app/circle/widgets/vicinity.dart @@ -83,17 +83,7 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin if (index == 0) { return bannerView(widget.logic); } else { - // if (widget.logic.myVip == 0 && index == widget.logic.vicinityList.length) { - // // return; - // return Stack( - // children: [ - // ListItem(widget.logic.vicinityList[index - 1], index - 1), - // showVipView() - // ], - // ); - // } else { return ListItem(widget.logic.vicinityList[index - 1], index - 1); - // } } }, ), @@ -272,16 +262,20 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin Widget ListItem(VicinityItemBean item, int index) { return GestureDetector( onTap: () { - if (index < 5) { + if (index < widget.logic.chargeFreeNum) { Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); } else { - if (widget.logic - .myVip > 0) { - Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + if (widget.logic.chargeType == 1) { + if (widget.logic + .myVip > 0) { + Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + } else { + Get.bottomSheet(Scaffold(backgroundColor: Colors.transparent,body: Center( + child: showVipView(), + ),),isScrollControlled: true,backgroundColor: Colors.transparent,barrierColor: Colors.black.withOpacity(0.6)); + } } else { - Get.bottomSheet(Scaffold(backgroundColor: Colors.transparent,body: Center( - child: showVipView(), - ),),isScrollControlled: true,backgroundColor: Colors.transparent,barrierColor: Colors.black.withOpacity(0.6)); + Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); } } diff --git a/circle_app/lib/app/circle_list/view.dart b/circle_app/lib/app/circle_list/view.dart index 5957480..d426553 100644 --- a/circle_app/lib/app/circle_list/view.dart +++ b/circle_app/lib/app/circle_list/view.dart @@ -144,6 +144,7 @@ class _CircleListPageState extends State with RouteAware { ), )), RefreshIndicator( + onRefresh: () async { logic.relaodData(); }, @@ -151,7 +152,7 @@ class _CircleListPageState extends State with RouteAware { controller: logic.rightCtr, itemBuilder: (context, index) { if (index == logic.circle.lists.length) { - return loaddingWidget(logic.isMore); + return loaddingWidget(logic.isMore,tip: '更多特色圈子正在赶来的路上~'); } return circleInfoItem(logic.circle.lists[index], index); }, @@ -278,8 +279,6 @@ class _CircleListPageState extends State with RouteAware { imageUrl: bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), @@ -442,8 +441,6 @@ class _CircleListPageState extends State with RouteAware { width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], diff --git a/circle_app/lib/app/friendslist/logic.dart b/circle_app/lib/app/friendslist/logic.dart index 57557b7..338321f 100644 --- a/circle_app/lib/app/friendslist/logic.dart +++ b/circle_app/lib/app/friendslist/logic.dart @@ -1,34 +1,85 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import '../../network/api.dart'; import '../../network/dio_manager.dart'; +import '../../util/SharedPreferencesHelper.dart'; +import '../../util/eventBus.dart'; import '../../util/util.dart'; import 'state.dart'; class FriendslistLogic extends GetxController { final RefreshController refreshController = RefreshController(); + final RefreshController eachRefreshController = RefreshController(); final FriendslistState state = FriendslistState(); - + StreamSubscription? subscription; int page = 1; int isVip = 0; bool isLoad = true; + + int eachPage = 1; + + bool isEachLoad = true; + List lists = []; + List eachlists = []; + + int sameCityCount = 0; + int wantMeetCount = 0; + String tip = ''; + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + subscription?.cancel(); + } + @override void onInit() async { super.onInit(); - - + loadTotal(Get.arguments + 1); + SharedPreferencesHelper.getInstance().then((sharedPreferences) { + isVip = sharedPreferences.getInt(SharedPreferencesHelper.VIP); + }); + subscription = EventBusManager.on().listen((event) { + isVip = event.vip; + update(); + }); initList(); + initEachList(); } void dispose() { refreshController.dispose(); + eachRefreshController.dispose(); super.dispose(); } + + loadTotal(int type) async { + var data = await DioManager.instance + .get(url: Api.getFollowTotal+type.toString()); + if (data['code'] == 200) { + sameCityCount = data['data']['sameCityCount']; + wantMeetCount = data['data']['wantMeetCount']; + if (sameCityCount > 0 && wantMeetCount > 0) { + tip = '${sameCityCount}人和你同城,${wantMeetCount}人是你想认识的圈友'; + } else if (sameCityCount > 0) { + tip = '${sameCityCount}人和你同城'; + } else if (wantMeetCount > 0) { + tip = '${wantMeetCount}人是你想认识的圈友'; + } else { + tip = ''; + } + update(); + } + } + initList() async { if (page == 1) { lists.clear(); @@ -48,6 +99,34 @@ class FriendslistLogic extends GetxController { } } + sendCallMyFollowData() async { + var data = await DioManager.instance + .post(url: Api.callMyFollow); + if (data['code'] == 200) { + showOKToast('召唤喜欢操作成功'); + } + } + + initEachList() async { + if (eachPage == 1) { + eachlists.clear(); + } + var data = await DioManager.instance + .get(url: Api.mutualUsers, params: {'page': eachPage}); + var bean = BaseResponse.fromJson(data, (data) => User.fromJson(data)); + if (bean.isSuccess()) { + eachlists.addAll(bean.data.lists); + } + isEachLoad = false; + update(); + if (eachPage == 1) { + eachRefreshController.refreshCompleted(); + } else { + eachRefreshController.loadComplete(); + } + } + + setLike(int index) async { var data = await DioManager.instance.post( url: "${Api.setLike + lists[index].id.toString()}/follow", diff --git a/circle_app/lib/app/friendslist/view.dart b/circle_app/lib/app/friendslist/view.dart index ab70073..1a25ba5 100644 --- a/circle_app/lib/app/friendslist/view.dart +++ b/circle_app/lib/app/friendslist/view.dart @@ -1,43 +1,49 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:circle_app/app/likelist/view.dart'; +import 'package:circle_app/common/colors/app_color.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import '../../common/Widgets/base_tip_widget.dart'; import '../../components/my_app_bar.dart'; import '../../router/app_routers.dart'; import '../../util/util.dart'; import 'logic.dart'; -class FriendslistPage extends StatefulWidget { +class FriendslistPage extends StatefulWidget { FriendslistPage({Key? key}) : super(key: key); @override State createState() => _FriendslistPageState(); } -class _FriendslistPageState extends State with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { +class _FriendslistPageState extends State + with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { final logic = Get.find(); final state = Get.find().state; late TabController _tabController; - @override bool get wantKeepAlive => true; @override void initState() { // TODO: implement initState super.initState(); - _tabController = TabController(length: 2, vsync: this, initialIndex: Get.arguments); + _tabController = + TabController(length: 3, vsync: this, initialIndex: Get.arguments); + _tabController.addListener(() { + if (_tabController.indexIsChanging) { + logic.loadTotal(_tabController.index + 1); + } + }); } - @override Widget build(BuildContext context) { - return GetBuilder(builder: (logic) { return Container( decoration: BoxDecoration( @@ -48,7 +54,7 @@ class _FriendslistPageState extends State with SingleTickerProv ), child: Scaffold( backgroundColor: Colors.transparent, - appBar: MyAppBar( + appBar: MyAppBar( diyTitleWdiget: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -66,13 +72,21 @@ class _FriendslistPageState extends State with SingleTickerProv labelColor: const Color(0xFF00FFF4), unselectedLabelColor: const Color(0xB3FFFFFF), indicatorSize: TabBarIndicatorSize.label, - indicatorPadding: EdgeInsets.only(left: 30.sp, right: 30.sp), + indicatorPadding: EdgeInsets.only(left: 20.sp, right: 20.sp,bottom: 8.sp), tabs: [ + Tab( + child: Text( + '互相喜欢', + style: TextStyle( + fontSize: 15.sp, + ), + ), + ), Tab( child: Text( '我喜欢的', style: TextStyle( - fontSize: 20.sp, + fontSize: 15.sp, ), ), ), @@ -80,15 +94,14 @@ class _FriendslistPageState extends State with SingleTickerProv child: Text( '喜欢我的', style: TextStyle( - fontSize: 20.sp, + fontSize: 15.sp, ), ), ), - ], labelStyle: TextStyle( color: const Color(0xFF00FFF4), - fontSize: 18.sp, + fontSize: 15.sp, shadows: [ Shadow( color: const Color(0xFFF657FF).withOpacity(0.5), @@ -100,7 +113,7 @@ class _FriendslistPageState extends State with SingleTickerProv ), unselectedLabelStyle: TextStyle( // color: const Color(0xB3FFFFFF), - fontSize: 18.sp, + fontSize: 15.sp, shadows: [ Shadow( // color: const Color(0xFFF657FF), @@ -109,134 +122,241 @@ class _FriendslistPageState extends State with SingleTickerProv ), ], ), - onTap: (index) { - - }, + onTap: (index) {}, ), ], ), - + actionWdiget: GestureDetector( + onTap: () { + if (logic.isVip == 2) { + if (logic.lists.isEmpty) { + showOKToast('您还没有喜欢的人哦,可以前往感兴趣的圈子寻找喜欢的人'); + } else { + logic.sendCallMyFollowData(); + } + } else { + showOKToast('成为年会员后可以一键召唤喜欢的人哦~'); + showOepnVipDialog(); + } + }, + child: Container( + height: 20.sp, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 4.sp, right: 4.sp), + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(10.sp)), + child: Text( + '召唤喜欢', + style: TextStyle(color: Colors.black, fontSize: 10.sp), + ), + ), + ), + ), + body: Column( + children: [ + if (logic.tip.isNotEmpty) + Container( + margin: EdgeInsets.only(bottom: 5.sp,), + child: RichText( + text: TextSpan( + children: [ + if (logic.sameCityCount > 0) + TextSpan( + text: '${logic.sameCityCount}', + style: TextStyle( + color: AppColor.mainColor, fontSize: 14.0), + ), + if (logic.sameCityCount > 0) + TextSpan( + text: '人和你同城', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + if (logic.sameCityCount > 0 && + logic.wantMeetCount > 0) + TextSpan( + text: ',', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + if (logic.wantMeetCount > 0) + TextSpan( + text: '${logic.wantMeetCount}', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.0, + fontWeight: FontWeight.bold), + ), + if (logic.wantMeetCount > 0) + TextSpan( + text: '人是你想认识的类型', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + ], + ), + ), + ), + Expanded( + child: TabBarView( + children: [eachtherLiveWidget(), myLiveWidget(), LikelistPage()], + controller: _tabController, + ), + ), + ], ), - body: TabBarView(children: [myLiveWidget(),LikelistPage()],controller: _tabController,), ), ); }); } + Widget eachtherLiveWidget() { + return SafeArea( + child: logic.isEachLoad + ? loaddingWidget(true) + : logic.eachlists.isEmpty + ? noResultWidget() + : SmartRefresher( + controller: logic.eachRefreshController, + onRefresh: _onEachRefresh, + onLoading: _onEachLoading, + enablePullUp: true, + child: ListView.builder( + padding: EdgeInsets.all(10.sp), + itemCount: logic.eachlists.length, + itemBuilder: (context, index) { + return ListItem(logic.eachlists[index], index); + }, + ), + ), + ); + } + Widget myLiveWidget() { return SafeArea( - child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( - controller: logic.refreshController, - onRefresh: _onRefresh, - onLoading: _onLoading, - enablePullUp: true, - child: ListView.builder( - padding: EdgeInsets.all(10.sp), - itemCount: logic.lists.length, - itemBuilder: (context, index) { - return ListItem(logic.lists[index],index); - }, + child: logic.isLoad + ? loaddingWidget(true) + : logic.lists.isEmpty + ? noResultWidget() + : SmartRefresher( + controller: logic.refreshController, + onRefresh: _onRefresh, + onLoading: _onLoading, + enablePullUp: true, + child: ListView.builder( + padding: EdgeInsets.all(10.sp), + itemCount: logic.lists.length, + itemBuilder: (context, index) { + return ListItem(logic.lists[index], index); + }, + ), + ), + ); + } + + Widget ListItem(UserInfo item, int index) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + }, + child: Container( + margin: const EdgeInsets.only(bottom: 21), + child: Row( + children: [ + Stack( + children: [ + ClipOval( + child: GestureDetector( + onTap: () { + var imgList = []; + imgList.add(item.avatar); + Get.toNamed(AppRoutes.Swiper, + arguments: {'imaglist': imgList, 'index': 0}); + }, + child: CachedNetworkImage( + fit: BoxFit.cover, + imageUrl: item.avatarThumb, + width: 53.sp, + height: 53.sp, + ), + ), + ), + Positioned( + right: 0, + left: 0, + bottom: 0, + child: item.vip > 0 + ? Image( + image: AssetImage( + getBaseImage(item.vip == 1 ? "vip" : 'year_vip')), + width: 44.sp, + height: 18.sp, + ) + : Container(), + ) + ], + ), + SizedBox(width: 10.sp), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + item.nickname, + style: const TextStyle( + color: Colors.white70, + fontSize: 14, + fontWeight: FontWeight.bold), + ), + SizedBox(width: 4.sp), + // SizedBox(height: 8.sp), + _buildInfoRow(item), + // Placeholder image + ], + ), + SizedBox(height: 8.sp), + SizedBox( + width: 200.sp, + child: Text( + item.signature, + overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示 + maxLines: 1, + style: TextStyle( + fontSize: 12.sp, color: const Color(0xFFB7BECC)), + ), + ), + ], + ), + // Pla + const Spacer(), + GestureDetector( + onTap: () { + logic.setLike(index); + }, + child: Container( + width: 75, + height: 28, + decoration: BoxDecoration( + color: const Color(0xFFFF4D7C), + borderRadius: BorderRadius.circular(14), + ), + child: Center( + child: Text(item.isLike ? "取消喜欢" : "喜欢", + style: TextStyle(fontSize: 14.sp, color: Colors.white)), + ), + ), + ), + ], ), ), ); } - Widget ListItem(UserInfo item,int index) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); - }, - child: Container( - margin: const EdgeInsets.only(bottom: 21), - child: Row( - children: [ - Stack(children: [ - ClipOval( - child: GestureDetector( - onTap: () { - var imgList = []; - imgList.add(item.avatar); - Get.toNamed(AppRoutes.Swiper, arguments: { - 'imaglist': imgList, - 'index': 0 - }); - }, - child: CachedNetworkImage( - fit: BoxFit.cover, - imageUrl: item.avatarThumb, - width: 53.sp, - height: 53.sp, - ), - ), - ), - Positioned( - right: 0, - left: 0, - bottom: 0, - - child: item.vip>0 ? - Image( - image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')), - width: 44.sp, - height: 18.sp, - ):Container(),) - ],), - SizedBox(width: 10.sp), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - item.nickname, - style: const TextStyle(color :Colors.white70,fontSize: 14, fontWeight: FontWeight.bold), - ), - SizedBox(width: 4.sp), - // SizedBox(height: 8.sp), - _buildInfoRow(item), - // Placeholder image - ], - ), - - SizedBox(height: 8.sp), - SizedBox( - width: 200.sp, - child: Text( - item.signature, - overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示 - maxLines: 1, - style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)), - ), - ), - ], - ), - // Pla - const Spacer(), - GestureDetector(onTap: (){ - - logic.setLike(index); - }, - child: Container( - width: 75, - height: 28, - decoration: BoxDecoration( - color: const Color(0xFFFF4D7C), - borderRadius: BorderRadius.circular(14), - ), - child: - Center( - child: Text(item.isLike?"取消喜欢":"喜欢", style: TextStyle(fontSize: 14.sp, color: Colors.white)), - ), - ), - ), - ], - ), - ),); - } - Widget _buildInfoRow(UserInfo userInfoBean) { - String ageMsg = getAgeCOntent(userInfoBean.gender, userInfoBean.age, + String ageMsg = getAgeCOntent(userInfoBean.gender, userInfoBean.age, userInfoBean.role, userInfoBean.orientation); return Row( children: [ @@ -255,7 +375,7 @@ class _FriendslistPageState extends State with SingleTickerProv padding: EdgeInsets.only( top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), child: Text( - ageMsg , + ageMsg, style: TextStyle( color: Colors.black, fontSize: 10.sp, @@ -263,7 +383,6 @@ class _FriendslistPageState extends State with SingleTickerProv ), ), SizedBox(width: 6.sp), - ], ); } @@ -277,4 +396,14 @@ class _FriendslistPageState extends State with SingleTickerProv logic.page = logic.page + 1; logic.initList(); } + + void _onEachRefresh() async { + logic.eachPage = 1; + logic.initEachList(); + } + + void _onEachLoading() async { + logic.eachPage = logic.eachPage + 1; + logic.initEachList(); + } } diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index 1688767..173545f 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -161,6 +161,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { content['nickname']); }); break; + case 9://有新人加入 + { + CircleLogic logic = Get.find(); + logic.isNewPeopleRed = true; + logic.update(); + } + break; } } diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index 443e79f..bcf5469 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -591,7 +591,7 @@ class _MinefragmentPageState extends State with RouteAware { GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Get.toNamed(AppRoutes.FriendsActivity,arguments: 0); + Get.toNamed(AppRoutes.FriendsActivity,arguments: 1); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -629,7 +629,7 @@ class _MinefragmentPageState extends State with RouteAware { SharedPreferencesHelper.getInstance().then((sharedPreferences) { sharedPreferences.setInt(SharedPreferencesHelper.LIKEMECOUNT, logic.like_me_count); }); - Get.toNamed(AppRoutes.FriendsActivity,arguments: 1); + Get.toNamed(AppRoutes.FriendsActivity,arguments: 2); }, child: Stack( children: [ diff --git a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart index 0f28c1a..443b433 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -1134,8 +1134,6 @@ class _TIMConversationState extends TIMUIKitState { imageUrl: bean['image'], width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/app/msg/recommend_circle_friend_item.dart b/circle_app/lib/app/msg/recommend_circle_friend_item.dart index d5076a1..5898a1d 100644 --- a/circle_app/lib/app/msg/recommend_circle_friend_item.dart +++ b/circle_app/lib/app/msg/recommend_circle_friend_item.dart @@ -542,8 +542,6 @@ class _CircleInfoItemState extends State { imageUrl: bean['image'], width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/app/msg/view.dart b/circle_app/lib/app/msg/view.dart index 7305699..65f913a 100644 --- a/circle_app/lib/app/msg/view.dart +++ b/circle_app/lib/app/msg/view.dart @@ -110,8 +110,6 @@ class _MsgPageState extends State with AutomaticKeepAliveClientMixin { width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], diff --git a/circle_app/lib/app/my_circle/view.dart b/circle_app/lib/app/my_circle/view.dart index a5f4e42..4074bee 100644 --- a/circle_app/lib/app/my_circle/view.dart +++ b/circle_app/lib/app/my_circle/view.dart @@ -182,8 +182,6 @@ class _My_circlePageState extends State imageUrl: bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/app/offaccount/view.dart b/circle_app/lib/app/offaccount/view.dart index e483e5f..87af129 100644 --- a/circle_app/lib/app/offaccount/view.dart +++ b/circle_app/lib/app/offaccount/view.dart @@ -287,26 +287,36 @@ class _OffaccountState extends State { void showBottomSheetDialog(BuildContext context,OffaccountLogic logic) { showModalBottomSheet( context: context, - backgroundColor: Colors.transparent, + // backgroundColor: Colors.transparent, + builder: (BuildContext context) { return Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(0.6), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20.sp), - topRight: Radius.circular(20.sp), - ), + color: Colors.black, + + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(20.sp), + // topRight: Radius.circular(20.sp), + // ), ), child: Column( mainAxisSize: MainAxisSize.min, children: [ - buildOptionItem("体验太差", context,logic), + buildOptionItem("换平台玩了", context, logic), buildDivider(), - buildOptionItem("换平台了", context,logic), + buildOptionItem("功能体验差", context, logic), buildDivider(), - buildOptionItem("担心隐私泄露", context,logic), + buildOptionItem("消息通知比较频繁", context, logic), buildDivider(), - buildOptionItem("其他原因", context,logic), + buildOptionItem("找不到合适的人", context, logic), + buildDivider(), + buildOptionItem("回复消息的人少", context, logic), + buildDivider(), + buildOptionItem("收费有点高", context, logic), + buildDivider(), + buildOptionItem("收费的地方有点多", context, logic), + buildDivider(), + buildOptionItem("其他原因", context, logic), ], ), ); diff --git a/circle_app/lib/app/setup/view.dart b/circle_app/lib/app/setup/view.dart index 7c68a6b..211b44a 100644 --- a/circle_app/lib/app/setup/view.dart +++ b/circle_app/lib/app/setup/view.dart @@ -121,6 +121,8 @@ class SetupPage extends StatelessWidget { child: _buildItemRow('关于微乐园', getHomeImage("icon_in")), ), ), + Expanded(child: Container()), + SafeArea(child: Center(child: Text('备案号:粤ICP备2023079493号-2A',style: TextStyle(color: Colors.white.withOpacity(0.5),fontSize: 12.sp),))) ], ), ),), diff --git a/circle_app/lib/app/swiper/view.dart b/circle_app/lib/app/swiper/view.dart index 6868062..17801b7 100644 --- a/circle_app/lib/app/swiper/view.dart +++ b/circle_app/lib/app/swiper/view.dart @@ -159,6 +159,19 @@ class _SwiperPageState extends State { ), ), )), + Positioned( + left: 5.sp, + top: 10.sp + MediaQuery.of(context).padding.top, + child: IconButton( + onPressed: () { + Get.back(); + }, + padding: EdgeInsets.only(left: 15.sp), + icon: Image.asset('assets/images/navigator/back.png', + width: 30.sp, + height: 30.sp, + ), + )), ], ), ), diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index a561d77..3e0a73f 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -268,11 +268,11 @@ class MyTabbedScreenState extends State toolbarHeight: 0, foregroundColor: Colors.transparent, backgroundColor: Colors.transparent, - expandedHeight: 355.sp + + expandedHeight: 352.sp + (logic.userInfoBean != null ? logic.userInfoBean!.contact!.isNotEmpty && logic.userId.toString().isNotEmpty - ? 59.sp + ? 42.sp : 0 : 0), // bottom: PreferredSize( @@ -478,7 +478,7 @@ class MyTabbedScreenState extends State padding: EdgeInsets.symmetric( horizontal: 15.sp, ), - margin: EdgeInsets.only(top: 19.sp), + margin: EdgeInsets.only(top: 13.sp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -565,7 +565,7 @@ class MyTabbedScreenState extends State alignment: Alignment.centerLeft, // width: 200.sp, // color: Colors.red, - margin: EdgeInsets.only(left: 15.sp, bottom: 15.sp), + margin: EdgeInsets.only(left: 5.sp, bottom: 5.sp), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -591,10 +591,11 @@ class MyTabbedScreenState extends State }, child: Container( margin: EdgeInsets.only( - top: 0.sp, left: 15.sp, right: 10.sp, bottom: 10.sp), + top: 0.sp, left: 15.sp, right: 10.sp, bottom: 0.sp), padding: EdgeInsets.only( - left: 12.sp, right: 12.sp, bottom: 18.sp, top: 16.sp), - height: 144.sp, + left: 12.sp, right: 12.sp, top: 16.sp), + + height: 134.sp, decoration: BoxDecoration( color: Color(0x1AFFFFFF), borderRadius: BorderRadius.circular(14.sp)), diff --git a/circle_app/lib/app/visitorlist/logic.dart b/circle_app/lib/app/visitorlist/logic.dart index 6c8c240..34bc1e0 100644 --- a/circle_app/lib/app/visitorlist/logic.dart +++ b/circle_app/lib/app/visitorlist/logic.dart @@ -1,6 +1,8 @@ import 'dart:async'; +import 'package:circle_app/util/util.dart'; import 'package:get/get.dart'; +import 'package:oktoast/oktoast.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import '../../common/Widgets/open_vip_tip/logic.dart'; @@ -11,6 +13,25 @@ import '../../util/eventBus.dart'; import 'state.dart'; class VisitorlistLogic extends GetxController { + + + + final RefreshController refreshController = RefreshController(); + final VisitorlistState state = VisitorlistState(); + int page = 1; + int isVip = 0; + bool isLoad = true; + List lists = []; + List users = []; + StreamSubscription? subscription = null; + + int sameCityCount = 0; + int wantMeetCount = 0; + String tip = ''; + + bool userIsMore = true; + int userPage = 1; + @override void dispose() { refreshController.dispose(); @@ -21,14 +42,6 @@ class VisitorlistLogic extends GetxController { super.dispose(); } - final RefreshController refreshController = RefreshController(); - final VisitorlistState state = VisitorlistState(); - int page = 1; - int isVip = 0; - bool isLoad = true; - List lists = []; - StreamSubscription? subscription = null; - @override void onInit() async { super.onInit(); @@ -38,7 +51,38 @@ class VisitorlistLogic extends GetxController { page = 1; initList(); }); + loadVisitorTotalData(); refreshVipStatus(); + loadInterestedInMeUsersData(); + } + + void loadInterestedInMeUsersData() async { + var data = + await DioManager.instance.get(url: Api.interestedInMeUsers); + if (data['code'] == 200) { + List infoList = data['data']['lists']; + if (infoList.isNotEmpty) { + users = data['data']['lists']; + } + update(); + } + } + + void loadVisitorTotalData() async { + var data = + await DioManager.instance.get(url: Api.getVisitorTotal,); + if (data['code'] == 200) { + sameCityCount = data['data']['sameCityCount']; + wantMeetCount = data['data']['wantMeetCount']; + if (sameCityCount > 0 && wantMeetCount > 0) { + tip = '${sameCityCount}人和你同城,${wantMeetCount}人是你想认识的圈友'; + } else if (sameCityCount > 0) { + tip = '${sameCityCount}人和你同城'; + } else if (wantMeetCount > 0) { + tip = '${wantMeetCount}人是你想认识的圈友'; + } + update(); + } } refreshVipStatus() async { @@ -58,7 +102,7 @@ class VisitorlistLogic extends GetxController { initList() async { if (page == 1) { - lists.clear(); + // lists.clear(); } var data = await DioManager.instance @@ -66,16 +110,37 @@ class VisitorlistLogic extends GetxController { var bean = BaseResponse.fromJson( data, (data) => UserList.fromJson(data)); if (bean.isSuccess()) { - lists.addAll(bean.data.lists); + List list = bean.data.lists; + + if (list.isNotEmpty) { + if (page == 1) { + lists = bean.data.lists; + refreshController.resetNoData(); + refreshController.refreshCompleted(); + } else { + refreshController.loadComplete(); + lists.addAll(bean.data.lists); + } + + } else { + refreshController.loadNoData(); + } + } isLoad = false; update(); - if (page == 1) { - refreshController.refreshCompleted(); - } else { - refreshController.loadComplete(); + + } + + void sendAllLike(List idList) async { + var data = await DioManager.instance + .postBody(url: Api.allUserFollow, params: {'userIds': idList}); + if (data['code'] == 200) { + showOKToast('一键喜欢操作成功'); + users.clear(); + update(); } } } @@ -90,6 +155,7 @@ class User { final int vip; final int gender; final int role; + final int mark; final int orientation; final double lng; final double lat; @@ -104,6 +170,7 @@ class User { required this.birthday, required this.age, required this.vip, + required this.mark, required this.gender, required this.role, required this.orientation, @@ -127,6 +194,7 @@ class User { orientation: json['orientation'], lng: json['lng'], lat: json['lat'], + mark: json['mark'] ?? 0, city: json['city'], avatarThumb: json['avatar_thumb'], ); diff --git a/circle_app/lib/app/visitorlist/view.dart b/circle_app/lib/app/visitorlist/view.dart index 8f668f3..38ab52a 100644 --- a/circle_app/lib/app/visitorlist/view.dart +++ b/circle_app/lib/app/visitorlist/view.dart @@ -1,13 +1,16 @@ import 'dart:ui'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/app/visitorlist/widget/visitors_follow_item.dart'; import 'package:circle_app/main.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import '../../common/Widgets/base_tip_widget.dart'; import '../../common/Widgets/open_vip_tip/view.dart'; +import '../../common/colors/app_color.dart'; import '../../components/my_app_bar.dart'; import '../../router/app_routers.dart'; import '../../util/util.dart'; @@ -17,17 +20,10 @@ class VisitorlistPage extends StatelessWidget { VisitorlistPage({Key? key}) : super(key: key); final logic = Get.find(); - final state = Get - .find() - .state; + final state = Get.find().state; @override Widget build(BuildContext context) { - - - - - return GetBuilder(builder: (logic) { return Container( decoration: BoxDecoration( @@ -38,8 +34,33 @@ class VisitorlistPage extends StatelessWidget { ), child: Scaffold( backgroundColor: Colors.transparent, - appBar: const MyAppBar( + appBar: MyAppBar( centerTitle: "最近访客", + actionWdiget: GestureDetector( + onTap: () { + if (logic.isVip == 2) { + showOKToast('已为你增加10倍曝光啦'); + } else { + showOKToast('开通年会员可以增加10倍曝光哦~'); + showOepnVipDialog(); + } + }, + child: Container( + height: 24.sp, + padding: EdgeInsets.only(left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(12.sp)), + child: Row( + children: [ + Text( + '10倍曝光', + style: TextStyle(color: Colors.black, fontSize: 13.sp), + ) + ], + ), + ), + ), ), body: Stack( children: [ @@ -47,26 +68,26 @@ class VisitorlistPage extends StatelessWidget { child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty - ? noResultWidget() - : SmartRefresher( - controller: logic.refreshController, - onRefresh: _onRefresh, - onLoading: _onLoading, - enablePullUp: true, - child: Stack( - alignment: Alignment.topCenter, - children: [ - ListView.builder( - padding: EdgeInsets.all(10.sp), - itemCount: logic.lists.length, - itemBuilder: (context, index) { - return ListItem(logic.lists[index], index); - }, - ), - showGd() - ], - ), - ), + ? noResultWidget() + : Stack( + alignment: Alignment.topCenter, + children: [ + SmartRefresher( + controller: logic.refreshController, + onRefresh: _onRefresh, + onLoading: _onLoading, + enablePullUp: true, + child: ListView.builder( + padding: EdgeInsets.all(10.sp), + itemCount: logic.lists.length, + itemBuilder: (context, index) { + return ListItem( + logic.lists[index], index); + }, + )), + showGd() + ], + ), ), ], ), @@ -91,10 +112,10 @@ class VisitorlistPage extends StatelessWidget { List widgets = []; - switch(urlList.length){ + switch (urlList.length) { case 0: widgets.add(Positioned( - left: (Get.width /2) - 40, + left: (Get.width / 2) - 40, child: circleWidget(""), )); break; @@ -102,7 +123,7 @@ class VisitorlistPage extends StatelessWidget { for (int i = 0; i < urlList.length; i++) { var element = urlList[i]; // double xOffset = interval * i + xOffsetBase; - double let = (Get.width /2) - 60 ; + double let = (Get.width / 2) - 60; widgets.add(Positioned( left: let, @@ -111,18 +132,19 @@ class VisitorlistPage extends StatelessWidget { } widgets.add(Positioned( - left: (Get.width /2) - 20, + left: (Get.width / 2) - 20, child: circleWidget(""), )); break; case 2: - - double xOffsetBase = (Get.width + interval * urlList.length - 60.0 * urlList.length) * 0.25; + double xOffsetBase = + (Get.width + interval * urlList.length - 60.0 * urlList.length) * + 0.25; for (int i = 0; i < urlList.length; i++) { var element = urlList[i]; // double xOffset = interval * i + xOffsetBase; - double let = ((Get.width /2) - ((40*urlList.length))+(i*40)) ; + double let = ((Get.width / 2) - ((40 * urlList.length)) + (i * 40)); widgets.add(Positioned( left: let, @@ -137,218 +159,264 @@ class VisitorlistPage extends StatelessWidget { )); break; case 3: - // double xOffsetBase = (Get.width + interval * urlList.length - 60.0 * urlList.length) * 0.25; + // double xOffsetBase = (Get.width + interval * urlList.length - 60.0 * urlList.length) * 0.25; for (int i = 0; i < urlList.length; i++) { - switch(i){ + switch (i) { case 0: widgets.add(Positioned( - left: (Get.width /2) - 100, + left: (Get.width / 2) - 100, child: circleWidget(urlList[i]), )); break; case 1: widgets.add(Positioned( - left: (Get.width /2) - 60, + left: (Get.width / 2) - 60, child: circleWidget(urlList[i]), )); break; case 2: widgets.add(Positioned( - left: (Get.width /2) - 20, + left: (Get.width / 2) - 20, child: circleWidget(urlList[i]), )); break; } } widgets.add(Positioned( - left: (Get.width /2) + 20, + left: (Get.width / 2) + 20, child: circleWidget(""), )); - break; } - return logic.isVip > 0 ? Container() : Positioned( - bottom: 150, - child: Container( - width: Get.width, - child: Column( - children: [ - SizedBox( - height: 140.sp, + bottom: 0, + child: Container( width: Get.width, - child: Stack( - alignment: Alignment.centerLeft, - children: widgets, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 40.sp), - child: Text( - "TA们也喜欢你哦 \n" - "成为会员查看所有圈友信息", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 15.sp, - ), - ), - ), - GestureDetector( - onTap: () { - showRechargeDialog(); - }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17), - gradient: LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - padding: EdgeInsets.symmetric( - vertical: 10.sp, - horizontal: 55.sp, - ), - child: Text( - "开通会员查看更多访客", - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - ), - ), - ), - ), - ], - ), - ), - ); - } - - - Widget ListItem(UserListItem item, int index) { - //print("是不是vip"+logic.isVip.toString()); - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if (logic.isVip > 0 || index < 3) { - Get.toNamed(AppRoutes.UserInfoActivity, - arguments: item.user.id.toString()); - } - }, - child: ImageFiltered( - imageFilter: ImageFilter.blur( - sigmaX: (logic.isVip > 0 || index < 3) ? 0 : 5, - sigmaY: (logic.isVip > 0 || index < 3) ? 0 : 5, - ), - child: Container( - margin: const EdgeInsets.only(bottom: 21), - child: Row( - children: [ - Stack( - children: [ - ClipOval( - child: GestureDetector( - onTap: () { - if (logic.isVip > 0 || index < 3) { - var imgList = []; - imgList.add(item.user.avatar); - Get.toNamed(AppRoutes.Swiper, - arguments: {'imaglist': imgList, 'index': 0}); - } - }, - child: CachedNetworkImage( - fit: BoxFit.cover, - imageUrl: item.user.avatarThumb, - width: 53.sp, - height: 53.sp, - ), - ), - ), - Positioned( - right: 0.sp, - left: 0.sp, - bottom: 0.sp, - child: item.user.vip != 0 - ? Image( - image: AssetImage(getBaseImage(item.user.vip == 1 ? "vip" : 'year_vip')), - width: 44.sp, - height: 18.sp, - ) - : Container(), - ) - ], - ), - SizedBox(width: 10.sp), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + child: Column( children: [ - Text( - item.user.nickname, - style: const TextStyle( - color: Colors.white70, - fontSize: 14, - fontWeight: FontWeight.bold), + SizedBox( + height: 70.sp, + width: Get.width, + child: Stack( + alignment: Alignment.centerLeft, + children: widgets, + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.sp, top: 10.sp), + child: Text( + "TA们也喜欢你哦 \n" + "成为会员查看所有圈友信息", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 15.sp, + ), + ), + ), + if (logic.tip.isNotEmpty) + Container( + margin: EdgeInsets.only(bottom: 10.sp), + child: RichText( + text: TextSpan( + children: [ + if (logic.sameCityCount > 0) + TextSpan( + text: '${logic.sameCityCount}', + style: TextStyle( + color: AppColor.mainColor, fontSize: 14.0), + ), + if (logic.sameCityCount > 0) + TextSpan( + text: '人和你同城', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + if (logic.sameCityCount > 0 && + logic.wantMeetCount > 0) + TextSpan( + text: ',', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + if (logic.wantMeetCount > 0) + TextSpan( + text: '${logic.wantMeetCount}', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.0, + fontWeight: FontWeight.bold), + ), + if (logic.wantMeetCount > 0) + TextSpan( + text: '人是你想认识的类型', + style: TextStyle( + color: Colors.white, fontSize: 14.0), + ), + ], + ), + ), + ), + GestureDetector( + onTap: () { + showRechargeDialog(); + }, + child: Container( + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + margin: EdgeInsets.only( + left: 50.sp, right: 50.sp, bottom: 20.sp), + child: Text( + "开通会员查看更多访客", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + ), + ), + ), ), - SizedBox(width: 4.sp), - // SizedBox(height: 8.sp), - _buildInfoRow(item), - // Placeholder image ], ), - SizedBox(height: 8.sp), - SizedBox( - width: 200.sp, - child: Text( - item.user.signature, - overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示 - maxLines: 1, - style: TextStyle( - fontSize: 12.sp, color: const Color(0xFFB7BECC)), - ), - ), - ], - ), - // Pla - const Spacer(), - GestureDetector( - onTap: () { - if (logic.isVip > 0 || index < 3) { - Get.toNamed(AppRoutes.UserInfoActivity, - arguments: item.user.id.toString()); - // pushChatPage(item.user.id.toString(), item.accountId, - // item.user.nickname); - } - }, + ), + ); + } + + Widget ListItem(UserListItem item, int index) { + return Column( + children: [ + if (index == 0 && logic.users.isNotEmpty) + VisitorsFollowItem(users: logic.users), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (logic.isVip > 0 || index < 3) { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: item.user.id.toString()); + } + }, + child: ImageFiltered( + imageFilter: ImageFilter.blur( + sigmaX: (logic.isVip > 0 || index < 3) ? 0 : 5, + sigmaY: (logic.isVip > 0 || index < 3) ? 0 : 5, + ), child: Container( - width: 60.sp, - height: 28.sp, - decoration: BoxDecoration( - color: const Color(0xFFFF4D7C), - borderRadius: BorderRadius.circular(14.sp), - ), - child: Center( - child: Text("回访", - style: TextStyle(fontSize: 14.sp, color: Colors.white)), + margin: const EdgeInsets.only(bottom: 21), + child: Row( + children: [ + Stack( + children: [ + ClipOval( + child: GestureDetector( + onTap: () { + if (logic.isVip > 0 || index < 3) { + var imgList = []; + imgList.add(item.user.avatar); + Get.toNamed(AppRoutes.Swiper, + arguments: {'imaglist': imgList, 'index': 0}); + } + }, + child: CachedNetworkImage( + fit: BoxFit.cover, + imageUrl: item.user.avatarThumb, + width: 53.sp, + height: 53.sp, + ), + ), + ), + Positioned( + right: 0.sp, + left: 0.sp, + bottom: 0.sp, + child: item.user.vip != 0 + ? Image( + image: AssetImage(getBaseImage( + item.user.vip == 1 ? "vip" : 'year_vip')), + width: 44.sp, + height: 18.sp, + ) + : Container(), + ) + ], + ), + SizedBox(width: 10.sp), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + item.user.nickname, + style: const TextStyle( + color: Colors.white70, + fontSize: 14, + fontWeight: FontWeight.bold), + ), + SizedBox(width: 4.sp), + // SizedBox(height: 8.sp), + _buildInfoRow(item), + // Placeholder image + ], + ), + SizedBox(height: 8.sp), + SizedBox( + width: 200.sp, + child: Text( + item.user.signature, + overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示 + maxLines: 1, + style: TextStyle( + fontSize: 12.sp, color: const Color(0xFFB7BECC)), + ), + ), + ], + ), + // Pla + const Spacer(), + GestureDetector( + onTap: () { + if (logic.isVip > 0 || index < 3) { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: item.user.id.toString()); + // pushChatPage(item.user.id.toString(), item.accountId, + // item.user.nickname); + } + }, + child: Container( + width: 60.sp, + height: 28.sp, + decoration: BoxDecoration( + color: const Color(0xFFFF4D7C), + borderRadius: BorderRadius.circular(14.sp), + ), + child: Center( + child: Text("回访", + style: TextStyle( + fontSize: 14.sp, color: Colors.white)), + ), + ), + ), + ], ), ), ), - ], - ) - , - ),) - , + ), + ], ); } @@ -399,24 +467,20 @@ class VisitorlistPage extends StatelessWidget { showRechargeDialog() async { Get.bottomSheet( - Scaffold( - backgroundColor: Colors.transparent, - body: Open_vip_tipPage(false), - ), - isScrollControlled: true, - enableDrag: false) - .then((value) { - - }); + Scaffold( + backgroundColor: Colors.transparent, + body: Open_vip_tipPage(false), + ), + isScrollControlled: true, + enableDrag: false) + .then((value) {}); } - - - circleWidget(String url, {double width = 80}) { + circleWidget(String url, {double width = 70}) { return GestureDetector( - onTap: (){ - showRechargeDialog(); - }, + onTap: () { + showRechargeDialog(); + }, child: Stack( alignment: Alignment.center, children: [ @@ -425,18 +489,20 @@ class VisitorlistPage extends StatelessWidget { width: width.sp, height: width.sp, ), - url.contains("http") ? ClipOval( - child: CachedNetworkImage( - imageUrl:url, - width: (width - 1).sp, - height: (width - 1).sp, - fit: BoxFit.cover, - ), - ) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),) + url.contains("http") + ? ClipOval( + child: CachedNetworkImage( + imageUrl: url, + width: (width - 1).sp, + height: (width - 1).sp, + fit: BoxFit.cover, + ), + ) + : Text( + url, + style: TextStyle(color: Color(0xffF756FF), fontSize: 12.sp), + ) ], )); } } - - - diff --git a/circle_app/lib/app/visitorlist/widget/visitors_follow_item.dart b/circle_app/lib/app/visitorlist/widget/visitors_follow_item.dart new file mode 100644 index 0000000..9653442 --- /dev/null +++ b/circle_app/lib/app/visitorlist/widget/visitors_follow_item.dart @@ -0,0 +1,155 @@ +import 'package:circle_app/common/Widgets/base_tip_widget.dart'; +import 'package:circle_app/common/colors/app_color.dart'; +import 'package:circle_app/router/app_routers.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../common/Widgets/tag_widget.dart'; +import '../../../util/util.dart'; +import '../../circle/widgets/discover.dart'; +import '../logic.dart'; + +class VisitorsFollowItem extends StatefulWidget { + List users; + + VisitorsFollowItem({super.key,required this.users}); + @override + _VisitorsFollowItemState createState() => new _VisitorsFollowItemState(); + +} + +class _VisitorsFollowItemState extends State { + // TODO: add state variables and methods + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return Container( + height: 240.sp, + width: Get.width, + padding: EdgeInsets.all(10.sp), + margin: EdgeInsets.only(bottom: 20.sp), + decoration: BoxDecoration( + color: AppColor.bgColor, + borderRadius: BorderRadius.circular(8.sp) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + margin: EdgeInsets.only(bottom: 10.sp), + child: Text('有${widget.users.length}个人反复看过你,喜欢一下吧',style: TextStyle(color: Colors.white.withOpacity(0.75),fontSize: 18.sp,fontWeight: FontWeight.bold),)), + Expanded( + child: ListView.builder(itemBuilder: (context,index) { + var user = UserListItem.fromJson(widget.users[index]).user; + return GestureDetector( + onTap: () { + VisitorlistLogic logic = Get.find(); + if (logic.isVip > 0) { + Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.id.toString()); + } else { + showOKToast('开通会员可以一键喜欢哦~'); + showOepnVipDialog(); + } + }, + child: Container( + width: 120.sp, + height: 120.sp, + margin: EdgeInsets.only(right: 10.sp), + child: Stack( + fit: StackFit.expand, + children: [ + ClipRRect(borderRadius: BorderRadius.circular(8.sp),child: Image.network(user.avatar!,fit: BoxFit.cover,)), + Positioned( + bottom: 5.sp, + left: 5.sp, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + user.nickname ?? '', + style: TextStyle( + fontSize: 18.sp, + color: Color(0XFFF7FAFA), + fontWeight: FontWeight.bold), + ), + Container( + margin: EdgeInsets.only( + left: 4.sp, + ), + child: UserTagWidget(user.mark!), + ), + ], + ), + Container( + margin: + EdgeInsets.only(left: 0.sp), + alignment: Alignment.center, + height: 18.sp, + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 9.sp), + gradient: + const LinearGradient( + begin: Alignment( + 0.25, 0.5), + end: Alignment( + 0.75, 0.5), + colors: [ + Color(0xff8DFFF8), + Color(0xffB5D3FF) + ])), + child: Text( + getAgeCOntent( + user!.gender ?? 0, + user!.age ?? 0, + user!.role ?? 0, + user!.orientation ?? 0), + style: TextStyle( + color: Colors.black, + fontSize: 10.sp, + ), + ), + ), + + ], + )), + ], + ), + ), + ); + },itemCount: widget.users.length,scrollDirection: Axis.horizontal,), + ), + GestureDetector( + onTap: () { + VisitorlistLogic logic = Get.find(); + List idList = []; + widget.users.forEach((element) { + var user = UserListItem.fromJson(element).user; + idList.add(user.id.toString()); + }); + logic.sendAllLike(idList); + }, + child: Container( + margin: EdgeInsets.only(left: 50.sp,right: 50.sp,top: 10.sp), + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.sp), + color: AppColor.mainBgColor, + ), + child: Text('一键喜欢',style: TextStyle(color: Colors.white,fontSize: 16.sp),), + ), + ) + ], + ), + ); + } +} diff --git a/circle_app/lib/common/Widgets/circle_share.dart b/circle_app/lib/common/Widgets/circle_share.dart index fa4f40a..084c5eb 100644 --- a/circle_app/lib/common/Widgets/circle_share.dart +++ b/circle_app/lib/common/Widgets/circle_share.dart @@ -493,8 +493,6 @@ class _CircleShareState extends State { width: (width - 1).sp, height: (width - 1).sp, fit: BoxFit.cover, - memCacheHeight: width.toInt() - 1, - memCacheWidth: width.toInt() - 1, ), ) ], @@ -565,8 +563,6 @@ class _CircleShareState extends State { imageUrl: bean.image, width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/common/Widgets/open_vip_tip/view.dart b/circle_app/lib/common/Widgets/open_vip_tip/view.dart index 5049244..4e47ebf 100644 --- a/circle_app/lib/common/Widgets/open_vip_tip/view.dart +++ b/circle_app/lib/common/Widgets/open_vip_tip/view.dart @@ -20,26 +20,60 @@ class Open_vip_tipPage extends StatelessWidget { final state = Get.find().state; final mineLogic = Get.find(); + Map vipImgMap = { + "身份标识" : 'vip_fun_1', + "专属客服": 'vip_fun_2', + "无限畅聊": 'vip_fun_3', + "至尊喊话": 'vip_fun_4', + "图片私聊": 'vip_fun_5', + "视频私聊": 'vip_fun_6', + "看谁喜欢你": 'vip_fun_7', + "看谁看过你": 'vip_fun_8', + "缘分匹配": 'vip_fun_9', + "取向筛选": 'vip_fun_10', + "角色筛选": 'vip_fun_11', + "查看附近": 'vip_fun_12', + "排序靠前": 'vip_fun_13', + "权重提升": 'vip_fun_14', + }; @override Widget build(BuildContext context) { List vipFuncList = [ + "至尊喊话", + '权重提升', + '取向筛选', + '排序靠前', + '查看附近', + '角色筛选', "身份标识", "专属客服", "无限畅聊", - "至尊喊话", + "图片私聊", "视频私聊", "看谁喜欢你", "看谁看过你", "缘分匹配" ]; + // 权重提升- + // 取向筛选- + // 排序靠前- + // 查看附近- + // 角色筛选- + + List vipDescList = [ + "发布的喊话在圈内凸显", + '年会员权重直接提升数倍', + '可以精准筛选符合您取向的TA', + '在各个列表的排序都可以靠前', + '可以无限查看并私聊附近圈友', + '可以精准筛选您喜欢的角色', '会员专属,更显尊贵', "给您更加贴心的服务", "可以随心所欲畅聊", - "发布的喊话在圈内凸显", "聊天可以一直使用图片", "聊天可以一直使用视频", "看到所有喜欢你的人", @@ -360,7 +394,7 @@ class Open_vip_tipPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( - getBaseImage('vip_fun_$index'), + getBaseImage(vipImgMap[func]!), width: 70.sp, ), SizedBox( diff --git a/circle_app/lib/common/Widgets/today_people_dialog.dart b/circle_app/lib/common/Widgets/today_people_dialog.dart index e22fba1..647e7c7 100644 --- a/circle_app/lib/common/Widgets/today_people_dialog.dart +++ b/circle_app/lib/common/Widgets/today_people_dialog.dart @@ -476,8 +476,6 @@ class _TodayPeopleDialogState extends State { imageUrl: bean['image'], width: 40.sp, height: 40.sp, - memCacheHeight: 40, - memCacheWidth: 40, fit: BoxFit.cover), ), ), diff --git a/circle_app/lib/common/const.dart b/circle_app/lib/common/const.dart index 1199515..035902a 100644 --- a/circle_app/lib/common/const.dart +++ b/circle_app/lib/common/const.dart @@ -50,7 +50,7 @@ wxStatusWidget(bool isUnclock,String wx,String userId,int type,String avatarUrl, }, child: Container( height: 38.sp, - width: (isUnclock ? 45.sp : 60.sp) + textWidth, + width: (isUnclock ? 45.sp : 65.sp) + textWidth, padding: EdgeInsets.only(left: 10.sp,right: 10.sp), decoration: BoxDecoration( color: Color(0x66000000), diff --git a/circle_app/lib/main.dart b/circle_app/lib/main.dart index 20e7de6..b4c2be6 100644 --- a/circle_app/lib/main.dart +++ b/circle_app/lib/main.dart @@ -45,7 +45,6 @@ final TUIChatSeparateViewModel chatSeparateViewModel = OverlayEntry? mainOverlayEntry; void main() { - checkAndExitIfEmulator(); // setCustomErrorWidget(); FlutterBugly.postCatchedException(() async { // 如果需要 ensureInitialized,请在这里运行。 @@ -70,17 +69,6 @@ void main() { } } - -Future checkAndExitIfEmulator() async { - DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); - if (Platform.isAndroid) { - AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; - if (!androidInfo.isPhysicalDevice) { - exit(0); - } - } -} - setCustomErrorWidget() { ErrorWidget.builder = (FlutterErrorDetails details) { print(details.toString()); @@ -93,7 +81,10 @@ setCustomErrorWidget() { // errorBuilder = buildErrorWidget(details); // } return Center( - child: Text('请重新加载',style: TextStyle(color: Colors.white,fontSize: 15.sp),), + child: Text( + '请重新加载', + style: TextStyle(color: Colors.white, fontSize: 15.sp), + ), ); }; } @@ -155,9 +146,7 @@ logoutIM() async { try { final result = await coreInstance.logout(); print(result.desc + '退出IM'); - } catch (e) { - - } + } catch (e) {} } //获取设备Token,获取成功后开启离线推送 @@ -167,7 +156,6 @@ void uploadBuzIDAndToken() async { return; } - await ChannelPush.init((msg) {}); int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo); @@ -184,7 +172,6 @@ void uploadBuzIDAndToken() async { } } - class MyApp extends StatefulWidget { const MyApp({super.key}); @@ -351,9 +338,6 @@ class _MyAppState extends State with WidgetsBindingObserver { }, // [建议配置,详见此部分](https://cloud.tencent.com/document/product/269/70746#callback) listener: V2TimSDKListener(onConnectSuccess: () { - print('IM登录成功'); - - // loginIM(); })); } @@ -380,34 +364,44 @@ class _MyAppState extends State with WidgetsBindingObserver { return RefreshConfiguration( footerBuilder: () => CustomLoadFooter(), child: OKToast( - // 2-A: wrap your app with OKToast - textStyle: - const TextStyle(fontSize: 19.0, color: Colors.white), - backgroundColor: Colors.grey, - animationCurve: Curves.easeIn, + // 2-A: wrap your app with OKToast + textStyle: const TextStyle(fontSize: 19.0, color: Colors.white), + backgroundColor: Colors.grey, + animationCurve: Curves.easeIn, - // animationBuilder: const Miui10AnimBuilder(), - animationDuration: const Duration(milliseconds: 200), - duration: const Duration(seconds: 2), - child: GetMaterialApp( - title: '微乐园', - initialBinding: SplashBinding(), - getPages: AppPages.routes, - /// 国际化处理 - localizationsDelegates: const [ - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, /// iOS一定要设置,不然报错 - ], - locale: const Locale('zh', 'CN'), - supportedLocales : const [ - Locale('zh', 'CN'), - ], - home: SplashPage(), - navigatorObservers: [routeObserver], - builder: FlutterSmartDialog.init(), - debugShowCheckedModeBanner: false, - ))); + // animationBuilder: const Miui10AnimBuilder(), + animationDuration: const Duration(milliseconds: 200), + duration: const Duration(seconds: 2), + child: GetMaterialApp( + title: '微乐园', + initialBinding: SplashBinding(), + getPages: AppPages.routes, + + /// 国际化处理 + localizationsDelegates: const [ + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + + /// iOS一定要设置,不然报错 + ], + locale: const Locale('zh', 'CN'), + supportedLocales: const [ + Locale('zh', 'CN'), + ], + home: SplashPage(), + navigatorObservers: [routeObserver], + builder: (BuildContext context, Widget? child) { + return MediaQuery( + ///设置文字大小不随系统设置改变 + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), + child:FlutterSmartDialog( + child: child, + )); + }, + debugShowCheckedModeBanner: false, + ), + )); }); } diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index e8c0a2d..aa1621d 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -85,6 +85,8 @@ class Api { //发视频图片消息增加计数 static const getAddTrialCount = 'mall-service/vips/trialCount/'; + //访客信息匹配 + static const getVisitorTotal = '/user-service/visit/getVisitorTotal'; //个人信息 static const getUserInfo = 'user-service/my/home'; @@ -141,14 +143,21 @@ class Api { //关注列表 static const followList = 'user-service/follow/users'; + //互相喜欢 + static const mutualUsers = '/user-service/mutual/users'; //被关注列表 static const fansList = 'user-service/fans/users'; + //喜欢列表统计 + static const getFollowTotal = '/user-service/getFollowTotal/'; //被关注列表 static const visitList = 'user-service/visit/users'; + //召唤喜欢 + static const callMyFollow = '/user-service/callMyFollow'; + //举报 static const postReport = 'up-service/report'; @@ -281,6 +290,9 @@ class Api { static const sendGift = '/mall-service/gift/sendGift'; + //新人欢迎 + static const sayHelloV2 = '/user-service/newUser/sayHelloV2/'; + //礼物列表 static const giftList = '/mall-service/gift/giftMall'; @@ -387,4 +399,11 @@ class Api { //打招呼 static const sayHello = '/user-service/newUser/sayHello/'; + + //访问多次且未关注的用户列表 + static const interestedInMeUsers = '/user-service/visit/allInterestedInMeUsers'; + + + //批量关注用户 + static const allUserFollow = '/user-service/follow/users'; } \ No newline at end of file diff --git a/circle_app/lib/util/eventBus.dart b/circle_app/lib/util/eventBus.dart index e56cbea..2e86ef8 100644 --- a/circle_app/lib/util/eventBus.dart +++ b/circle_app/lib/util/eventBus.dart @@ -45,6 +45,11 @@ V2TimValueCallback? createCustomMessageRes = null; SendCoustomMessage(this.createCustomMessageRes); } +class ChatRefreshMsg { + +} + + class CommentBlackEvent { String userId = ""; bool isBlack = false; diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index add47b9..97b52ca 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -330,6 +330,32 @@ class CustomLoadFooter extends StatelessWidget { } } +class DiyLoadFooter extends StatefulWidget { + String noDataText; + + DiyLoadFooter({super.key,required this.noDataText}); + + + @override + State createState() => _DiyLoadFooterState(); +} + +class _DiyLoadFooterState extends State { + + + @override + Widget build(BuildContext context) { + return ClassicFooter( + // 自定义加载更多时的文字 + canLoadingText: "松手开始加载数据", + loadingText: "正在加载...", + idleText: "上拉加载更多", + noDataText: widget.noDataText, + failedText: "加载失败", + ); + } +} + class CustomLikeLoadFooter extends StatelessWidget { @override @@ -677,20 +703,21 @@ sendCustomMsg(String userId, String data, String desc) async { if (createCustomMessageRes.code == 0) { String? id = createCustomMessageRes.data?.id; // 发送自定义消息 - if (Get.currentRoute == AppRoutes.Chat) { - EventBusManager.fire(SendCoustomMessage(createCustomMessageRes)); - } else { + // if (Get.currentRoute == AppRoutes.Chat) { + // EventBusManager.fire(SendCoustomMessage(createCustomMessageRes)); + // } else { V2TimValueCallback sendMessageRes = await TencentImSDKPlugin .v2TIMManager .getMessageManager() .sendMessage(id: id!, receiver: userId, groupID: ''); if (sendMessageRes.code == 0) { // 发送成功 + EventBusManager.fire(ChatRefreshMsg()); sendMessageRes.data?.customElem?.data; //自定义data sendMessageRes.data?.customElem?.desc; //自定义desc sendMessageRes.data?.customElem?.extension; //自定义extension } - } + // } } } diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index a84af43..3da8b9a 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -111,7 +111,7 @@ dependencies: svgaplayer_flutter: ^2.2.0 #边框渐变 gradient_borders: ^1.0.0 - #系统设置 + #系统设置 安卓4.3.1 苹果4.0.4 app_settings: 4.3.1 #百度定位插件 flutter_bmflocation: ^3.6.0