代码提交

This commit is contained in:
CYH 2025-05-24 22:24:46 +08:00
parent ad1cecc56d
commit 01856e42ce
22 changed files with 1389 additions and 676 deletions

View File

@ -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",

View File

@ -571,27 +571,20 @@ class _Call_out_detailPageState extends State<Call_out_detailPage> {
await Future.delayed(Duration(seconds: 1));
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
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;
getCallOutDetail(bean.id!, bean);
}
}
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(() {});
}
}
}

View File

@ -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,

View File

@ -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) {
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));
}

View File

@ -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);

View File

@ -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(() {});
}
}

View File

@ -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: () {
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),

View File

@ -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;
}

View File

@ -266,27 +266,21 @@ class _AllCircleItemState extends State<AllCircleItem>
await Future.delayed(Duration(seconds: 1));
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
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;
getCallOutDetail(bean.id!, bean);
}
}
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),

View File

@ -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(() {});
}
}
}

View File

@ -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);
}
}

View File

@ -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",
);

View File

@ -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;
}
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();
}

View File

@ -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,17 +435,55 @@ class LoginPage extends StatelessWidget {
),
),
),
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: 120.sp,
height: 50.sp,
width: 85.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,
@ -424,7 +505,11 @@ class LoginPage extends StatelessWidget {
),
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,14 +594,46 @@ class LoginPage extends StatelessWidget {
),
),
)),
Positioned(top: MediaQuery.of(context).padding.top + 15.sp,right: 15.sp,child: InkWell(
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: [
Icon(Icons.question_mark,color: AppColor.mainColor,size: 15.sp,),
Text('在线反馈',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),),
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),
),
],
),
],
),
)),
@ -550,38 +667,61 @@ class LoginPage extends StatelessWidget {
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)
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(
@ -615,10 +755,14 @@ class LoginPage extends StatelessWidget {
alignment: Alignment.center,
decoration: BoxDecoration(
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#'
});
}
}

View File

@ -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 =

View File

