代码提交
This commit is contained in:
parent
ad1cecc56d
commit
01856e42ce
@ -71,8 +71,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 115
|
||||
versionName "2.6.5"
|
||||
versionCode 117
|
||||
versionName "2.6.7"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
@ -571,27 +571,20 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
getCallOutDetail(bean.id!, bean);
|
||||
}
|
||||
}
|
||||
|
||||
int userId =
|
||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
||||
String avatar =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
||||
String name =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
||||
|
||||
bool isContain = false;
|
||||
for (var info in bean.chat!.users!) {
|
||||
if (info.id == userId) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
bean.chat!.users!
|
||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
||||
bean.chat!.count = bean.chat!.count! + 1;
|
||||
// widget.logic.update();
|
||||
void getCallOutDetail(id, bean) async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.signInterestCalloutDetail, params: {
|
||||
'calloutId': id,
|
||||
});
|
||||
if (data['code'] == 200) {
|
||||
Lists bean = Lists.fromJson(data['data']);
|
||||
logic.lists = bean;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,6 +82,12 @@ final ScrollController nearScrollController = ScrollController();
|
||||
|
||||
int flush = 0;
|
||||
bool isMore = true;
|
||||
|
||||
|
||||
bool getNewUserIsShowData = false;
|
||||
|
||||
bool isShowNewUser = true;
|
||||
|
||||
int myVip = -1;
|
||||
bool isShowCircle = true;
|
||||
bool _isLocationGranted = false;
|
||||
@ -153,6 +159,7 @@ final ScrollController nearScrollController = ScrollController();
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
await loadNewUserIsShowData();
|
||||
loadCircleListData();
|
||||
loadCirclePeopleData();
|
||||
await initGerder();
|
||||
@ -188,6 +195,16 @@ final ScrollController nearScrollController = ScrollController();
|
||||
getCityList();
|
||||
}
|
||||
|
||||
loadNewUserIsShowData() async {
|
||||
var data = await DioManager.instance.get(url: Api.newUserIsShow);
|
||||
getNewUserIsShowData = true;
|
||||
if (data['code'] == 200) {
|
||||
isShowNewUser = data['data'] == 1;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void loadNewUserRewardData() async {
|
||||
var data = await DioManager.instance.get(url: Api.newUserConfig);
|
||||
if (data['code'] == 200) {
|
||||
@ -946,16 +963,25 @@ final ScrollController nearScrollController = ScrollController();
|
||||
WelcomeDialog(
|
||||
userId: id.toString(),
|
||||
callBack: () {
|
||||
newPeopleList.removeAt(index);
|
||||
newPeopleList[index]['interactionType'] = 2;
|
||||
update();
|
||||
if (newPeopleList.length < 5) {
|
||||
onLoading();
|
||||
}
|
||||
}),
|
||||
isScrollControlled: true,
|
||||
);
|
||||
}
|
||||
|
||||
void getGuideUser(String id, int index) async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: Api.guideNewUser + id,
|
||||
);
|
||||
if (data['code'] == 200) {
|
||||
showOKToast(data['msg']);
|
||||
newPeopleList[index]['interactionType'] = 3;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void snedHelloMoreData() async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: Api.sayHelloMore,
|
||||
@ -1059,6 +1085,7 @@ class VicinityItemBean {
|
||||
final int gender;
|
||||
final int role;
|
||||
final int orientation;
|
||||
final int interactionType;
|
||||
final double lng;
|
||||
final double lat;
|
||||
final String city;
|
||||
@ -1103,6 +1130,7 @@ class VicinityItemBean {
|
||||
required this.lastRewardInterest,
|
||||
required this.lastInterestWelfare,
|
||||
required this.lastJoinInterest,
|
||||
required this.interactionType,
|
||||
required this.hasContact,
|
||||
required this.lastRankTopDesc,
|
||||
required this.lastUserRelation,
|
||||
@ -1161,7 +1189,7 @@ class VicinityItemBean {
|
||||
lastJoinInterest: json['lastJoinInterest'] ?? {},
|
||||
lastRankTopDesc: json['lastRankTopDesc'] ?? '',
|
||||
lastUserRelation: json['lastUserRelation'].toString() ?? '',
|
||||
|
||||
interactionType: json['interactionType'],
|
||||
imId: json['imId'] ?? '',
|
||||
avatar: json['avatar'],
|
||||
isFollow: json['isFollow'] ?? false,
|
||||
|
||||
@ -39,7 +39,6 @@ class CirclePage extends StatefulWidget {
|
||||
class _CirclePageState extends State<CirclePage>
|
||||
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
||||
late TabController _tabController;
|
||||
late PageController _pageController;
|
||||
|
||||
// int currentIndex = 0;
|
||||
|
||||
@ -49,6 +48,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
final homelogic = Get.find<HomeLogic>();
|
||||
var getContext;
|
||||
|
||||
bool isLoadTab = false;
|
||||
|
||||
// 是否需要缓存
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
@ -59,21 +60,37 @@ class _CirclePageState extends State<CirclePage>
|
||||
super.initState();
|
||||
|
||||
sub = EventBusManager.on<ChangeIndex>().listen((event) {
|
||||
logic.currentIndex = event.index;
|
||||
_tabController.index = logic.currentIndex;
|
||||
addUmengPage('${titleList[logic.currentIndex]}');
|
||||
if (logic.isShowNewUser) {
|
||||
logic.currentIndex = event.index;
|
||||
_tabController.index = logic.currentIndex;
|
||||
addUmengPage('${titleList[logic.currentIndex]}');
|
||||
} else {
|
||||
if (event.index >= 1) {
|
||||
logic.currentIndex = event.index - 1;
|
||||
_tabController.index = logic.currentIndex;
|
||||
addUmengPage('${titleList[logic.currentIndex]}');
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
logic.currentIndex = 1;
|
||||
addUmengPage('${titleList[logic.currentIndex]}');
|
||||
_pageController = PageController(initialPage: logic.currentIndex);
|
||||
_tabController =
|
||||
TabController(length: 3, vsync: this, initialIndex: logic.currentIndex);
|
||||
_tabController.addListener(_handleTabChange);
|
||||
|
||||
getContext = context;
|
||||
}
|
||||
|
||||
initTabData() {
|
||||
logic.currentIndex = 1;
|
||||
if (!logic.isShowNewUser) {
|
||||
titleList.removeAt(0);
|
||||
logic.currentIndex = 0;
|
||||
}
|
||||
isLoadTab = true;
|
||||
addUmengPage('${titleList[logic.currentIndex]}');
|
||||
_tabController =
|
||||
TabController(length: logic.isShowNewUser ? 3 : 2, vsync: this, initialIndex: logic.currentIndex);
|
||||
_tabController.addListener(_handleTabChange);
|
||||
}
|
||||
|
||||
void _handleTabChange() {
|
||||
// 在这里可以执行滑动监听后的逻辑操作
|
||||
// 比如根据当前选中的标签执行其他操作
|
||||
@ -91,10 +108,10 @@ class _CirclePageState extends State<CirclePage>
|
||||
sub.cancel();
|
||||
_tabController.removeListener(_handleTabChange); // 移除监听
|
||||
_tabController.dispose();
|
||||
_pageController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
@ -103,9 +120,12 @@ class _CirclePageState extends State<CirclePage>
|
||||
if (logic.currentIndex == 0) {
|
||||
logic.isNewPeopleRed = false;
|
||||
}
|
||||
if (logic.getNewUserIsShowData && !isLoadTab) {
|
||||
initTabData();
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Stack(
|
||||
body:logic.getNewUserIsShowData ? Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
SafeArea(
|
||||
@ -120,10 +140,10 @@ class _CirclePageState extends State<CirclePage>
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [NewPeople(logic:controller), Vicinity(controller), Discover(0)],
|
||||
children: logic.isShowNewUser ? [NewPeople(logic:controller), Vicinity(controller), Discover(0)] : [Vicinity(controller), Discover(0)],
|
||||
),
|
||||
),
|
||||
if (logic.callList.isNotEmpty && _tabController.index == 1)
|
||||
if (logic.callList.isNotEmpty)
|
||||
Positioned(
|
||||
left: 10.sp,
|
||||
bottom: 10.sp,
|
||||
@ -254,9 +274,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
),
|
||||
)),
|
||||
|
||||
],
|
||||
),
|
||||
) : loaddingWidget(true),
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -717,7 +736,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
child: logic.isShowNewUser ? Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
_tabController.index == 0
|
||||
@ -1017,21 +1036,214 @@ class _CirclePageState extends State<CirclePage>
|
||||
],
|
||||
)),
|
||||
],
|
||||
) : Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
_tabController.index == 0
|
||||
? Positioned(
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
showCityPiker(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('icon_city'),
|
||||
width: 24.sp,
|
||||
),
|
||||
Container(
|
||||
width: 80.sp,
|
||||
margin: EdgeInsets.only(left: 4.sp, top: 4.sp),
|
||||
child: Text(
|
||||
modifyCityName(logic.cityName),
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 16.sp),
|
||||
))
|
||||
],
|
||||
),
|
||||
))
|
||||
: Positioned(
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.DisCover);
|
||||
},
|
||||
child: Container(
|
||||
// width: 70.sp,
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp,
|
||||
right: 6.sp,
|
||||
top: 4.sp,
|
||||
bottom: 4.sp),
|
||||
// height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(13.sp)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('lock_icon'),
|
||||
height: 18.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
'已解锁',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFF7FAFA),
|
||||
fontSize: 13.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
],
|
||||
),
|
||||
))),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 27.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 12.0.sp),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color: const Color(0xFF00FFF4),
|
||||
),
|
||||
),
|
||||
indicatorColor: const Color(0xFF00FFF4),
|
||||
indicatorWeight: 2.sp,
|
||||
labelColor: const Color(0xFF00FFF4),
|
||||
unselectedLabelColor: const Color(0xB3FFFFFF),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorPadding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Text(
|
||||
'附近',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
'精选',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
labelStyle: TextStyle(
|
||||
color: const Color(0xFF00FFF4),
|
||||
fontSize: 18.sp,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: const Color(0xFFF657FF).withOpacity(0.5),
|
||||
offset: Offset(0, -2), // 阴影偏移
|
||||
blurRadius: 3, // 阴影模糊半径
|
||||
// spreadRadius: 0
|
||||
),
|
||||
],
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
// color: const Color(0xB3FFFFFF),
|
||||
fontSize: 18.sp,
|
||||
shadows: [
|
||||
Shadow(
|
||||
// color: const Color(0xFFF657FF),
|
||||
offset: const Offset(0, -1),
|
||||
blurRadius: 3.0.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: (index) {
|
||||
if (logic.currentIndex == index) {
|
||||
if (index == 2) {
|
||||
EventBusManager.fire(DiscovrScrollTap());
|
||||
} else if (index == 1) {
|
||||
EventBusManager.fire(NearScrollTap());
|
||||
} else if (index == 0) {
|
||||
EventBusManager.fire(ScrollToTop());
|
||||
}
|
||||
return;
|
||||
}
|
||||
logic.currentIndex = index;
|
||||
// _pageController.animateToPage(
|
||||
// index, // 目标页面索引
|
||||
// duration: const Duration(milliseconds: 300), // 动画时长
|
||||
// curve: Curves.ease, // 动画曲线
|
||||
// );
|
||||
},
|
||||
),
|
||||
if (logic.isNewPeopleRed)
|
||||
Positioned(
|
||||
left: 42.5.sp,
|
||||
top: 0.sp,
|
||||
child: Container(
|
||||
height: 10.sp,
|
||||
width: 10.sp,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (_tabController.index == 1) {
|
||||
Get.bottomSheet(
|
||||
TodayPeopleDialog(isShow: true,source:'fate_match'),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
);
|
||||
} else {
|
||||
Get.toNamed(Routes.Search);
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
_tabController.index == 1
|
||||
? getMsgImage('heart_icon')
|
||||
: getHomeImage('icon_search'),
|
||||
width: _tabController.index == 2 ? 24.sp : 30.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showBottomSheet(BuildContext context) {
|
||||
if (_tabController.index == 1) {
|
||||
addUmengTag('点击附近筛选');
|
||||
} else {
|
||||
addUmengTag('点击精选筛选');
|
||||
}
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (BuildContext context) {
|
||||
return ScreenBottomSheetDialog(
|
||||
return logic.isShowNewUser ? ScreenBottomSheetDialog(
|
||||
genderList: _tabController.index == 1
|
||||
? logic.genderList
|
||||
: _tabController.index == 0
|
||||
@ -1086,6 +1298,42 @@ class _CirclePageState extends State<CirclePage>
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
|
||||
EventBusManager.fire(
|
||||
OptionFindclass(genders, roles, orientations));
|
||||
}
|
||||
},
|
||||
) : ScreenBottomSheetDialog(
|
||||
genderList: _tabController.index == 0
|
||||
? logic.genderList
|
||||
: logic.dis_genderList,
|
||||
orientationList: _tabController.index == 0
|
||||
? logic.orientationList
|
||||
: logic.dis_orientationList,
|
||||
roleList: _tabController.index == 0
|
||||
? logic.roleList
|
||||
: logic.dis_roleList,
|
||||
isHaveCity: _tabController.index == 1,
|
||||
callback: (genderList, orientationList, roleList, status) {
|
||||
if (_tabController.index == 0) {
|
||||
EventBusManager.fire(NearScrollTap());
|
||||
logic.refreshController.requestRefresh();
|
||||
} else {
|
||||
List<String> genders = [];
|
||||
logic.dis_genderList.forEach((element) {
|
||||
if (element.isSelect) {
|
||||
genders.add(element.id);
|
||||
}
|
||||
});
|
||||
List<String> roles = [];
|
||||
logic.dis_orientationList.forEach((element) {
|
||||
if (element.isSelect) roles.add(element.id);
|
||||
});
|
||||
|
||||
List<String> orientations = [];
|
||||
logic.dis_roleList.forEach((element) {
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
|
||||
EventBusManager.fire(
|
||||
OptionFindclass(genders, roles, orientations));
|
||||
}
|
||||
|
||||
@ -326,22 +326,21 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
|
||||
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
|
||||
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
|
||||
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
|
||||
getCallOutDetail(bean.id!, bean);
|
||||
}
|
||||
}
|
||||
|
||||
bool isContain = false;
|
||||
for (var info in bean.chat!.users!) {
|
||||
if (info.id == userId) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
||||
bean.chat!.count = bean.chat!.count! + 1;
|
||||
widget.logic.update();
|
||||
void getCallOutDetail(id, bean) async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.signInterestCalloutDetail, params: {
|
||||
'calloutId': id,
|
||||
});
|
||||
if (data['code'] == 200) {
|
||||
Lists bean = Lists.fromJson(data['data']);
|
||||
int index = lists.indexOf(bean);
|
||||
lists[index] = bean;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -800,7 +799,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
widget.logic.getWelfareDetailData(
|
||||
data['id'].toString(),index);
|
||||
} else {
|
||||
showOKToast('申请加入圈子才能领取圈内福袋~');
|
||||
_showReportDialog(context,data['id'].toString(),index);
|
||||
// showOKToast('申请加入圈子才能领取圈内福袋~');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2336,6 +2337,159 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
}
|
||||
|
||||
void _showReportDialog(BuildContext context, String id,index) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 277.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(1.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
"温馨提示",
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Image(
|
||||
image: AssetImage(getBaseImage('fu_icon')),
|
||||
width: 70.sp,
|
||||
height: 70.sp,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"在圈子里发的福袋需要申请加入对应圈子才能领取哦,你先加入圈子然后领取福袋呗~",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
||||
padding: EdgeInsets.only(top:15.sp,bottom: 10.0.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0x26FFFFFF),
|
||||
Color(0x26FFFFFF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp),
|
||||
alignment: Alignment.center,
|
||||
width: 110.sp,
|
||||
child: const Text(
|
||||
"放弃领取",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 60.sp),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
await widget.logic.outCircle(
|
||||
widget.bean.id.toString(),
|
||||
widget.bean.isJoin);
|
||||
widget.logic.getWelfareDetailData(
|
||||
id,index);
|
||||
// logic.setBlock("1");
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp),
|
||||
alignment: Alignment.center,
|
||||
width: 110.sp,
|
||||
child: const Text(
|
||||
"加入圈子再领福袋",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
double contentHeight(String content) {
|
||||
return calculateTextHeight(
|
||||
content, 17.sp, FontWeight.w300, Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100);
|
||||
|
||||
@ -418,26 +418,20 @@ class _LikeViewState extends State<LikeView>
|
||||
data['data']['account_id'], bean.user!.nickname!);
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
int userId =
|
||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
||||
String avatar =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
||||
String name =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
||||
getCallOutDetail(bean.id!, bean);
|
||||
}
|
||||
}
|
||||
|
||||
bool isContain = false;
|
||||
for (var info in bean.chat!.users!) {
|
||||
if (info.id == userId) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
bean.chat!.users!
|
||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
||||
bean.chat!.count = bean.chat!.count + 1;
|
||||
void getCallOutDetail(id, bean) async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.signInterestCalloutDetail, params: {
|
||||
'calloutId': id,
|
||||
});
|
||||
if (data['code'] == 200) {
|
||||
Lists bean = Lists.fromJson(data['data']);
|
||||
int index = lists.indexOf(bean);
|
||||
lists[index] = bean;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,9 @@ class _NewPeopleState extends State<NewPeople> {
|
||||
double maxOff = 0;
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -117,7 +120,7 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
Widget build(BuildContext context) {
|
||||
return ListItem(VicinityItemBean.fromJson(widget.info), widget.index);
|
||||
}
|
||||
|
||||
List<String> actionList = ['','欢迎新人','👉指引新人','💬和TA聊聊'];
|
||||
Widget ListItem(VicinityItemBean item, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
@ -204,7 +207,7 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showOKToast('点击“👏欢迎”,对方回复您后就可以在消息列表进行聊天互动啦~');
|
||||
showOKToast('点击右上角可以和新人互动哦~');
|
||||
// Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
@ -340,7 +343,13 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
logic.snedHelloData(item.id, index);
|
||||
if (item.interactionType == 1) {
|
||||
logic.snedHelloData(item.id, index);
|
||||
} else if (item.interactionType == 2) {
|
||||
logic.getGuideUser(item.id.toString(), index);
|
||||
} else {
|
||||
pushChatPage(item.id.toString(), item.imId, item.nickname);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
@ -349,15 +358,17 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
height: 26.sp,
|
||||
child: Row(
|
||||
children: [
|
||||
if (item.interactionType == 1)
|
||||
Image.asset(
|
||||
getCircleImage('hello_icon'),
|
||||
width: 24.sp,
|
||||
),
|
||||
if (item.interactionType == 1)
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
'欢迎新人',
|
||||
actionList[item.interactionType],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp),
|
||||
|
||||
@ -194,10 +194,18 @@ class LikeLogic extends GetxController {
|
||||
if (page == 1) {
|
||||
circle = bean.data!;
|
||||
} else {
|
||||
circle.lists.addAll(bean.data!.lists);
|
||||
for (var model in bean.data!.lists) {
|
||||
bool isContain = false;
|
||||
for (var info in circle.lists) {
|
||||
if (model.id == info.id) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
circle.lists.add(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (bean.data!.lists.length == 0) {
|
||||
isMore = false;
|
||||
}
|
||||
|
||||
@ -266,27 +266,21 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
getCallOutDetail(bean.id!, bean);
|
||||
}
|
||||
}
|
||||
|
||||
int userId =
|
||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
||||
String avatar =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
||||
String name =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
||||
|
||||
bool isContain = false;
|
||||
for (var info in bean.chat!.users!) {
|
||||
if (info.id == userId) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
bean.chat!.users!
|
||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
||||
bean.chat!.count = bean.chat!.count! + 1;
|
||||
// widget.logic.update();
|
||||
void getCallOutDetail(id, bean) async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.signInterestCalloutDetail, params: {
|
||||
'calloutId': id,
|
||||
});
|
||||
if (data['code'] == 200) {
|
||||
Lists bean = Lists.fromJson(data['data']);
|
||||
int index = lists.indexOf(bean);
|
||||
lists[index] = bean;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1095,11 +1089,8 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
Get.bottomSheet(CallOutShareDialog('', '', lists),
|
||||
isScrollControlled: true, enableDrag: false);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
@ -1592,11 +1583,8 @@ class _AllCircleItemState extends State<AllCircleItem>
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
|
||||
Get.bottomSheet(CallOutShareDialog('', '', lists),
|
||||
isScrollControlled: true, enableDrag: false);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
|
||||
@ -1767,27 +1767,21 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
int userId =
|
||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
||||
String avatar =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
||||
String name =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
||||
getCallOutDetail(bean.id!, bean);
|
||||
}
|
||||
}
|
||||
|
||||
bool isContain = false;
|
||||
for (var info in bean.chat!.users!) {
|
||||
if (info.id == userId) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (!isContain) {
|
||||
bean.chat!.users!
|
||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
||||
bean.chat!.count = bean.chat!.count! + 1;
|
||||
widget.logic.update();
|
||||
void getCallOutDetail(id, bean) async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.signInterestCalloutDetail, params: {
|
||||
'calloutId': id,
|
||||
});
|
||||
if (data['code'] == 200) {
|
||||
Lists bean = Lists.fromJson(data['data']);
|
||||
int index = lists.indexOf(bean);
|
||||
lists[index] = bean;
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@ -301,7 +301,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
|
||||
installApk() async {
|
||||
//flutter_install_app
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:circle_app/router/routers.dart';
|
||||
import 'package:connectivity/connectivity.dart';
|
||||
import 'package:device_info/device_info.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@ -11,6 +12,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bugly/flutter_bugly.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../main.dart';
|
||||
import '../../utils/SharedPreferencesHelper.dart';
|
||||
import '../../utils/device.dart';
|
||||
@ -131,7 +133,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
||||
var sp = await SharedPreferencesHelper.getInstance();
|
||||
sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
||||
} catch (e) {}
|
||||
pushLoginPage();
|
||||
Get.offAllNamed(Routes.Login);
|
||||
FlutterBugly.init(
|
||||
androidAppId: "8509314e11",
|
||||
);
|
||||
|
||||
@ -35,6 +35,11 @@ class LoginLogic extends GetxController {
|
||||
bool isLogining = false;
|
||||
|
||||
String loginPhone = '';
|
||||
|
||||
bool showOthner = false;
|
||||
|
||||
String isAuto = '';
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
@ -47,9 +52,9 @@ class LoginLogic extends GetxController {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
|
||||
// if (!kDebugMode) {
|
||||
// checkNetworkUrl();
|
||||
// }
|
||||
if (!kDebugMode) {
|
||||
checkNetworkUrl();
|
||||
}
|
||||
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
|
||||
loginPhone =
|
||||
await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ??
|
||||
@ -70,8 +75,18 @@ class LoginLogic extends GetxController {
|
||||
pwd.isNotEmpty) {
|
||||
loginType = 1;
|
||||
pwdEditingController.text = pwd;
|
||||
showOthner = true;
|
||||
}
|
||||
isInitSuccess(isAuto:true);
|
||||
isAuto = sharedPreferences!.getString(SharedPreferencesHelper.firstLogin) ?? '';
|
||||
if (isAuto.isEmpty && phoneEditingController.text.isEmpty) {
|
||||
isInitSuccess(isAuto:true);
|
||||
sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1');
|
||||
} else {
|
||||
isInitSuccess(isAuto:false);
|
||||
loginType = 1;
|
||||
showOthner = true;
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@ -57,8 +57,7 @@ class LoginPage extends StatelessWidget {
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top:270.sp),
|
||||
margin: EdgeInsets.only(top: 270.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
@ -95,11 +94,17 @@ class LoginPage extends StatelessWidget {
|
||||
if (GetUtils.isPhoneNumber(msg) &&
|
||||
msg.length == 11) {
|
||||
logic.isPhone = true;
|
||||
sendOpenSourceData('input_mobile',params: jsonEncode({'phone':logic.phoneEditingController.text}));
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
} else {
|
||||
|
||||
}
|
||||
sendOpenSourceData(
|
||||
'input_mobile',
|
||||
params: jsonEncode({
|
||||
'phone': logic
|
||||
.phoneEditingController
|
||||
.text
|
||||
}));
|
||||
FocusManager
|
||||
.instance.primaryFocus
|
||||
?.unfocus();
|
||||
} else {}
|
||||
logic.update();
|
||||
},
|
||||
controller:
|
||||
@ -165,9 +170,17 @@ class LoginPage extends StatelessWidget {
|
||||
keyboardType: TextInputType.phone,
|
||||
maxLength: 8,
|
||||
onChanged: (String text) {
|
||||
sendOpenSourceData('input_mobile',params: jsonEncode({'input_captcha':logic.phoneEditingController.text}));
|
||||
sendOpenSourceData(
|
||||
'input_mobile',
|
||||
params: jsonEncode({
|
||||
'input_captcha': logic
|
||||
.phoneEditingController
|
||||
.text
|
||||
}));
|
||||
if (text.length >= 4) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
FocusManager
|
||||
.instance.primaryFocus
|
||||
?.unfocus();
|
||||
}
|
||||
},
|
||||
style: TextStyle(
|
||||
@ -189,9 +202,16 @@ class LoginPage extends StatelessWidget {
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.phoneEditingController.text.length == 11) {
|
||||
if (logic
|
||||
.phoneEditingController
|
||||
.text
|
||||
.length ==
|
||||
11) {
|
||||
logic.starDownTimer();
|
||||
} else if (logic.phoneEditingController.text.isEmail) {
|
||||
} else if (logic
|
||||
.phoneEditingController
|
||||
.text
|
||||
.isEmail) {
|
||||
logic.starDownTimer();
|
||||
} else {
|
||||
showOKToast('请输入正确的手机号/邮箱');
|
||||
@ -317,31 +337,47 @@ class LoginPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
if (logic.showOthner)
|
||||
Container(
|
||||
width: 280.sp,
|
||||
margin:
|
||||
EdgeInsets.only(top: 15.sp, right: 0.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
logic.showOthner = false;
|
||||
// logic.loginType = logic.loginType == 0 ? 1 : 0;
|
||||
logic.update();
|
||||
},
|
||||
child: Text(
|
||||
'其他方式登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (!logic.showOthner)
|
||||
Container(
|
||||
width: 280.sp,
|
||||
margin: EdgeInsets.only(top: 15.sp, right: 0.sp),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (logic.loginPhone.isNotEmpty) return;
|
||||
Get.toNamed(Routes.VisitorsPreview);
|
||||
},
|
||||
child: Text(
|
||||
'游客预览',
|
||||
style: TextStyle(
|
||||
color: logic.loginPhone.isNotEmpty ? Colors.transparent : Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
),
|
||||
Container(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
logic.loginType = logic.loginType == 0 ? 1 : 0;
|
||||
logic.update();
|
||||
},
|
||||
child: Text(
|
||||
logic.loginType == 1 ? '验证码登录' : '密码登录',
|
||||
logic.loginType == 1 ? '切换验证码登录' : '切换密码登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
@ -359,23 +395,30 @@ class LoginPage extends StatelessWidget {
|
||||
Container(
|
||||
width: 280.sp,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: !logic.showOthner
|
||||
? MainAxisAlignment.spaceBetween
|
||||
: MainAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (!logic.check) {
|
||||
Get.bottomSheet(privacyDialog(),isScrollControlled:true);
|
||||
Get.bottomSheet(privacyDialog(),
|
||||
isScrollControlled: true);
|
||||
} else {
|
||||
if (logic.loginType == 0) {
|
||||
showOKToast('请先切换密码登录');
|
||||
return;
|
||||
}
|
||||
logic.login();
|
||||
}
|
||||
|
||||
},
|
||||
child: Container(
|
||||
width: 120.sp,
|
||||
height: 50.sp,
|
||||
width: !logic.showOthner ? 85.sp : 120.sp,
|
||||
height: 40.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.sp),
|
||||
borderRadius:
|
||||
BorderRadius.circular(25.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
@ -384,7 +427,7 @@ class LoginPage extends StatelessWidget {
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
logic.loginType == 0 ? '验证码登录' : '密码登录',
|
||||
'密码登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
@ -392,39 +435,81 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.preLogin();
|
||||
|
||||
},
|
||||
child: Container(
|
||||
width: 120.sp,
|
||||
height: 50.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
Color(0xff0AFCFF),
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
'一键登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
if (!logic.showOthner)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (!logic.check) {
|
||||
Get.bottomSheet(privacyDialog(),
|
||||
isScrollControlled: true);
|
||||
} else {
|
||||
if (logic.loginType == 1) {
|
||||
showOKToast('请先切换验证码登录');
|
||||
return;
|
||||
}
|
||||
logic.login();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 85.sp,
|
||||
height: 40.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
Color(0xff0AFCFF),
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
'验证码登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!logic.showOthner)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.preLogin();
|
||||
},
|
||||
child: Container(
|
||||
width: 85.sp,
|
||||
height: 40.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(25.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
Color(0xff0AFCFF),
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
'一键登录',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15.sp),
|
||||
child: Text('若验证码未收到请打开数据网络使用[一键登录]',style: TextStyle(color: Colors.white,fontSize: 14.sp),),
|
||||
child: Text(
|
||||
'若验证码未收到请打开数据网络使用[一键登录]',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -509,17 +594,49 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
)),
|
||||
Positioned(top: MediaQuery.of(context).padding.top + 15.sp,right: 15.sp,child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.HelpBack);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.question_mark,color: AppColor.mainColor,size: 15.sp,),
|
||||
Text('在线反馈',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).padding.top + 15.sp,
|
||||
right: 15.sp,
|
||||
left: 15.sp,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.HelpBack);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (logic.loginPhone.isNotEmpty) return;
|
||||
Get.toNamed(Routes.VisitorsPreview);
|
||||
},
|
||||
child: Text(
|
||||
'👁游客预览',
|
||||
style: TextStyle(
|
||||
color: logic.isAuto.isNotEmpty
|
||||
? Colors.transparent
|
||||
: Colors.white,
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.question_mark,
|
||||
color: AppColor.mainColor,
|
||||
size: 15.sp,
|
||||
),
|
||||
Text(
|
||||
'在线反馈',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
);
|
||||
})),
|
||||
@ -536,52 +653,75 @@ class LoginPage extends StatelessWidget {
|
||||
child: Container(
|
||||
width: 250.sp,
|
||||
height: 140.sp,
|
||||
padding: EdgeInsets.only(top:15.sp,left: 15.sp,right: 15.sp),
|
||||
padding: EdgeInsets.only(top: 15.sp, left: 15.sp, right: 15.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(10.sp)
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
child: Text('用户协议和隐私政策',style: TextStyle(color: Colors.white,fontSize: 15.sp),),
|
||||
child: Text(
|
||||
'用户协议和隐私政策',
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
SizedBox(height: 10.sp,),
|
||||
Wrap(
|
||||
children: [
|
||||
Container(
|
||||
child: Text('我已阅读并同意',style: TextStyle(color: Colors.white.withOpacity(0.75),fontSize: 15.sp),),
|
||||
child: Text(
|
||||
'我已阅读并同意',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
navigateToUserAgreement();
|
||||
},
|
||||
child: Container(
|
||||
child: Text('《用户协议》',style: TextStyle(color:AppColor.mainColor,fontSize: 15.sp),),
|
||||
child: Text(
|
||||
'《用户协议》',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
child: Text('和',style: TextStyle(color: Colors.white.withOpacity(0.75),fontSize: 15.sp),),
|
||||
child: Text(
|
||||
'和',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
navigateToPrivacyPolicy();
|
||||
},
|
||||
child: Container(
|
||||
child: Text('《隐私协议》',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),),
|
||||
child: Text(
|
||||
'《隐私协议》',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 10.sp,),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -590,16 +730,16 @@ class LoginPage extends StatelessWidget {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
|
||||
width: 80.sp,
|
||||
height: 30.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x26FFFFFF),
|
||||
borderRadius: BorderRadius.circular(15.sp)
|
||||
color: Color(0x26FFFFFF),
|
||||
borderRadius: BorderRadius.circular(15.sp)),
|
||||
child: Text(
|
||||
'不同意',
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
child: Text('不同意',style: TextStyle(color: Colors.white,fontSize: 15.sp),),
|
||||
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
@ -614,11 +754,15 @@ class LoginPage extends StatelessWidget {
|
||||
height: 30.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(15.sp)
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(15.sp)),
|
||||
child: Text(
|
||||
'同意',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
child: Text('同意',style: TextStyle(color: Colors.white,fontSize: 15.sp,fontWeight: FontWeight.w500),),
|
||||
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -636,5 +780,4 @@ class LoginPage extends StatelessWidget {
|
||||
"url": 'https://www.wjx.cn/vm/PEMJOvz.aspx#'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../commons/Widgets/open_vip_tip/logic.dart';
|
||||
import '../../commons/config.dart';
|
||||
import '../../net/api.dart';
|
||||
import '../../net/dio_manager.dart';
|
||||
@ -64,7 +65,7 @@ class MinefragmentLogic extends GetxController {
|
||||
bool isUpdateVersion = false;
|
||||
String enterHomeInfoMsg = "进入主页";
|
||||
String joinedCircle = "";
|
||||
String vipMsg = "十几种特权等您领取";
|
||||
String vipMsg = "0.5元/天享受十几种专属特权";
|
||||
String isLikeFoMsg = '';
|
||||
bool isProxy = true;
|
||||
|
||||
@ -92,6 +93,10 @@ class MinefragmentLogic extends GetxController {
|
||||
|
||||
Map masterInfo = {};
|
||||
bool isHaveBady = false;
|
||||
|
||||
var ticketCount = 0;
|
||||
var beiCount = 0;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
@ -131,6 +136,8 @@ class MinefragmentLogic extends GetxController {
|
||||
loadBabyData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
setSpServeTip() async {
|
||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||
sp.setBool(SharedPreferencesHelper.serveTip, false);
|
||||
@ -141,12 +148,39 @@ class MinefragmentLogic extends GetxController {
|
||||
sp.setBool(SharedPreferencesHelper.mineOpTip, false);
|
||||
}
|
||||
|
||||
loadKingOrBaData() async {
|
||||
var data = await DioManager.instance.get(url: Api.masterBabies);
|
||||
if (data['code'] == 200) {
|
||||
beiCount = data['count'] ?? 0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
loadPriceData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getVipPrice, params: {});
|
||||
var vipPriceList = BaseResponse<List<PriceBean>>.fromJson(
|
||||
data,
|
||||
(data) =>
|
||||
List<PriceBean>.from(data.map((item) => PriceBean.fromJson(item))),
|
||||
);
|
||||
var priceBean = vipPriceList.data;
|
||||
|
||||
for (var value in priceBean) {
|
||||
if (value.isYearVip) {
|
||||
ticketCount = value.firstPresentBean ?? 0;
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
loadData() {
|
||||
getMode();
|
||||
checkVersion();
|
||||
loadMasterData();
|
||||
loadBabyData();
|
||||
loadPriceData();
|
||||
loadKingOrBaData();
|
||||
}
|
||||
|
||||
void loadMasterData() async {
|
||||
@ -297,7 +331,7 @@ class MinefragmentLogic extends GetxController {
|
||||
vipMsg = "会员时长剩余${bean.data.vipExpireDays}天";
|
||||
} else if (bean.data.last_vip_expire_date != '') {
|
||||
vipMsg =
|
||||
"会员已于${bean.data.last_vip_expire_date.toString().split(' ').first}到期";
|
||||
"${bean.data.last_vip_expire_date.toString().split(' ').first}到期,续费领福利";
|
||||
}
|
||||
|
||||
int likeMeCount =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -152,11 +152,7 @@ class UserinfoLogic extends GetxController {
|
||||
if (userId.isEmpty) {
|
||||
isMe = true;
|
||||
update();
|
||||
fetchUserInfo(Api.getUserInfo);
|
||||
fetchMyAlbum(Api.getMyAlbum);
|
||||
loadDyanmicListData();
|
||||
loadBabyData();
|
||||
loadMyTimeData();
|
||||
loadMyData();
|
||||
} else {
|
||||
sendHotAction(8, userId);
|
||||
|
||||
@ -174,6 +170,14 @@ class UserinfoLogic extends GetxController {
|
||||
loadMasterData();
|
||||
}
|
||||
|
||||
loadMyData() {
|
||||
fetchUserInfo(Api.getUserInfo);
|
||||
fetchMyAlbum(Api.getMyAlbum);
|
||||
loadDyanmicListData();
|
||||
loadBabyData();
|
||||
loadMyTimeData();
|
||||
}
|
||||
|
||||
loadDyanmicListData() async {
|
||||
String requestUserId = '';
|
||||
if (userId.isEmpty) {
|
||||
|
||||
@ -358,7 +358,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
Routes.Complete_materialPage,
|
||||
arguments: "user",
|
||||
);
|
||||
logic.onInit();
|
||||
logic.loadMyData();
|
||||
},
|
||||
child: Center(
|
||||
child: Container(
|
||||
|
||||
@ -302,6 +302,9 @@ class _LuckyBagDialogState extends State<LuckyBagDialog> {
|
||||
} else {
|
||||
if (data['code'] == 500) {
|
||||
Get.toNamed(Routes.SignalCircleListPage,arguments: widget.info['interestId'].toString());
|
||||
} else if (data['code'] == 32112) {
|
||||
Get.back();
|
||||
Get.toNamed(Routes.SignalCircleListPage,arguments: data['data'].toString());
|
||||
}
|
||||
showOKToast(data['msg']);
|
||||
}
|
||||
|
||||
@ -130,9 +130,8 @@ Future<void> _handleError(dynamic error) async {
|
||||
showOKToast('内存异常,请重新上传');
|
||||
}
|
||||
|
||||
int IM_SDK_APP_ID = 1400799631;
|
||||
const int IM_SDK_APP_ID = 1400799631;
|
||||
|
||||
String IOS_APP_ID = "";
|
||||
|
||||
//登录IM
|
||||
loginIM(String userId, String sig) async {
|
||||
|
||||
@ -403,7 +403,7 @@ class Api {
|
||||
static const wxNumConfig = '/user-service/contact/user/conf/get/';
|
||||
|
||||
//新人列表
|
||||
static const queryNewUserList = '/user-service/newUser/queryNewUserList/v2';
|
||||
static const queryNewUserList = '/user-service/newUser/queryNewUserList/v3';
|
||||
|
||||
//30人打招呼
|
||||
static const sayHelloMore = '/user-service/newUser/sayHelloMore';
|
||||
@ -776,7 +776,7 @@ class Api {
|
||||
static var masterConfig = '/user-service/user/master/enabled';
|
||||
|
||||
//小贝列表
|
||||
static var masterBabies = '/user-service/user/master/babies';
|
||||
static var masterBabies = '/user-service/user/master/babies/v2';
|
||||
|
||||
//召唤贝
|
||||
static var batchCallBabies = '/user-service/user/master/batchCallBabies';
|
||||
@ -801,4 +801,10 @@ class Api {
|
||||
//我的乐园时光
|
||||
static var trends = '/user-service/my/trends';
|
||||
|
||||
//是否显示新人入口
|
||||
static var newUserIsShow = '/user-service/newUser/isShow';
|
||||
|
||||
//指引新人
|
||||
static var guideNewUser = '/user-service/newUser/guide/';
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class SharedPreferencesHelper {
|
||||
|
||||
static const AGREEMENT = 'agreement';
|
||||
|
||||
static const String firstLogin = 'firstlogin';
|
||||
static const String firstLogin = 'first';
|
||||
|
||||
static const msgTip = 'msgTip';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user