代码提交
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.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 115
|
versionCode 117
|
||||||
versionName "2.6.5"
|
versionName "2.6.7"
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
vivo_APPID: "105669716",
|
vivo_APPID: "105669716",
|
||||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||||
|
|||||||
@ -571,27 +571,20 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
|
|||||||
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =
|
getCallOutDetail(bean.id!, bean);
|
||||||
await SharedPreferences.getInstance();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int userId =
|
void getCallOutDetail(id, bean) async {
|
||||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
var data = await DioManager.instance
|
||||||
String avatar =
|
.get(url: Api.signInterestCalloutDetail, params: {
|
||||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
'calloutId': id,
|
||||||
String name =
|
});
|
||||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
if (data['code'] == 200) {
|
||||||
|
Lists bean = Lists.fromJson(data['data']);
|
||||||
bool isContain = false;
|
logic.lists = bean;
|
||||||
for (var info in bean.chat!.users!) {
|
if (mounted) {
|
||||||
if (info.id == userId) {
|
setState(() {});
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,6 +82,12 @@ final ScrollController nearScrollController = ScrollController();
|
|||||||
|
|
||||||
int flush = 0;
|
int flush = 0;
|
||||||
bool isMore = true;
|
bool isMore = true;
|
||||||
|
|
||||||
|
|
||||||
|
bool getNewUserIsShowData = false;
|
||||||
|
|
||||||
|
bool isShowNewUser = true;
|
||||||
|
|
||||||
int myVip = -1;
|
int myVip = -1;
|
||||||
bool isShowCircle = true;
|
bool isShowCircle = true;
|
||||||
bool _isLocationGranted = false;
|
bool _isLocationGranted = false;
|
||||||
@ -153,6 +159,7 @@ final ScrollController nearScrollController = ScrollController();
|
|||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
await loadNewUserIsShowData();
|
||||||
loadCircleListData();
|
loadCircleListData();
|
||||||
loadCirclePeopleData();
|
loadCirclePeopleData();
|
||||||
await initGerder();
|
await initGerder();
|
||||||
@ -188,6 +195,16 @@ final ScrollController nearScrollController = ScrollController();
|
|||||||
getCityList();
|
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 {
|
void loadNewUserRewardData() async {
|
||||||
var data = await DioManager.instance.get(url: Api.newUserConfig);
|
var data = await DioManager.instance.get(url: Api.newUserConfig);
|
||||||
if (data['code'] == 200) {
|
if (data['code'] == 200) {
|
||||||
@ -946,16 +963,25 @@ final ScrollController nearScrollController = ScrollController();
|
|||||||
WelcomeDialog(
|
WelcomeDialog(
|
||||||
userId: id.toString(),
|
userId: id.toString(),
|
||||||
callBack: () {
|
callBack: () {
|
||||||
newPeopleList.removeAt(index);
|
newPeopleList[index]['interactionType'] = 2;
|
||||||
update();
|
update();
|
||||||
if (newPeopleList.length < 5) {
|
|
||||||
onLoading();
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
isScrollControlled: true,
|
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 {
|
void snedHelloMoreData() async {
|
||||||
var data = await DioManager.instance.post(
|
var data = await DioManager.instance.post(
|
||||||
url: Api.sayHelloMore,
|
url: Api.sayHelloMore,
|
||||||
@ -1059,6 +1085,7 @@ class VicinityItemBean {
|
|||||||
final int gender;
|
final int gender;
|
||||||
final int role;
|
final int role;
|
||||||
final int orientation;
|
final int orientation;
|
||||||
|
final int interactionType;
|
||||||
final double lng;
|
final double lng;
|
||||||
final double lat;
|
final double lat;
|
||||||
final String city;
|
final String city;
|
||||||
@ -1103,6 +1130,7 @@ class VicinityItemBean {
|
|||||||
required this.lastRewardInterest,
|
required this.lastRewardInterest,
|
||||||
required this.lastInterestWelfare,
|
required this.lastInterestWelfare,
|
||||||
required this.lastJoinInterest,
|
required this.lastJoinInterest,
|
||||||
|
required this.interactionType,
|
||||||
required this.hasContact,
|
required this.hasContact,
|
||||||
required this.lastRankTopDesc,
|
required this.lastRankTopDesc,
|
||||||
required this.lastUserRelation,
|
required this.lastUserRelation,
|
||||||
@ -1161,7 +1189,7 @@ class VicinityItemBean {
|
|||||||
lastJoinInterest: json['lastJoinInterest'] ?? {},
|
lastJoinInterest: json['lastJoinInterest'] ?? {},
|
||||||
lastRankTopDesc: json['lastRankTopDesc'] ?? '',
|
lastRankTopDesc: json['lastRankTopDesc'] ?? '',
|
||||||
lastUserRelation: json['lastUserRelation'].toString() ?? '',
|
lastUserRelation: json['lastUserRelation'].toString() ?? '',
|
||||||
|
interactionType: json['interactionType'],
|
||||||
imId: json['imId'] ?? '',
|
imId: json['imId'] ?? '',
|
||||||
avatar: json['avatar'],
|
avatar: json['avatar'],
|
||||||
isFollow: json['isFollow'] ?? false,
|
isFollow: json['isFollow'] ?? false,
|
||||||
|
|||||||
@ -39,7 +39,6 @@ class CirclePage extends StatefulWidget {
|
|||||||
class _CirclePageState extends State<CirclePage>
|
class _CirclePageState extends State<CirclePage>
|
||||||
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
late PageController _pageController;
|
|
||||||
|
|
||||||
// int currentIndex = 0;
|
// int currentIndex = 0;
|
||||||
|
|
||||||
@ -49,6 +48,8 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
final homelogic = Get.find<HomeLogic>();
|
final homelogic = Get.find<HomeLogic>();
|
||||||
var getContext;
|
var getContext;
|
||||||
|
|
||||||
|
bool isLoadTab = false;
|
||||||
|
|
||||||
// 是否需要缓存
|
// 是否需要缓存
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
@ -59,21 +60,37 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
sub = EventBusManager.on<ChangeIndex>().listen((event) {
|
sub = EventBusManager.on<ChangeIndex>().listen((event) {
|
||||||
logic.currentIndex = event.index;
|
if (logic.isShowNewUser) {
|
||||||
_tabController.index = logic.currentIndex;
|
logic.currentIndex = event.index;
|
||||||
addUmengPage('${titleList[logic.currentIndex]}');
|
_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(() {});
|
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;
|
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() {
|
void _handleTabChange() {
|
||||||
// 在这里可以执行滑动监听后的逻辑操作
|
// 在这里可以执行滑动监听后的逻辑操作
|
||||||
// 比如根据当前选中的标签执行其他操作
|
// 比如根据当前选中的标签执行其他操作
|
||||||
@ -91,10 +108,10 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
sub.cancel();
|
sub.cancel();
|
||||||
_tabController.removeListener(_handleTabChange); // 移除监听
|
_tabController.removeListener(_handleTabChange); // 移除监听
|
||||||
_tabController.dispose();
|
_tabController.dispose();
|
||||||
_pageController.dispose();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
@ -103,9 +120,12 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
if (logic.currentIndex == 0) {
|
if (logic.currentIndex == 0) {
|
||||||
logic.isNewPeopleRed = false;
|
logic.isNewPeopleRed = false;
|
||||||
}
|
}
|
||||||
|
if (logic.getNewUserIsShowData && !isLoadTab) {
|
||||||
|
initTabData();
|
||||||
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: Stack(
|
body:logic.getNewUserIsShowData ? Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
SafeArea(
|
SafeArea(
|
||||||
@ -120,10 +140,10 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
margin: EdgeInsets.only(top: 45.sp),
|
margin: EdgeInsets.only(top: 45.sp),
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
controller: _tabController,
|
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(
|
Positioned(
|
||||||
left: 10.sp,
|
left: 10.sp,
|
||||||
bottom: 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,
|
width: Get.width,
|
||||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||||
height: 44.sp,
|
height: 44.sp,
|
||||||
child: Stack(
|
child: logic.isShowNewUser ? Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
_tabController.index == 0
|
_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) {
|
void _showBottomSheet(BuildContext context) {
|
||||||
if (_tabController.index == 1) {
|
|
||||||
addUmengTag('点击附近筛选');
|
|
||||||
} else {
|
|
||||||
addUmengTag('点击精选筛选');
|
|
||||||
}
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return ScreenBottomSheetDialog(
|
return logic.isShowNewUser ? ScreenBottomSheetDialog(
|
||||||
genderList: _tabController.index == 1
|
genderList: _tabController.index == 1
|
||||||
? logic.genderList
|
? logic.genderList
|
||||||
: _tabController.index == 0
|
: _tabController.index == 0
|
||||||
@ -1086,6 +1298,42 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
if (element.isSelect) orientations.add(element.id);
|
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(
|
EventBusManager.fire(
|
||||||
OptionFindclass(genders, roles, orientations));
|
OptionFindclass(genders, roles, orientations));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -326,22 +326,21 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
|
getCallOutDetail(bean.id!, bean);
|
||||||
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
}
|
||||||
int userId = sharedPreferences.getInt(SharedPreferencesHelper.USERID)??0;
|
}
|
||||||
String avatar = sharedPreferences.getString(SharedPreferencesHelper.AVATAR)??"";
|
|
||||||
String name = sharedPreferences.getString(SharedPreferencesHelper.NAME)??"";
|
|
||||||
|
|
||||||
bool isContain = false;
|
void getCallOutDetail(id, bean) async {
|
||||||
for (var info in bean.chat!.users!) {
|
var data = await DioManager.instance
|
||||||
if (info.id == userId) {
|
.get(url: Api.signInterestCalloutDetail, params: {
|
||||||
isContain = true;
|
'calloutId': id,
|
||||||
}
|
});
|
||||||
}
|
if (data['code'] == 200) {
|
||||||
if (!isContain) {
|
Lists bean = Lists.fromJson(data['data']);
|
||||||
bean.chat!.users!.add(Users(avatar: avatar,id: userId,nickname: name));
|
int index = lists.indexOf(bean);
|
||||||
bean.chat!.count = bean.chat!.count! + 1;
|
lists[index] = bean;
|
||||||
widget.logic.update();
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -800,7 +799,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
widget.logic.getWelfareDetailData(
|
widget.logic.getWelfareDetailData(
|
||||||
data['id'].toString(),index);
|
data['id'].toString(),index);
|
||||||
} else {
|
} 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) {
|
double contentHeight(String content) {
|
||||||
return calculateTextHeight(
|
return calculateTextHeight(
|
||||||
content, 17.sp, FontWeight.w300, Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100);
|
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!);
|
data['data']['account_id'], bean.user!.nickname!);
|
||||||
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
SharedPreferences sharedPreferences =
|
getCallOutDetail(bean.id!, bean);
|
||||||
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) ?? "";
|
|
||||||
|
|
||||||
bool isContain = false;
|
void getCallOutDetail(id, bean) async {
|
||||||
for (var info in bean.chat!.users!) {
|
var data = await DioManager.instance
|
||||||
if (info.id == userId) {
|
.get(url: Api.signInterestCalloutDetail, params: {
|
||||||
isContain = true;
|
'calloutId': id,
|
||||||
}
|
});
|
||||||
}
|
if (data['code'] == 200) {
|
||||||
if (!isContain) {
|
Lists bean = Lists.fromJson(data['data']);
|
||||||
bean.chat!.users!
|
int index = lists.indexOf(bean);
|
||||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
lists[index] = bean;
|
||||||
bean.chat!.count = bean.chat!.count + 1;
|
if (mounted) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,9 @@ class _NewPeopleState extends State<NewPeople> {
|
|||||||
double maxOff = 0;
|
double maxOff = 0;
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
@ -117,7 +120,7 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListItem(VicinityItemBean.fromJson(widget.info), widget.index);
|
return ListItem(VicinityItemBean.fromJson(widget.info), widget.index);
|
||||||
}
|
}
|
||||||
|
List<String> actionList = ['','欢迎新人','👉指引新人','💬和TA聊聊'];
|
||||||
Widget ListItem(VicinityItemBean item, int index) {
|
Widget ListItem(VicinityItemBean item, int index) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@ -204,7 +207,7 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showOKToast('点击“👏欢迎”,对方回复您后就可以在消息列表进行聊天互动啦~');
|
showOKToast('点击右上角可以和新人互动哦~');
|
||||||
// Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
// Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -340,7 +343,13 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
|||||||
Expanded(child: Container()),
|
Expanded(child: Container()),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
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(
|
child: Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
@ -349,15 +358,17 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
|||||||
height: 26.sp,
|
height: 26.sp,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
if (item.interactionType == 1)
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('hello_icon'),
|
getCircleImage('hello_icon'),
|
||||||
width: 24.sp,
|
width: 24.sp,
|
||||||
),
|
),
|
||||||
|
if (item.interactionType == 1)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 2.sp,
|
width: 2.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'欢迎新人',
|
actionList[item.interactionType],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 14.sp),
|
fontSize: 14.sp),
|
||||||
|
|||||||
@ -194,10 +194,18 @@ class LikeLogic extends GetxController {
|
|||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
circle = bean.data!;
|
circle = bean.data!;
|
||||||
} else {
|
} 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) {
|
if (bean.data!.lists.length == 0) {
|
||||||
isMore = false;
|
isMore = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -266,27 +266,21 @@ class _AllCircleItemState extends State<AllCircleItem>
|
|||||||
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =
|
getCallOutDetail(bean.id!, bean);
|
||||||
await SharedPreferences.getInstance();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int userId =
|
void getCallOutDetail(id, bean) async {
|
||||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
|
var data = await DioManager.instance
|
||||||
String avatar =
|
.get(url: Api.signInterestCalloutDetail, params: {
|
||||||
sharedPreferences.getString(SharedPreferencesHelper.AVATAR) ?? "";
|
'calloutId': id,
|
||||||
String name =
|
});
|
||||||
sharedPreferences.getString(SharedPreferencesHelper.NAME) ?? "";
|
if (data['code'] == 200) {
|
||||||
|
Lists bean = Lists.fromJson(data['data']);
|
||||||
bool isContain = false;
|
int index = lists.indexOf(bean);
|
||||||
for (var info in bean.chat!.users!) {
|
lists[index] = bean;
|
||||||
if (info.id == userId) {
|
if (mounted) {
|
||||||
isContain = true;
|
setState(() {});
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!isContain) {
|
|
||||||
bean.chat!.users!
|
|
||||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
|
||||||
bean.chat!.count = bean.chat!.count! + 1;
|
|
||||||
// widget.logic.update();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1095,11 +1089,8 @@ class _AllCircleItemState extends State<AllCircleItem>
|
|||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(CallOutShareDialog('', '', lists),
|
||||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
isScrollControlled: true, enableDrag: false);
|
||||||
enableDrag: false
|
|
||||||
);
|
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(right: 5.sp),
|
margin: EdgeInsets.only(right: 5.sp),
|
||||||
@ -1592,11 +1583,8 @@ class _AllCircleItemState extends State<AllCircleItem>
|
|||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(CallOutShareDialog('', '', lists),
|
||||||
CallOutShareDialog('','',lists), isScrollControlled: true,
|
isScrollControlled: true, enableDrag: false);
|
||||||
enableDrag: false
|
|
||||||
);
|
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(right: 5.sp),
|
margin: EdgeInsets.only(right: 5.sp),
|
||||||
|
|||||||
@ -1767,27 +1767,21 @@ class _RightCircleListWidgetState extends State<RightCircleListWidget>
|
|||||||
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
|
||||||
SharedPreferences sharedPreferences =
|
getCallOutDetail(bean.id!, bean);
|
||||||
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) ?? "";
|
|
||||||
|
|
||||||
bool isContain = false;
|
void getCallOutDetail(id, bean) async {
|
||||||
for (var info in bean.chat!.users!) {
|
var data = await DioManager.instance
|
||||||
if (info.id == userId) {
|
.get(url: Api.signInterestCalloutDetail, params: {
|
||||||
isContain = true;
|
'calloutId': id,
|
||||||
}
|
});
|
||||||
}
|
if (data['code'] == 200) {
|
||||||
if (!isContain) {
|
Lists bean = Lists.fromJson(data['data']);
|
||||||
bean.chat!.users!
|
int index = lists.indexOf(bean);
|
||||||
.add(Users(avatar: avatar, id: userId, nickname: name));
|
lists[index] = bean;
|
||||||
bean.chat!.count = bean.chat!.count! + 1;
|
if (mounted) {
|
||||||
widget.logic.update();
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.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:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
|||||||
|
|
||||||
installApk() async {
|
installApk() async {
|
||||||
//flutter_install_app
|
//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 'dart:io';
|
||||||
|
|
||||||
import 'package:circle_app/commons/colors/app_color.dart';
|
import 'package:circle_app/commons/colors/app_color.dart';
|
||||||
|
import 'package:circle_app/router/routers.dart';
|
||||||
import 'package:connectivity/connectivity.dart';
|
import 'package:connectivity/connectivity.dart';
|
||||||
import 'package:device_info/device_info.dart';
|
import 'package:device_info/device_info.dart';
|
||||||
import 'package:flutter/cupertino.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_bugly/flutter_bugly.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import '../../utils/SharedPreferencesHelper.dart';
|
import '../../utils/SharedPreferencesHelper.dart';
|
||||||
import '../../utils/device.dart';
|
import '../../utils/device.dart';
|
||||||
@ -131,7 +133,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
|
|||||||
var sp = await SharedPreferencesHelper.getInstance();
|
var sp = await SharedPreferencesHelper.getInstance();
|
||||||
sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
pushLoginPage();
|
Get.offAllNamed(Routes.Login);
|
||||||
FlutterBugly.init(
|
FlutterBugly.init(
|
||||||
androidAppId: "8509314e11",
|
androidAppId: "8509314e11",
|
||||||
);
|
);
|
||||||
|
|||||||
@ -35,6 +35,11 @@ class LoginLogic extends GetxController {
|
|||||||
bool isLogining = false;
|
bool isLogining = false;
|
||||||
|
|
||||||
String loginPhone = '';
|
String loginPhone = '';
|
||||||
|
|
||||||
|
bool showOthner = false;
|
||||||
|
|
||||||
|
String isAuto = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
@ -47,9 +52,9 @@ class LoginLogic extends GetxController {
|
|||||||
// TODO: implement onInit
|
// TODO: implement onInit
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
// if (!kDebugMode) {
|
if (!kDebugMode) {
|
||||||
// checkNetworkUrl();
|
checkNetworkUrl();
|
||||||
// }
|
}
|
||||||
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
|
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
|
||||||
loginPhone =
|
loginPhone =
|
||||||
await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ??
|
await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ??
|
||||||
@ -70,8 +75,18 @@ class LoginLogic extends GetxController {
|
|||||||
pwd.isNotEmpty) {
|
pwd.isNotEmpty) {
|
||||||
loginType = 1;
|
loginType = 1;
|
||||||
pwdEditingController.text = pwd;
|
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();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,8 +57,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(top: 270.sp),
|
||||||
top:270.sp),
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -95,11 +94,17 @@ class LoginPage extends StatelessWidget {
|
|||||||
if (GetUtils.isPhoneNumber(msg) &&
|
if (GetUtils.isPhoneNumber(msg) &&
|
||||||
msg.length == 11) {
|
msg.length == 11) {
|
||||||
logic.isPhone = true;
|
logic.isPhone = true;
|
||||||
sendOpenSourceData('input_mobile',params: jsonEncode({'phone':logic.phoneEditingController.text}));
|
sendOpenSourceData(
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
'input_mobile',
|
||||||
} else {
|
params: jsonEncode({
|
||||||
|
'phone': logic
|
||||||
}
|
.phoneEditingController
|
||||||
|
.text
|
||||||
|
}));
|
||||||
|
FocusManager
|
||||||
|
.instance.primaryFocus
|
||||||
|
?.unfocus();
|
||||||
|
} else {}
|
||||||
logic.update();
|
logic.update();
|
||||||
},
|
},
|
||||||
controller:
|
controller:
|
||||||
@ -165,9 +170,17 @@ class LoginPage extends StatelessWidget {
|
|||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
maxLength: 8,
|
maxLength: 8,
|
||||||
onChanged: (String text) {
|
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) {
|
if (text.length >= 4) {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager
|
||||||
|
.instance.primaryFocus
|
||||||
|
?.unfocus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -189,9 +202,16 @@ class LoginPage extends StatelessWidget {
|
|||||||
right: 0,
|
right: 0,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (logic.phoneEditingController.text.length == 11) {
|
if (logic
|
||||||
|
.phoneEditingController
|
||||||
|
.text
|
||||||
|
.length ==
|
||||||
|
11) {
|
||||||
logic.starDownTimer();
|
logic.starDownTimer();
|
||||||
} else if (logic.phoneEditingController.text.isEmail) {
|
} else if (logic
|
||||||
|
.phoneEditingController
|
||||||
|
.text
|
||||||
|
.isEmail) {
|
||||||
logic.starDownTimer();
|
logic.starDownTimer();
|
||||||
} else {
|
} else {
|
||||||
showOKToast('请输入正确的手机号/邮箱');
|
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(
|
Container(
|
||||||
width: 280.sp,
|
width: 280.sp,
|
||||||
margin: EdgeInsets.only(top: 15.sp, right: 0.sp),
|
margin: EdgeInsets.only(top: 15.sp, right: 0.sp),
|
||||||
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
Container(),
|
||||||
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
logic.loginType = logic.loginType == 0 ? 1 : 0;
|
logic.loginType = logic.loginType == 0 ? 1 : 0;
|
||||||
logic.update();
|
logic.update();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.loginType == 1 ? '验证码登录' : '密码登录',
|
logic.loginType == 1 ? '切换验证码登录' : '切换密码登录',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 14.sp),
|
color: Colors.white, fontSize: 14.sp),
|
||||||
),
|
),
|
||||||
@ -359,23 +395,30 @@ class LoginPage extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 280.sp,
|
width: 280.sp,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: !logic.showOthner
|
||||||
|
? MainAxisAlignment.spaceBetween
|
||||||
|
: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!logic.check) {
|
if (!logic.check) {
|
||||||
Get.bottomSheet(privacyDialog(),isScrollControlled:true);
|
Get.bottomSheet(privacyDialog(),
|
||||||
|
isScrollControlled: true);
|
||||||
} else {
|
} else {
|
||||||
|
if (logic.loginType == 0) {
|
||||||
|
showOKToast('请先切换密码登录');
|
||||||
|
return;
|
||||||
|
}
|
||||||
logic.login();
|
logic.login();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 120.sp,
|
width: !logic.showOthner ? 85.sp : 120.sp,
|
||||||
height: 50.sp,
|
height: 40.sp,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(25.sp),
|
borderRadius:
|
||||||
|
BorderRadius.circular(25.sp),
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment.centerLeft,
|
begin: Alignment.centerLeft,
|
||||||
end: Alignment.centerRight,
|
end: Alignment.centerRight,
|
||||||
@ -384,7 +427,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
Color(0xffD739EA)
|
Color(0xffD739EA)
|
||||||
])),
|
])),
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.loginType == 0 ? '验证码登录' : '密码登录',
|
'密码登录',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
@ -392,39 +435,81 @@ class LoginPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GestureDetector(
|
if (!logic.showOthner)
|
||||||
onTap: () {
|
GestureDetector(
|
||||||
logic.preLogin();
|
onTap: () {
|
||||||
|
if (!logic.check) {
|
||||||
},
|
Get.bottomSheet(privacyDialog(),
|
||||||
child: Container(
|
isScrollControlled: true);
|
||||||
width: 120.sp,
|
} else {
|
||||||
height: 50.sp,
|
if (logic.loginType == 1) {
|
||||||
alignment: Alignment.center,
|
showOKToast('请先切换验证码登录');
|
||||||
decoration: BoxDecoration(
|
return;
|
||||||
borderRadius: BorderRadius.circular(25.sp),
|
}
|
||||||
gradient: const LinearGradient(
|
logic.login();
|
||||||
begin: Alignment.centerLeft,
|
}
|
||||||
end: Alignment.centerRight,
|
},
|
||||||
colors: [
|
child: Container(
|
||||||
Color(0xff0AFCFF),
|
width: 85.sp,
|
||||||
Color(0xffD739EA)
|
height: 40.sp,
|
||||||
])),
|
alignment: Alignment.center,
|
||||||
child: Text(
|
decoration: BoxDecoration(
|
||||||
'一键登录',
|
borderRadius:
|
||||||
style: TextStyle(
|
BorderRadius.circular(25.sp),
|
||||||
color: Colors.white,
|
gradient: const LinearGradient(
|
||||||
fontSize: 16.sp,
|
begin: Alignment.centerLeft,
|
||||||
fontWeight: FontWeight.w500),
|
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(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 15.sp),
|
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(
|
Positioned(
|
||||||
onTap: () {
|
top: MediaQuery.of(context).padding.top + 15.sp,
|
||||||
Get.toNamed(Routes.HelpBack);
|
right: 15.sp,
|
||||||
},
|
left: 15.sp,
|
||||||
child: Row(
|
child: InkWell(
|
||||||
children: [
|
onTap: () {
|
||||||
Icon(Icons.question_mark,color: AppColor.mainColor,size: 15.sp,),
|
Get.toNamed(Routes.HelpBack);
|
||||||
Text('在线反馈',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),),
|
},
|
||||||
],
|
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(
|
child: Container(
|
||||||
width: 250.sp,
|
width: 250.sp,
|
||||||
height: 140.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(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
),
|
),
|
||||||
// borderRadius: BorderRadius.circular(10.sp)
|
// borderRadius: BorderRadius.circular(10.sp)
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
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(
|
Wrap(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
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(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
navigateToUserAgreement();
|
navigateToUserAgreement();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Text('《用户协议》',style: TextStyle(color:AppColor.mainColor,fontSize: 15.sp),),
|
child: Text(
|
||||||
|
'《用户协议》',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColor.mainColor, fontSize: 15.sp),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Container(
|
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(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
navigateToPrivacyPolicy();
|
navigateToPrivacyPolicy();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Text('《隐私协议》',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),),
|
child: Text(
|
||||||
|
'《隐私协议》',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColor.mainColor, fontSize: 15.sp),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
SizedBox(
|
||||||
SizedBox(height: 10.sp,),
|
height: 10.sp,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -590,16 +730,16 @@ class LoginPage extends StatelessWidget {
|
|||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
||||||
width: 80.sp,
|
width: 80.sp,
|
||||||
height: 30.sp,
|
height: 30.sp,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0x26FFFFFF),
|
color: Color(0x26FFFFFF),
|
||||||
borderRadius: BorderRadius.circular(15.sp)
|
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(
|
InkWell(
|
||||||
@ -614,11 +754,15 @@ class LoginPage extends StatelessWidget {
|
|||||||
height: 30.sp,
|
height: 30.sp,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: AppColor.mainVerLinearGradient,
|
gradient: AppColor.mainVerLinearGradient,
|
||||||
borderRadius: BorderRadius.circular(15.sp)
|
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#'
|
"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:image_picker/image_picker.dart';
|
||||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
|
|
||||||
|
import '../../commons/Widgets/open_vip_tip/logic.dart';
|
||||||
import '../../commons/config.dart';
|
import '../../commons/config.dart';
|
||||||
import '../../net/api.dart';
|
import '../../net/api.dart';
|
||||||
import '../../net/dio_manager.dart';
|
import '../../net/dio_manager.dart';
|
||||||
@ -64,7 +65,7 @@ class MinefragmentLogic extends GetxController {
|
|||||||
bool isUpdateVersion = false;
|
bool isUpdateVersion = false;
|
||||||
String enterHomeInfoMsg = "进入主页";
|
String enterHomeInfoMsg = "进入主页";
|
||||||
String joinedCircle = "";
|
String joinedCircle = "";
|
||||||
String vipMsg = "十几种特权等您领取";
|
String vipMsg = "0.5元/天享受十几种专属特权";
|
||||||
String isLikeFoMsg = '';
|
String isLikeFoMsg = '';
|
||||||
bool isProxy = true;
|
bool isProxy = true;
|
||||||
|
|
||||||
@ -92,6 +93,10 @@ class MinefragmentLogic extends GetxController {
|
|||||||
|
|
||||||
Map masterInfo = {};
|
Map masterInfo = {};
|
||||||
bool isHaveBady = false;
|
bool isHaveBady = false;
|
||||||
|
|
||||||
|
var ticketCount = 0;
|
||||||
|
var beiCount = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
@ -131,6 +136,8 @@ class MinefragmentLogic extends GetxController {
|
|||||||
loadBabyData();
|
loadBabyData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSpServeTip() async {
|
setSpServeTip() async {
|
||||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||||
sp.setBool(SharedPreferencesHelper.serveTip, false);
|
sp.setBool(SharedPreferencesHelper.serveTip, false);
|
||||||
@ -141,12 +148,39 @@ class MinefragmentLogic extends GetxController {
|
|||||||
sp.setBool(SharedPreferencesHelper.mineOpTip, false);
|
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() {
|
loadData() {
|
||||||
getMode();
|
getMode();
|
||||||
checkVersion();
|
checkVersion();
|
||||||
loadMasterData();
|
loadMasterData();
|
||||||
loadBabyData();
|
loadBabyData();
|
||||||
|
loadPriceData();
|
||||||
|
loadKingOrBaData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadMasterData() async {
|
void loadMasterData() async {
|
||||||
@ -297,7 +331,7 @@ class MinefragmentLogic extends GetxController {
|
|||||||
vipMsg = "会员时长剩余${bean.data.vipExpireDays}天";
|
vipMsg = "会员时长剩余${bean.data.vipExpireDays}天";
|
||||||
} else if (bean.data.last_vip_expire_date != '') {
|
} else if (bean.data.last_vip_expire_date != '') {
|
||||||
vipMsg =
|
vipMsg =
|
||||||
"会员已于${bean.data.last_vip_expire_date.toString().split(' ').first}到期";
|
"${bean.data.last_vip_expire_date.toString().split(' ').first}到期,续费领福利";
|
||||||
}
|
}
|
||||||
|
|
||||||
int likeMeCount =
|
int likeMeCount =
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -152,11 +152,7 @@ class UserinfoLogic extends GetxController {
|
|||||||
if (userId.isEmpty) {
|
if (userId.isEmpty) {
|
||||||
isMe = true;
|
isMe = true;
|
||||||
update();
|
update();
|
||||||
fetchUserInfo(Api.getUserInfo);
|
loadMyData();
|
||||||
fetchMyAlbum(Api.getMyAlbum);
|
|
||||||
loadDyanmicListData();
|
|
||||||
loadBabyData();
|
|
||||||
loadMyTimeData();
|
|
||||||
} else {
|
} else {
|
||||||
sendHotAction(8, userId);
|
sendHotAction(8, userId);
|
||||||
|
|
||||||
@ -174,6 +170,14 @@ class UserinfoLogic extends GetxController {
|
|||||||
loadMasterData();
|
loadMasterData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadMyData() {
|
||||||
|
fetchUserInfo(Api.getUserInfo);
|
||||||
|
fetchMyAlbum(Api.getMyAlbum);
|
||||||
|
loadDyanmicListData();
|
||||||
|
loadBabyData();
|
||||||
|
loadMyTimeData();
|
||||||
|
}
|
||||||
|
|
||||||
loadDyanmicListData() async {
|
loadDyanmicListData() async {
|
||||||
String requestUserId = '';
|
String requestUserId = '';
|
||||||
if (userId.isEmpty) {
|
if (userId.isEmpty) {
|
||||||
|
|||||||
@ -358,7 +358,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
Routes.Complete_materialPage,
|
Routes.Complete_materialPage,
|
||||||
arguments: "user",
|
arguments: "user",
|
||||||
);
|
);
|
||||||
logic.onInit();
|
logic.loadMyData();
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@ -302,6 +302,9 @@ class _LuckyBagDialogState extends State<LuckyBagDialog> {
|
|||||||
} else {
|
} else {
|
||||||
if (data['code'] == 500) {
|
if (data['code'] == 500) {
|
||||||
Get.toNamed(Routes.SignalCircleListPage,arguments: widget.info['interestId'].toString());
|
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']);
|
showOKToast(data['msg']);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,9 +130,8 @@ Future<void> _handleError(dynamic error) async {
|
|||||||
showOKToast('内存异常,请重新上传');
|
showOKToast('内存异常,请重新上传');
|
||||||
}
|
}
|
||||||
|
|
||||||
int IM_SDK_APP_ID = 1400799631;
|
const int IM_SDK_APP_ID = 1400799631;
|
||||||
|
|
||||||
String IOS_APP_ID = "";
|
|
||||||
|
|
||||||
//登录IM
|
//登录IM
|
||||||
loginIM(String userId, String sig) async {
|
loginIM(String userId, String sig) async {
|
||||||
|
|||||||
@ -403,7 +403,7 @@ class Api {
|
|||||||
static const wxNumConfig = '/user-service/contact/user/conf/get/';
|
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人打招呼
|
//30人打招呼
|
||||||
static const sayHelloMore = '/user-service/newUser/sayHelloMore';
|
static const sayHelloMore = '/user-service/newUser/sayHelloMore';
|
||||||
@ -776,7 +776,7 @@ class Api {
|
|||||||
static var masterConfig = '/user-service/user/master/enabled';
|
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';
|
static var batchCallBabies = '/user-service/user/master/batchCallBabies';
|
||||||
@ -801,4 +801,10 @@ class Api {
|
|||||||
//我的乐园时光
|
//我的乐园时光
|
||||||
static var trends = '/user-service/my/trends';
|
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 AGREEMENT = 'agreement';
|
||||||
|
|
||||||
static const String firstLogin = 'firstlogin';
|
static const String firstLogin = 'first';
|
||||||
|
|
||||||
static const msgTip = 'msgTip';
|
static const msgTip = 'msgTip';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user