2.3.8代码提交

This commit is contained in:
CYH 2025-01-09 16:10:28 +08:00
parent 849a459e80
commit 20ff09c9d5
14 changed files with 178 additions and 75 deletions

View File

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.3.3</string>
<string>2.3.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View File

@ -38,8 +38,8 @@ class CircleLogic extends GetxController {
SwiperController swiperController = SwiperController();
final RefreshController refreshController = RefreshController();
final RefreshController peopleRefreshController = RefreshController();
final ScrollController nearScrollController = ScrollController();
ScrollController newscrollController = ScrollController();
HomeLogic homeLogic = Get.find<HomeLogic>();
late RefreshManager newPeopleManager;
@ -561,9 +561,9 @@ class CircleLogic extends GetxController {
loadNearbyInfo();
}
if (vicinityPage == 1) {
// if (vicinityPage == 1) {
refreshController.refreshCompleted();
}
// }
try {
if (vicinityPage == 1) {
@ -586,8 +586,8 @@ class CircleLogic extends GetxController {
refreshController.loadComplete();
} else {
isLoadNearByList = false;
// refreshController.loadComplete();
getNearByList();
refreshController.loadComplete();
// getNearByList();
return;
}
}
@ -607,10 +607,17 @@ class CircleLogic extends GetxController {
}
} else if (bean.code == 21201) {
showOKToast(bean.msg);
if (vicinityPage == 1) {
// if (vicinityPage == 1) {
showVipDialog('nearby_list');
}
myVip = 0;
roleList.forEach((element) {
element.isSelect = false;
});
orientationList.forEach((element) {
element.isSelect = false;
});
refreshController.refreshCompleted();
// }
refreshController.loadComplete();
update();
} else if (bean.code == 404 || bean.code == 500) {
@ -694,6 +701,7 @@ class CircleLogic extends GetxController {
if (pageIndex == 1) {
chargeNewPeopleType = data['data']['chargeType'];
chargeNewPeopleFreeNum = data['data']['chargeFreeNum'];
newPeopleList.clear();
}
List list = data['data']['users'];
@ -719,6 +727,24 @@ class CircleLogic extends GetxController {
isNewPeopleMore = false;
}
update();
} else if (data['code'] == 21201) {
showOKToast(data['msg']);
// if (pageIndex == 1) {
new_roleList.forEach((element) {
element.isSelect = false;
});
new_orientationList.forEach((element) {
element.isSelect = false;
});
showVipDialog('new_list');
// }
if (peopleRefreshController.headerStatus == RefreshStatus.refreshing) {
peopleRefreshController.refreshCompleted();
}
if (peopleRefreshController.footerStatus == LoadStatus.loading) {
peopleRefreshController.loadComplete();
}
update();
} else if (data['code'] == 404 || data['code'] == 500) {
isLoadFail = true;
if (peopleRefreshController.headerStatus == RefreshStatus.refreshing) {
@ -732,6 +758,7 @@ class CircleLogic extends GetxController {
} else {
isNewPeopleMore = false;
}
return data['code'];
}
void loadRecommendCircleFriendData() async {
@ -818,13 +845,17 @@ class CircleLogic extends GetxController {
void onRefresh() async {
int lastPage = pageIndex;
pageIndex = 1;
newPeopleList.clear();
// newPeopleList.clear();
newscrollController.jumpTo(0);
isNewPeopleMore = true;
peopleRefreshController.resetNoData();
// peopleRefreshController.resetNoData();
update();
getNewPeopleListData();
int code = await getNewPeopleListData();
if (code != 200) {
pageIndex = lastPage;
}
}
void onLoading() async {

View File

@ -117,7 +117,7 @@ class _CirclePageState extends State<CirclePage>
margin: EdgeInsets.only(top: 45.sp),
child: TabBarView(
controller: _tabController,
children: [NewPeople(), Vicinity(controller), Discover(0)],
children: [NewPeople(logic:controller), Vicinity(controller), Discover(0)],
),
),
if (logic.callList.isNotEmpty && _tabController.index == 1)
@ -213,6 +213,7 @@ class _CirclePageState extends State<CirclePage>
onLoading: _onLoading,
enablePullUp: logic.myVip > 0,
child: ListView.builder(
controller: logic.nearScrollController,
padding: EdgeInsets.all(10.sp),
itemCount: logic.myVip == 0
? logic.vicinityList.length + 2
@ -540,8 +541,7 @@ class _CirclePageState extends State<CirclePage>
void _onRefresh() async {
logic.vicinityPage = 1;
logic.offset = 0;
logic.vicinityList.clear();
logic.update();
logic.nearScrollController.jumpTo(0);
logic.loadNearbyInfo();
logic.getNearByList();
@ -1016,7 +1016,7 @@ class _CirclePageState extends State<CirclePage>
callback: (genderList, orientationList, roleList, status) {
if (_tabController.index == 1) {
EventBusManager.fire(NearScrollTap());
_onRefresh();
logic.refreshController.requestRefresh();
} else if (_tabController.index == 0) {
List<String> genders = [];
logic.new_genderList.forEach((element) {
@ -1033,7 +1033,7 @@ class _CirclePageState extends State<CirclePage>
logic.new_roleList.forEach((element) {
if (element.isSelect) orientations.add(element.id);
});
logic.onRefresh();
logic.peopleRefreshController.requestRefresh();
} else {
List<String> genders = [];
logic.dis_genderList.forEach((element) {

View File

@ -385,13 +385,16 @@ class _DiscoverState extends State<Discover>
if (mounted) {
setState(() {});
if (isLoadMore) {
isLoadMore = false;
lastPage = lastPage + 1;
animateToOffset(
_scrollController, lastPage * (screenHeight + 5.sp), () {});
Future.delayed(Duration(milliseconds: 250),() {
isLoadMore = false;
lastPage = lastPage + 1;
animateToOffset(
_scrollController, lastPage * (screenHeight + 5.sp), () {});
});
}
}
} else {
isLoadMore = false;
loadFail = true;
isMore = false;
showOKToast(data['msg']);
@ -408,12 +411,15 @@ class _DiscoverState extends State<Discover>
}
void refreshData() {
if (refreshController.headerStatus == RefreshStatus.refreshing) return;
index = 1;
loadFail = false;
loadData();
}
_onLoading() {
if (isLoadMore) return;
// if (refreshController.footerStatus == LoadStatus.loading) return;
isLoadMore = true;
loadData();
}

View File

@ -17,6 +17,9 @@ import '../../userinfo/view.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class NewPeople extends StatefulWidget {
CircleLogic logic;
NewPeople({super.key,required this.logic});
@override
_NewPeopleState createState() => new _NewPeopleState();
}
@ -24,9 +27,9 @@ class NewPeople extends StatefulWidget {
class _NewPeopleState extends State<NewPeople> {
// TODO: add state variables and methods
CircleLogic logic = Get.find<CircleLogic>();
late CircleLogic logic;
var sub;
ScrollController _scrollController = ScrollController();
double maxOff = 0;
@override
@ -35,6 +38,7 @@ class _NewPeopleState extends State<NewPeople> {
void initState() {
// TODO: implement initState
super.initState();
logic = widget.logic;
logic.newPeopleManager = RefreshManager(
refreshInterval: 5 * 60,
pageType: '新人',
@ -49,7 +53,7 @@ class _NewPeopleState extends State<NewPeople> {
logic.loadNerPeopleRouteStatus();
}
sub = EventBusManager.on<ScrollToTop>().listen((event) {
_scrollController.animateTo(0,
logic.newscrollController.animateTo(0,
duration: const Duration(milliseconds: 300), curve: Curves.easeInOut);
});
}
@ -58,7 +62,7 @@ class _NewPeopleState extends State<NewPeople> {
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
logic.newscrollController.dispose();
sub.cancel();
}
@ -77,7 +81,7 @@ class _NewPeopleState extends State<NewPeople> {
onLoading: logic.onLoading,
enablePullUp: true,
child: ListView.builder(
controller: _scrollController,
controller: logic.newscrollController,
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
itemCount: logic.newPeopleList.length,
itemBuilder: (context, index) {

View File

@ -728,6 +728,7 @@ class _VicinityState extends State<Vicinity>
return Text(
text,
maxLines: 1,
style: TextStyle(
color: Colors.white,
fontSize: 13.sp),
@ -869,6 +870,7 @@ class _VicinityState extends State<Vicinity>
return Text(
text,
maxLines: 1,
style: TextStyle(
color: Colors.white,
fontSize: 13.sp),

View File

@ -24,9 +24,9 @@ typedef void ScreenCallback(List<int> genderList,List<int> orientationList,List<
class ScreenBottomSheetDialog extends StatefulWidget {
final List<MyConfigData> genderList ;
final List<MyConfigData> orientationList ;
List<MyConfigData> orientationList ;
final List<MyConfigData> roleList ;
List<MyConfigData> roleList ;
final ScreenCallback callback;
bool? isShowAutoSwitch;
final bool isHaveCity;
@ -55,6 +55,8 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
List<MyConfigData> roleList = [] ;
bool isShowAutoSwitch = false;
@override
void initState() {
// TODO: implement initState
@ -65,6 +67,7 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
var logic = Get.find<CircleLogic>();
locationCity = logic.cityName;
}
isShowAutoSwitch = widget.isShowAutoSwitch ?? false;
initGerder();
}
StreamSubscription? subscription = null;
@ -149,15 +152,15 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
}
List<String> roles = [];
widget.orientationList.forEach((element) {
orientationList.forEach((element) {
if (element.isSelect) roles.add(element.id);
});
List<String> orientations = [];
widget.roleList.forEach((element) {
roleList.forEach((element) {
if (element.isSelect) orientations.add(element.id);
});
if (widget.isHaveCity) {
var result = await DioManager.instance.postBody(url: Api.nearbyCanSearch,params: {'orientations':roles,'roles':orientations});
int code = result['code'];
@ -166,14 +169,25 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
// LIMIT_YEAR_VIP(21202, "功能限制开启年VIP后再进行使用"),
showOKToast(result['msg']);
if (code == 21201) {
widget.roleList.forEach((element) {
element.isSelect = false;
});
widget.orientationList.forEach((element) {
element.isSelect = false;
});
showRechargeDialog('nearby_search');
} else if (code == 21202) {
showRechargeDialog(isYear: true,'nearby_search');
widget.roleList == roleList;
widget.orientationList = orientationList;
}
return;
} else if (code == 200) {
widget.roleList == roleList;
widget.orientationList = orientationList;
}
} else {
var result = await DioManager.instance.postBody(url: Api.nfindPageCanSearch,params: {'orientations':roles,'roles':orientations});
var result = await DioManager.instance.postBody(url: Api.findPageCanSearch,params: {'orientations':roles,'roles':orientations});
int code = result['code'];
if (code != 200) {
// LIMIT_VIP(21201, "功能限制开启VIP后再进行使用"),
@ -331,10 +345,10 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
height: 23.sp,
margin: EdgeInsets.only(left: 18.sp,top: 6.sp),
child: ListView.builder(
itemCount: widget.roleList.length,
itemCount: roleList.length,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
final isSelected = widget.roleList[index]
final isSelected = roleList[index]
.isSelect; // Replace with your condition
return GestureDetector(
@ -345,32 +359,32 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
// return;
// }
if (index == 0) {
if (widget.roleList[0].isSelect) {
widget.roleList.forEach((element) {
if (roleList[0].isSelect) {
roleList.forEach((element) {
print(element.name);
element.isSelect = false;
});
} else {
widget.roleList.forEach((element) {
roleList.forEach((element) {
element.isSelect = true;
});
}
} else {
if (widget.roleList[index].isSelect) {
widget.roleList[index].isSelect = false;
widget.roleList[0].isSelect = false;
if (roleList[index].isSelect) {
roleList[index].isSelect = false;
roleList[0].isSelect = false;
} else {
widget.roleList[index].isSelect = true;
roleList[index].isSelect = true;
bool istrue = true;
widget.roleList.asMap().forEach((index,element) {
roleList.asMap().forEach((index,element) {
if(index!=0&&!element.isSelect) {
// print(element.isSelect);
istrue = false;
}
});
widget.roleList[0].isSelect = istrue;
roleList[0].isSelect = istrue;
}
}
@ -410,7 +424,7 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
),
child: Center(
child: Text(
widget.roleList[index].name,
roleList[index].name,
style: TextStyle(
fontSize: 13.0,
color: Colors.white,
@ -456,10 +470,10 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
height: 23.sp,
margin: EdgeInsets.only(left: 18.sp,top: 6.sp),
child: ListView.builder(
itemCount: widget.orientationList.length,
itemCount: orientationList.length,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
final isSelected = widget.orientationList[index]
final isSelected = orientationList[index]
.isSelect; // Replace with your condition
return GestureDetector(
@ -471,32 +485,32 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
// }
if (index == 0) {
if (widget.orientationList[0].isSelect) {
widget.orientationList.forEach((element) {
if (orientationList[0].isSelect) {
orientationList.forEach((element) {
print(element.name);
element.isSelect = false;
});
} else {
widget.orientationList.forEach((element) {
orientationList.forEach((element) {
element.isSelect = true;
});
}
} else {
if (widget.orientationList[index].isSelect) {
widget.orientationList[index].isSelect = false;
widget.orientationList[0].isSelect = false;
if (orientationList[index].isSelect) {
orientationList[index].isSelect = false;
orientationList[0].isSelect = false;
} else {
widget.orientationList[index].isSelect = true;
orientationList[index].isSelect = true;
bool istrue = true;
widget.orientationList.asMap().forEach((index,element) {
orientationList.asMap().forEach((index,element) {
if(index!=0&&!element.isSelect) {
// print(element.isSelect);
istrue = false;
}
});
widget.orientationList[0].isSelect = istrue;
orientationList[0].isSelect = istrue;
}
}
@ -536,7 +550,7 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
),
child: Center(
child: Text(
widget.orientationList[index].name,
orientationList[index].name,
style: TextStyle(
fontSize: 13.0,
color: Colors.white,

View File

@ -21,6 +21,8 @@ class QuickLogic extends GetxController {
final RefreshController refreshController = RefreshController();
List<MyConfigData> genderList = [MyConfigData('0', '全部', true)];
List<MyConfigData> locationGenderList = [MyConfigData('0', '全部', true)];
List lists = [];
List lists1 = [];
int page = 1;
@ -30,6 +32,8 @@ class QuickLogic extends GetxController {
bool isLoad = true;
bool isLoad1 = true;
bool isLoadFail = false;
bool isMore = true;
bool isMore1 = true;
@ -94,19 +98,31 @@ class QuickLogic extends GetxController {
configBean.genderMap.forEach((key, value) {
if (int.parse(key) < 3) {
genderList.add(MyConfigData(key, value, true));
locationGenderList.add(MyConfigData(key, value, true));
}
});
genderList.add(MyConfigData('-1', '非二元', true));
locationGenderList.add(MyConfigData('-1', '非二元', true));
}
}
initList(int type) async {
List wantMeet = [];
genderList.forEach((element) {
if (element.isSelect && element.id != '0') {
wantMeet.add(element.id);
}
});
if (type == 1) {
genderList.forEach((element) {
if (element.isSelect && element.id != '0') {
wantMeet.add(element.id);
}
});
} else {
locationGenderList.forEach((element) {
if (element.isSelect && element.id != '0') {
wantMeet.add(element.id);
}
});
}
var data =
await DioManager.instance.post(url: Api.queryQuickChatUserV2, params: {
'page': type == 1 ? page : page1,
@ -117,13 +133,14 @@ class QuickLogic extends GetxController {
"lng": position?.longitude ?? 0,
});
if (data['code'] == 200) {
refreshController.refreshCompleted();
if (type == 1) {
List list = data['data']['lists'];
if (list.isNotEmpty) {
isLoad = false;
if (page == 1) {
refreshController.refreshCompleted();
refreshController.loadComplete();
lists = list;
} else {
@ -189,6 +206,10 @@ class QuickLogic extends GetxController {
}
} else if (data['code'] == 21201) {
showOepnVipDialog('');
} else if (data['code'] == 404 || data['code'] == 500) {
if (lists.isEmpty) {
isLoadFail = true;
}
}
update();
}
@ -197,7 +218,7 @@ class QuickLogic extends GetxController {
if (type == 1) {
page = 1;
} else {
page = 2;
page1 = 1;
}
initList(type);
@ -209,7 +230,7 @@ class QuickLogic extends GetxController {
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return ScreenBottomSheetDialog(
genderList: genderList,
genderList: currentIndex == 0 ? genderList : locationGenderList,
orientationList: [],
roleList: [],
isHaveCity: false,

View File

@ -130,7 +130,12 @@ class _QuickPageState extends State<QuickPage>
),
),
body: SafeArea(
child: logic.isLoad
child: logic.isLoadFail
? noResultWidget(tip: '加载失败,请重新加载',callBack: () {
logic.isLoad = true;
logic.update();
logic.initList(1);
}) : logic.isLoad
? loaddingWidget(true)
: logic.lists.isEmpty
? noResultWidget()

View File

@ -38,7 +38,7 @@ class SplashLogic extends GetxController {
void onClose() {
// TODO: implement onClose
super.onClose();
DioManager.getInstance().setDioTimeOut(10000);
DioManager.getInstance().setDioTimeOut(15000);
}

View File

@ -539,7 +539,7 @@ class Api {
static var nearbyCanSearch = '/user-service/nearby/search/need/vip';
//
static var nfindPageCanSearch = '/user-service/findPage/search/need/vip';
static var findPageCanSearch = '/user-service/findPage/search/need/vip';
//
static var interestApplyToCreate = '/up-service/interest/applyToCreate';

View File

@ -4,6 +4,7 @@ import 'dart:math';
import 'package:circle_app/router/routers.dart';
import 'package:circle_app/utils/util.dart';
import 'package:dio/dio.dart';
import 'package:flutter_bugly/flutter_bugly.dart';
import '../utils/SharedPreferencesHelper.dart';
import '../utils/device.dart';
@ -43,9 +44,9 @@ class DioManager {
// Api.testBaseUrl,
Api.baseUrl1,
//
connectTimeout: const Duration(seconds: 10),
connectTimeout: const Duration(seconds: 15),
//
receiveTimeout: const Duration(seconds: 10),
receiveTimeout: const Duration(seconds: 15),
));
_dio!.interceptors.add(LogInterceptor(
responseBody: true,
@ -308,12 +309,23 @@ class DioManager {
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''};
}
//
var info = await FlutterBugly.uploadException(
message: url + e.error.toString(),
detail: Platform.isIOS ? 'crash_attach.log' : 'extraMessage.txt',
);
print(info);
return {'code': 500, 'msg': '服务器开小差了,请重试'};
} catch (e) {
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''};
}
//
var info = await FlutterBugly.uploadException(
message: url + e.toString(),
detail: Platform.isIOS ? 'crash_attach.log' : 'extraMessage.txt',
);
//
return {'code': 500, 'msg': '加载中...'};
}

View File

@ -45,10 +45,10 @@ packages:
dependency: "direct main"
description:
name: app_settings
sha256: "2ec421f375d747916c4c0193933567074ea60c4f01c4a68642f07fef1002524e"
sha256: e6a34735d4ddb24ca9c5fd7e965ec65c8b611cbd3a329152c294f9e9f4bacb33
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.4"
version: "4.3.1"
archive:
dependency: transitive
description:
@ -630,6 +630,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
flutter_install_app:
dependency: "direct main"
description:
name: flutter_install_app
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
flutter_intl:
dependency: "direct main"
description:

View File

@ -92,7 +92,7 @@ dependencies:
fluwx: ^3.8.1+1
event_bus: ^2.0.0
#安装apk
# flutter_install_app: 1.3.0
flutter_install_app: 1.3.0
#闪屏页
flutter_native_splash: 2.2.16
#腾讯离线推送
@ -114,7 +114,7 @@ dependencies:
#边框渐变
gradient_borders: ^1.0.0
#系统设置 安卓4.3.1 苹果4.0.4
app_settings: 4.0.4
app_settings: 4.3.1
#通知权限
notification_permissions: ^0.6.1
#分帧