diff --git a/circle_app/ios/Runner.xcodeproj/project.pbxproj b/circle_app/ios/Runner.xcodeproj/project.pbxproj index cf137a1..d5b0035 100644 --- a/circle_app/ios/Runner.xcodeproj/project.pbxproj +++ b/circle_app/ios/Runner.xcodeproj/project.pbxproj @@ -381,7 +381,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.7; + MARKETING_VERSION = 1.4.1; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -530,7 +530,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.7; + MARKETING_VERSION = 1.4.1; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -573,7 +573,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.7; + MARKETING_VERSION = 1.4.1; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart index 81f78ca..4d3bf3b 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart @@ -446,8 +446,6 @@ class _InputTextFieldState extends TIMUIKitState { ); } - - bool isSendLoging = false; onSubmitted() async { if (isBlack) { showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); @@ -547,14 +545,17 @@ class _InputTextFieldState extends TIMUIKitState { } Future.delayed(Duration(seconds: 1), () {isSending = false;}); if (words.isEmpty) { - var msgResult = await MessageUtils.handleMessageError( - widget.model.sendTextMessage( - text: text, - convID: widget.conversationID, - convType: convType), - context); + try { + var msgResult = await MessageUtils.handleMessageError( + widget.model.sendTextMessage( + text: text, + convID: widget.conversationID, + convType: convType), + context); + addChatRecord(text, msgResult!.data!.msgID ?? '', msgResult!.data!.timestamp.toString() ?? ''); + } catch (e) { - addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? ''); + } } else { showOKToast('含违规词汇,无法发送'); return; diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index a71a257..2e836a7 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -841,6 +841,11 @@ class _TIMTextFieldLayoutNarrowState scrollDirection: Axis.horizontal, children: [ chatActionWidget('hello', '打招呼', () async { + if (isBlack) { + showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); + _showIsCancelBlackDialog(context); + return; + } var reulst = await DioManager.instance.get(url: Api.msgRandOne); String text = reulst['data']; @@ -1470,9 +1475,14 @@ class _TIMTextFieldLayoutNarrowState data, (data) => ResponseBean.fromJson(data)); if (bean.isSuccess()) { - userInfoBean = bean.data.user; - unLockWxNum = bean.data.unLockWxNum; - setState(() {}); + try { + userInfoBean = bean.data.user; + unLockWxNum = bean.data.unLockWxNum; + setState(() {}); + } catch (e) { + + } + } } } diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index b5b0815..9b42b5c 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -171,15 +171,15 @@ class _ChatPageState extends State { } if (message.elemType ==1) { - return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + message.textElem!.text! ?? ''; + return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + message.textElem!.text! ?? ''; } else if (message.elemType == 3) { - return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一张图片'; + return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一张图片'; } else if (message.elemType == 4) { - return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条语音'; + return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条语音'; } else if (message.elemType == 5) { - return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条视频'; + return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条视频'; } else { - return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条消息'; + return ((userInfoBean!.nickname ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname ?? '昵称待审核') +':' : '') + '发了一条消息'; } }, diff --git a/circle_app/lib/app/circle/logic.dart b/circle_app/lib/app/circle/logic.dart index 2721c88..e87aa3d 100644 --- a/circle_app/lib/app/circle/logic.dart +++ b/circle_app/lib/app/circle/logic.dart @@ -105,21 +105,23 @@ class CircleLogic extends GetxController { var bean1 = BaseResponse.fromJson( data1, (data1) => ConfigBean.fromJson(data1)); - ConfigBean configBean = bean1.data!; + if (bean1.isSuccess()) { + ConfigBean configBean = bean1.data!; - configBean.genderMap.forEach((key, value) { - genderList.add(MyConfigData(key, value, false)); - dis_genderList.add(MyConfigData(key, value, false)); - }); + configBean.genderMap.forEach((key, value) { + genderList.add(MyConfigData(key, value, false)); + dis_genderList.add(MyConfigData(key, value, false)); + }); - configBean.orientationMap.forEach((key, value) { - orientationList.add(MyConfigData(key, value, false)); - dis_orientationList.add(MyConfigData(key, value, false)); - }); - configBean.roleMap.forEach((key, value) { - roleList.add(MyConfigData(key, value, false)); - dis_roleList.add(MyConfigData(key, value, false)); - }); + configBean.orientationMap.forEach((key, value) { + orientationList.add(MyConfigData(key, value, false)); + dis_orientationList.add(MyConfigData(key, value, false)); + }); + configBean.roleMap.forEach((key, value) { + roleList.add(MyConfigData(key, value, false)); + dis_roleList.add(MyConfigData(key, value, false)); + }); + } } List provinceList = []; diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index 17e82dd..cf94bf5 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -59,6 +59,7 @@ class _CirclePageState extends State sub = EventBusManager.on().listen((event) { currentIndex = event.index; + _tabController.index = currentIndex; setState(() { }); @@ -638,7 +639,7 @@ class _CirclePageState extends State color: const Color(0xFF392D53), ), child: Text( - "邀请得会员", + "邀请赚钱", style: TextStyle( fontSize: 12.sp, color: Colors.white, diff --git a/circle_app/lib/app/circle/widgets/discover.dart b/circle_app/lib/app/circle/widgets/discover.dart index 678cf3b..51f29cd 100644 --- a/circle_app/lib/app/circle/widgets/discover.dart +++ b/circle_app/lib/app/circle/widgets/discover.dart @@ -113,6 +113,10 @@ class _DiscoverState extends State //弹窗提示 checkIsPopWxTip(); } + + if (lastPage == list.length - 2) { + loadData(); + } } }; } @@ -823,15 +827,26 @@ class _DiscoverState extends State } loadWxNumData() async { - var data = await DioManager.instance.get(url: Api.getUserInfo); - if (data['code'] == 200) { - if (data['data']['user']['wxNum'] == null) { - showAddWxPicker(false); - } else if (data['data']['user']['wxNum'].toString().isEmpty) { - showAddWxPicker(false); + loadWXEditStatus() async { + var data = + await DioManager.instance.get(url: Api.checkWxNumState,); + if (data['code'] == 200) { + var data = await DioManager.instance.get(url: Api.getUserInfo); + + if (data['code'] != 4000) { + if (data['data']['user']['wxNum'] == null) { + showAddWxPicker(false); + } else if (data['data']['user']['wxNum'].toString().isEmpty) { + showAddWxPicker(false); + } + } + } else { + // wxStatusInfo['${data['code']}'] = data['msg']; } } + + } void sendNoLookData(String userId, int index) async { diff --git a/circle_app/lib/app/dialog/YesAgreementDialog.dart b/circle_app/lib/app/dialog/YesAgreementDialog.dart index 70f1640..9f87754 100644 --- a/circle_app/lib/app/dialog/YesAgreementDialog.dart +++ b/circle_app/lib/app/dialog/YesAgreementDialog.dart @@ -150,7 +150,6 @@ class _CustomDialogState extends State { pushLoginPage(); FlutterBugly.init( androidAppId: "8509314e11", - iOSAppId: "51e7b4e472", ); }, child: Container( diff --git a/circle_app/lib/app/feedback/logic.dart b/circle_app/lib/app/feedback/logic.dart index 1df67ae..1944824 100644 --- a/circle_app/lib/app/feedback/logic.dart +++ b/circle_app/lib/app/feedback/logic.dart @@ -53,12 +53,18 @@ class FeedbackLogic extends GetxController { getFeedBack() async{ + if (textEditingController.text.isEmpty && state.imaglist.isEmpty) { + showOKToast('请输入反馈内容或者提交反馈图片'); + return; + } + List myBean = []; if (!state.imaglist.isEmpty) { state.imaglist.forEach((element) { myBean.add(MyBean(type: 1, url: element).toJson()); }); } + textEditingController.text; var data = diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index ae52f7b..a5dc279 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -15,6 +15,7 @@ import 'package:circle_app/util/util.dart'; import 'package:connectivity/connectivity.dart'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:get/get.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -79,8 +80,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { unreadSIze.value = '0'; // 设置网络变化监听 connectListener(); - // 获取网络连接状态 - getConnectType(); getIMData(); setFirstData(); @@ -93,8 +92,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { sub = EventBusManager.on().listen((event) { getUnreadSize(); }); - // getUnreadSize(); - WidgetsBinding.instance.addObserver(this); @@ -114,7 +111,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { text, ) async { print("收到新消息" + text); - // unreadSIze.value = (int.parse(unreadSIze.value) + 1).toString(); getUnreadSize(); }, onRecvC2CCustomMessage: ( String msgID, @@ -214,7 +210,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { break; case AppLifecycleState.resumed: //从后台切换前台,界面可见 - break; case AppLifecycleState.paused: // 界面不可见,后台 @@ -222,7 +217,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { break; case AppLifecycleState.detached: // APP结束时调用 - break; } } @@ -442,30 +436,9 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { } } - /// 获取联网类型 - void getConnectType() async { - var connectResult = await (Connectivity().checkConnectivity()); - - if (connectResult == ConnectivityResult.mobile) { - // _netType = "4G"; - } else if (connectResult == ConnectivityResult.wifi) { - // _netType = "wifi"; - } else if (connectResult == ConnectivityResult.none) { - // _netType = "未连接"; - } - - } - - /// 判断网络是否连接 - Future isConnected() async { - var connectResult = await (Connectivity().checkConnectivity()); - return connectResult != ConnectivityResult.none; - } - /// 设置网络切换监听 connectListener() { connectivitySub = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { - if (result == ConnectivityResult.none) { if (currentIndex == 0) { var logic = Get.put(CircleLogic()); @@ -482,6 +455,9 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { } }}); } + + + } diff --git a/circle_app/lib/app/invent_record/binding.dart b/circle_app/lib/app/invent_record/binding.dart new file mode 100644 index 0000000..c12b9f8 --- /dev/null +++ b/circle_app/lib/app/invent_record/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class Invent_recordBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => Invent_recordLogic()); + } +} diff --git a/circle_app/lib/app/invent_record/logic.dart b/circle_app/lib/app/invent_record/logic.dart new file mode 100644 index 0000000..607b772 --- /dev/null +++ b/circle_app/lib/app/invent_record/logic.dart @@ -0,0 +1,57 @@ +import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; +import 'package:circle_app/network/api.dart'; +import 'package:circle_app/network/dio_manager.dart'; + +import 'state.dart'; + +class Invent_recordLogic extends GetxController { + final Invent_recordState state = Invent_recordState(); + bool isLoad = true; + bool isMore = true; + int index = 1; + + + List data = []; + ScrollController scrollController = ScrollController(); + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + scrollController.addListener(() { + if (scrollController.position.pixels == + scrollController.position.maxScrollExtent) { + if (isMore) { + loadData(); + } + + } + }); + loadData(); + } + + void loadData() async { + var result = await DioManager.instance.post(url:Get.arguments == 0 ? Api.inviteRecord : Api.inviteRankRecord,params: {'page':index,'pageSize':10}); + isLoad = false; + if (result['code'] == 200) { + if (result['data'] != null) { + List dataList = result['data']; + + isMore = dataList.length >= 10; + + if (index == 1) { + data = result['data']; + } else { + data.addAll(result['data']); + } + + index = index + 1; + } else { + isMore = false; + } + } + update(); + } + +} diff --git a/circle_app/lib/app/invent_record/state.dart b/circle_app/lib/app/invent_record/state.dart new file mode 100644 index 0000000..050476e --- /dev/null +++ b/circle_app/lib/app/invent_record/state.dart @@ -0,0 +1,5 @@ +class Invent_recordState { + Invent_recordState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/invent_record/view.dart b/circle_app/lib/app/invent_record/view.dart new file mode 100644 index 0000000..8b73615 --- /dev/null +++ b/circle_app/lib/app/invent_record/view.dart @@ -0,0 +1,320 @@ +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 '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class Invent_recordPage extends StatelessWidget { + Invent_recordPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.black, + appBar: MyAppBar( + centerTitle: Get.arguments == 0 ? '邀请记录及返利' : '推荐大使邀请榜', + ), + body: GetBuilder(builder: (logic) { + return Container( + decoration: BoxDecoration( + color: Color(0x99282733), + border: Border.all(color: Color(0x0AFFFFFF), width: 1.sp), + borderRadius: BorderRadius.circular(4.sp)), + margin: EdgeInsets.only(left: 15.sp, right: 15.sp, bottom: 10.sp), + child: logic.isLoad + ? loaddingWidget(true) + : logic.data.isEmpty + ? noResultWidget() + : ListView.builder( + itemBuilder: (BuildContext context, int index) { + if (Get.arguments == 0) { + if (index == 0) { + return titileWidget(); + } else if (index == logic.data!.length + 1) { + return loaddingWidget(logic.isMore); + } + var data = logic.data[index - 1]; + return rowWidget( + data['nickName'], + data['inviteTime'], + '${data['sysProfit']}票', + '${data['rebate'] > 0 ? data['rebate'] : 0}票(${data['rebateRate']}%)', + data['userId'].toString()); + } else { + if (index == 0) { + return allTitileWidget(); + } else if (index == logic.data!.length + 1) { + return loaddingWidget(logic.isMore); + } + var data = logic.data[index - 1]; + return allRowWidget( + data['nickname'], + data['inviteCount'].toString(), + data['vipDays'].toString() + '天', + '${data['directProfit'] > 0 ? data['directProfit'] : 0}票', + '${data['rebate'] > 0 ? data['rebate'] : 0}票', + data['userId'].toString()); + } + }, + itemCount: logic.data!.length + 2, + controller: logic.scrollController, + ), + ); + }), + ); + } + + allTitileWidget() { + return Container( + height: 41.sp, + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: infoText('推广大使'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('邀请人数'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('获会员时长'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('直接返利'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('间接返利'), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + allRowWidget( + String str1, + String str2, + String str3, + String str4, + String str5, + String userId, + ) { + return Container( + height: 41.sp, + // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: userId); + }, + child: infoText(str1, AppColor.mainColor)), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str2, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str3, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str4, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str5, Colors.white), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + infoText(String info, [Color color = const Color(0xFFF7FAFA)]) { + return Center( + child: Text( + info, + style: TextStyle(color: color, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), + ); + } + + titileWidget() { + return Container( + height: 41.sp, + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: infoText('圈友'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('填码时间'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('平台返利'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('平台为你返利'), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + rowWidget( + String str1, + String str2, + String str3, + String str4, + String userId, + ) { + return Container( + height: 41.sp, + // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: userId); + }, + child: infoText(str1, AppColor.mainColor)), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str2, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str3, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str4, Colors.white), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } +} diff --git a/circle_app/lib/app/invite/logic.dart b/circle_app/lib/app/invite/logic.dart index 363b3cd..58b0491 100644 --- a/circle_app/lib/app/invite/logic.dart +++ b/circle_app/lib/app/invite/logic.dart @@ -12,25 +12,55 @@ class InviteLogic extends GetxController { TextEditingController codeEditingController = TextEditingController(); Data? homeData; + List inveiteData = []; + + List allInveiteData = []; List sysData = []; + String directProfit = ''; + String rebate = ''; + int selectedIndex = 0; - + int myPage = 1; + int otherPage = 1; @override void onInit() { // TODO: implement onInit super.onInit(); loadData(); + loadMyInviteData(); + loadAllInviteData(); + } + + loadMyInviteData() async { + var resultData = await DioManager.instance.post(url: Api.inviteRecord,params: {'page':myPage,'pageSize':10}); + if (resultData['code'] == 200) { + inveiteData = resultData['data']; + update(); + } + } + + loadAllInviteData() async { + var resultData = await DioManager.instance.post(url: Api.inviteRankRecord,); + if (resultData['code'] == 200) { + allInveiteData = resultData['data']; + update(); + } } void loadData() async { + var resultData = await DioManager.instance.get(url: Api.inviteTotal); + if (resultData['code'] == 200) { + rebate = resultData['data']['rebate'].toString(); + directProfit = resultData['data']['directProfit'].toString(); + } + var data = await DioManager.instance.get(url: Api.inviteMainPage); if (data['code'] == 200) { Autogenerated result = Autogenerated.fromJson(data); - homeData = result.data; - } + var recorddata = await DioManager.instance.get(url: Api.inviteSysRecord); if (recorddata['code'] == 200) { sysData = recorddata['data']; @@ -78,11 +108,26 @@ class Autogenerated { } } +class Superior { + int? id; + String? avatar; + String? nickname; + Superior( + {this.id,this.avatar,this.nickname} + ); + Superior.fromJson(Map json) { + id = json['id'] ?? 0; + avatar = json['avatar'] ?? ''; + nickname = json['nickname'] ?? ''; + } +} + class Data { int? achieveCount; int? achieveRewardDay; int? diffAwardCount; List? inviteAwardConf; + Superior? superior; int? inviteAwardCount; String? inviteCode; String? link; @@ -95,6 +140,7 @@ class Data { this.inviteAwardConf, this.inviteAwardCount, this.inviteCode, + this.superior, this.link, this.inviteCount}); @@ -110,6 +156,7 @@ class Data { } inviteAwardCount = json['invite_award_count']; inviteCode = json['invite_code']; + superior = json['superior'] != null ? Superior.fromJson(json['superior']) : null; link = json['site_link']; inviteCount = json['invite_count']; } diff --git a/circle_app/lib/app/invite/view.dart b/circle_app/lib/app/invite/view.dart index 93e4daa..ad7a2b7 100644 --- a/circle_app/lib/app/invite/view.dart +++ b/circle_app/lib/app/invite/view.dart @@ -1,24 +1,27 @@ - import 'package:circle_app/app/invite/share.dart'; import 'package:circle_app/app/swiper/view.dart'; import 'package:circle_app/common/Widgets/rich_text.dart'; +import 'package:circle_app/common/colors/app_color.dart'; import 'package:circle_app/components/my_app_bar.dart'; import 'package:circle_app/util/util.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.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:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; +import '../../router/app_routers.dart'; import 'logic.dart'; class InvitePage extends StatelessWidget { InvitePage({Key? key}) : super(key: key); final logic = Get.find(); - final state = Get - .find() - .state; + final state = Get.find().state; @override Widget build(BuildContext context) { @@ -32,18 +35,18 @@ class InvitePage extends StatelessWidget { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - centerTitle: "邀请得会员", + centerTitle: "邀请赚钱", actionWdiget: Container( alignment: Alignment.center, height: 22.sp, width: 62.sp, - - child: Image.asset(getMineImage('invite_right_icon'), + child: Image.asset( + getMineImage('invite_right_icon'), width: 62.sp, fit: BoxFit.fill, ), ), - onPressed: (){ + onPressed: () { navigateToInviteStrategy(); }, ), @@ -52,24 +55,25 @@ class InvitePage extends StatelessWidget { List dayCountList = []; List allSpan = []; if (logic.isLoad == false) { - logic.homeData!.inviteAwardConf!.forEach((element) { - peopleCountList.add(peopleCountWidget('${element!.inviteCount! ?? '0'}',(element!.inviteCount! ?? 0) <= logic.homeData!.inviteCount!)); + logic.homeData!.inviteAwardConf!.forEach((element) { + peopleCountList.add(peopleCountWidget( + '${element!.inviteCount! ?? '0'}', + (element!.inviteCount! ?? 0) <= + logic.homeData!.inviteCount!)); if ((element.rewardDay! ?? 0) > 365) { - dayCountList.add(timeWidget('${(element.rewardDay! / 365).toInt()}年')); + dayCountList.add( + timeWidget('${(element.rewardDay! / 365).toInt()}年')); } else { dayCountList.add(timeWidget('${element.rewardDay!}天')); } // timeWidget( // '+30天', // ), - }); allSpan.addAll(getTextSpanList( - 'Tip:您已成功邀请', - Color(0xFF0DF5F7), - 13.sp, + 'Tip:您已成功邀请', Color(0xFF0DF5F7), 13.sp, searchContent: 'Tip:')); allSpan.addAll(getTextSpanList( ' ${logic.homeData!.inviteCount! ?? 0} 位圈友,', @@ -80,13 +84,13 @@ class InvitePage extends StatelessWidget { '免费获得会员 ${logic.homeData!.achieveRewardDay! ?? '0'} 天,', Color(0xFFDC5BFD), 13.sp, - searchContent: '${logic.homeData!.achieveRewardDay! ?? '0'} ')); - int maxCount = logic.homeData!.inviteAwardConf!.last.inviteCount ?? 0; + searchContent: + '${logic.homeData!.achieveRewardDay! ?? '0'} ')); + int maxCount = + logic.homeData!.inviteAwardConf!.last.inviteCount ?? 0; if (logic.homeData!.inviteCount! >= maxCount) { allSpan.addAll(getTextSpanList( - ' 再邀请可领取更多奖励~', - Color(0xFFDC5BFD), - 13.sp, + ' 再邀请可领取更多奖励~', Color(0xFFDC5BFD), 13.sp, searchContent: '')); } else { allSpan.addAll(getTextSpanList( @@ -95,346 +99,943 @@ class InvitePage extends StatelessWidget { 13.sp, searchContent: '${logic.homeData!.diffAwardCount}')); } - - } - - return logic.isLoad ? loaddingWidget(true) : SingleChildScrollView( - child: Column(children: [ - Container( - height: 203.sp, - margin: EdgeInsets.only( - left: 20.sp, - right: 20.sp, - top: 10.sp - ), - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getCircleImage("pic_bg")), - fit: BoxFit.fill, - ), - ), - child: Column( - children: [ + return logic.isLoad + ? loaddingWidget(true) + : Stack( + fit: StackFit.expand, + children: [ + SingleChildScrollView( + child: Column(children: [ Container( - padding: EdgeInsets.only( - left: 14.sp, right: 14.sp, top: 24.sp), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '我的专属邀请码', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w500), + // height: 83.sp, + margin: EdgeInsets.only( + left: 20.sp, right: 20.sp, top: 0.sp), + decoration: BoxDecoration( + color: Color(0xFF4C3E5F).withOpacity(0.25), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - showCodePicker(logic); - }, - child: Container( - alignment: Alignment.center, - - width: 84.sp, - - child: Image.asset(getMineImage('add_code_icon')), - ), - ) - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 10.sp), - child: Row( + borderRadius: BorderRadius.circular(10.sp)), + child: Column( children: [ - SizedBox(width: 20.sp,), - Text( - logic.homeData!.inviteCode! ?? '', - style: TextStyle( - fontSize: 30.sp, - fontWeight: FontWeight.w600, - color: Color(0xffF657FF) + Container( + padding: EdgeInsets.only( + left: 14.sp, right: 14.sp, top: 10.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '专属邀请码', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), ), + if (logic.homeData!.superior == null) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showCodePicker(logic); + }, + child: Container( + alignment: Alignment.center, + width: 84.sp, + child: Image.asset( + getMineImage('add_code_icon')), + ), + ), + if (logic.homeData!.superior != null) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity,arguments: logic.homeData!.superior!.id!.toString()); + }, + child: Container( + alignment: Alignment.center, + child: Row( + children: [ + Text('邀请人:',style: TextStyle(color: Colors.white,fontSize: 14.sp),), + Text( + '${logic.homeData!.superior!.nickname!}', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.sp), + ), + ], + ), + ), + ), + ], + ), ), - SizedBox( - width: 4.sp, + Container( + margin: EdgeInsets.only(top: 0.sp), + child: Row( + children: [ + SizedBox( + width: 14.sp, + ), + Text( + logic.homeData!.inviteCode! ?? '', + style: TextStyle( + fontSize: 30.sp, + fontWeight: FontWeight.w600, + color: Color(0xffF657FF)), + ), + SizedBox( + width: 4.sp, + ), + GestureDetector( + onTap: () { + Clipboard.setData(ClipboardData( + text: logic.homeData! + .inviteCode! ?? + '')); + showOKToast('复制成功'); + }, + child: Text( + '复制', + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 14.sp), + )), + Expanded(child: Container()) + ], + ), ), - GestureDetector( - onTap: () { - Clipboard.setData( - ClipboardData(text: logic.homeData!.inviteCode! ?? '')); - showOKToast('复制成功'); - }, - child: Text( - '复制', - style: TextStyle( - color: Color(0xff0DF5F7), - fontSize: 14.sp), - )), - Expanded(child: Container()) ], ), ), - GestureDetector( - onTap: () { - shopSharePiker(logic.homeData!.inviteCode! ?? '',(logic.homeData!.link! ?? '') + - '?code=${logic.homeData!.inviteCode! ?? ''}'); - }, - child: Container( - width: 174.sp, - height: 42.sp, - margin: EdgeInsets.only(top: 35.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.sp), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), + Container( + height: 40.sp, + margin: EdgeInsets.only( + left: 20.sp, right: 20.sp, top: 10.sp), + decoration: BoxDecoration( + color: Color(0xFF4C3E5F).withOpacity(0.25), + border: GradientBoxBorder( + gradient: AppColor.mainVerLinearGradient, + width: 1.sp, + ), + borderRadius: BorderRadius.circular(10.sp), + ), + child: Swiper( + physics: NeverScrollableScrollPhysics(), + autoplay: true, + // controller: 5, + index: 0, + itemBuilder: (BuildContext context, int index) { + Map data = logic.sysData[index]; + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + data['inviter_name'], + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), + Container( + margin: EdgeInsets.only( + left: 5.sp, right: 5.sp), + child: Text( + '邀请', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + )), + Text( + data['invitee_name'], + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), + Container( + margin: EdgeInsets.only(left: 5.sp), + child: Text( + '加入微乐园', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + )), ], - )), - alignment: Alignment.center, - child: Text( - '立即邀请', - style: TextStyle( - color: Color(0xFF000000), - fontSize: 16, - fontWeight: FontWeight.w600), + ), + ); + }, + itemCount: logic.sysData.length, + ), + ), + Container( + height: 220.sp, + width: Get.width - 30.sp, + margin: EdgeInsets.only(top: 10.sp), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 10.sp, + right: 10.sp), + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + getMineImage("invite_count_bg")), + fit: BoxFit.fill, + ), + ), + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + top: 15.sp, left: 35.sp, right: 35.sp), + alignment: Alignment.center, + child: Image.asset( + getMineImage('invite_title'), + height: 22.sp, + ), + ), + Container( + margin: EdgeInsets.only(top: 15.sp), + alignment: Alignment.center, + child: Image.asset( + getMineImage('invite_line'), + height: 1.2.sp, + ), + ), + Container( + height: 70.sp, + margin: EdgeInsets.only( + left: 15.sp, right: 15.sp), + child: Row( + children: [ + Text( + '邀请人数', + style: TextStyle( + color: Color(0xFF0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Expanded( + child: Stack( + // fit: StackFit.expand, + alignment: Alignment.center, + children: [ + Container( + margin: EdgeInsets.only( + left: 61.sp, right: 46.sp), + height: 2.sp, + color: Color(0xFF0DF5F7), + ), + Container( + margin: EdgeInsets.only( + left: 15.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: peopleCountList, + ), + ) + ], + )) + ], + )), + Container( + height: 20.sp, + margin: EdgeInsets.only( + left: 15.sp, right: 15.sp), + child: Row( + children: [ + Text( + '会员时长', + style: TextStyle( + color: Color(0xFF0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Expanded( + child: Stack( + // fit: StackFit.expand, + alignment: Alignment.center, + children: [ + Container( + margin: EdgeInsets.only( + left: 25.sp, right: 15.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: dayCountList), + ) + ], + )), + ], + )), + Expanded(child: Container()), + Container( + margin: EdgeInsets.only( + left: 15.sp, + right: 15.sp, + bottom: 10.sp), + child: RichText( + text: TextSpan(children: allSpan))) + ], + )), + Container( + margin: EdgeInsets.only( + top: 15.sp, + left: 15.sp, + right: 15.sp, + bottom: MediaQuery.of(context).padding.bottom + 10.sp + 50.sp), + height: 565.sp, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + getMineImage("invite_count_bg")), + fit: BoxFit.fill)), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 45.sp), + // height: 40.sp, + child: Row( + children: [ + Expanded( + child: Container( + child: Column( + children: [ + Container( + child: Text( + '${logic.homeData!.inviteCount! ?? 0}人', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.sp), + ), + ), + Container( + margin: + EdgeInsets.only(top: 10.sp), + child: Text( + '已成功邀请', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 12.sp), + ), + ), + ], + ), + ), + ), + Container( + width: 1, + height: 47.sp, + color: Color(0x3AF0F1F4), + ), + Expanded( + child: Container( + child: Column( + children: [ + Container( + child: Text( + '${logic.homeData!.achieveRewardDay! ?? 0}天', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.sp), + ), + ), + Container( + margin: + EdgeInsets.only(top: 10.sp), + child: Text( + '获得会员时长', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 12.sp), + ), + ), + ], + ), + ), + ), + Container( + width: 1, + height: 47.sp, + color: Color(0x3AF0F1F4), + ), + Expanded( + child: Container( + child: Column( + children: [ + Container( + child: Text( + '${logic.directProfit! ?? 0}小票', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.sp), + ), + ), + Container( + margin: + EdgeInsets.only(top: 10.sp), + child: Text( + '直接返利', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 12.sp), + ), + ), + ], + ), + ), + ), + Container( + width: 1, + height: 47.sp, + color: Color(0x3AF0F1F4), + ), + Expanded( + child: Container( + child: Column( + children: [ + Container( + child: Text( + '${logic.rebate! ?? 0}小票', + style: TextStyle( + color: AppColor.mainColor, + fontSize: 14.sp), + ), + ), + Container( + margin: + EdgeInsets.only(top: 10.sp), + child: Text( + '间接返利', + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 12.sp), + ), + ), + ], + ), + ), + ), + ], + ), + ), + buildSegment(), + // Container( + // margin: EdgeInsets.only(top: 21.sp), + // child: Image.asset(getMineImage('icon_yaoqingjilujifenhong'))), + Expanded( + child: Container( + margin: EdgeInsets.only( + top: 15.sp, left: 20.sp, right: 20.sp), + // height: 135.sp, + decoration: BoxDecoration( + color: Color(0x99363542), + borderRadius: + BorderRadiusDirectional.circular( + 4.sp), + border: Border.all( + color: Color(0x99363542), + width: 1.sp)), + child: logic.selectedIndex == 0 && + logic.inveiteData.isEmpty + ? noResultWidget() + : logic.selectedIndex == 1 && + logic.allInveiteData.isEmpty + ? noResultWidget() + : MediaQuery.removePadding( + removeTop:true, + context:context, + child:ListView.builder( + itemBuilder: + (BuildContext context, + int index) { + if (logic.selectedIndex == 0) { + if (index == 0) { + return myTitileWidget(); + } + var data = logic + .inveiteData[index - 1]; + return myRowWidget( + data['nickName'], + data['inviteTime'], + '${data['sysProfit']}票', + '${data['rebate'] > 0 ? data['rebate'] : 0}票(${data['rebateRate']}%)', + data['userId'] + .toString()); + } + + if (index == 0) { + return titileWidget(); + } else if (logic.allInveiteData + .length + + 1 == + index) { + return Container( + margin: EdgeInsets.only( + top: 4.sp, + left: 5.sp, + right: 5.sp), + child: Text( + '温馨提示:仅展示前${logic.allInveiteData.length}名,上榜的推广大使还能获得微乐园APP官方定制的精美礼品一份哦~', + style: TextStyle( + color: Colors.white + .withOpacity( + 0.75), + fontSize: 13.sp), + ), + ); + } + var data = logic + .allInveiteData[index - 1]; + return rowWidget( + data['nickname'], + data['inviteCount'] + .toString(), + data['vipDays'].toString() + + '天', + '${data['directProfit'] > 0 ? data['directProfit'] : 0}票', + '${data['rebate'] > 0 ? data['rebate'] : 0}票', + data['userId'].toString()); + }, + itemCount: logic.selectedIndex == + 0 + ? logic.inveiteData!.length + + 1 + : logic.allInveiteData + .length + + 2 + ), + ))), + if (logic.selectedIndex == 0) + GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.Invite_Record, + arguments: 0); + }, + child: Container( + margin: EdgeInsets.only( + top: 15.sp, bottom: 15.sp), + child: Text( + '查看更多邀请记录>', + style: TextStyle( + color: AppColor.mainColor + .withOpacity(0.75), + fontSize: 12.sp, + fontWeight: FontWeight.w500), + ), + ), + ) + ], + ), + ), + ])), + Positioned( + bottom: 10.sp, + left: 30.sp, + child: SafeArea( + child: GestureDetector( + onTap: () { + shopSharePiker( + logic.homeData!.inviteCode! ?? '', + (logic.homeData!.link! ?? '') + + '#code=${logic.homeData!.inviteCode! ?? ''}'); + }, + child: Container( + width: 150.sp, + height: 42.sp, + margin: EdgeInsets.only(top: 35.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.sp), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + )), + alignment: Alignment.center, + child: Text( + '邀请圈友赚钱', + style: TextStyle( + color: Colors.black, + fontSize: 16, + fontWeight: FontWeight.w600), + ), ), ), ), - ], - ), - ), - Container( - height: 62.sp, - margin: EdgeInsets.only( - left: 20.sp, right: 20.sp, top: 15.sp), - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getMineImage("invite_sys_bg")), - fit: BoxFit.fill, ), - ), - child: Swiper( - physics: NeverScrollableScrollPhysics(), - autoplay: true, - // controller: 5, - index: 0, - itemBuilder: (BuildContext context, int index) { - Map data = logic.sysData[index]; - return Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - data['inviter_name'], - style: TextStyle( - color: Color(0xff0DF5F7), - fontSize: 16.sp, - fontWeight: FontWeight.w500), - ), - Container( - margin: EdgeInsets.only( - left: 5.sp, right: 5.sp), - child: Text( - '邀请', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w500), + Positioned( + bottom: 10.sp, + right: 30.sp, + child: SafeArea( + child: GestureDetector( + onTap: () { + var con; + if (kDebugMode) { + con = V2TimConversation( + conversationID: "c2c_qpqz_dev_10_102", + userID: "qpqz_dev_10_102", + showName: "测试乐园客服", + type: 1); + } else { + con = V2TimConversation( + conversationID: "c2c_qpqz_prod_10_102", + userID: "qpqz_prod_10_102", + showName: "乐园客服", + type: 1); + } + Get.toNamed(AppRoutes.Chat, arguments: con); + }, + child: Container( + width: 150.sp, + height: 42.sp, + margin: EdgeInsets.only(top: 35.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.sp), + gradient: const LinearGradient( + colors: [ + Color(0xFFDC5BFD), + Color(0xFFDC5BFD), + ], )), - Text( - data['invitee_name'], + alignment: Alignment.center, + child: Text( + '联系客服结算', style: TextStyle( - color: Color(0xff0DF5F7), - fontSize: 16.sp, - fontWeight: FontWeight.w500), + color: Colors.white, + fontSize: 16, + fontWeight: FontWeight.w600), ), - Container( - margin: EdgeInsets.only(left: 5.sp), - child: Text( - '加入微乐园', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w500), - )), - ], + ), ), - ); - }, - itemCount: logic.sysData.length, - ), - ), - Container( - height: 220.sp, - width: Get.width-30.sp, - margin: - EdgeInsets.only(top: 15.sp), - padding: EdgeInsets.only(top: 10.sp,bottom: 10.sp,left: 10.sp,right: 10.sp), - decoration: BoxDecoration( - image:DecorationImage( - image: AssetImage(getMineImage("invite_count_bg")), - fit: BoxFit.fill, ), ), - child: Column( - children: [ - Container( - margin: EdgeInsets.only(top: 15.sp,left: 35.sp,right: 35.sp), - alignment: Alignment.center, - child: Image.asset(getMineImage('invite_title'),height: 22.sp,), - ), - Container( - margin: EdgeInsets.only(top: 15.sp), - alignment: Alignment.center, - child: Image.asset(getMineImage('invite_line'),height: 1.2.sp,), - ), - Container( - height: 70.sp, - margin: EdgeInsets.only( - left: 15.sp, right: 15.sp), - child: Row( - children: [ - Text( - '邀请人数', - style: TextStyle( - color: Color(0xFF0DF5F7), - fontSize: 14.sp, - fontWeight: FontWeight.w500), - ), - Expanded( - child: Stack( - // fit: StackFit.expand, - alignment: Alignment.center, - children: [ - Container( - margin: EdgeInsets.only( - left: 61.sp, right: 46.sp), - height: 2.sp, - color: Color(0xFF0DF5F7), - ), - Container( - margin: EdgeInsets.only( - left: 15.sp), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children:peopleCountList, - ), - ) - ], - )) - ], - )), - Container( - height: 20.sp, - margin: EdgeInsets.only( - left: 15.sp, right: 15.sp), - child: Row( - children: [ - Text( - '会员时长', - style: TextStyle( - color: Color(0xFF0DF5F7), - fontSize: 14.sp, - fontWeight: FontWeight.w500), - ), - Expanded( - child: Stack( - // fit: StackFit.expand, - alignment: Alignment.center, - children: [ - Container( - margin: EdgeInsets.only( - left: 25.sp, right: 15.sp), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: dayCountList - ), - ) - ], - )), - ], - )), - Expanded(child: Container()), - Container( - margin: EdgeInsets.only( - left: 15.sp, right: 15.sp,bottom: 10.sp), - child: RichText( - text: TextSpan( - children: allSpan - ))) - ], - )), - SafeArea( - child: Container( - margin: EdgeInsets.only(top: 15.sp), - alignment: Alignment.center, - child: Image.asset(getMineImage('invite_vip_desc'),width: Get.width-30.sp,), - ), - ), - // Container( - // height: 203.sp, - // margin: - // EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.sp), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10.sp), - // color: Color(0x1AFFFFFF), - // ), - // child: Column(children: [ - // Expanded( - // child: ListView.builder( - // itemBuilder: (BuildContext context, int index) { - // return Container( - // margin: EdgeInsets.only(top: 10.sp), - // padding: EdgeInsets.only(left: 15.sp, right: 15.sp), - // child: Row( - // children: [ - // ClipOval( - // child: Image.network( - // 'https://p26-passport.byteacctimg.com/img/user-avatar/b0541a2a377dd239a22eea2934709967~100x100.awebp', - // width: 40.sp, - // height: 40.sp, - // ), - // ), - // SizedBox( - // width: 4.sp, - // ), - // Column( - // children: [ - // Text( - // '2222', - // style: TextStyle( - // color: Colors.white, fontSize: 14.sp), - // ), - // ], - // ) - // ], - // ), - // ); - // }, - // itemCount: 5, - // )) - // ])), - ])); + ], + ); }))); } + titileWidget() { + return Container( + height: 41.sp, + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: infoText('推广大使'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('邀请人数'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('获会员'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('直接返利'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('间接返利'), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + myTitileWidget() { + return Container( + height: 41.sp, + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: infoText('圈友'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('邀请时间'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('平台所得'), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText('平台为您返利'), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + infoText(String info, [Color color = const Color(0xFFF7FAFA)]) { + return Center( + child: Text( + info, + style: TextStyle(color: color, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), + ); + } + + myRowWidget( + String str1, + String str2, + String str3, + String str4, + String userId, + ) { + return Container( + height: 41.sp, + // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: userId); + }, + child: infoText(str1, AppColor.mainColor)), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str2, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str3, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str4, Colors.white), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + rowWidget( + String str1, + String str2, + String str3, + String str4, + String str5, + String userId, + ) { + return Container( + height: 41.sp, + // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), + child: Column( + children: [ + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: userId); + }, + child: infoText(str1, AppColor.mainColor)), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str2, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str3, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str4, Colors.white), + flex: 1, + ), + Container( + width: 1, + color: Color(0x0AFFFFFF), + ), + Expanded( + child: infoText(str5, Colors.white), + flex: 1, + ), + ], + ), + ), + Container( + height: 1, + color: Color(0x0AFFFFFF), + ), + ], + ), + ); + } + + buildSegment() { + return Container( + margin: EdgeInsets.only(top: 15.sp), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.sp)), + child: CupertinoSegmentedControl( + //子标签 + children: { + 0: Container( + margin: EdgeInsets.only(left: 10.sp, right: 10.sp), + child: Text( + "邀请记录及返利", + style: TextStyle( + color: logic.selectedIndex == 0 + ? Colors.black + : AppColor.mainColor, + fontSize: 14.sp, + ), + ), + ), + 1: Container( + margin: EdgeInsets.only(left: 10.sp, right: 10.sp), + child: Text( + "推广大使邀请榜", + style: TextStyle( + color: logic.selectedIndex == 1 + ? Colors.black + : AppColor.mainColor, + fontSize: 14.sp), + ), + ) + }, + //当前选中的索引 + groupValue: logic.selectedIndex, + //点击回调 + onValueChanged: (int index) { + print("当前选中 $index"); + + logic.selectedIndex = index; + logic.update(); + }, + //选中的背景颜色 + selectedColor: AppColor.mainColor, + //未选中的背景颜色 + unselectedColor: Colors.transparent, + + //边框颜色 + borderColor: AppColor.mainColor, + //按下的颜色 + // pressedColor: Colors.white, + ), + ); + } + peopleCountWidget(String count, bool isCheck) { return Container( width: 46.sp, height: 46.sp, alignment: Alignment.center, - decoration: - BoxDecoration(color: isCheck ? Color(0xFF0DF5F7) : Color(0xFF504261), shape: BoxShape.circle), + decoration: BoxDecoration( + color: isCheck ? Color(0xFF0DF5F7) : Color(0xFF504261), + shape: BoxShape.circle), child: Text( '$count人', - style: TextStyle(color:isCheck ? Color(0xFF000000) : Colors.white, fontSize: 12.sp), + style: TextStyle( + color: isCheck ? Color(0xFF000000) : Colors.white, fontSize: 12.sp), ), ); } @@ -446,11 +1047,9 @@ class InvitePage extends StatelessWidget { ); } - void shopSharePiker(String code,String link) { - Get.bottomSheet( - Share(code,link), isScrollControlled: true, - enableDrag: false - ); + void shopSharePiker(String code, String link) { + Get.bottomSheet(Share(code, link), + isScrollControlled: true, enableDrag: false); } } @@ -493,7 +1092,7 @@ void showCodePicker(InviteLogic logic) { decoration: InputDecoration( hintText: '请输入邀请码', hintStyle: - TextStyle(color: Colors.white70, fontSize: 16.sp), + TextStyle(color: Colors.white70, fontSize: 16.sp), border: InputBorder.none, counterText: '', contentPadding: EdgeInsets.only(left: 16.sp)), @@ -527,8 +1126,8 @@ void showCodePicker(InviteLogic logic) { color: Color(0x1AFFFFFF)), child: const Text( '放弃对接', - style: TextStyle( - color: Colors.white, fontSize: 16), + style: + TextStyle(color: Colors.white, fontSize: 16), ), ), ), @@ -555,8 +1154,8 @@ void showCodePicker(InviteLogic logic) { )), child: const Text( '确认对接', - style: TextStyle( - color: Colors.black, fontSize: 16), + style: + TextStyle(color: Colors.black, fontSize: 16), ), ), ) diff --git a/circle_app/lib/app/login/login/logic.dart b/circle_app/lib/app/login/login/logic.dart index 64ecd17..18ff14b 100644 --- a/circle_app/lib/app/login/login/logic.dart +++ b/circle_app/lib/app/login/login/logic.dart @@ -6,6 +6,7 @@ import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/util/util.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; @@ -22,11 +23,15 @@ class LoginLogic extends GetxController { int loginType = 0; bool isGetCode = false; + String clipboardStr = ''; + @override void onReady() { // TODO: implement onReady super.onReady(); FlutterNativeSplash.remove(); + readClipboardData(); + } @override @@ -70,6 +75,20 @@ class LoginLogic extends GetxController { } } + /// 从剪贴板读取信息 + void readClipboardData() async { + var dataText = await Clipboard.getData(Clipboard.kTextPlain); + if (dataText != null) { + if ((dataText!.text! ?? '').isNotEmpty) { + String codeStr = dataText!.text!; + if (codeStr.startsWith('https://leyuan666.com/#code=')) { + String code = codeStr.split('#code=').last; + clipboardStr = code; + } + } + } + } + Future getCode() async { SmartDialog.showLoading(msg: '正在发送中'); var data = await DioManager.instance.post( @@ -133,6 +152,9 @@ class LoginLogic extends GetxController { "phone": phoneEditingController.text, "code": codeEditingController.text }; + if (clipboardStr.isNotEmpty) { + params['inviteCode'] = clipboardStr; + } } else { params = { "phone": phoneEditingController.text, diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index f4aeb52..50a7553 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -355,7 +355,7 @@ class _MinefragmentPageState extends State with RouteAware { ), SizedBox(width: 10.sp), const Text( - "邀请得会员", + "邀请赚钱", style: TextStyle(color: Colors.white), ), 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 5812adb..ac942a2 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -1123,8 +1123,11 @@ class _TIMConversationState extends TIMUIKitState { ); if (data['code'] == 200) { - recommendCircleFriendData = data['data'][0]; - setState(() {}); + List dataList = data['data']; + if (dataList.isNotEmpty) { + recommendCircleFriendData = data['data'][0]; + setState(() {}); + } } else { showOKToast(data['msg']); if (data['code'] == 21201 || data['code'] == 21202) { diff --git a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation_item.dart b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation_item.dart index 40d889d..cc57237 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation_item.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation_item.dart @@ -248,7 +248,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget { child: Image( image: AssetImage(getBaseImage(vipType == 2 ? 'year_vip' : "vip")), width: 44.sp, - height: 18.sp, + height: 20.sp, ) ,), Expanded( diff --git a/circle_app/lib/app/msg/series/binding.dart b/circle_app/lib/app/msg/series/binding.dart new file mode 100644 index 0000000..4c1036b --- /dev/null +++ b/circle_app/lib/app/msg/series/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class SeriesBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => SeriesLogic()); + } +} diff --git a/circle_app/lib/app/msg/series/logic.dart b/circle_app/lib/app/msg/series/logic.dart new file mode 100644 index 0000000..427dd59 --- /dev/null +++ b/circle_app/lib/app/msg/series/logic.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:circle_app/network/api.dart'; +import 'package:circle_app/network/dio_manager.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class SeriesLogic extends GetxController { + ScrollController scrollController = ScrollController(); + final RefreshController refreshController = RefreshController(); + List listData = []; + bool isMore = true; + int page = 1; + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + loadData(); + } + + void loadData() async { + var data = await DioManager.instance.post( + url: Api.getActivityDetail+Get.arguments['id'].toString(),params: {'page':page,'pageSize':20}); + + if (data['code'] == 200) { + List list = data['data']; + if (list.isNotEmpty) { + listData.addAll(list); + isMore = false; + refreshController.loadComplete(); + } else { + isMore = false; + refreshController.loadNoData(); + } + update(); + } + } + + void loadMore() { + page = page + 1; + loadData(); + } + + +} diff --git a/circle_app/lib/app/msg/series/view.dart b/circle_app/lib/app/msg/series/view.dart new file mode 100644 index 0000000..5a86e9d --- /dev/null +++ b/circle_app/lib/app/msg/series/view.dart @@ -0,0 +1,54 @@ +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 '../../../components/my_app_bar.dart'; +import '../../../util/util.dart'; +import '../sys_notify_list/platform_item.dart'; +import 'logic.dart'; + +class SeriesPage extends StatelessWidget { + SeriesPage({Key? key}) : super(key: key); + + final logic = Get.find(); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("bg")), + fit: BoxFit.cover, + ), + ), + child: GetBuilder(builder: (logic) { + return Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: Get.arguments['title'], + ), + body: logic.listData.isEmpty && logic.isMore + ? loaddingWidget(true) + : SmartRefresher( + controller: logic.refreshController, + enablePullUp: true, + enablePullDown: false, + onLoading: () { + logic.loadMore(); + }, + child: ListView.builder( + controller: logic.scrollController, + itemBuilder: (context, index) { + if (index == logic.listData.length) { + return loaddingWidget(logic.isMore); + } + return PlatformWdiget(list: logic.listData[index]); + }, + itemCount: logic.listData.isNotEmpty + ? logic.listData.length + 1 + : 0, + ))); + })); + } +} diff --git a/circle_app/lib/app/msg/sys_notify_list/logic.dart b/circle_app/lib/app/msg/sys_notify_list/logic.dart index 636f8c1..4cf9b61 100644 --- a/circle_app/lib/app/msg/sys_notify_list/logic.dart +++ b/circle_app/lib/app/msg/sys_notify_list/logic.dart @@ -14,12 +14,17 @@ class Sys_notify_listLogic extends GetxController { final RefreshController refreshController = RefreshController(); V2TimConversation? con; - int page = 0; + int page = 1; + int isVip = 0; bool isLoad = true; bool isMore = true; List lists = []; + List serieslists = []; + + List normallists = []; + List msgLists = []; @override @@ -30,12 +35,45 @@ class Sys_notify_listLogic extends GetxController { if (con!.showName! == '互动通知') { // 拉取单聊历史消息 loadMsgList(); + } else if (con!.showName! == '活动驿站') { + loadActivityList(); } else { initList(); } } + loadActivityList() async { + if (serieslists.isEmpty) { + var seriesData = + await DioManager.instance.get(url: Api.getSeriesActivity,); + if (seriesData['code'] == 200) { + if (seriesData['data'] != null) { + serieslists = seriesData['data']; + } + } + } + + var normalData = + await DioManager.instance.post(url: Api.getNormalActivity,params: {'page':1, 'pageSize':20}); + + if (normalData['code'] == 200) { + if (normalData['data'] != null) { + List list = normalData['data']; + if (list.isNotEmpty) { + normallists.addAll(list); + refreshController.loadComplete(); + } else { + refreshController.loadNoData(); + } + } + } else { + refreshController.loadNoData(); + } + isLoad = false; + update(); + } + loadMsgList() async { String msgId = ''; if (msgLists.isNotEmpty) { @@ -170,6 +208,11 @@ class Sys_notify_listLogic extends GetxController { } } + void loadMore() { + page = page + 1; + loadActivityList(); + } + } class Lists { diff --git a/circle_app/lib/app/msg/sys_notify_list/platform_item.dart b/circle_app/lib/app/msg/sys_notify_list/platform_item.dart new file mode 100644 index 0000000..68523ec --- /dev/null +++ b/circle_app/lib/app/msg/sys_notify_list/platform_item.dart @@ -0,0 +1,84 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../router/app_routers.dart'; +import '../../../util/util.dart'; + +class PlatformWdiget extends StatelessWidget { + var list; + PlatformWdiget({Key? key,required this.list}) : super(key: key); + + @override + Widget build(BuildContext context) { + // TODO: implement build + return GestureDetector( + onTap: () { + if (list['scene'] == 'url') { + Map bean = json.decode(list['note']); + String url = bean['url']; + + Get.toNamed(AppRoutes.WebViewActivity, + arguments: {'title': "", "url": url}); + } else { + if (list['note'] == null) { + // Map bean = json.decode(data.note!); + pushPage(list['scene'], ''); + } else { + Map bean = json.decode(list['note']); + pushPage(list['note'], bean['param']); + } + } + }, + child: Container( + margin: EdgeInsets.only(top: 15.sp, left: 5.sp, right: 5.sp), + // padding: EdgeInsets.only(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.sp), color: Color(0xFF292836)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (list['picUrl'] != null) + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.sp), + topRight: Radius.circular(10.sp)), + child: Image.network( + list['picUrl'], + width: Get.width, + fit: BoxFit.fill, + height: 114.sp, + )), + if (list['name'] != null) + Padding( + padding: EdgeInsets.only(left: 15.sp, right: 17.sp, top: 8.sp), + child: Text( + list['name'], + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ), + ), + if (list['description'] != null) + Padding( + padding: EdgeInsets.only( + left: 15.sp, right: 15.sp, top: 8.sp,), + child: Text( + list['description'], + style: TextStyle(color: Color(0xFFB7BECC), fontSize: 12.sp), + ), + ), + Padding( + padding: EdgeInsets.only( + left: 15.sp, right: 15.sp, top: 10.sp, bottom: 10.sp), + child: Text( + '活动时间: ${list['startTime'].split('T').first}至${list['endTime'].split('T').first}', + style: TextStyle(color: Color(0xFFB7BECC), fontSize: 12.sp), + )) + ], + ), + ), + ); + } + +} \ No newline at end of file diff --git a/circle_app/lib/app/msg/sys_notify_list/view.dart b/circle_app/lib/app/msg/sys_notify_list/view.dart index d312b44..f547fa8 100644 --- a/circle_app/lib/app/msg/sys_notify_list/view.dart +++ b/circle_app/lib/app/msg/sys_notify_list/view.dart @@ -1,9 +1,13 @@ import 'dart:convert'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/app/msg/series/view.dart'; +import 'package:circle_app/app/msg/sys_notify_list/platform_item.dart'; +import 'package:circle_app/common/Widgets/base_tip_widget.dart'; import 'package:circle_app/components/my_app_bar.dart'; import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/util/util.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -11,6 +15,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import '../../home/logic.dart'; +import '../series/view.dart'; +import '../series/view.dart'; import 'logic.dart'; class Sys_notify_listPage extends StatelessWidget { @@ -31,46 +37,171 @@ class Sys_notify_listPage extends StatelessWidget { backgroundColor: Colors.transparent, appBar: MyAppBar( centerTitle: logic.con != null ? logic.con!.showName! ?? '' : '', + actionWdiget: logic.con != null ? logic.con!.showName == '活动驿站' ? InkWell( + onTap: () { + var con; + if(kDebugMode){ + con = V2TimConversation( + conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1); + }else{ + con = V2TimConversation( + conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1); + } + Get.toNamed(AppRoutes.Chat, arguments: con); + }, + child: Text('联系客服',style: TextStyle(color: Colors.white,fontSize: 15.sp),)) : Container() : Container(), ), body: Container( width: Get.width, height: Get.height, - child: SafeArea( - child: logic.isLoad - ? loaddingWidget(true) - : logic.lists.isEmpty && logic.msgLists.isEmpty - ? noResultWidget() - : logic.msgLists.isNotEmpty - ? SmartRefresher( - controller: logic.refreshController, - enablePullUp: true, - enablePullDown:false, - onLoading: () { - logic.onLoadingMsgList(); - }, - child: ListView.builder( - padding: EdgeInsets.all(10.sp), - itemCount: logic.msgLists.length, - itemBuilder: (context, index) { - return msgItem(logic.msgLists![index]); - }, - ), - ) - : SmartRefresher( - controller: logic.refreshController, - enablePullUp: true, - onRefresh: logic.onRefresh, - onLoading: () { - logic.onLoading(); - }, - child: ListView.builder( - padding: EdgeInsets.all(10.sp), - itemCount: logic.lists.length, - itemBuilder: (context, index) { - return ListItem(logic.lists[index]); - }, - ), + child: Column( + children: [ + Expanded( + child: SafeArea( + child: logic.isLoad + ? loaddingWidget(true) + : logic.lists.isEmpty && + logic.msgLists.isEmpty && + logic.serieslists.isEmpty && + logic.normallists.isNotEmpty + ? noResultWidget() + : logic.msgLists.isNotEmpty || + logic.serieslists.isEmpty || + logic.normallists.isNotEmpty + ? SmartRefresher( + controller: logic.refreshController, + enablePullUp: true, + enablePullDown: false, + onLoading: () { + if (logic.con!.showName == '活动驿站') { + logic.loadMore(); + } else { + logic.onLoadingMsgList(); + } + }, + child: ListView.builder( + padding: EdgeInsets.all(10.sp), + itemCount: logic.con!.showName == '活动驿站' + ? logic.serieslists.length + + (logic.normallists.isNotEmpty + ? 1 + : 0) + : logic.msgLists.length, + itemBuilder: (context, index) { + if (logic.con!.showName == '活动驿站') { + if (index == 0 && + logic.serieslists.isNotEmpty) { + return activeHorItem(); + } else { + if (logic.serieslists.isNotEmpty) { + return PlatformWdiget( + list: logic + .normallists[index - 1]); + } + } + return PlatformWdiget( + list: + logic.normallists[index - 1]); + } + return msgItem(logic.msgLists![index]); + }, + ), + ) + : SmartRefresher( + controller: logic.refreshController, + enablePullUp: true, + onRefresh: logic.onRefresh, + onLoading: () { + logic.onLoading(); + }, + child: ListView.builder( + padding: EdgeInsets.all(10.sp), + itemCount: logic.lists.length, + itemBuilder: (context, index) { + return ListItem(logic.lists[index]); + }, + ), + ), + ), + ), + if (logic.con!.showName != '官方通知' && + logic.con!.showName != '系统通知' && + logic.con!.showName != '活动驿站' && + logic.con!.showName != '互动通知') + SafeArea( + child: Container( + height: 40.sp, + color: Color(0xFF090B14), + child: Row( + children: [ + Expanded( + child: GestureDetector( + onTap: () { + if (logic.con!.showName == '会员中心') { + showOepnVipDialog(); + } else if (logic.con!.showName == '资产中心') { + Get.toNamed(AppRoutes.MyAssets); + } else { + Get.toNamed(AppRoutes.MyCircle); + } + }, + behavior: HitTestBehavior.opaque, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(right: 4.sp), + child: Image.network( + logic.con!.faceUrl!, + width: 20.sp, + ), + ), + Text( + logic.con!.showName == '会员中心' + ? '会员中心' + : logic.con!.showName == '资产中心' + ? '资产中心' + : '我的圈子', + style: TextStyle( + color: Colors.white, fontSize: 15.sp), + ) + ], ), + ), + )), + Container( + height: 20.sp, + width: 0.5.sp, + color: Colors.white.withOpacity(0.5), + ), + Expanded( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.HelpActivity); + }, + behavior: HitTestBehavior.opaque, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + getHomeImage("mine_help"), + width: 20.sp, + ), + Text( + '帮助与反馈', + style: TextStyle( + color: Colors.white, + fontSize: 15.sp), + ) + ], + ), + ))), + ], + ), + )) + ], ), ), ), @@ -78,18 +209,102 @@ class Sys_notify_listPage extends StatelessWidget { }); } - msgItem(V2TimMessage data) { + activeHorItem() { + return Container( + padding: EdgeInsets.only(left: 0.sp), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '系列活动', + style: TextStyle(color: Colors.white, fontSize: 16.sp), + ), + SizedBox(height: 10.sp), + Container( + width: Get.width, + height: 165.sp, + child: ListView.builder( + itemBuilder: (context, index) { + return Container( + height: 165.sp, + width: 160.sp, + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.SeriesPage, + arguments: {'id':logic.serieslists[index]['id'].toString(),'title':logic.serieslists[index]['name'] }); + }, + child: seriesWidget(logic.serieslists[index]), + ), + ); + }, + itemCount: logic.serieslists.length, + scrollDirection: Axis.horizontal, + ), + ), + SizedBox(height: 10.sp), + Text( + '平台活动', + style: TextStyle(color: Colors.white, fontSize: 16.sp), + ), + SizedBox(height: 10.sp), + ], + ), + ); + } + seriesWidget(var list) { + return Container( + margin: EdgeInsets.only(right: 15.sp), + // padding: EdgeInsets.only(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.sp), color: Color(0xFF292836)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (list['picUrl'] != null) + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.sp), + topRight: Radius.circular(10.sp)), + child: Image.network( + list['picUrl'], + width: Get.width, + fit: BoxFit.cover, + height: 100.sp, + )), + if (list['name'] != null) + Padding( + padding: EdgeInsets.only(left: 15.sp, right: 17.sp, top: 8.sp), + child: Text( + list['name'], + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ), + ), + if (list['description'] != null) + Padding( + padding: EdgeInsets.only( + left: 15.sp, right: 5.sp, top: 8.sp, bottom: 10.sp), + child: Text( + list['description'], + style: TextStyle(color: Color(0xFFB7BECC), fontSize: 12.sp), + ), + ), + ], + ), + ); + } + + msgItem(V2TimMessage data) { Map info = jsonDecode(data.customElem!.data!); if (info['ta'] != null) { return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - if (info.containsKey('scene')) { if (info['scene'] != null) { String param = info['param']; - pushPage(info['scene'], param,name: info['ta']['nickname'] ?? ''); + pushPage(info['scene'], param, + name: info['ta']['nickname'] ?? ''); } else { Get.toNamed(AppRoutes.UserInfoActivity, arguments: info['ta']['id'].toString()); @@ -109,8 +324,8 @@ class Sys_notify_listPage extends StatelessWidget { child: Image.network( info['ta']['avatarUrl'] != null ? info['ta']['avatarUrl'].toString().isNotEmpty - ? info['ta']['avatarUrl'] - : 'http://qiniuyun.ikuayou.com/avatar/default/default_header.png' + ? info['ta']['avatarUrl'] + : 'http://qiniuyun.ikuayou.com/avatar/default/default_header.png' : 'http://qiniuyun.ikuayou.com/avatar/default/default_header.png', width: 50.sp, height: 50.sp, @@ -147,9 +362,8 @@ class Sys_notify_listPage extends StatelessWidget { width: Get.width - 100.sp, child: Text( info['msg'], - style: TextStyle( - color: Colors.white54, - fontSize: 14.sp), + style: + TextStyle(color: Colors.white54, fontSize: 14.sp), ), ), SizedBox( @@ -159,7 +373,8 @@ class Sys_notify_listPage extends StatelessWidget { info['noticeTime'], style: TextStyle( color: Colors.white54, - fontSize: 12.sp,), + fontSize: 12.sp, + ), ), ], ), @@ -212,8 +427,6 @@ class Sys_notify_listPage extends StatelessWidget { } } - - ListItem(Lists data) { V2TimConversation con = Get.arguments; List widgets = []; @@ -270,7 +483,6 @@ class Sys_notify_listPage extends StatelessWidget { Map bean = json.decode(data.note!); pushPage(data.scene!, bean['param']); } - } }, child: Container( diff --git a/circle_app/lib/app/msg/view.dart b/circle_app/lib/app/msg/view.dart index 5a96935..7305699 100644 --- a/circle_app/lib/app/msg/view.dart +++ b/circle_app/lib/app/msg/view.dart @@ -80,14 +80,13 @@ class _MsgPageState extends State with AutomaticKeepAliveClientMixin { Expanded(child: TIMConversation( autoScrollController: logic.scrollController, scrollController: logic.listScrollController, - onTapItem: (selectedConv) async{ + onTapItem: (selectedConv) async { String type = selectedConv.userID!.split('_')[2]; if (int.parse(type) == 11) { Get.toNamed(AppRoutes.Sys_notify_list, arguments: selectedConv); return; } Get.toNamed(AppRoutes.Chat, arguments: selectedConv); - }, )) ], @@ -196,32 +195,21 @@ class _MsgPageState extends State with AutomaticKeepAliveClientMixin { ), ) : Container(),)), - ShaderMask( - shaderCallback: (Rect bounds) { - return const LinearGradient( - begin: Alignment(0.0, -1.0), - end: Alignment.bottomCenter, - colors: [Color(0xff71F3F2), Color(0xffF657FF)], - ).createShader(Offset.zero & bounds.size); + GestureDetector( + onTap: () { + logic.listScrollController.animateTo( + 0.0, + duration: Duration(milliseconds: 300), + curve: Curves.easeInOut, + ); }, - child: GestureDetector( - onTap: () { - logic.listScrollController.animateTo( - 0.0, - duration: Duration(milliseconds: 300), - curve: Curves.easeInOut, - ); - }, - child: Text( - '消息', - style: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w600, - color: Colors.white, - shadows: const [ - Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1)) - ]), - ), + child: Text( + '消息', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w600, + color: AppColor.mainColor, + ), ), ), Positioned( diff --git a/circle_app/lib/app/my_circle/logic.dart b/circle_app/lib/app/my_circle/logic.dart index fc5d326..d847396 100644 --- a/circle_app/lib/app/my_circle/logic.dart +++ b/circle_app/lib/app/my_circle/logic.dart @@ -59,7 +59,9 @@ class MyCircleLogic extends GetxController { var bean = BaseResponse.fromJson( data, (data) => InterestsBean.fromJson(data)); - circle.lists.addAll(bean.data!); + + + circle.lists.addAll(bean.data!.lists); if (circle.lists.length < 20 * page) { isMore = false; diff --git a/circle_app/lib/app/userinfo/logic.dart b/circle_app/lib/app/userinfo/logic.dart index c9ef8f9..2064677 100644 --- a/circle_app/lib/app/userinfo/logic.dart +++ b/circle_app/lib/app/userinfo/logic.dart @@ -219,7 +219,7 @@ class UserinfoLogic extends GetxController { } else { bool isTip = await checkIsShowTip(); if (isTip) { - showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){ + showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname ?? '',ageMsg,userInfoBean!.avatarThumb,0,(){ setLike(); }); } diff --git a/circle_app/lib/common/Widgets/base_tip_widget.dart b/circle_app/lib/common/Widgets/base_tip_widget.dart index 92b0865..f2f8059 100644 --- a/circle_app/lib/common/Widgets/base_tip_widget.dart +++ b/circle_app/lib/common/Widgets/base_tip_widget.dart @@ -13,6 +13,7 @@ import '../../network/dio_manager.dart'; import '../../util/PaymentUtils.dart'; import 'RechargeScreenDialog.dart'; import 'open_vip_tip/logic.dart'; +import 'open_vip_tip/view.dart'; bool isZfbPrice = true; @@ -285,4 +286,14 @@ Future showRechargeScreenDialog() { return RechargeScreenDialog(isShowBalance: true,); }, ); +} + +showOepnVipDialog() async { + return Get.bottomSheet( + Scaffold( + backgroundColor: Colors.transparent, + body: Open_vip_tipPage(false), + ), + isScrollControlled: true, + enableDrag: false); } \ No newline at end of file diff --git a/circle_app/lib/common/Widgets/today_people_dialog.dart b/circle_app/lib/common/Widgets/today_people_dialog.dart index 560edfe..ee254ed 100644 --- a/circle_app/lib/common/Widgets/today_people_dialog.dart +++ b/circle_app/lib/common/Widgets/today_people_dialog.dart @@ -34,9 +34,12 @@ class _TodayPeopleDialogState extends State { ); if (data['code'] == 200) { - recommendCircleFriendData = data['data'][0]; - if (mounted) { - setState(() {}); + List dataList = data['data']; + if (dataList.isNotEmpty) { + recommendCircleFriendData = data['data'][0]; + if (mounted) { + setState(() {}); + } } } else { showOKToast(data['msg']); diff --git a/circle_app/lib/main.dart b/circle_app/lib/main.dart index a0f1a16..e690812 100644 --- a/circle_app/lib/main.dart +++ b/circle_app/lib/main.dart @@ -55,12 +55,13 @@ void main() { if (isAgreemement) { FlutterBugly.init( androidAppId: "8509314e11", - iOSAppId: "51e7b4e472", ); } + } else { + FlutterBugly.init( + iOSAppId: "51e7b4e472", + ); } - - }); if (Platform.isAndroid) { getLostData(); diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index 7b128da..8fff4ba 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -205,9 +205,17 @@ class Api { //邀请好友主页 static const inviteMainPage = 'user-service/invite/mainPage'; + //邀请统计 + static const inviteTotal = '/user-service/invite/total'; //系统随机的邀请记录 static const inviteSysRecord = 'user-service/invite/record/rand'; + //邀请记录 + static const inviteRecord = '/user-service/invite/record'; + + //邀请总榜 + static const inviteRankRecord = '/user-service/invite/rank/all'; + //填写邀请码 static const inviteFillIn = 'user-service/invite/fillin'; @@ -300,6 +308,7 @@ class Api { //聊天推荐圈友 static const chatRecommendFriend = '/msg-service/im/chat/recommend/v2'; + //是否显示送礼物 static const isShow_give_gift = '/msg-service/message/show_give_gift/'; @@ -309,5 +318,14 @@ class Api { //是否弹窗 static const popup = '/user-service/follow/popup/'; + //获取普通活动 + static const getNormalActivity = '/msg-service/activity/normal'; + + //获取系列活动 + static const getSeriesActivity = '/msg-service/activity/series'; + + //获取系列活动详细信息 + static const getActivityDetail = '/msg-service/activity/series/detail/'; + } \ No newline at end of file diff --git a/circle_app/lib/network/dio_manager.dart b/circle_app/lib/network/dio_manager.dart index 2c5812d..09d047f 100644 --- a/circle_app/lib/network/dio_manager.dart +++ b/circle_app/lib/network/dio_manager.dart @@ -40,7 +40,11 @@ class DioManager { int type = Random().nextInt(2); _dio ??= Dio(BaseOptions( // baseUrl2 - baseUrl: type == 1 ? Api.baseUrl2 : Api.baseUrl1, + baseUrl: + + Api.baseUrl, + + // type == 1 ? Api.baseUrl2 : Api.baseUrl1, // 连接服务器超时时间,单位是毫秒 connectTimeout: const Duration(seconds: 30), // 接收数据的最长时限 diff --git a/circle_app/lib/router/app_pages.dart b/circle_app/lib/router/app_pages.dart index abfcfbf..4311734 100644 --- a/circle_app/lib/router/app_pages.dart +++ b/circle_app/lib/router/app_pages.dart @@ -79,6 +79,10 @@ import '../app/externalshare/binding.dart'; import '../app/externalshare/view.dart'; import '../app/good_reviews/binding.dart'; import '../app/good_reviews/view.dart'; +import '../app/invent_record/binding.dart'; +import '../app/invent_record/view.dart'; +import '../app/msg/series/binding.dart'; +import '../app/msg/series/view.dart'; import '../app/my_assets/binding.dart'; import '../app/privacy/binding.dart'; import '../app/quick/binding.dart'; @@ -267,7 +271,15 @@ class AppPages { GetPage(name: AppRoutes.GiftShopPage, page: () => Gift_shopPage(), binding: Gift_shopBinding(),), GetPage(name: AppRoutes.Quick, page: () => QuickPage(), - binding: QuickBinding(),) - + binding: QuickBinding(),), + GetPage( + name: AppRoutes.SeriesPage, + page: () => SeriesPage(), + binding: SeriesBinding(), + ), + GetPage( + name: AppRoutes.Invite_Record, + page: () => Invent_recordPage(), + binding: Invent_recordBinding()), ]; } diff --git a/circle_app/lib/router/app_routers.dart b/circle_app/lib/router/app_routers.dart index 497037b..2a28a4b 100644 --- a/circle_app/lib/router/app_routers.dart +++ b/circle_app/lib/router/app_routers.dart @@ -27,9 +27,9 @@ abstract class AppRoutes { static const MyCircle = '/myCircle'; static const SetPasswordActivity = '/SetPasswordActivity'; static const MyFeedBackListActivity = '/mine/MyFeedBackListActivity'; - + static const SeriesPage = '/notice/SeriesPage'; static const Sys_notify_list = '/msg/Sys_notify_list'; - + static const Invite_Record = '/Invite/record'; static const PrivacyActivity = '/user/PrivacyActivity'; static const Signal_circle_list = '/msg/chat/signal_circle_list'; diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index 5f89bf7..d1b03b3 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -179,14 +179,12 @@ String convertToTenThousand(int number) { pushLoginPage() async { await logoutIM(); SharedPreferencesHelper.getInstance().then((sharedPreferences) { - bool agreement = - sharedPreferences.getBool(SharedPreferencesHelper.AGREEMENT) ?? false; String loginPhone = sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ?? ""; print(loginPhone); sharedPreferences.clear(); sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, loginPhone); - sharedPreferences.setBool(SharedPreferencesHelper.AGREEMENT, agreement); + sharedPreferences.setBool(SharedPreferencesHelper.AGREEMENT, true); sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1'); }); @@ -947,18 +945,20 @@ pushPage(String action,String param,{String name = ''}) { // public final static String INVITE = "invite";//邀请页 // public final static String WALLET = "wallet";//个人资产/钱包 if (action == 'my_main') { + Get.until((route) => route.settings.name == '/home'); final homeLogic = Get.put(HomeLogic()); homeLogic.tabController.animateTo(3); homeLogic.updateIndex(3); - Get.back(); } else if (action == 'my_user_home') { Get.toNamed(AppRoutes.UserInfoActivity); } else if (action == 'find_page') { + Get.until((route) => route.settings.name == '/home'); final homeLogic = Get.put(HomeLogic()); homeLogic.tabController.animateTo(0); homeLogic.updateIndex(0); - Get.back(); - EventBusManager.fire(ChangeIndex(2)); + Future.delayed(Duration(milliseconds: 200),() { + EventBusManager.fire(ChangeIndex(2)); + }); } else if (action == 'to_user_home' || action == 'user_home_callout') { Get.toNamed(AppRoutes.UserInfoActivity,arguments: param); } else if (action == 'my_gift_hall') {