From 67a4ad30a851188baf1582f5617cf7c80eb93db8 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 23 Oct 2023 16:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E5=BA=97=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=88=B7=E6=96=B0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mine/business_mine_page.dart | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index 66ac89e6..1d6e0e8b 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -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 final RefreshController refreshController = RefreshController(); BusinessApiService businessService; List records = []; + double visiblePercentage; @override void initState() { super.initState(); - queryStoreList(); } @override @@ -50,9 +51,9 @@ class _BusinessMinePage extends State ///门店设置列表 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 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 @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 height: 76.h, ), ], - ); + )); } Widget mineInfo() {