diff --git a/circle_app/lib/circle_app/circle_list/widgets/hug_tip.dart b/circle_app/lib/circle_app/circle_list/widgets/hug_tip.dart index 04d8e5e..6bf17e4 100644 --- a/circle_app/lib/circle_app/circle_list/widgets/hug_tip.dart +++ b/circle_app/lib/circle_app/circle_list/widgets/hug_tip.dart @@ -28,10 +28,6 @@ class _HugTipState extends State { int index = 1; sendHugCount() async { - // [parameters setValue:self.hugCount forKey:@"hugCount"]; - // [parameters setValue:self.objId forKey:@"objId"]; - // [parameters setValue:@"2" forKey:@"objType"]; - var result = await DioManager.instance.post(url: Api.rewardAgent,params: {'amount':widget.rewardConfigs[index],'interestAgentId':widget.circleId}); if (result['code'] == 200) { showOKToast('打赏成功'); diff --git a/circle_app/lib/circle_app/home/logic.dart b/circle_app/lib/circle_app/home/logic.dart index bae0c6b..5cafc50 100644 --- a/circle_app/lib/circle_app/home/logic.dart +++ b/circle_app/lib/circle_app/home/logic.dart @@ -48,6 +48,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { int currentIndex = 0; int showMsgTipCount = 0; String inventStr = '邀请好友'; + String inventTipStr = '邀请更多圈友一起玩'; Widget currentPage = Container(); final HomeState state = HomeState(); @@ -590,6 +591,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { String phone = sp.getString(SharedPreferencesHelper.LOGINPHONE); if (phone != '18800000100') { inventStr = '邀请赚钱'; + inventTipStr = '免费领取会员'; } } } diff --git a/circle_app/lib/circle_app/invite/logic.dart b/circle_app/lib/circle_app/invite/logic.dart index 49cae96..877b581 100644 --- a/circle_app/lib/circle_app/invite/logic.dart +++ b/circle_app/lib/circle_app/invite/logic.dart @@ -9,7 +9,7 @@ import 'state.dart'; class InviteLogic extends GetxController { final InviteState state = InviteState(); - bool isLoad = true; + bool isLoadData = true; ScrollController scrollController = ScrollController(); @@ -108,7 +108,7 @@ class InviteLogic extends GetxController { var recorddata = await DioManager.instance.get(url: Api.inviteSysRecord); if (recorddata['code'] == 200) { sysData = recorddata['data']; - isLoad = false; + isLoadData = false; update(); } diff --git a/circle_app/lib/circle_app/invite/my_invite_page.dart b/circle_app/lib/circle_app/invite/my_invite_page.dart new file mode 100644 index 0000000..e3cf215 --- /dev/null +++ b/circle_app/lib/circle_app/invite/my_invite_page.dart @@ -0,0 +1,938 @@ +import 'package:circle_app/circle_app/home/logic.dart'; +import 'package:circle_app/circle_app/invite/share.dart'; +import 'package:circle_app/circle_app/swiper/view.dart'; +import 'package:circle_app/commons/Widgets/rich_text.dart'; +import 'package:circle_app/commons/colors/app_color.dart'; +import '../../commons/Widgets/my_app_bar.dart'; +import 'package:circle_app/utils/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/routers.dart'; +import 'logic.dart'; + +class MyInvitePage extends StatelessWidget { + MyInvitePage({Key? key}) : super(key: key); + + final logic = Get.find(); + final homeLogic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: homeLogic.inventStr, + ), + body: GetBuilder(builder: (logic) { + List peopleCountList = []; + List dayCountList = []; + List allSpan = []; + if (logic.isLoadData == false) { + 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()}年')); + } else { + dayCountList.add(timeWidget('${element.rewardDay!}天')); + } + // timeWidget( + // '+30天', + // ), + }); + + allSpan.addAll(getTextSpanList( + 'Tip:您已成功邀请', Color(0xFF0DF5F7), 13.sp, + searchContent: 'Tip:')); + allSpan.addAll(getTextSpanList( + ' ${logic.homeData!.inviteCount! ?? 0} 位圈友,', + Color(0xFFDC5BFD), + 13.sp, + searchContent: '${logic.homeData!.inviteCount! ?? 0}')); + allSpan.addAll(getTextSpanList( + '免费获得会员 ${logic.homeData!.achieveRewardDay! ?? '0'} 天,', + Color(0xFFDC5BFD), + 13.sp, + 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, + searchContent: '')); + } else { + allSpan.addAll(getTextSpanList( + ' 再邀请 ${logic.homeData!.diffAwardCount} 位圈友可领取更多奖励~', + Color(0xFFDC5BFD), + 13.sp, + searchContent: '${logic.homeData!.diffAwardCount}')); + } + } + + return logic.isLoadData + ? loaddingWidget(true) + : Stack( + fit: StackFit.expand, + children: [ + SingleChildScrollView( + controller: logic.scrollController, + child: Column(children: [ + Container( + // 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, + ), + borderRadius: BorderRadius.circular(10.sp)), + child: Column( + children: [ + 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(Routes.UserInfoPage, + 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), + ), + ], + ), + ), + ), + ], + ), + ), + 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()) + ], + ), + ), + ], + ), + ), + 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), + )), + ], + ), + ); + }, + 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))) + ], + )), + ])), + 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), + ), + ), + ), + ), + ), + 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(Routes.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), + ], + )), + alignment: Alignment.center, + child: Text( + '联系客服', + style: TextStyle( + color: Colors.black, + fontSize: 16, + fontWeight: FontWeight.w600), + ), + ), + ), + ), + ), + ], + ); + }))); + } + + 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(Routes.UserInfoPage, 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( + flex: 1, + child: GestureDetector( + onTap: () { + if (userId == '0') return; + + Get.toNamed(Routes.UserInfoPage, arguments: userId); + }, + child: infoText(str1, AppColor.mainColor)), + ), + 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), + child: Text( + '$count人', + style: TextStyle( + color: isCheck ? Color(0xFF000000) : Colors.white, fontSize: 12.sp), + ), + ); + } + + timeWidget(String time) { + return Text( + time, + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ); + } + + void shopSharePiker(String code, String link) { + Get.bottomSheet(Share(code, link), + isScrollControlled: true, enableDrag: false); + } +} + +void showCodePicker(InviteLogic logic) { + Get.bottomSheet( + GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Scaffold( + backgroundColor: Colors.transparent, + resizeToAvoidBottomInset: false, + body: Center( + child: Container( + height: 240.sp, + decoration: BoxDecoration( + color: Color(0xFF292247), + borderRadius: BorderRadius.circular(6.sp)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 20.sp, left: 20.sp), + child: Text( + '请输入邀请您加入APP的圈友的邀请码', + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ), + ), + Container( + margin: EdgeInsets.only(left: 20, right: 20.sp, top: 30.sp), + decoration: BoxDecoration( + color: Color(0x1AFFFFFF), + borderRadius: BorderRadius.circular(6.sp)), + alignment: Alignment.center, + child: TextField( + controller: logic.codeEditingController, + maxLength: 8, + textAlign: TextAlign.center, + style: TextStyle(color: Colors.white, fontSize: 16.sp), + decoration: InputDecoration( + hintText: '请输入邀请码', + hintStyle: + TextStyle(color: Colors.white70, fontSize: 16.sp), + border: InputBorder.none, + counterText: '', + contentPadding: EdgeInsets.only(left: 16.sp)), + ), + ), + Container( + margin: EdgeInsets.only(top: 15.sp), + alignment: Alignment.center, + child: Text( + '为防止作弊,进入APP后请在1小时填写TA的邀请码', + style: TextStyle(color: Colors.white, fontSize: 12.sp), + ), + ), + Expanded(child: Container()), + Container( + margin: EdgeInsets.only( + left: 40.sp, right: 40.sp, bottom: 20.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + alignment: Alignment.center, + width: 114.sp, + height: 38.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(19.sp), + color: Color(0x1AFFFFFF)), + child: const Text( + '放弃对接', + style: + TextStyle(color: Colors.white, fontSize: 16), + ), + ), + ), + GestureDetector( + onTap: () { + if (logic.codeEditingController.text.isEmpty) { + showOKToast('请输入邀请码'); + return; + } + Get.back(); + logic.addCode(logic.codeEditingController.text); + }, + child: Container( + alignment: Alignment.center, + width: 114.sp, + height: 38.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(19.sp), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + )), + child: const Text( + '确认对接', + style: + TextStyle(color: Colors.black, fontSize: 16), + ), + ), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ), + isScrollControlled: true, + enableDrag: false); +} diff --git a/circle_app/lib/circle_app/invite/view.dart b/circle_app/lib/circle_app/invite/view.dart index f9d1b28..7644cc8 100644 --- a/circle_app/lib/circle_app/invite/view.dart +++ b/circle_app/lib/circle_app/invite/view.dart @@ -43,20 +43,20 @@ class InvitePage extends StatelessWidget { return !logic.isIventData ? Container() : GestureDetector( - onTap: () { - navigateToInviteStrategy(); - }, - child: Container( - alignment: Alignment.center, - height: 22.sp, - width: 62.sp, - child: Image.asset( - getMineImage('invite_right_icon'), - width: 62.sp, - fit: BoxFit.fill, - ), - ), - ); + onTap: () { + navigateToInviteStrategy(); + }, + child: Container( + alignment: Alignment.center, + height: 22.sp, + width: 62.sp, + child: Image.asset( + getMineImage('invite_right_icon'), + width: 62.sp, + fit: BoxFit.fill, + ), + ), + ); }, ), ), @@ -64,7 +64,7 @@ class InvitePage extends StatelessWidget { List peopleCountList = []; List dayCountList = []; List allSpan = []; - if (logic.isLoad == false) { + if (logic.isLoadData == false) { logic.homeData!.inviteAwardConf!.forEach((element) { peopleCountList.add(peopleCountWidget( '${element!.inviteCount! ?? '0'}', @@ -95,7 +95,7 @@ class InvitePage extends StatelessWidget { Color(0xFFDC5BFD), 13.sp, searchContent: - '${logic.homeData!.achieveRewardDay! ?? '0'} ')); + '${logic.homeData!.achieveRewardDay! ?? '0'} ')); int maxCount = logic.homeData!.inviteAwardConf!.last.inviteCount ?? 0; if (logic.homeData!.inviteCount! >= maxCount) { @@ -111,685 +111,683 @@ class InvitePage extends StatelessWidget { } } - return logic.isLoad + return logic.isLoadData ? loaddingWidget(true) : Stack( - fit: StackFit.expand, - children: [ - SingleChildScrollView( - controller: logic.scrollController, - child: Column(children: [ + fit: StackFit.expand, + children: [ + SingleChildScrollView( + controller: logic.scrollController, + child: Column(children: [ + Container( + // 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, + ), + borderRadius: BorderRadius.circular(10.sp)), + child: Column( + children: [ Container( - // 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, - ), - borderRadius: BorderRadius.circular(10.sp)), - child: Column( + padding: EdgeInsets.only( + left: 14.sp, + right: 14.sp, + top: 10.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - 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(Routes.UserInfoPage, - 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), - ), - ], - ), - ), - ), - ], - ), + Text( + '专属邀请码', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), ), - 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( - '复制', + 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(Routes.UserInfoPage, + arguments: logic + .homeData!.superior!.id! + .toString()); + }, + child: Container( + alignment: Alignment.center, + child: Row( + children: [ + Text( + '邀请人:', style: TextStyle( - color: Color(0xff0DF5F7), + color: Colors.white, fontSize: 14.sp), - )), - Expanded(child: Container()) - ], + ), + Text( + '${logic.homeData!.superior!.nickname!}', + style: TextStyle( + color: AppColor + .mainColor, + fontSize: 14.sp), + ), + ], + ), + ), ), - ), ], ), ), 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), - )), - ], - ), - ); - }, - itemCount: logic.sysData.length, + 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()) + ], ), ), - if (homeLogic.inventStr.contains('赚')) - 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, - ), + ], + ), + ), + 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), ), - 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( + 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), + )), + ], + ), + ); + }, + 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), ), - ), - 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), + 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( - margin: EdgeInsets.only( - left: 15.sp), - child: Row( + ) + ], + )) + ], + )), + 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, + 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))) - ], - )), - if (homeLogic.inventStr.contains('赚')) + 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: 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( + margin: EdgeInsets.only(top: 45.sp), + // height: 40.sp, + child: Row( 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), - ), - ), - ], + Expanded( + child: Container( + child: Column( + children: [ + Container( + child: Text( + '${logic.homeData!.inviteCount! ?? 0}人', + style: TextStyle( + color: AppColor + .mainColor, + fontSize: 14.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( + 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'))), + Container( + width: 1, + height: 47.sp, + color: Color(0x3AF0F1F4), + ), Expanded( - child: Container( - margin: EdgeInsets.only( - top: 15.sp, - left: 20.sp, - right: 20.sp, - bottom: - logic.selectedIndex == 1 - ? 15.sp - : 0.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( - controller: - logic - .contentScrollController, - physics: logic - .isContentScroll - ? BouncingScrollPhysics() - : NeverScrollableScrollPhysics(), - 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['vipDaysStr'].toString() + - '天', - '${data['directProfitStr']}票', - '${data['rebateStr']}票', - data['userId'].toString()); - }, - itemCount: logic.selectedIndex == - 0 - ? logic.inveiteData!.length + - 1 - : logic.allInveiteData.length + - 2), - ))), - if (logic.selectedIndex == 0) - GestureDetector( - onTap: () { - Get.toNamed(Routes.InviteRecordPage, - arguments: 0); - }, - child: Container( - margin: EdgeInsets.only( - top: 5.sp, bottom: 15.sp), - child: Text( - '查看更多邀请记录>', - style: TextStyle( - color: AppColor.mainColor - .withOpacity(0.75), - fontSize: 12.sp, - fontWeight: FontWeight.w500), - ), + 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), + ), + ), + ], + ), + ), + ), ], ), ), - ])), - 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( - homeLogic.inventStr.contains('赚') ? '邀请圈友赚钱' : homeLogic.inventStr, - style: TextStyle( - color: Colors.black, - fontSize: 16, - fontWeight: FontWeight.w600), - ), - ), + 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, + bottom: + logic.selectedIndex == 1 + ? 15.sp + : 0.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( + controller: + logic + .contentScrollController, + physics: logic + .isContentScroll + ? BouncingScrollPhysics() + : NeverScrollableScrollPhysics(), + 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['vipDaysStr'].toString() + + '天', + '${data['directProfitStr']}票', + '${data['rebateStr']}票', + data['userId'].toString()); + }, + itemCount: logic.selectedIndex == + 0 + ? logic.inveiteData!.length + + 1 + : logic.allInveiteData.length + + 2), + ))), + if (logic.selectedIndex == 0) + GestureDetector( + onTap: () { + Get.toNamed(Routes.InviteRecordPage, + arguments: 0); + }, + child: Container( + margin: EdgeInsets.only( + top: 5.sp, bottom: 15.sp), + child: Text( + '查看更多邀请记录>', + style: TextStyle( + color: AppColor.mainColor + .withOpacity(0.75), + fontSize: 12.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(Routes.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), - ], - )), - alignment: Alignment.center, - child: Text( - homeLogic.inventStr.contains('赚') ? '联系客服结算' : '联系客服', - style: TextStyle( - color: Colors.black, - fontSize: 16, - fontWeight: FontWeight.w600), - ), - ), - ), + ])), + 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), ), ), - ], - ); + ), + ), + ), + 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(Routes.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), + ], + )), + alignment: Alignment.center, + child: Text( + homeLogic.inventStr.contains('赚') ? '联系客服结算' : '联系客服', + style: TextStyle( + color: Colors.black, + fontSize: 16, + fontWeight: FontWeight.w600), + ), + ), + ), + ), + ), + ], + ); }))); } @@ -910,12 +908,12 @@ class InvitePage extends StatelessWidget { } myRowWidget( - String str1, - String str2, - String str3, - String str4, - String userId, - ) { + String str1, + String str2, + String str3, + String str4, + String userId, + ) { return Container( height: 41.sp, // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), @@ -970,13 +968,13 @@ class InvitePage extends StatelessWidget { } rowWidget( - String str1, - String str2, - String str3, - String str4, - String str5, - String userId, - ) { + String str1, + String str2, + String str3, + String str4, + String str5, + String userId, + ) { return Container( height: 41.sp, // margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp), @@ -1161,7 +1159,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)), @@ -1196,7 +1194,7 @@ void showCodePicker(InviteLogic logic) { child: const Text( '放弃对接', style: - TextStyle(color: Colors.white, fontSize: 16), + TextStyle(color: Colors.white, fontSize: 16), ), ), ), @@ -1224,7 +1222,7 @@ void showCodePicker(InviteLogic logic) { child: const Text( '确认对接', style: - TextStyle(color: Colors.black, fontSize: 16), + TextStyle(color: Colors.black, fontSize: 16), ), ), ) diff --git a/circle_app/lib/circle_app/minefragment/logic.dart b/circle_app/lib/circle_app/minefragment/logic.dart index 31c412d..53e9cb1 100644 --- a/circle_app/lib/circle_app/minefragment/logic.dart +++ b/circle_app/lib/circle_app/minefragment/logic.dart @@ -13,7 +13,6 @@ import 'package:shared_preferences/shared_preferences.dart'; class MinefragmentLogic extends GetxController { final MinefragmentState state = MinefragmentState(); User? userInfoBean; - bool isProxy = false; String ageMsg = ""; var isVip = 0.obs; var likeCount = 0; @@ -31,7 +30,6 @@ class MinefragmentLogic extends GetxController { bool has_pwd = false; bool isUpdateVersion = false; - bool isShwGoodReview = false; String enterHomeInfoMsg = "进入主页"; String joinedCircle = ""; String vipMsg = "十几种专属特权等你领取"; @@ -39,16 +37,15 @@ class MinefragmentLogic extends GetxController { @override void onInit() async { super.onInit(); - SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); - if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { - isProxy = true; - } else { - isProxy = false; - } + // SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + // if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { + // isProxy = true; + // } else { + // isProxy = false; + // } getMode(); checkVersion(); - checkShowPositiveFeedBack(); EventBusManager.on().listen((event) { isVip.value = event.vip; // update(); @@ -58,7 +55,6 @@ class MinefragmentLogic extends GetxController { loadData() { getMode(); checkVersion(); - checkShowPositiveFeedBack(); } Future checkVersion() async { @@ -138,14 +134,6 @@ class MinefragmentLogic extends GetxController { showOKToast(bean.msg); } } - - void checkShowPositiveFeedBack() async { - var data = await DioManager.instance.get(url: Api.showPositiveFeedBack); - isShwGoodReview = data['data']; - update(); - } - - } class User { diff --git a/circle_app/lib/circle_app/minefragment/view.dart b/circle_app/lib/circle_app/minefragment/view.dart index d27a0db..f9102e0 100644 --- a/circle_app/lib/circle_app/minefragment/view.dart +++ b/circle_app/lib/circle_app/minefragment/view.dart @@ -75,7 +75,6 @@ class _MinefragmentPageState extends State with RouteAware { void didPopNext() { print('didPopNext'); mineLogic.checkVersion(); - mineLogic.checkShowPositiveFeedBack(); } ///当前页面进入时触发 @@ -123,7 +122,7 @@ class _MinefragmentPageState extends State with RouteAware { }, child: Stack(children: [ - logic.isProxy ? MyImageWidget1 : MyImageWidget, + MyImageWidget, Positioned( top:24.sp, child: Container( @@ -132,10 +131,7 @@ class _MinefragmentPageState extends State with RouteAware { height: 50.sp, child: Row( children: [ - if (!logic.isProxy) Image.asset(getHomeImage('mine_vip_icon'),width: 46.sp,), - - SizedBox(width: !logic.isProxy ? 5.sp : 60.sp,), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -146,7 +142,6 @@ class _MinefragmentPageState extends State with RouteAware { ], ), ), - if (!logic.isProxy) Image.asset(getHomeImage(logic.vipMsg.contains('十几种') ? 'open_vip' : 'pay_vip'),height: 28.sp,), ], ), @@ -377,7 +372,7 @@ class _MinefragmentPageState extends State with RouteAware { shape: BoxShape.circle), ), Text( - homelogic.inventStr.contains('赚') ? "免费领取会员" : '邀请更多圈友一起玩', + homelogic.inventTipStr, style: TextStyle(color: Colors.white60), ), Image( @@ -396,7 +391,7 @@ class _MinefragmentPageState extends State with RouteAware { Widget _editGoodReviewItemView() { - return (mineLogic.isShwGoodReview ?? false) ? GestureDetector( + return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -450,7 +445,7 @@ class _MinefragmentPageState extends State with RouteAware { ], ), ), - ) : Container(); + ); } Widget _shareItemView() { diff --git a/circle_app/lib/router/pages.dart b/circle_app/lib/router/pages.dart index 7816407..92ea25f 100644 --- a/circle_app/lib/router/pages.dart +++ b/circle_app/lib/router/pages.dart @@ -21,6 +21,7 @@ import 'package:circle_app/circle_app/gift_shop/view.dart'; import 'package:circle_app/circle_app/help/binding.dart'; import 'package:circle_app/circle_app/help/view.dart'; import 'package:circle_app/circle_app/home/binding.dart'; +import 'package:circle_app/circle_app/home/logic.dart'; import 'package:circle_app/circle_app/home/view.dart'; import 'package:circle_app/circle_app/invite/binding.dart'; import 'package:circle_app/circle_app/invite/view.dart'; @@ -62,6 +63,7 @@ import 'package:circle_app/circle_app/userinfo/view.dart'; import 'package:circle_app/circle_app/visitorlist/view.dart'; import 'package:circle_app/circle_app/webview/binding.dart'; import 'package:circle_app/circle_app/webview/view.dart'; +import 'package:get/get.dart'; import 'package:get/get_navigation/src/routes/get_route.dart'; import '../circle_app/agent_circle_list/binding.dart'; @@ -114,6 +116,7 @@ import '../circle_app/infinity__isle/binding.dart'; import '../circle_app/infinity__isle/view.dart'; import '../circle_app/invent_record/binding.dart'; import '../circle_app/invent_record/view.dart'; +import '../circle_app/invite/my_invite_page.dart'; import '../circle_app/labyrinth__lounge/binding.dart'; import '../circle_app/labyrinth__lounge/view.dart'; import '../circle_app/luminary/binding.dart'; @@ -310,7 +313,14 @@ class PageList { ), GetPage( name: Routes.InvitePage, - page: () => InvitePage(), + page: () { + HomeLogic logic = Get.find(); + if (logic.inventStr == '邀请好友') { + return MyInvitePage(); + } else { + return InvitePage(); + } + }, binding: InviteBinding(), ), GetPage(name: Routes.DisCover, page: () => DiscoverPage()), @@ -368,18 +378,15 @@ class PageList { name: Routes.InviteRecordPage, page: () => Invent_recordPage(), binding: Invent_recordBinding()), - GetPage( name: Routes.Revenue_Details, page: () => Revenue_detailsPage(), binding: Revenue_detailsBinding()), - GetPage( name: Routes.AgentSignalCircleListPage, page: () => Agent_circle_listPage(), binding: Agent_circle_listBinding()), - /**/ GetPage( name: Routes.InviteRecordPage,