From 01856e42ce8a622715f874208baaf88b3978b25b Mon Sep 17 00:00:00 2001 From: CYH <13923927013@163.com> Date: Sat, 24 May 2025 22:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circle_app/android/app/build.gradle | 4 +- .../lib/circle_app/call_out_detail/view.dart | 33 +- circle_app/lib/circle_app/circle/logic.dart | 38 +- circle_app/lib/circle_app/circle/view.dart | 294 +++++- .../circle/widgets/info_list_view.dart | 186 +++- .../circle_app/circle/widgets/like_view.dart | 32 +- .../circle_app/circle/widgets/new_people.dart | 19 +- .../lib/circle_app/circle_list/logic.dart | 14 +- .../circle_list/widgets/all_circle_item.dart | 48 +- .../widgets/right_circle_iten.dart | 34 +- .../lib/circle_app/dialog/UpdateDialog.dart | 4 +- .../circle_app/dialog/YesAgreementDialog.dart | 4 +- .../lib/circle_app/login/login/logic.dart | 23 +- .../lib/circle_app/login/login/view.dart | 333 +++++-- .../lib/circle_app/minefragment/logic.dart | 38 +- .../lib/circle_app/minefragment/view.dart | 927 ++++++++++-------- circle_app/lib/circle_app/userinfo/logic.dart | 14 +- circle_app/lib/circle_app/userinfo/view.dart | 2 +- .../lib/commons/widgets/lucky_bag_dialog.dart | 3 + circle_app/lib/main.dart | 3 +- circle_app/lib/net/api.dart | 10 +- .../lib/utils/SharedPreferencesHelper.dart | 2 +- 22 files changed, 1389 insertions(+), 676 deletions(-) diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index af1bd08..385aa9f 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 115 - versionName "2.6.5" + versionCode 117 + versionName "2.6.7" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/lib/circle_app/call_out_detail/view.dart b/circle_app/lib/circle_app/call_out_detail/view.dart index b011345..1f8a953 100644 --- a/circle_app/lib/circle_app/call_out_detail/view.dart +++ b/circle_app/lib/circle_app/call_out_detail/view.dart @@ -571,27 +571,20 @@ class _Call_out_detailPageState extends State { await Future.delayed(Duration(seconds: 1)); - SharedPreferences sharedPreferences = - await SharedPreferences.getInstance(); + getCallOutDetail(bean.id!, bean); + } + } - int userId = - sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0; - String avatar = - sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? ""; - String name = - sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? ""; - - bool isContain = false; - for (var info in bean.chat!.users!) { - if (info.id == userId) { - isContain = true; - } - } - if (!isContain) { - bean.chat!.users! - .add(Users(avatar: avatar, id: userId, nickname: name)); - bean.chat!.count = bean.chat!.count! + 1; - // widget.logic.update(); + void getCallOutDetail(id, bean) async { + var data = await DioManager.instance + .get(url: Api.signInterestCalloutDetail, params: { + 'calloutId': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + logic.lists = bean; + if (mounted) { + setState(() {}); } } } diff --git a/circle_app/lib/circle_app/circle/logic.dart b/circle_app/lib/circle_app/circle/logic.dart index 4b6833e..902a706 100644 --- a/circle_app/lib/circle_app/circle/logic.dart +++ b/circle_app/lib/circle_app/circle/logic.dart @@ -82,6 +82,12 @@ final ScrollController nearScrollController = ScrollController(); int flush = 0; bool isMore = true; + + + bool getNewUserIsShowData = false; + + bool isShowNewUser = true; + int myVip = -1; bool isShowCircle = true; bool _isLocationGranted = false; @@ -153,6 +159,7 @@ final ScrollController nearScrollController = ScrollController(); @override void onInit() async { super.onInit(); + await loadNewUserIsShowData(); loadCircleListData(); loadCirclePeopleData(); await initGerder(); @@ -188,6 +195,16 @@ final ScrollController nearScrollController = ScrollController(); getCityList(); } + loadNewUserIsShowData() async { + var data = await DioManager.instance.get(url: Api.newUserIsShow); + getNewUserIsShowData = true; + if (data['code'] == 200) { + isShowNewUser = data['data'] == 1; + } else { + + } + } + void loadNewUserRewardData() async { var data = await DioManager.instance.get(url: Api.newUserConfig); if (data['code'] == 200) { @@ -946,16 +963,25 @@ final ScrollController nearScrollController = ScrollController(); WelcomeDialog( userId: id.toString(), callBack: () { - newPeopleList.removeAt(index); + newPeopleList[index]['interactionType'] = 2; update(); - if (newPeopleList.length < 5) { - onLoading(); - } }), isScrollControlled: true, ); } + void getGuideUser(String id, int index) async { + var data = await DioManager.instance.post( + url: Api.guideNewUser + id, + ); + if (data['code'] == 200) { + showOKToast(data['msg']); + newPeopleList[index]['interactionType'] = 3; + update(); + } + } + + void snedHelloMoreData() async { var data = await DioManager.instance.post( url: Api.sayHelloMore, @@ -1059,6 +1085,7 @@ class VicinityItemBean { final int gender; final int role; final int orientation; + final int interactionType; final double lng; final double lat; final String city; @@ -1103,6 +1130,7 @@ class VicinityItemBean { required this.lastRewardInterest, required this.lastInterestWelfare, required this.lastJoinInterest, + required this.interactionType, required this.hasContact, required this.lastRankTopDesc, required this.lastUserRelation, @@ -1161,7 +1189,7 @@ class VicinityItemBean { lastJoinInterest: json['lastJoinInterest'] ?? {}, lastRankTopDesc: json['lastRankTopDesc'] ?? '', lastUserRelation: json['lastUserRelation'].toString() ?? '', - + interactionType: json['interactionType'], imId: json['imId'] ?? '', avatar: json['avatar'], isFollow: json['isFollow'] ?? false, diff --git a/circle_app/lib/circle_app/circle/view.dart b/circle_app/lib/circle_app/circle/view.dart index 80b215d..de72df8 100644 --- a/circle_app/lib/circle_app/circle/view.dart +++ b/circle_app/lib/circle_app/circle/view.dart @@ -39,7 +39,6 @@ class CirclePage extends StatefulWidget { class _CirclePageState extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { late TabController _tabController; - late PageController _pageController; // int currentIndex = 0; @@ -49,6 +48,8 @@ class _CirclePageState extends State final homelogic = Get.find(); var getContext; + bool isLoadTab = false; + // 是否需要缓存 @override bool get wantKeepAlive => true; @@ -59,21 +60,37 @@ class _CirclePageState extends State super.initState(); sub = EventBusManager.on().listen((event) { - logic.currentIndex = event.index; - _tabController.index = logic.currentIndex; - addUmengPage('${titleList[logic.currentIndex]}'); + if (logic.isShowNewUser) { + logic.currentIndex = event.index; + _tabController.index = logic.currentIndex; + addUmengPage('${titleList[logic.currentIndex]}'); + } else { + if (event.index >= 1) { + logic.currentIndex = event.index - 1; + _tabController.index = logic.currentIndex; + addUmengPage('${titleList[logic.currentIndex]}'); + } + } setState(() {}); }); - logic.currentIndex = 1; - addUmengPage('${titleList[logic.currentIndex]}'); - _pageController = PageController(initialPage: logic.currentIndex); - _tabController = - TabController(length: 3, vsync: this, initialIndex: logic.currentIndex); - _tabController.addListener(_handleTabChange); + getContext = context; } + initTabData() { + logic.currentIndex = 1; + if (!logic.isShowNewUser) { + titleList.removeAt(0); + logic.currentIndex = 0; + } + isLoadTab = true; + addUmengPage('${titleList[logic.currentIndex]}'); + _tabController = + TabController(length: logic.isShowNewUser ? 3 : 2, vsync: this, initialIndex: logic.currentIndex); + _tabController.addListener(_handleTabChange); + } + void _handleTabChange() { // 在这里可以执行滑动监听后的逻辑操作 // 比如根据当前选中的标签执行其他操作 @@ -91,10 +108,10 @@ class _CirclePageState extends State sub.cancel(); _tabController.removeListener(_handleTabChange); // 移除监听 _tabController.dispose(); - _pageController.dispose(); super.dispose(); } + @override Widget build(BuildContext context) { super.build(context); @@ -103,9 +120,12 @@ class _CirclePageState extends State if (logic.currentIndex == 0) { logic.isNewPeopleRed = false; } + if (logic.getNewUserIsShowData && !isLoadTab) { + initTabData(); + } return Scaffold( backgroundColor: Colors.transparent, - body: Stack( + body:logic.getNewUserIsShowData ? Stack( fit: StackFit.expand, children: [ SafeArea( @@ -120,10 +140,10 @@ class _CirclePageState extends State margin: EdgeInsets.only(top: 45.sp), child: TabBarView( controller: _tabController, - children: [NewPeople(logic:controller), Vicinity(controller), Discover(0)], + children: logic.isShowNewUser ? [NewPeople(logic:controller), Vicinity(controller), Discover(0)] : [Vicinity(controller), Discover(0)], ), ), - if (logic.callList.isNotEmpty && _tabController.index == 1) + if (logic.callList.isNotEmpty) Positioned( left: 10.sp, bottom: 10.sp, @@ -254,9 +274,8 @@ class _CirclePageState extends State ), ), )), - ], - ), + ) : loaddingWidget(true), ); }); } @@ -717,7 +736,7 @@ class _CirclePageState extends State width: Get.width, padding: EdgeInsets.only(left: 10.sp, right: 10.sp), height: 44.sp, - child: Stack( + child: logic.isShowNewUser ? Stack( alignment: Alignment.center, children: [ _tabController.index == 0 @@ -1017,21 +1036,214 @@ class _CirclePageState extends State ], )), ], + ) : Stack( + alignment: Alignment.center, + children: [ + _tabController.index == 0 + ? Positioned( + left: 0, + child: GestureDetector( + onTap: () { + showCityPiker(context); + }, + child: Row( + children: [ + Image.asset( + getCircleImage('icon_city'), + width: 24.sp, + ), + Container( + width: 80.sp, + margin: EdgeInsets.only(left: 4.sp, top: 4.sp), + child: Text( + modifyCityName(logic.cityName), + style: TextStyle( + color: Colors.white, fontSize: 16.sp), + )) + ], + ), + )) + : Positioned( + left: 0, + child: GestureDetector( + onTap: () { + Get.toNamed(Routes.DisCover); + }, + child: Container( + // width: 70.sp, + padding: EdgeInsets.only( + left: 6.sp, + right: 6.sp, + top: 4.sp, + bottom: 4.sp), + // height: 26.sp, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(13.sp)), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + getCircleImage('lock_icon'), + height: 18.sp, + ), + SizedBox( + width: 2.sp, + ), + Text( + '已解锁', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 13.sp, + fontWeight: FontWeight.w500), + ) + ], + ), + ))), + Container( + alignment: Alignment.center, + height: 27.sp, + child: Stack( + alignment: Alignment.center, + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + labelPadding: EdgeInsets.symmetric(horizontal: 12.0.sp), + indicator: UnderlineTabIndicator( + borderSide: BorderSide( + color: const Color(0xFF00FFF4), + ), + ), + indicatorColor: const Color(0xFF00FFF4), + indicatorWeight: 2.sp, + labelColor: const Color(0xFF00FFF4), + unselectedLabelColor: const Color(0xB3FFFFFF), + indicatorSize: TabBarIndicatorSize.label, + indicatorPadding: EdgeInsets.only(left: 12.sp, right: 12.sp), + tabs: [ + Tab( + child: Text( + '附近', + style: TextStyle( + fontSize: 18.sp, + ), + ), + ), + Tab( + child: Text( + '精选', + style: TextStyle( + fontSize: 18.sp, + ), + ), + ), + ], + labelStyle: TextStyle( + color: const Color(0xFF00FFF4), + fontSize: 18.sp, + shadows: [ + Shadow( + color: const Color(0xFFF657FF).withOpacity(0.5), + offset: Offset(0, -2), // 阴影偏移 + blurRadius: 3, // 阴影模糊半径 + // spreadRadius: 0 + ), + ], + ), + unselectedLabelStyle: TextStyle( + // color: const Color(0xB3FFFFFF), + fontSize: 18.sp, + shadows: [ + Shadow( + // color: const Color(0xFFF657FF), + offset: const Offset(0, -1), + blurRadius: 3.0.sp, + ), + ], + ), + onTap: (index) { + if (logic.currentIndex == index) { + if (index == 2) { + EventBusManager.fire(DiscovrScrollTap()); + } else if (index == 1) { + EventBusManager.fire(NearScrollTap()); + } else if (index == 0) { + EventBusManager.fire(ScrollToTop()); + } + return; + } + logic.currentIndex = index; + // _pageController.animateToPage( + // index, // 目标页面索引 + // duration: const Duration(milliseconds: 300), // 动画时长 + // curve: Curves.ease, // 动画曲线 + // ); + }, + ), + 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, + ), + )) + ], + ), + ), + Positioned( + right: 0, + child: Row( + children: [ + InkWell( + onTap: () async { + if (_tabController.index == 1) { + Get.bottomSheet( + TodayPeopleDialog(isShow: true,source:'fate_match'), + isScrollControlled: true, + enableDrag: false, + ); + } else { + Get.toNamed(Routes.Search); + } + }, + child: Image.asset( + _tabController.index == 1 + ? getMsgImage('heart_icon') + : getHomeImage('icon_search'), + width: _tabController.index == 2 ? 24.sp : 30.sp, + ), + ), + SizedBox( + width: 8.sp, + ), + GestureDetector( + onTap: () { + _showBottomSheet(context); + }, + child: Image.asset( + getCircleImage('icon_screen'), + width: 30.sp, + ), + ), + ], + )), + ], ), ); } void _showBottomSheet(BuildContext context) { - if (_tabController.index == 1) { - addUmengTag('点击附近筛选'); - } else { - addUmengTag('点击精选筛选'); - } showModalBottomSheet( context: context, backgroundColor: Colors.transparent, builder: (BuildContext context) { - return ScreenBottomSheetDialog( + return logic.isShowNewUser ? ScreenBottomSheetDialog( genderList: _tabController.index == 1 ? logic.genderList : _tabController.index == 0 @@ -1086,6 +1298,42 @@ class _CirclePageState extends State if (element.isSelect) orientations.add(element.id); }); + EventBusManager.fire( + OptionFindclass(genders, roles, orientations)); + } + }, + ) : ScreenBottomSheetDialog( + genderList: _tabController.index == 0 + ? logic.genderList + : logic.dis_genderList, + orientationList: _tabController.index == 0 + ? logic.orientationList + : logic.dis_orientationList, + roleList: _tabController.index == 0 + ? logic.roleList + : logic.dis_roleList, + isHaveCity: _tabController.index == 1, + callback: (genderList, orientationList, roleList, status) { + if (_tabController.index == 0) { + EventBusManager.fire(NearScrollTap()); + logic.refreshController.requestRefresh(); + } else { + List genders = []; + logic.dis_genderList.forEach((element) { + if (element.isSelect) { + genders.add(element.id); + } + }); + List roles = []; + logic.dis_orientationList.forEach((element) { + if (element.isSelect) roles.add(element.id); + }); + + List orientations = []; + logic.dis_roleList.forEach((element) { + if (element.isSelect) orientations.add(element.id); + }); + EventBusManager.fire( OptionFindclass(genders, roles, orientations)); } 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 5c7e713..b6b9caf 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 @@ -326,22 +326,21 @@ class InfoListViewState extends State with AutomaticKeepAliveClien await Future.delayed(Duration(seconds: 1)); - SharedPreferences sharedPreferences =await SharedPreferences.getInstance(); - // SharedPreferencesHelper.getInstance().then((sharedPreferences) { - int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0; - String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??""; - String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??""; + getCallOutDetail(bean.id!, bean); + } + } - bool isContain = false; - for (var info in bean.chat!.users!) { - if (info.id == userId) { - isContain = true; - } - } - if (!isContain) { - bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name)); - bean.chat!.count = bean.chat!.count! + 1; - widget.logic.update(); + void getCallOutDetail(id, bean) async { + var data = await DioManager.instance + .get(url: Api.signInterestCalloutDetail, params: { + 'calloutId': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + int index = lists.indexOf(bean); + lists[index] = bean; + if (mounted) { + setState(() {}); } } } @@ -800,7 +799,9 @@ class InfoListViewState extends State with AutomaticKeepAliveClien widget.logic.getWelfareDetailData( data['id'].toString(),index); } else { - showOKToast('申请加入圈子才能领取圈内福袋~'); + _showReportDialog(context,data['id'].toString(),index); + // showOKToast('申请加入圈子才能领取圈内福袋~'); + } @@ -2336,6 +2337,159 @@ class InfoListViewState extends State with AutomaticKeepAliveClien } } + void _showReportDialog(BuildContext context, String id,index) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.all(1.sp), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.sp), + child: Column( + children: [ + Center( + child: Text( + "温馨提示", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + child: Image( + image: AssetImage(getBaseImage('fu_icon')), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "在圈子里发的福袋需要申请加入对应圈子才能领取哦,你先加入圈子然后领取福袋呗~", + textAlign: TextAlign.center, + style: TextStyle( + color: const Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Padding( + + padding: EdgeInsets.only(top:15.sp,bottom: 10.0.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + 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), + alignment: Alignment.center, + width: 110.sp, + child: const Text( + "放弃领取", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 60.sp), + GestureDetector( + onTap: () async { + Get.back(); + await widget.logic.outCircle( + widget.bean.id.toString(), + widget.bean.isJoin); + widget.logic.getWelfareDetailData( + id,index); + // logic.setBlock("1"); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp), + alignment: Alignment.center, + width: 110.sp, + child: const Text( + "加入圈子再领福袋", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ), + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } + double contentHeight(String content) { return calculateTextHeight( content, 17.sp, FontWeight.w300, Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100); 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 00ca414..34e69d8 100644 --- a/circle_app/lib/circle_app/circle/widgets/like_view.dart +++ b/circle_app/lib/circle_app/circle/widgets/like_view.dart @@ -418,26 +418,20 @@ class _LikeViewState extends State data['data']['account_id'], bean.user!.nickname!); await Future.delayed(Duration(seconds: 1)); - SharedPreferences sharedPreferences = - await SharedPreferences.getInstance(); - // SharedPreferencesHelper.getInstance().then((sharedPreferences) { - int userId = - sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0; - String avatar = - sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? ""; - String name = - sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? ""; + getCallOutDetail(bean.id!, bean); + } + } - bool isContain = false; - for (var info in bean.chat!.users!) { - if (info.id == userId) { - isContain = true; - } - } - if (!isContain) { - bean.chat!.users! - .add(Users(avatar: avatar, id: userId, nickname: name)); - bean.chat!.count = bean.chat!.count + 1; + void getCallOutDetail(id, bean) async { + var data = await DioManager.instance + .get(url: Api.signInterestCalloutDetail, params: { + 'calloutId': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + int index = lists.indexOf(bean); + lists[index] = bean; + if (mounted) { setState(() {}); } } diff --git a/circle_app/lib/circle_app/circle/widgets/new_people.dart b/circle_app/lib/circle_app/circle/widgets/new_people.dart index 76cc77f..d625349 100644 --- a/circle_app/lib/circle_app/circle/widgets/new_people.dart +++ b/circle_app/lib/circle_app/circle/widgets/new_people.dart @@ -33,6 +33,9 @@ class _NewPeopleState extends State { double maxOff = 0; @override bool get wantKeepAlive => true; + + + @override void initState() { // TODO: implement initState @@ -117,7 +120,7 @@ class _NewPeopleItemState extends State { Widget build(BuildContext context) { return ListItem(VicinityItemBean.fromJson(widget.info), widget.index); } - + List actionList = ['','欢迎新人','👉指引新人','💬和TA聊聊']; Widget ListItem(VicinityItemBean item, int index) { return Column( children: [ @@ -204,7 +207,7 @@ class _NewPeopleItemState extends State { ), GestureDetector( onTap: () { - showOKToast('点击“👏欢迎”,对方回复您后就可以在消息列表进行聊天互动啦~'); + showOKToast('点击右上角可以和新人互动哦~'); // Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); }, child: Container( @@ -340,7 +343,13 @@ class _NewPeopleItemState extends State { Expanded(child: Container()), InkWell( onTap: () { - logic.snedHelloData(item.id, index); + if (item.interactionType == 1) { + logic.snedHelloData(item.id, index); + } else if (item.interactionType == 2) { + logic.getGuideUser(item.id.toString(), index); + } else { + pushChatPage(item.id.toString(), item.imId, item.nickname); + } }, child: Container( padding: EdgeInsets.only( @@ -349,15 +358,17 @@ class _NewPeopleItemState extends State { height: 26.sp, child: Row( children: [ + if (item.interactionType == 1) Image.asset( getCircleImage('hello_icon'), width: 24.sp, ), + if (item.interactionType == 1) SizedBox( width: 2.sp, ), Text( - '欢迎新人', + actionList[item.interactionType], style: TextStyle( color: Colors.white, fontSize: 14.sp), diff --git a/circle_app/lib/circle_app/circle_list/logic.dart b/circle_app/lib/circle_app/circle_list/logic.dart index 9e141aa..db23862 100644 --- a/circle_app/lib/circle_app/circle_list/logic.dart +++ b/circle_app/lib/circle_app/circle_list/logic.dart @@ -194,10 +194,18 @@ class LikeLogic extends GetxController { if (page == 1) { circle = bean.data!; } else { - circle.lists.addAll(bean.data!.lists); + for (var model in bean.data!.lists) { + bool isContain = false; + for (var info in circle.lists) { + if (model.id == info.id) { + isContain = true; + } + } + if (!isContain) { + circle.lists.add(model); + } + } } - - if (bean.data!.lists.length == 0) { isMore = false; } 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 a4b5887..07caa1e 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 @@ -266,27 +266,21 @@ class _AllCircleItemState extends State await Future.delayed(Duration(seconds: 1)); - SharedPreferences sharedPreferences = - await SharedPreferences.getInstance(); + getCallOutDetail(bean.id!, bean); + } + } - int userId = - sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0; - String avatar = - sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? ""; - String name = - sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? ""; - - bool isContain = false; - for (var info in bean.chat!.users!) { - if (info.id == userId) { - isContain = true; - } - } - if (!isContain) { - bean.chat!.users! - .add(Users(avatar: avatar, id: userId, nickname: name)); - bean.chat!.count = bean.chat!.count! + 1; - // widget.logic.update(); + void getCallOutDetail(id, bean) async { + var data = await DioManager.instance + .get(url: Api.signInterestCalloutDetail, params: { + 'calloutId': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + int index = lists.indexOf(bean); + lists[index] = bean; + if (mounted) { + setState(() {}); } } } @@ -1095,11 +1089,8 @@ class _AllCircleItemState extends State children: [ InkWell( onTap: () { - Get.bottomSheet( - CallOutShareDialog('','',lists), isScrollControlled: true, - enableDrag: false - ); - + Get.bottomSheet(CallOutShareDialog('', '', lists), + isScrollControlled: true, enableDrag: false); }, child: Container( margin: EdgeInsets.only(right: 5.sp), @@ -1592,11 +1583,8 @@ class _AllCircleItemState extends State children: [ InkWell( onTap: () { - Get.bottomSheet( - CallOutShareDialog('','',lists), isScrollControlled: true, - enableDrag: false - ); - + Get.bottomSheet(CallOutShareDialog('', '', lists), + isScrollControlled: true, enableDrag: false); }, child: Container( margin: EdgeInsets.only(right: 5.sp), 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 b5dfaed..97c7a38 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 @@ -1767,27 +1767,21 @@ class _RightCircleListWidgetState extends State await Future.delayed(Duration(seconds: 1)); - SharedPreferences sharedPreferences = - await SharedPreferences.getInstance(); - // SharedPreferencesHelper.getInstance().then((sharedPreferences) { - int userId = - sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0; - String avatar = - sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? ""; - String name = - sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? ""; + getCallOutDetail(bean.id!, bean); + } + } - bool isContain = false; - for (var info in bean.chat!.users!) { - if (info.id == userId) { - isContain = true; - } - } - if (!isContain) { - bean.chat!.users! - .add(Users(avatar: avatar, id: userId, nickname: name)); - bean.chat!.count = bean.chat!.count! + 1; - widget.logic.update(); + void getCallOutDetail(id, bean) async { + var data = await DioManager.instance + .get(url: Api.signInterestCalloutDetail, params: { + 'calloutId': id, + }); + if (data['code'] == 200) { + Lists bean = Lists.fromJson(data['data']); + int index = lists.indexOf(bean); + lists[index] = bean; + if (mounted) { + setState(() {}); } } } diff --git a/circle_app/lib/circle_app/dialog/UpdateDialog.dart b/circle_app/lib/circle_app/dialog/UpdateDialog.dart index 047b4e9..790bcc3 100644 --- a/circle_app/lib/circle_app/dialog/UpdateDialog.dart +++ b/circle_app/lib/circle_app/dialog/UpdateDialog.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -// import 'package:flutter_install_app/flutter_install_app.dart'; +import 'package:flutter_install_app/flutter_install_app.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -301,7 +301,7 @@ class _CustomDialogState extends State { installApk() async { //flutter_install_app - // await AppInstaller.installApk(filePath, actionRequired: false); + await AppInstaller.installApk(filePath, actionRequired: false); } } diff --git a/circle_app/lib/circle_app/dialog/YesAgreementDialog.dart b/circle_app/lib/circle_app/dialog/YesAgreementDialog.dart index 58248b7..a4e912a 100644 --- a/circle_app/lib/circle_app/dialog/YesAgreementDialog.dart +++ b/circle_app/lib/circle_app/dialog/YesAgreementDialog.dart @@ -2,6 +2,7 @@ import 'dart:ffi'; import 'dart:io'; import 'package:circle_app/commons/colors/app_color.dart'; +import 'package:circle_app/router/routers.dart'; import 'package:connectivity/connectivity.dart'; import 'package:device_info/device_info.dart'; import 'package:flutter/cupertino.dart'; @@ -11,6 +12,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_bugly/flutter_bugly.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:get/get.dart'; import '../../main.dart'; import '../../utils/SharedPreferencesHelper.dart'; import '../../utils/device.dart'; @@ -131,7 +133,7 @@ class _CustomDialogState extends State { var sp = await SharedPreferencesHelper.getInstance(); sp.setBool(SharedPreferencesHelper.AGREEMENT, true); } catch (e) {} - pushLoginPage(); + Get.offAllNamed(Routes.Login); FlutterBugly.init( androidAppId: "8509314e11", ); diff --git a/circle_app/lib/circle_app/login/login/logic.dart b/circle_app/lib/circle_app/login/login/logic.dart index 6199b7e..982d478 100644 --- a/circle_app/lib/circle_app/login/login/logic.dart +++ b/circle_app/lib/circle_app/login/login/logic.dart @@ -35,6 +35,11 @@ class LoginLogic extends GetxController { bool isLogining = false; String loginPhone = ''; + + bool showOthner = false; + + String isAuto = ''; + @override void onReady() { // TODO: implement onReady @@ -47,9 +52,9 @@ class LoginLogic extends GetxController { // TODO: implement onInit super.onInit(); - // if (!kDebugMode) { - // checkNetworkUrl(); - // } + if (!kDebugMode) { + checkNetworkUrl(); + } SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); loginPhone = await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ?? @@ -70,8 +75,18 @@ class LoginLogic extends GetxController { pwd.isNotEmpty) { loginType = 1; pwdEditingController.text = pwd; + showOthner = true; } - isInitSuccess(isAuto:true); + isAuto = sharedPreferences!.getString(SharedPreferencesHelper.firstLogin) ?? ''; + if (isAuto.isEmpty && phoneEditingController.text.isEmpty) { + isInitSuccess(isAuto:true); + sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1'); + } else { + isInitSuccess(isAuto:false); + loginType = 1; + showOthner = true; + } + update(); } diff --git a/circle_app/lib/circle_app/login/login/view.dart b/circle_app/lib/circle_app/login/login/view.dart index c4b94fb..58975b0 100644 --- a/circle_app/lib/circle_app/login/login/view.dart +++ b/circle_app/lib/circle_app/login/login/view.dart @@ -57,8 +57,7 @@ class LoginPage extends StatelessWidget { // mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only( - top:270.sp), + margin: EdgeInsets.only(top: 270.sp), child: Stack( alignment: Alignment.center, children: [ @@ -95,11 +94,17 @@ class LoginPage extends StatelessWidget { if (GetUtils.isPhoneNumber(msg) && msg.length == 11) { logic.isPhone = true; - sendOpenSourceData('input_mobile',params: jsonEncode({'phone':logic.phoneEditingController.text})); - FocusManager.instance.primaryFocus?.unfocus(); - } else { - - } + sendOpenSourceData( + 'input_mobile', + params: jsonEncode({ + 'phone': logic + .phoneEditingController + .text + })); + FocusManager + .instance.primaryFocus + ?.unfocus(); + } else {} logic.update(); }, controller: @@ -165,9 +170,17 @@ class LoginPage extends StatelessWidget { keyboardType: TextInputType.phone, maxLength: 8, onChanged: (String text) { - sendOpenSourceData('input_mobile',params: jsonEncode({'input_captcha':logic.phoneEditingController.text})); + sendOpenSourceData( + 'input_mobile', + params: jsonEncode({ + 'input_captcha': logic + .phoneEditingController + .text + })); if (text.length >= 4) { - FocusManager.instance.primaryFocus?.unfocus(); + FocusManager + .instance.primaryFocus + ?.unfocus(); } }, style: TextStyle( @@ -189,9 +202,16 @@ class LoginPage extends StatelessWidget { right: 0, child: GestureDetector( onTap: () { - if (logic.phoneEditingController.text.length == 11) { + if (logic + .phoneEditingController + .text + .length == + 11) { logic.starDownTimer(); - } else if (logic.phoneEditingController.text.isEmail) { + } else if (logic + .phoneEditingController + .text + .isEmail) { logic.starDownTimer(); } else { showOKToast('请输入正确的手机号/邮箱'); @@ -317,31 +337,47 @@ class LoginPage extends StatelessWidget { ], ), ), + if (logic.showOthner) + Container( + width: 280.sp, + margin: + EdgeInsets.only(top: 15.sp, right: 0.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container(), + InkWell( + onTap: () { + logic.showOthner = false; + // logic.loginType = logic.loginType == 0 ? 1 : 0; + logic.update(); + }, + child: Text( + '其他方式登录', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp), + ), + ), + ], + ), + ), + if (!logic.showOthner) Container( width: 280.sp, margin: EdgeInsets.only(top: 15.sp, right: 0.sp), - child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - InkWell( - onTap: () { - if (logic.loginPhone.isNotEmpty) return; - Get.toNamed(Routes.VisitorsPreview); - }, - child: Text( - '游客预览', - style: TextStyle( - color: logic.loginPhone.isNotEmpty ? Colors.transparent : Colors.white, fontSize: 14.sp), - ), - ), + Container(), InkWell( onTap: () { logic.loginType = logic.loginType == 0 ? 1 : 0; logic.update(); }, child: Text( - logic.loginType == 1 ? '验证码登录' : '密码登录', + logic.loginType == 1 ? '切换验证码登录' : '切换密码登录', style: TextStyle( color: Colors.white, fontSize: 14.sp), ), @@ -359,23 +395,30 @@ class LoginPage extends StatelessWidget { Container( width: 280.sp, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: !logic.showOthner + ? MainAxisAlignment.spaceBetween + : MainAxisAlignment.center, children: [ GestureDetector( onTap: () { if (!logic.check) { - Get.bottomSheet(privacyDialog(),isScrollControlled:true); + Get.bottomSheet(privacyDialog(), + isScrollControlled: true); } else { + if (logic.loginType == 0) { + showOKToast('请先切换密码登录'); + return; + } logic.login(); } - }, child: Container( - width: 120.sp, - height: 50.sp, + width: !logic.showOthner ? 85.sp : 120.sp, + height: 40.sp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25.sp), + borderRadius: + BorderRadius.circular(25.sp), gradient: const LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, @@ -384,7 +427,7 @@ class LoginPage extends StatelessWidget { Color(0xffD739EA) ])), child: Text( - logic.loginType == 0 ? '验证码登录' : '密码登录', + '密码登录', style: TextStyle( color: Colors.white, fontSize: 16.sp, @@ -392,39 +435,81 @@ class LoginPage extends StatelessWidget { ), ), ), - GestureDetector( - onTap: () { - logic.preLogin(); - - }, - child: Container( - width: 120.sp, - height: 50.sp, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25.sp), - gradient: const LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xff0AFCFF), - Color(0xffD739EA) - ])), - child: Text( - '一键登录', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w500), + if (!logic.showOthner) + GestureDetector( + onTap: () { + if (!logic.check) { + Get.bottomSheet(privacyDialog(), + isScrollControlled: true); + } else { + if (logic.loginType == 1) { + showOKToast('请先切换验证码登录'); + return; + } + logic.login(); + } + }, + child: Container( + width: 85.sp, + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(25.sp), + gradient: const LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xff0AFCFF), + Color(0xffD739EA) + ])), + child: Text( + '验证码登录', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), + ), + ), + if (!logic.showOthner) + GestureDetector( + onTap: () { + logic.preLogin(); + }, + child: Container( + width: 85.sp, + height: 40.sp, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(25.sp), + gradient: const LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xff0AFCFF), + Color(0xffD739EA) + ])), + child: Text( + '一键登录', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), ), ), - ), ], ), ), Container( margin: EdgeInsets.only(top: 15.sp), - child: Text('若验证码未收到请打开数据网络使用[一键登录]',style: TextStyle(color: Colors.white,fontSize: 14.sp),), + child: Text( + '若验证码未收到请打开数据网络使用[一键登录]', + style: TextStyle( + color: Colors.white, fontSize: 14.sp), + ), ) ], ), @@ -509,17 +594,49 @@ class LoginPage extends StatelessWidget { ), ), )), - Positioned(top: MediaQuery.of(context).padding.top + 15.sp,right: 15.sp,child: InkWell( - onTap: () { - Get.toNamed(Routes.HelpBack); - }, - child: Row( - children: [ - Icon(Icons.question_mark,color: AppColor.mainColor,size: 15.sp,), - Text('在线反馈',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),), - ], - ), - )), + Positioned( + top: MediaQuery.of(context).padding.top + 15.sp, + right: 15.sp, + left: 15.sp, + child: InkWell( + onTap: () { + Get.toNamed(Routes.HelpBack); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + if (logic.loginPhone.isNotEmpty) return; + Get.toNamed(Routes.VisitorsPreview); + }, + child: Text( + '👁游客预览', + style: TextStyle( + color: logic.isAuto.isNotEmpty + ? Colors.transparent + : Colors.white, + fontSize: 15.sp), + ), + ), + Row( + children: [ + Icon( + Icons.question_mark, + color: AppColor.mainColor, + size: 15.sp, + ), + Text( + '在线反馈', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 15.sp), + ), + ], + ), + ], + ), + )), ], ); })), @@ -536,52 +653,75 @@ class LoginPage extends StatelessWidget { child: Container( width: 250.sp, height: 140.sp, - padding: EdgeInsets.only(top:15.sp,left: 15.sp,right: 15.sp), + padding: EdgeInsets.only(top: 15.sp, left: 15.sp, right: 15.sp), decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(10.0), - gradient: const LinearGradient( - colors: [Color(0xFF4C3E5F), Color(0xFF324140)], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - ), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), // borderRadius: BorderRadius.circular(10.sp) ), child: Column( children: [ Container( - child: Text('用户协议和隐私政策',style: TextStyle(color: Colors.white,fontSize: 15.sp),), + child: Text( + '用户协议和隐私政策', + style: TextStyle(color: Colors.white, fontSize: 15.sp), + ), + ), + SizedBox( + height: 10.sp, ), - SizedBox(height: 10.sp,), Wrap( children: [ Container( - child: Text('我已阅读并同意',style: TextStyle(color: Colors.white.withOpacity(0.75),fontSize: 15.sp),), + child: Text( + '我已阅读并同意', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 15.sp), + ), ), InkWell( onTap: () { navigateToUserAgreement(); }, child: Container( - child: Text('《用户协议》',style: TextStyle(color:AppColor.mainColor,fontSize: 15.sp),), + child: Text( + '《用户协议》', + style: TextStyle( + color: AppColor.mainColor, fontSize: 15.sp), + ), ), ), - Container( - child: Text('和',style: TextStyle(color: Colors.white.withOpacity(0.75),fontSize: 15.sp),), + child: Text( + '和', + style: TextStyle( + color: Colors.white.withOpacity(0.75), + fontSize: 15.sp), + ), ), InkWell( onTap: () { navigateToPrivacyPolicy(); }, child: Container( - child: Text('《隐私协议》',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),), + child: Text( + '《隐私协议》', + style: TextStyle( + color: AppColor.mainColor, fontSize: 15.sp), + ), ), ), ], ), - - SizedBox(height: 10.sp,), + SizedBox( + height: 10.sp, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -590,16 +730,16 @@ class LoginPage extends StatelessWidget { Get.back(); }, child: Container( - width: 80.sp, height: 30.sp, alignment: Alignment.center, decoration: BoxDecoration( - color: Color(0x26FFFFFF), - borderRadius: BorderRadius.circular(15.sp) + color: Color(0x26FFFFFF), + borderRadius: BorderRadius.circular(15.sp)), + child: Text( + '不同意', + style: TextStyle(color: Colors.white, fontSize: 15.sp), ), - child: Text('不同意',style: TextStyle(color: Colors.white,fontSize: 15.sp),), - ), ), InkWell( @@ -614,11 +754,15 @@ class LoginPage extends StatelessWidget { height: 30.sp, alignment: Alignment.center, decoration: BoxDecoration( - gradient: AppColor.mainVerLinearGradient, - borderRadius: BorderRadius.circular(15.sp) + gradient: AppColor.mainVerLinearGradient, + borderRadius: BorderRadius.circular(15.sp)), + child: Text( + '同意', + style: TextStyle( + color: Colors.white, + fontSize: 15.sp, + fontWeight: FontWeight.w500), ), - child: Text('同意',style: TextStyle(color: Colors.white,fontSize: 15.sp,fontWeight: FontWeight.w500),), - ), ), ], @@ -636,5 +780,4 @@ class LoginPage extends StatelessWidget { "url": 'https://www.wjx.cn/vm/PEMJOvz.aspx#' }); } - } diff --git a/circle_app/lib/circle_app/minefragment/logic.dart b/circle_app/lib/circle_app/minefragment/logic.dart index 055781d..8d3bf51 100644 --- a/circle_app/lib/circle_app/minefragment/logic.dart +++ b/circle_app/lib/circle_app/minefragment/logic.dart @@ -10,6 +10,7 @@ import 'package:get/get.dart'; import 'package:image_picker/image_picker.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import '../../commons/Widgets/open_vip_tip/logic.dart'; import '../../commons/config.dart'; import '../../net/api.dart'; import '../../net/dio_manager.dart'; @@ -64,7 +65,7 @@ class MinefragmentLogic extends GetxController { bool isUpdateVersion = false; String enterHomeInfoMsg = "进入主页"; String joinedCircle = ""; - String vipMsg = "十几种特权等您领取"; + String vipMsg = "0.5元/天享受十几种专属特权"; String isLikeFoMsg = ''; bool isProxy = true; @@ -92,6 +93,10 @@ class MinefragmentLogic extends GetxController { Map masterInfo = {}; bool isHaveBady = false; + + var ticketCount = 0; + var beiCount = 0; + @override void onReady() { // TODO: implement onReady @@ -131,6 +136,8 @@ class MinefragmentLogic extends GetxController { loadBabyData(); } + + setSpServeTip() async { SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); sp.setBool(SharedPreferencesHelper.serveTip, false); @@ -141,12 +148,39 @@ class MinefragmentLogic extends GetxController { sp.setBool(SharedPreferencesHelper.mineOpTip, false); } + loadKingOrBaData() async { + var data = await DioManager.instance.get(url: Api.masterBabies); + if (data['code'] == 200) { + beiCount = data['count'] ?? 0; + update(); + } + } + + loadPriceData() async { + var data = await DioManager.instance.get(url: Api.getVipPrice, params: {}); + var vipPriceList = BaseResponse>.fromJson( + data, + (data) => + List.from(data.map((item) => PriceBean.fromJson(item))), + ); + var priceBean = vipPriceList.data; + + for (var value in priceBean) { + if (value.isYearVip) { + ticketCount = value.firstPresentBean ?? 0; + } + } + update(); + } + loadData() { getMode(); checkVersion(); loadMasterData(); loadBabyData(); + loadPriceData(); + loadKingOrBaData(); } void loadMasterData() async { @@ -297,7 +331,7 @@ class MinefragmentLogic extends GetxController { vipMsg = "会员时长剩余${bean.data.vipExpireDays}天"; } else if (bean.data.last_vip_expire_date != '') { vipMsg = - "会员已于${bean.data.last_vip_expire_date.toString().split(' ').first}到期"; + "${bean.data.last_vip_expire_date.toString().split(' ').first}到期,续费领福利"; } int likeMeCount = diff --git a/circle_app/lib/circle_app/minefragment/view.dart b/circle_app/lib/circle_app/minefragment/view.dart index c4c0d45..d9737da 100644 --- a/circle_app/lib/circle_app/minefragment/view.dart +++ b/circle_app/lib/circle_app/minefragment/view.dart @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:get/get.dart'; +import 'package:gradient_borders/box_borders/gradient_box_border.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../commons/Widgets/base_tip_widget.dart'; @@ -371,46 +372,53 @@ class _MinefragmentPageState extends State logic.update(); }), if (logic.isShowserveTip && homelogic.isProd) - Positioned( - child: InkWell( - onTap: () { - logic.isShowserveTip = false; - logic.setSpServeTip(); - logic.update(); - logic.isShowMoreTip = true; - logic.update(); - }, - 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( + child: InkWell( + onTap: () { + logic.isShowserveTip = false; + logic.setSpServeTip(); + logic.update(); + logic.isShowMoreTip = true; + logic.update(); + }, + 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, @@ -447,15 +455,12 @@ class _MinefragmentPageState extends State child: Text( '客服与反馈', style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.w600, - color: Colors.white, - shadows: [ - Shadow( - color: Colors.black, - offset: Offset(0.0, -1)) - ] - ), + fontSize: 14.sp, + fontWeight: FontWeight.w600, + color: Colors.white, + shadows: [ + Shadow(color: Colors.black, offset: Offset(0.0, -1)) + ]), )) ], ), @@ -464,49 +469,56 @@ class _MinefragmentPageState extends State if (logic.isShowMoreTip && homelogic.isProd) Positioned( child: InkWell( - onTap: () { - logic.isShowMoreTip = false; - logic.setSpMoreTip(); - logic.update(); - }, - child: Container( - width: Get.width, - height: Get.height, - color: Colors.black.withOpacity(0.7), - child: Stack( - children: [ - Positioned( - top: 20.sp + MediaQuery.of(context).padding.top, - right: 10.sp, - child: Column( - - children: [ - Image.asset( - getBaseImage('pop_top_right'), - width: 174.sp, - ), - Container(margin: EdgeInsets.only(bottom: 10.sp),child: Text('更多功能等你体验',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.bold),)) - ], - )), - Positioned( - top: 5.sp + MediaQuery.of(context).padding.top, - right: 10.sp, - child: GestureDetector( - onTap: () { - logic.isShowMoreTip = false; - logic.setSpMoreTip(); - isShowMenu = true; - logic.update(); - }, - child: Image.asset( - getMineImage('my_more_icon'), - width: 24.sp, - ), - )), - ], - ), - ), - )), + onTap: () { + logic.isShowMoreTip = false; + logic.setSpMoreTip(); + logic.update(); + }, + child: Container( + width: Get.width, + height: Get.height, + color: Colors.black.withOpacity(0.7), + child: Stack( + children: [ + Positioned( + top: 20.sp + MediaQuery.of(context).padding.top, + right: 10.sp, + child: Column( + children: [ + Image.asset( + getBaseImage('pop_top_right'), + width: 174.sp, + ), + Container( + margin: EdgeInsets.only(bottom: 10.sp), + child: Text( + '更多功能等你体验', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold), + )) + ], + )), + Positioned( + top: 5.sp + MediaQuery.of(context).padding.top, + right: 10.sp, + child: GestureDetector( + onTap: () { + logic.isShowMoreTip = false; + logic.setSpMoreTip(); + isShowMenu = true; + logic.update(); + }, + child: Image.asset( + getMineImage('my_more_icon'), + width: 24.sp, + ), + )), + ], + ), + ), + )), ], ); } @@ -529,7 +541,7 @@ class _MinefragmentPageState extends State }, child: Container( height: 68.sp, - padding: EdgeInsets.symmetric(horizontal: 15.sp), + padding: EdgeInsets.only(left: 10.sp), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -622,85 +634,85 @@ class _MinefragmentPageState extends State ), ), ), - Container( - padding: EdgeInsets.symmetric( - horizontal: 15.sp, - ), - margin: EdgeInsets.only(top: 13.sp), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Text( - userInfoBean?.nickname ?? "", - style: TextStyle( - color: Color.fromRGBO(247, 250, 250, 1.0), - fontSize: 14.sp, - ), - ), - if ((logic.userInfoBean?.mark ?? 0) > 0) - SizedBox(width: 8.sp), - if ((logic.userInfoBean?.mark ?? 0) > 0) - UserTagWidget(logic.userInfoBean!.mark!), - if (logic.isAuth) SizedBox(width: 4.sp), - if (logic.isAuth) - Image( - image: AssetImage(getMineImage("auth")), - height: 18.sp, - ), - ], - ), - Container( - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.sp), - width: 5.sp, - height: 5.sp, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: const Color(0xFF00FFF4), - ), - ), - Text( - logic.onLineCity.isNotEmpty ? logic.onLineCity : '在线', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF00FFF4), - ), - ), - ], - ), - ), - ], - ), - ), - Container( - padding: EdgeInsets.symmetric( - horizontal: 15.sp, - ), - margin: EdgeInsets.only(top: 4.sp), - child: Row( - children: [ - _buildInfoRow(logic), - Expanded(child: Container()), - Text( - '常驻城市:' + (logic.userInfoBean?.city ?? ''), - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF00FFF4), - ), - ), - ], - ), - ), - if (interests.isNotEmpty) - Container( - height: 30.sp, - margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp), - child: _buildInterestsListView(interests), - ), + // Container( + // padding: EdgeInsets.symmetric( + // horizontal: 15.sp, + // ), + // margin: EdgeInsets.only(top: 13.sp), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Row( + // children: [ + // Text( + // userInfoBean?.nickname ?? "", + // style: TextStyle( + // color: Color.fromRGBO(247, 250, 250, 1.0), + // fontSize: 14.sp, + // ), + // ), + // if ((logic.userInfoBean?.mark ?? 0) > 0) + // SizedBox(width: 8.sp), + // if ((logic.userInfoBean?.mark ?? 0) > 0) + // UserTagWidget(logic.userInfoBean!.mark!), + // if (logic.isAuth) SizedBox(width: 4.sp), + // if (logic.isAuth) + // Image( + // image: AssetImage(getMineImage("auth")), + // height: 18.sp, + // ), + // ], + // ), + // Container( + // child: Row( + // children: [ + // Container( + // margin: EdgeInsets.only(right: 5.sp), + // width: 5.sp, + // height: 5.sp, + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // color: const Color(0xFF00FFF4), + // ), + // ), + // Text( + // logic.onLineCity.isNotEmpty ? logic.onLineCity : '在线', + // style: TextStyle( + // fontSize: 12.sp, + // color: const Color(0xFF00FFF4), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // Container( + // padding: EdgeInsets.symmetric( + // horizontal: 15.sp, + // ), + // margin: EdgeInsets.only(top: 4.sp), + // child: Row( + // children: [ + // _buildInfoRow(logic), + // Expanded(child: Container()), + // Text( + // '常驻城市:' + (logic.userInfoBean?.city ?? ''), + // style: TextStyle( + // fontSize: 12.sp, + // color: const Color(0xFF00FFF4), + // ), + // ), + // ], + // ), + // ), + // if (interests.isNotEmpty) + // Container( + // height: 30.sp, + // margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp), + // child: _buildInterestsListView(interests), + // ), _friendsRow(logic), Container( height: 70.sp, @@ -708,173 +720,113 @@ class _MinefragmentPageState extends State child: Row( children: [ Expanded(child: myAssetsItem()), - SizedBox( - width: 8.sp, - ), - Expanded(child: myVipItem()), + if (homelogic.isShowMasterFunc) + SizedBox( + width: 8.sp, + ), + if (homelogic.isShowMasterFunc) Expanded(child: myVipItem()), ], ), ), - if(homelogic.isShowMasterFunc) - InkWell( - onTap: () { - Get.toNamed(Routes.MyMasterOrBaby); - }, - child: Container( - height: 35.sp, - width: Get.width, - padding: EdgeInsets.only(left: 5.sp,right: 5.sp), - margin: EdgeInsets.only( - top: 10.sp, left: 15.sp, right: 10.sp, bottom: 0.sp), - decoration: BoxDecoration( - color: Color(0x1AFFFFFF), - borderRadius: BorderRadius.circular(14.sp)), - child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '❤️我的主或贝', - style: TextStyle(color: Colors.white, fontSize: 14.sp), - ), + Padding( + padding: const EdgeInsets.all(10.0), + child: GestureDetector( + onTapDown: (detail) { + if (detail.localPosition.dy > 100.0) { + showOKToast('相关特权需要在对应功能使用哦~'); - Spacer(), - Row( - children: [ - Text( - logic.isHaveBady || logic.masterInfo.isNotEmpty ? '多互动更能增加感情哦' : '快去收您的第一位小贝吧', - style: TextStyle(color: Colors.white, fontSize: 14.sp), - ), - Image.asset( - getMineImage('chevron_left'), - width: 14.sp, - ), - ], - ) - ], - ), - ), - ), - InkWell( - onTap: () { - if (Get.isRegistered()) { - Get.delete(); - int count = 0; - routeList.forEach((element) { - if (element == Routes.RelationshipBuilding) { - count++; + if (logic.isVip.value == 0) { + showRechargeDialog(logic); } - }); - if (count >= 10) { - showOKToast('您已跳转太多页面,请返回初始页面使用吧~'); - return; + } else { + addUmengTag('我的-开通会员'); + showRechargeDialog(logic); } - } - Get.toNamed(Routes.RelationshipBuilding, - arguments: {'userId': ''}); - }, - child: Container( - width: Get.width, - height: 40.sp, - child: Row( + }, + child: Stack( children: [ - Container( - margin: EdgeInsets.only( - top: 11.sp, left: 15.sp, right: 4.sp, bottom: 5.sp), - height: 24.sp, - padding: EdgeInsets.only(left: 5.sp, right: 5.sp), - decoration: BoxDecoration( - color: Color(0x4DFFFFFF), - borderRadius: BorderRadius.circular(6.sp)), - child: Row( - children: [ - Icon( - Icons.add, - color: Colors.white, - size: 12.sp, - ), - Icon( - Icons.people, - color: Colors.white, - size: 20.sp, - ), - ], - ), - ), - - Expanded( - child: ListView.builder( - itemBuilder: (ctx, index) { - Map userInfo = logic.relationTypeList[index]; - return Row( - children: [ - Container( - margin: EdgeInsets.only(right: 6.sp, top: 5.sp), - height: 24.sp, - padding: EdgeInsets.only(left: 4.sp, right: 4.sp), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [ - Color(0xFF402366), - Color(0xFF24403E), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - borderRadius: BorderRadius.circular(6.sp), + MyImageWidget, + Positioned( + top: 24.sp, + child: Container( + width: Get.width, + padding: EdgeInsets.only(left: 18.sp, right: 40.sp), + height: 50.sp, + child: Row( + children: [ + Image.asset( + getHomeImage('mine_vip_icon'), + width: 46.sp, ), - child: Row( - children: [ - if (userInfo['user'] == null) - Container( - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.5), - borderRadius: - BorderRadius.circular(25.sp)), - margin: EdgeInsets.only(right: 4.sp), - width: 20.sp, - height: 20.sp, - child: Icon( - Icons.add, - size: 15.sp, - color: Colors.black, - ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "会员-微乐园贵宾", + style: TextStyle( + color: const Color(0xFFFFFFFF), + fontSize: 16.sp), ), - if (userInfo['user'] != null) - ClipOval( - child: CachedImg( - imageUrl: userInfo['user'] - ['avatar_thumb'], - width: 20.sp, - height: 20.sp, - fit: BoxFit.cover, - ), + SizedBox( + height: 4.sp, + ), + Text( + logic.vipMsg, + style: TextStyle( + color: const Color(0x99FFFFFF), + fontSize: 13.sp), + ), + ], + ), + ), + ClipRRect( + borderRadius: BorderRadius.circular(4.sp), + child: Container( + alignment: Alignment.center, + width: 70.sp, + height: 27.sp, + decoration: BoxDecoration( + gradient: AppColor.mainVerLinearGradient + ), + child: Text( + logic.vipMsg.contains('十几种') + ? '领取会员' + : '续费会员', + style: TextStyle( + color: Colors.white, fontSize: 13.5.sp), ), - SizedBox( - width: 4.sp, - ), - Text( - userInfo['relationTypeName'], - style: TextStyle( - fontSize: 12.sp, color: Colors.white), ) - ], + ), + ], + ), + )), + if (logic.ticketCount > 0) + Positioned( + top: 5, + right: 8.sp, + child: Container( + padding: EdgeInsets.all(2.sp), + decoration: BoxDecoration( + gradient: AppColor.tagVerLinearGradient, + borderRadius: BorderRadius.circular(4.sp), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, ), ), - ], - ); - }, - itemCount: logic.relationTypeList.length, - scrollDirection: Axis.horizontal, - )), - SizedBox( - width: 11.sp, - ), + child: Text( + '送${logic.ticketCount}小票', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.bold), + ), + )) ], ), ), ), - - // titleTab(controller), ], ), ); @@ -1017,28 +969,159 @@ class _MinefragmentPageState extends State } Widget buildUserContainer(MinefragmentLogic controller) { - return Container( - margin: EdgeInsets.only(left: 3.sp), - height: 58.sp, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getMineImage("icon_user_content")), - fit: BoxFit.fill, - ), - ), - child: Container( - margin: EdgeInsets.only(left: 24.sp, right: 5.sp), - child: Center( - child: Text( - controller.userInfoBean != null - ? controller.userInfoBean!.signature ?? '' - : "", - maxLines: 2, - style: TextStyle(color: Colors.white, fontSize: 15.sp), - overflow: TextOverflow.ellipsis, + return Column( + children: [ + Container( + margin: EdgeInsets.only(left: 8.sp, right: 10.sp), + height: 35.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.sp), + color: const Color(0xFF392D53), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, + ), + ), + child: Container( + margin: EdgeInsets.only(left: 10.sp, right: 5.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Center( + child: Text( + controller.userInfoBean != null + ? controller.userInfoBean!.signature ?? '' + : "", + maxLines: 1, + style: TextStyle(color: Colors.white, fontSize: 15.sp), + overflow: TextOverflow.ellipsis, + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.white, + size: 24.sp, + ), + ], + ), ), ), - ), + InkWell( + onTap: () { + if (Get.isRegistered()) { + Get.delete(); + int count = 0; + routeList.forEach((element) { + if (element == Routes.RelationshipBuilding) { + count++; + } + }); + if (count >= 10) { + showOKToast('您已跳转太多页面,请返回初始页面使用吧~'); + return; + } + } + Get.toNamed(Routes.RelationshipBuilding, arguments: {'userId': ''}); + }, + child: Container( + width: Get.width, + height: 30.sp, + child: Row( + children: [ + Container( + margin: EdgeInsets.only(top: 8.sp, left: 10.sp, right: 4.sp), + height: 24.sp, + padding: EdgeInsets.only(left: 5.sp, right: 5.sp), + decoration: BoxDecoration( + color: Color(0x4DFFFFFF), + borderRadius: BorderRadius.circular(6.sp)), + child: Row( + children: [ + Icon( + Icons.add, + color: Colors.white, + size: 12.sp, + ), + Icon( + Icons.people, + color: Colors.white, + size: 20.sp, + ), + ], + ), + ), + Expanded( + child: ListView.builder( + itemBuilder: (ctx, index) { + Map userInfo = controller.relationTypeList[index]; + return Row( + children: [ + Container( + margin: EdgeInsets.only(right: 6.sp, top: 8.sp), + height: 24.sp, + padding: EdgeInsets.only(left: 4.sp, right: 4.sp), + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: [ + Color(0xFF402366), + Color(0xFF24403E), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + borderRadius: BorderRadius.circular(6.sp), + ), + child: Row( + children: [ + if (userInfo['user'] == null) + Container( + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.5), + borderRadius: + BorderRadius.circular(25.sp)), + margin: EdgeInsets.only(right: 4.sp), + width: 20.sp, + height: 20.sp, + child: Icon( + Icons.add, + size: 15.sp, + color: Colors.black, + ), + ), + if (userInfo['user'] != null) + ClipOval( + child: CachedImg( + imageUrl: userInfo['user']['avatar_thumb'], + width: 20.sp, + height: 20.sp, + fit: BoxFit.cover, + ), + ), + SizedBox( + width: 4.sp, + ), + Text( + userInfo['relationTypeName'], + style: TextStyle( + fontSize: 12.sp, color: Colors.white), + ) + ], + ), + ), + ], + ); + }, + itemCount: controller.relationTypeList.length, + scrollDirection: Axis.horizontal, + )), + SizedBox( + width: 11.sp, + ), + ], + ), + ), + ), + ], ); } @@ -1882,87 +1965,94 @@ class _MinefragmentPageState extends State myVipItem() { return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - showRechargeDialog(mineLogic); - // Get.toNamed(Routes.MyAssetsPage); - }, + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(Routes.MyMasterOrBaby); + }, + child: Container( + padding: + EdgeInsets.only(left: 6.sp, right: 6.sp, bottom: 5.sp, top: 10.sp), + // height: 80.sp, + decoration: BoxDecoration( + color: AppColor.cityBgColor, + borderRadius: BorderRadius.circular(13.sp)), child: Container( - padding: EdgeInsets.only( - left: 6.sp, right: 6.sp, bottom: 5.sp, top: 10.sp), - // height: 80.sp, - decoration: BoxDecoration( - color: AppColor.cityBgColor, - borderRadius: BorderRadius.circular(13.sp)), - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - getHomeImage('mine_vip_icon'), - height: 20.sp, - ), - SizedBox( - width: 4.sp, - ), - ShaderMask( - shaderCallback: (Rect bounds) { - return LinearGradient( - begin: Alignment.centerRight, - end: Alignment.centerLeft, - colors: [Color(0xffF657FF), AppColor.mainColor], - ).createShader(Offset.zero & bounds.size); - }, - child: Text( - 'VIP会员', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - ), - ), - ), - Spacer(), - Container( - child: Stack( - alignment: Alignment.centerLeft, - children: [ - Container( - width: 67.sp, - ), - Text( - mineLogic.vipMsg.contains('十几种') ? '领取特权' : '续费特权', - style: - TextStyle(color: Colors.white, fontSize: 14.sp), - ), - Positioned( - right: 0.sp, - child: Image( - image: AssetImage(getHomeImage("icon_in")), - width: 20.sp, - // height: 14.sp, - ), - ), - ], - ), - ) - ], - ), - SizedBox( - height: 10.sp, - ), - Text( - mineLogic.vipMsg, + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Container( + height: 20.sp, + alignment: Alignment.centerLeft, + child: Text( + '❤️', style: TextStyle( color: Colors.white, - fontSize: 13.sp, + fontSize: 16.sp, ), ), - ], + ), + SizedBox( + width: 4.sp, + ), + ShaderMask( + shaderCallback: (Rect bounds) { + return LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [Color(0xffF657FF), AppColor.mainColor], + ).createShader(Offset.zero & bounds.size); + }, + child: Text( + '我的主或贝', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + ), + ), + ), + Stack( + alignment: Alignment.centerRight, + children: [ + Container( + width: 65.sp, + height: 20.sp, + ), + if (mineLogic.beiCount > 0) + Container( + margin: EdgeInsets.only(right: 20.sp), + child: Text( + '${mineLogic.beiCount}位', + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ), + ), + Positioned( + right: 10.sp, + child: Image( + image: AssetImage(getHomeImage("icon_in")), + width: 20.sp, + // height: 14.sp, + ), + ), + ], + ), + ], + ), + SizedBox( + height: 10.sp, + ), + Text( + mineLogic.isHaveBady || mineLogic.masterInfo.isNotEmpty + ? '多互动更能增加感情哦' + : '快去收您的第一位小贝吧', + style: TextStyle( + color: Colors.white, + fontSize: 13.sp, ), ), - )); + ])), + ), + ); } Widget _circleLiveView(MinefragmentLogic logic) { @@ -2486,7 +2576,6 @@ class _MinefragmentPageState extends State msgLogic.getVisitorMsgsData(); } - Get.toNamed(Routes.VisitorListPage); }, child: Stack(fit: StackFit.expand, children: [ @@ -2660,7 +2749,7 @@ class _MinefragmentPageState extends State height: 22.sp, alignment: Alignment.center, padding: EdgeInsets.only(left: 3.sp, right: 3.sp), - decoration:BoxDecoration( + decoration: BoxDecoration( gradient: LinearGradient( colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], begin: Alignment.topCenter, @@ -2805,7 +2894,7 @@ class _MinefragmentPageState extends State Get.bottomSheet( Scaffold( backgroundColor: Colors.transparent, - body: Open_vip_tipPage(false, ''), + body: Open_vip_tipPage(true, ''), ), isScrollControlled: true, enableDrag: false) diff --git a/circle_app/lib/circle_app/userinfo/logic.dart b/circle_app/lib/circle_app/userinfo/logic.dart index 4b75d51..482bf7f 100644 --- a/circle_app/lib/circle_app/userinfo/logic.dart +++ b/circle_app/lib/circle_app/userinfo/logic.dart @@ -152,11 +152,7 @@ class UserinfoLogic extends GetxController { if (userId.isEmpty) { isMe = true; update(); - fetchUserInfo(Api.getUserInfo); - fetchMyAlbum(Api.getMyAlbum); - loadDyanmicListData(); - loadBabyData(); - loadMyTimeData(); + loadMyData(); } else { sendHotAction(8, userId); @@ -174,6 +170,14 @@ class UserinfoLogic extends GetxController { loadMasterData(); } + loadMyData() { + fetchUserInfo(Api.getUserInfo); + fetchMyAlbum(Api.getMyAlbum); + loadDyanmicListData(); + loadBabyData(); + loadMyTimeData(); + } + loadDyanmicListData() async { String requestUserId = ''; if (userId.isEmpty) { diff --git a/circle_app/lib/circle_app/userinfo/view.dart b/circle_app/lib/circle_app/userinfo/view.dart index a041b3f..76c60e6 100644 --- a/circle_app/lib/circle_app/userinfo/view.dart +++ b/circle_app/lib/circle_app/userinfo/view.dart @@ -358,7 +358,7 @@ class MyTabbedScreenState extends State Routes.Complete_materialPage, arguments: "user", ); - logic.onInit(); + logic.loadMyData(); }, child: Center( child: Container( diff --git a/circle_app/lib/commons/widgets/lucky_bag_dialog.dart b/circle_app/lib/commons/widgets/lucky_bag_dialog.dart index 315413e..ca1ed5b 100644 --- a/circle_app/lib/commons/widgets/lucky_bag_dialog.dart +++ b/circle_app/lib/commons/widgets/lucky_bag_dialog.dart @@ -302,6 +302,9 @@ class _LuckyBagDialogState extends State { } else { if (data['code'] == 500) { Get.toNamed(Routes.SignalCircleListPage,arguments: widget.info['interestId'].toString()); + } else if (data['code'] == 32112) { + Get.back(); + Get.toNamed(Routes.SignalCircleListPage,arguments: data['data'].toString()); } showOKToast(data['msg']); } diff --git a/circle_app/lib/main.dart b/circle_app/lib/main.dart index bc2ec5b..deaa00e 100644 --- a/circle_app/lib/main.dart +++ b/circle_app/lib/main.dart @@ -130,9 +130,8 @@ Future _handleError(dynamic error) async { showOKToast('内存异常,请重新上传'); } -int IM_SDK_APP_ID = 1400799631; +const int IM_SDK_APP_ID = 1400799631; -String IOS_APP_ID = ""; //登录IM loginIM(String userId, String sig) async { diff --git a/circle_app/lib/net/api.dart b/circle_app/lib/net/api.dart index b091997..0ce45f7 100644 --- a/circle_app/lib/net/api.dart +++ b/circle_app/lib/net/api.dart @@ -403,7 +403,7 @@ class Api { static const wxNumConfig = '/user-service/contact/user/conf/get/'; //新人列表 - static const queryNewUserList = '/user-service/newUser/queryNewUserList/v2'; + static const queryNewUserList = '/user-service/newUser/queryNewUserList/v3'; //30人打招呼 static const sayHelloMore = '/user-service/newUser/sayHelloMore'; @@ -776,7 +776,7 @@ class Api { static var masterConfig = '/user-service/user/master/enabled'; //小贝列表 - static var masterBabies = '/user-service/user/master/babies'; + static var masterBabies = '/user-service/user/master/babies/v2'; //召唤贝 static var batchCallBabies = '/user-service/user/master/batchCallBabies'; @@ -801,4 +801,10 @@ class Api { //我的乐园时光 static var trends = '/user-service/my/trends'; + //是否显示新人入口 + static var newUserIsShow = '/user-service/newUser/isShow'; + + //指引新人 + static var guideNewUser = '/user-service/newUser/guide/'; + } diff --git a/circle_app/lib/utils/SharedPreferencesHelper.dart b/circle_app/lib/utils/SharedPreferencesHelper.dart index 743d5a6..88e0080 100644 --- a/circle_app/lib/utils/SharedPreferencesHelper.dart +++ b/circle_app/lib/utils/SharedPreferencesHelper.dart @@ -23,7 +23,7 @@ class SharedPreferencesHelper { static const AGREEMENT = 'agreement'; - static const String firstLogin = 'firstlogin'; + static const String firstLogin = 'first'; static const msgTip = 'msgTip';