circle_app/circle_app/lib/app/invite/view.dart
2024-01-08 09:39:35 +08:00

1174 lines
53 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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<InviteLogic>();
final state = Get.find<InviteLogic>().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: "邀请赚钱",
actionWdiget: Container(
alignment: Alignment.center,
height: 22.sp,
width: 62.sp,
child: Image.asset(
getMineImage('invite_right_icon'),
width: 62.sp,
fit: BoxFit.fill,
),
),
onPressed: () {
navigateToInviteStrategy();
},
),
body: GetBuilder<InviteLogic>(builder: (logic) {
List<Widget> peopleCountList = [];
List<Widget> dayCountList = [];
List<TextSpan> allSpan = [];
if (logic.isLoad == 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.isLoad
? loaddingWidget(true)
: Stack(
fit: StackFit.expand,
children: [
SingleChildScrollView(
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(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),
),
],
),
),
),
],
),
),
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)))
],
)),
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,bottom: 10.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,),
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),
),
),
),
),
),
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),
],
)),
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(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: <int, Widget>{
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);
}