|
|
|
@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/custom_image.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:visibility_detector/visibility_detector.dart'; |
|
|
|
|
|
|
|
|
|
import '../../generated/l10n.dart'; |
|
|
|
|
import '../../retrofit/business_api.dart'; |
|
|
|
@ -35,11 +36,11 @@ class _BusinessMinePage extends State<BusinessMinePage>
|
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
BusinessApiService businessService; |
|
|
|
|
List<Records> records = []; |
|
|
|
|
double visiblePercentage; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
queryStoreList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -50,9 +51,9 @@ class _BusinessMinePage extends State<BusinessMinePage>
|
|
|
|
|
|
|
|
|
|
///门店设置列表 |
|
|
|
|
queryStoreList() async { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
// EasyLoading.show( |
|
|
|
|
// status: S.current.zhengzaijiazai, |
|
|
|
|
// maskType: EasyLoadingMaskType.black); |
|
|
|
|
if (businessService == null) { |
|
|
|
|
businessService = BusinessApiService(Dio(), |
|
|
|
|
context: context, |
|
|
|
@ -71,7 +72,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
|
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
records = baseData.data.records ?? []; |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
// EasyLoading.dismiss(); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
@ -80,7 +81,14 @@ class _BusinessMinePage extends State<BusinessMinePage>
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
super.build(context); |
|
|
|
|
return Column( |
|
|
|
|
return VisibilityDetector( |
|
|
|
|
key: Key('my-widget-key'), |
|
|
|
|
onVisibilityChanged: (visibilityInfo) { |
|
|
|
|
visiblePercentage = visibilityInfo.visibleFraction; |
|
|
|
|
if(visiblePercentage == 1) |
|
|
|
|
queryStoreList(); |
|
|
|
|
}, |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
@ -132,7 +140,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
|
|
|
|
|
height: 76.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget mineInfo() { |
|
|
|
|