@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:get/get.dart';
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../commons/Widgets/base_tip_widget.dart';
@ -396,7 +397,15 @@ class _MinefragmentPageState extends State<MinefragmentPage>
getMineImage('bubble_icon'),
width: 174.sp,
),
Container(margin: EdgeInsets.only(bottom: 10.sp),child: Text('产品反馈或在线客服',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.bold),))
Container(
margin: EdgeInsets.only(bottom: 10.sp),
child: Text(
'产品反馈或在线客服',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
))
],
)),
Positioned(
@ -410,7 +419,6 @@ class _MinefragmentPageState extends State<MinefragmentPage>
),
),
)),
Positioned(
bottom: 20.sp,
right: 15.sp,
@ -451,11 +459,8 @@ class _MinefragmentPageState extends State<MinefragmentPage>
fontWeight: FontWeight.w600,
color: Colors.white,
shadows: [
Shadow(
color: Colors.black,
offset: Offset(0.0, -1))
]
),
Shadow(color: Colors.black, offset: Offset(0.0, -1))
]),
))
],
),
@ -479,13 +484,20 @@ class _MinefragmentPageState extends State<MinefragmentPage>
top: 20.sp + MediaQuery.of(context).padding.top,
right: 10.sp,
child: Column(
children: [
Image.asset(
getBaseImage('pop_top_right'),
width: 174.sp,
),
Container(margin: EdgeInsets.only(bottom: 10.sp),child: Text('更多功能等你体验',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.bold),))
Container(
margin: EdgeInsets.only(bottom: 10.sp),
child: Text(
'更多功能等你体验',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
))
],
)),
Positioned(
@ -529,7 +541,7 @@ class _MinefragmentPageState extends State<MinefragmentPage>
},
child: Container(
height: 68.sp,
padding: EdgeInsets.symmetric(horizontal: 15.sp),
padding: EdgeInsets.only(left: 10.sp),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -622,85 +634,85 @@ class _MinefragmentPageState extends State<MinefragmentPage>
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 15.sp,
),
margin: EdgeInsets.only(top: 13.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
userInfoBean?.nickname ?? "",
style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 14.sp,
),
),
if ((logic.userInfoBean?.mark ?? 0) > 0)
SizedBox(width: 8.sp),
if ((logic.userInfoBean?.mark ?? 0) > 0)
UserTagWidget(logic.userInfoBean!.mark!),
if (logic.isAuth) SizedBox(width: 4.sp),
if (logic.isAuth)
Image(
image: AssetImage(getMineImage("auth")),
height: 18.sp,
),
],
),
Container(
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 5.sp,
height: 5.sp,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xFF00FFF4),
),
),
Text(
logic.onLineCity.isNotEmpty ? logic.onLineCity : '在线',
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF00FFF4),
),
),
],
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 15.sp,
),
margin: EdgeInsets.only(top: 4.sp),
child: Row(
children: [
_buildInfoRow(logic),
Expanded(child: Container()),
Text(
'常驻城市:' + (logic.userInfoBean?.city ?? ''),
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF00FFF4),
),
),
],
),
),
if (interests.isNotEmpty)
Container(
height: 30.sp,
margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp),
child: _buildInterestsListView(interests),
),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 15.sp,
// ),
// margin: EdgeInsets.only(top: 13.sp),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Row(
// children: [
// Text(
// userInfoBean?.nickname ?? "",
// style: TextStyle(
// color: Color.fromRGBO(247, 250, 250, 1.0),
// fontSize: 14.sp,
// ),
// ),
// if ((logic.userInfoBean?.mark ?? 0) > 0)
// SizedBox(width: 8.sp),
// if ((logic.userInfoBean?.mark ?? 0) > 0)
// UserTagWidget(logic.userInfoBean!.mark!),
// if (logic.isAuth) SizedBox(width: 4.sp),
// if (logic.isAuth)
// Image(
// image: AssetImage(getMineImage("auth")),
// height: 18.sp,
// ),
// ],
// ),
// Container(
// child: Row(
// children: [
// Container(
// margin: EdgeInsets.only(right: 5.sp),
// width: 5.sp,
// height: 5.sp,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: const Color(0xFF00FFF4),
// ),
// ),
// Text(
// logic.onLineCity.isNotEmpty ? logic.onLineCity : '在线',
// style: TextStyle(
// fontSize: 12.sp,
// color: const Color(0xFF00FFF4),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 15.sp,
// ),
// margin: EdgeInsets.only(top: 4.sp),
// child: Row(
// children: [
// _buildInfoRow(logic),
// Expanded(child: Container()),
// Text(
// '常驻城市:' + (logic.userInfoBean?.city ?? ''),
// style: TextStyle(
// fontSize: 12.sp,
// color: const Color(0xFF00FFF4),
// ),
// ),
// ],
// ),
// ),
// if (interests.isNotEmpty)
// Container(
// height: 30.sp,
// margin: EdgeInsets.only(top: 10.sp, left: 10.sp, right: 10.sp),
// child: _buildInterestsListView(interests),
// ),
_friendsRow(logic),
Container(
height: 70.sp,
@ -708,173 +720,113 @@ class _MinefragmentPageState extends State<MinefragmentPage>
child: Row(
children: [
Expanded(child: myAssetsItem()),
if (homelogic.isShowMasterFunc)
SizedBox(
width: 8.sp,
),
Expanded(child: myVipItem()),
if (homelogic.isShowMasterFunc) Expanded(child: myVipItem()),
],
),
),
if(homelogic.isShowMasterFunc)
InkWell(
onTap: () {
Get.toNamed(Routes.MyMasterOrBaby);
},
child: Container(
height: 35.sp,
width: Get.width,
padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
margin: EdgeInsets.only(
top: 10.sp, left: 15.sp, right: 10.sp, bottom: 0.sp),
decoration: BoxDecoration(
color: Color(0x1AFFFFFF),
borderRadius: BorderRadius.circular(14.sp)),
child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'❤️我的主或贝',
style: TextStyle(color: Colors.white, fontSize: 14.sp),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: GestureDetector(
onTapDown: (detail) {
if (detail.localPosition.dy > 100.0) {
showOKToast('相关特权需要在对应功能使用哦~');
Spacer(),
Row(
if (logic.isVip.value == 0) {
showRechargeDialog(logic);
}
} else {
addUmengTag('我的-开通会员');
showRechargeDialog(logic);
}
},
child: Stack(
children: [
MyImageWidget,
Positioned(
top: 24.sp,
child: Container(
width: Get.width,
padding: EdgeInsets.only(left: 18.sp, right: 40.sp),
height: 50.sp,
child: Row(
children: [
Text(
logic.isHaveBady || logic.masterInfo.isNotEmpty ? '多互动更能增加感情哦' : '快去收您的第一位小贝吧',
style: TextStyle(color: Colors.white, fontSize: 14.sp),
),
Image.asset(
getMineImage('chevron_left'),
width: 14.sp,
getHomeImage('mine_vip_icon'),
width: 46.sp,
),
],
)
],
),
),
),
InkWell(
onTap: () {
if (Get.isRegistered<Relationship_buildingLogic>()) {
Get.delete<Relationship_buildingLogic>();
int count = 0;
routeList.forEach((element) {
if (element == Routes.RelationshipBuilding) {
count++;
}
});
if (count >= 10) {
showOKToast('您已跳转太多页面,请返回初始页面使用吧~');
return;
}
}
Get.toNamed(Routes.RelationshipBuilding,
arguments: {'userId': ''});
},
child: Container(
width: Get.width,
height: 40.sp,
child: Row(
children: [
Container(
margin: EdgeInsets.only(
top: 11.sp, left: 15.sp, right: 4.sp, bottom: 5.sp),
height: 24.sp,
padding: EdgeInsets.only(left: 5.sp, right: 5.sp),
decoration: BoxDecoration(
color: Color(0x4DFFFFFF),
borderRadius: BorderRadius.circular(6.sp)),
child: Row(
children: [
Icon(
Icons.add,
color: Colors.white,
size: 12.sp,
),
Icon(
Icons.people,
color: Colors.white,
size: 20.sp,
),
],
),
),
Expanded(
child: ListView.builder(
itemBuilder: (ctx, index) {
Map userInfo = logic.relationTypeList[index];
return Row(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(right: 6.sp, top: 5.sp),
height: 24.sp,
padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color(0xFF402366),
Color(0xFF24403E),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
borderRadius: BorderRadius.circular(6.sp),
),
child: Row(
children: [
if (userInfo['user'] == null)
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.5),
borderRadius:
BorderRadius.circular(25.sp)),
margin: EdgeInsets.only(right: 4.sp),
width: 20.sp,
height: 20.sp,
child: Icon(
Icons.add,
size: 15.sp,
color: Colors.black,
),
),
if (userInfo['user'] != null)
ClipOval(
child: CachedImg(
imageUrl: userInfo['user']
['avatar_thumb'],
width: 20.sp,
height: 20.sp,
fit: BoxFit.cover,
),
Text(
"会员-微乐园贵宾",
style: TextStyle(
color: const Color(0xFFFFFFFF),
fontSize: 16.sp),
),
SizedBox(
width: 4.sp,
height: 4.sp,
),
Text(
userInfo['relationTypeName'],
logic.vipMsg,
style: TextStyle(
fontSize: 12.sp, color: Colors.white),
color: const Color(0x99FFFFFF),
fontSize: 13.sp),
),
],
),
),
ClipRRect(
borderRadius: BorderRadius.circular(4.sp),
child: Container(
alignment: Alignment.center,
width: 70.sp,
height: 27.sp,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient
),
child: Text(
logic.vipMsg.contains('十几种')
? '领取会员'
: '续费会员',
style: TextStyle(
color: Colors.white, fontSize: 13.5.sp),
),
)
],
),
),
],
);
},
itemCount: logic.relationTypeList.length,
scrollDirection: Axis.horizontal,
),
)),
SizedBox(
width: 11.sp,
if (logic.ticketCount > 0)
Positioned(
top: 5,
right: 8.sp,
child: Container(
padding: EdgeInsets.all(2.sp),
decoration: BoxDecoration(
gradient: AppColor.tagVerLinearGradient,
borderRadius: BorderRadius.circular(4.sp),
border: GradientBoxBorder(
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Text(
'${logic.ticketCount}小票',
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.bold),
),
))
],
),
),
),
// titleTab(controller),
],
),
);
@ -1017,28 +969,159 @@ class _MinefragmentPageState extends State<MinefragmentPage>
}
Widget buildUserContainer(MinefragmentLogic controller) {
return Container(
margin: EdgeInsets.only(left: 3.sp),
height: 58.sp,
return Column(
children: [
Container(
margin: EdgeInsets.only(left: 8.sp, right: 10.sp),
height: 35.sp,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getMineImage("icon_user_content")),
fit: BoxFit.fill,
borderRadius: BorderRadius.circular(8.sp),
color: const Color(0xFF392D53),
border: GradientBoxBorder(
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Container(
margin: EdgeInsets.only(left: 24.sp, right: 5.sp),
child: Center(
margin: EdgeInsets.only(left: 10.sp, right: 5.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Center(
child: Text(
controller.userInfoBean != null
? controller.userInfoBean!.signature ?? ''
: "",
maxLines: 2,
maxLines: 1,
style: TextStyle(color: Colors.white, fontSize: 15.sp),
overflow: TextOverflow.ellipsis,
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 24.sp,
),
],
),
),
),
InkWell(
onTap: () {
if (Get.isRegistered<Relationship_buildingLogic>()) {
Get.delete<Relationship_buildingLogic>();
int count = 0;
routeList.forEach((element) {
if (element == Routes.RelationshipBuilding) {
count++;
}
});
if (count >= 10) {
showOKToast('您已跳转太多页面,请返回初始页面使用吧~');
return;
}
}
Get.toNamed(Routes.RelationshipBuilding, arguments: {'userId': ''});
},
child: Container(
width: Get.width,
height: 30.sp,
child: Row(
children: [
Container(
margin: EdgeInsets.only(top: 8.sp, left: 10.sp, right: 4.sp),
height: 24.sp,
padding: EdgeInsets.only(left: 5.sp, right: 5.sp),
decoration: BoxDecoration(
color: Color(0x4DFFFFFF),
borderRadius: BorderRadius.circular(6.sp)),
child: Row(
children: [
Icon(
Icons.add,
color: Colors.white,
size: 12.sp,
),
Icon(
Icons.people,
color: Colors.white,
size: 20.sp,
),
],
),
),
Expanded(
child: ListView.builder(
itemBuilder: (ctx, index) {
Map userInfo = controller.relationTypeList[index];
return Row(
children: [
Container(
margin: EdgeInsets.only(right: 6.sp, top: 8.sp),
height: 24.sp,
padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color(0xFF402366),
Color(0xFF24403E),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
borderRadius: BorderRadius.circular(6.sp),
),
child: Row(
children: [
if (userInfo['user'] == null)
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.5),
borderRadius:
BorderRadius.circular(25.sp)),
margin: EdgeInsets.only(right: 4.sp),
width: 20.sp,
height: 20.sp,
child: Icon(
Icons.add,
size: 15.sp,
color: Colors.black,
),
),
if (userInfo['user'] != null)
ClipOval(
child: CachedImg(
imageUrl: userInfo['user']['avatar_thumb'],
width: 20.sp,
height: 20.sp,
fit: BoxFit.cover,
),
),
SizedBox(
width: 4.sp,
),
Text(
userInfo['relationTypeName'],
style: TextStyle(
fontSize: 12.sp, color: Colors.white),
)
],
),
),
],
);
},
itemCount: controller.relationTypeList.length,
scrollDirection: Axis.horizontal,
)),
SizedBox(
width: 11.sp,
),
],
),
),
),
],
);
}
@ -1884,25 +1967,30 @@ class _MinefragmentPageState extends State<MinefragmentPage>
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showRechargeDialog(mineLogic);
// Get.toNamed(Routes.MyAssetsPage);
Get.toNamed(Routes.MyMasterOrBaby);
},
child: Container(
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp, bottom: 5.sp, top: 10.sp),
padding:
EdgeInsets.only(left: 6.sp, right: 6.sp, bottom: 5.sp, top: 10.sp),
// height: 80.sp,
decoration: BoxDecoration(
color: AppColor.cityBgColor,
borderRadius: BorderRadius.circular(13.sp)),
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(
children: [
Image.asset(
getHomeImage('mine_vip_icon'),
Container(
height: 20.sp,
alignment: Alignment.centerLeft,
child: Text(
'❤️',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
),
),
),
SizedBox(
width: 4.sp,
@ -1916,28 +2004,30 @@ class _MinefragmentPageState extends State<MinefragmentPage>
).createShader(Offset.zero & bounds.size);
},
child: Text(
'VIP会员',
'我的主或贝',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
),
),
),
Spacer(),
Container(
child: Stack(
alignment: Alignment.centerLeft,
Stack(
alignment: Alignment.centerRight,
children: [
Container(
width: 67.sp,
width: 65.sp,
height: 20.sp,
),
if (mineLogic.beiCount > 0)
Container(
margin: EdgeInsets.only(right: 20.sp),
child: Text(
'${mineLogic.beiCount}',
style: TextStyle(color: Colors.white, fontSize: 14.sp),
),
Text(
mineLogic.vipMsg.contains('十几种') ? '领取特权' : '续费特权',
style:
TextStyle(color: Colors.white, fontSize: 14.sp),
),
Positioned(
right: 0.sp,
right: 10.sp,
child: Image(
image: AssetImage(getHomeImage("icon_in")),
width: 20.sp,
@ -1946,23 +2036,23 @@ class _MinefragmentPageState extends State<MinefragmentPage>
),
],
),
)
],
),
SizedBox(
height: 10.sp,
),
Text(
mineLogic.vipMsg,
mineLogic.isHaveBady || mineLogic.masterInfo.isNotEmpty
? '多互动更能增加感情哦'
: '快去收您的第一位小贝吧',
style: TextStyle(
color: Colors.white,
fontSize: 13.sp,
),
),
],
])),
),
),
));
);
}
Widget _circleLiveView(MinefragmentLogic logic) {
@ -2486,7 +2576,6 @@ class _MinefragmentPageState extends State<MinefragmentPage>
msgLogic.getVisitorMsgsData();
}
Get.toNamed(Routes.VisitorListPage);
},
child: Stack(fit: StackFit.expand, children: [
@ -2805,7 +2894,7 @@ class _MinefragmentPageState extends State<MinefragmentPage>
Get.bottomSheet(
Scaffold(
backgroundColor: Colors.transparent,
body: Open_vip_tipPage(false, ''),
body: Open_vip_tipPage(true, ''),
),
isScrollControlled: true,
enableDrag: false)

View File

@ -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) {

View File

@ -358,7 +358,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
Routes.Complete_materialPage,
arguments: "user",
);
logic.onInit();
logic.loadMyData();
},
child: Center(
child: Container(

View File

@ -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']);
}

View File

@ -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 {

View File

@ -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/';
}

View File

@ -23,7 +23,7 @@ class SharedPreferencesHelper {
static const AGREEMENT = 'agreement';
static const String firstLogin = 'firstlogin';
static const String firstLogin = 'first';
static const msgTip = 'msgTip';