diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 99c4b40a..7c586273 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -4,7 +4,6 @@ import 'dart:convert'; // Flutter imports: import 'package:akuCommunity/model/community/board_model.dart'; -import 'package:akuCommunity/ui/home/application/all_application.dart'; import 'package:akuCommunity/widget/buttons/column_action_button.dart'; import 'package:akuCommunity/widget/views/application_view.dart'; import 'package:flutter/cupertino.dart'; @@ -12,35 +11,24 @@ import 'package:flutter/material.dart'; // Package imports: import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; // Project imports: import 'package:akuCommunity/const/resource.dart'; -import 'package:akuCommunity/extensions/num_ext.dart'; import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; import 'package:akuCommunity/model/community/activity_item_model.dart'; -import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; import 'package:akuCommunity/pages/home/widget/animate_app_bar.dart'; -import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; import 'package:akuCommunity/pages/message_center_page/message_center_page.dart'; -import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; -import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart'; -import 'package:akuCommunity/pages/total_application_page/total_applications_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; import 'package:akuCommunity/service/base_model.dart'; import 'package:akuCommunity/ui/community/activity/activity_card.dart'; import 'package:akuCommunity/ui/community/activity/activity_list_page.dart'; import 'package:akuCommunity/ui/community/community_func.dart'; import 'package:akuCommunity/ui/home/home_notification.dart'; import 'package:akuCommunity/ui/home/home_title.dart'; -import 'package:akuCommunity/ui/manager/advice/advice_page.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/container_comment.dart'; -import 'package:akuCommunity/widget/grid_buttons.dart'; import 'widget/home_search.dart'; import 'widget/home_swiper.dart'; @@ -68,18 +56,6 @@ class _HomePageState extends State ActivityItemModel _activityItemModel; List _boardItemModels = []; - List _gridList = [ - GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, OpenDoorPage().to), - GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, VisitorAccessPage().to), - GridButton('报事报修', R.ASSETS_ICONS_TOOL_BSBX_PNG, FixedSubmitPage().to), - GridButton('生活缴费', R.ASSETS_ICONS_TOOL_SHJF_PNG, LifePayPage().to), - GridButton('业委会', R.ASSETS_ICONS_TOOL_YWH_PNG, IndustryCommitteePage().to), - GridButton('建议咨询', R.ASSETS_ICONS_TOOL_JYTS_PNG, - AdvicePage(type: AdviceType.SUGGESTION).to), - GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, ConvenientPhonePage().to), - GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, AllApplicationPage().to), - ]; - @override void initState() { super.initState(); diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index 2bfb96c8..65962488 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -6,31 +6,16 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; // Package imports: -import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; // Project imports: -import 'package:akuCommunity/const/resource.dart'; import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart'; import 'package:akuCommunity/pages/activities_page/activities_page.dart'; -import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; -import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart'; -import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart'; -import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; -import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; -import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart'; -import 'package:akuCommunity/pages/questionnaire_page/questionnaire_page.dart'; -import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart'; -import 'package:akuCommunity/pages/total_application_page/total_applications_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/ui/manager/advice/advice_page.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/circle_trend.dart'; import 'package:akuCommunity/widget/container_comment.dart'; -import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:akuCommunity/widget/single_ad_space.dart'; import 'widget/property_card.dart'; @@ -47,48 +32,6 @@ class PropertyIndex extends StatefulWidget { @Deprecated("sh*t property_index need to be cleaned.") class _PropertyIndexState extends State with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin { - List _gridList = [ - GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, () { - OpenDoorPage().to(); - }), - GridButton('开门码', R.ASSETS_ICONS_TOOL_KMM_PNG, () { - OpeningCodePage().to(); - }), - GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, () { - VisitorAccessPage().to(); - }), - GridButton('报事报修', R.ASSETS_ICONS_TOOL_BSBX_PNG, () { - FixedSubmitPage().to(); - }), - GridButton('生活缴费', R.ASSETS_ICONS_TOOL_SHJF_PNG, () { - LifePayPage().to(); - }), - GridButton('业委会', R.ASSETS_ICONS_TOOL_YWH_PNG, () { - IndustryCommitteePage().to(); - }), - GridButton('建议咨询', R.ASSETS_ICONS_TOOL_JYTS_PNG, - AdvicePage(type: AdviceType.SUGGESTION).to), - GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, () { - ConvenientPhonePage().to(); - }), - GridButton('活动投票', R.ASSETS_ICONS_TOOL_HDTP_PNG, () { - Get.to(ActivitiesPage()); - }), - GridButton('物品出户', R.ASSETS_ICONS_TOOL_WPCM_PNG, () { - GoodsDetoPage().to(); - }), - GridButton('投诉表扬', R.ASSETS_ICONS_TOOL_TSBY_PNG, - AdvicePage(type: AdviceType.COMPLAIN).to), - GridButton('问卷调查', R.ASSETS_ICONS_TOOL_WJDC_PNG, () { - QuestionnairePage().to(); - }), - GridButton('装修管理', R.ASSETS_ICONS_TOOL_ZXGL_PNG, () { - FitupManagePage().to(); - }), - GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, () { - TotalApplicationsPage().to(); - }), - ]; @override bool get wantKeepAlive => true; List> _listView = [ @@ -195,12 +138,6 @@ class _PropertyIndexState extends State child: CustomScrollView( controller: _controller, slivers: [ - SliverToBoxAdapter( - child: SingleAdSpace( - imagePath: 'assets/example/guanggao5.png', - radius: 16, - ), - ), SliverToBoxAdapter( child: ContainerComment( radius: 8, diff --git a/lib/pages/total_application_page/total_applications_page.dart b/lib/pages/total_application_page/total_applications_page.dart deleted file mode 100644 index 189d4699..00000000 --- a/lib/pages/total_application_page/total_applications_page.dart +++ /dev/null @@ -1,338 +0,0 @@ -// Flutter imports: -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -// Project imports: -import 'package:akuCommunity/base/assets_image.dart'; -import 'package:akuCommunity/pages/activities_page/activities_page.dart'; -import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; -import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart'; -import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart'; -import 'package:akuCommunity/pages/goods_manage_page/goods_manage_page.dart'; -import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; -import 'package:akuCommunity/pages/market/market_detail_page/market_detail_page.dart'; -import 'package:akuCommunity/pages/one_alarm/widget/alarm_page.dart'; -import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; -import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart'; -import 'package:akuCommunity/pages/questionnaire_page/questionnaire_page.dart'; -import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/ui/manager/advice/advice_page.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'widget/applications_bar.dart'; - -class TotalApplicationsPage extends StatefulWidget { - TotalApplicationsPage({Key key}) : super(key: key); - - @override - _TotalApplicationsPageState createState() => _TotalApplicationsPageState(); -} - -class _TotalApplicationsPageState extends State { - int _currentIndex = 0; - bool isEdit = false; - List _leftNav = ['为您推荐', '智慧管家']; - - Widget _myApp() { - return Container( - margin: EdgeInsets.only( - top: 32.w, - left: 32.w, - right: 32.w, - ), - padding: EdgeInsets.only(bottom: 16.w), - decoration: BoxDecoration( - border: - Border(bottom: BorderSide(color: Color(0xffd8d8d8), width: 0.5)), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '我的应用', - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333), - ), - ), - InkWell( - onTap: () { - setState(() { - isEdit = !isEdit; - }); - }, - child: Container( - alignment: Alignment.center, - width: 90.w, - padding: EdgeInsets.symmetric(vertical: 6.w), - decoration: BoxDecoration( - color: Color(0xffffd000), - borderRadius: BorderRadius.all(Radius.circular(2)), - ), - child: Text( - isEdit ? '完成' : '编辑', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 28.sp, - color: Color(0xff333333), - ), - ), - ), - ), - ], - ), - ); - } - - Widget _myAppGrid(List> gridList, int count) { - return Container( - child: GridView.builder( - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: gridList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: isEdit - ? () { - setState(() { - switch (count) { - case 3: - if ((!AssetsImage.mineAppList.any((item) => - item['title'] == gridList[index]['title'])) && - AssetsImage.mineAppList.length < 8) { - AssetsImage.mineAppList.add(gridList[index]); - } - break; - case 4: - gridList.removeAt(index); - break; - default: - } - }); - } - : () { - switch (gridList[index]['title']) { - case '居家生活': - case '数码家电': - case '休闲副食': - case '滋补保健': - case '彩妆香水': - case '服饰箱包': - case '母婴玩具': - case '饮料酒水': - MarketDetailPage( - bundle: Bundle() - ..putString('title', gridList[index]['title']), - ).to; - break; - case '一键开门': - OpenDoorPage().to(); - break; - case '开门码': - OpeningCodePage().to(); - break; - case '访客通行': - case '我的访客': - VisitorAccessPage().to(); - break; - case '报事报修': - FixedSubmitPage().to(); - break; - case '生活缴费': - case '我的缴费': - LifePayPage().to(); - break; - case '业委会': - IndustryCommitteePage().to(); - break; - case '建议咨询': - AdvicePage(type: AdviceType.SUGGESTION).to(); - break; - case '便民电话': - ConvenientPhonePage().to(); - break; - case '活动投票': - ActivitiesPage().to(); - break; - case '社区活动': - ActivitiesPage().to(); - break; - case '物品出户': - GoodsDetoPage().to(); - break; - case '投诉表扬': - AdvicePage(type: AdviceType.COMPLAIN).to(); - break; - case '问卷调查': - QuestionnairePage().to(); - break; - case '装修管理': - FitupManagePage().to(); - break; - case '借还管理': - GoodsManagePage().to(); - break; - case '一键报警': - AlarmPage().to(); - break; - default: - break; - } - }, - child: Container( - alignment: Alignment.center, - child: Stack( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - gridList[index]['imagePath'], - height: 75.w, - width: 75.w, - fit: BoxFit.cover, - ), - SizedBox(height: 8.w), - Text( - gridList[index]['title'], - style: TextStyle( - fontSize: 24.sp, - color: Color(0xff4a4b51), - ), - ) - ], - ), - isEdit - ? Positioned( - right: 0, - top: 24.w, - child: Image.asset( - count == 3 - ? AssetsImage.APPADD - : AssetsImage.APPREDUCE, - height: 24.w, - width: 24.w, - ), - ) - : SizedBox(), - ], - ), - ), - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: count, - childAspectRatio: 1.0, - ), - ), - ); - } - - Widget _leftInkWellNav(int index) { - return InkWell( - child: Stack( - children: [ - Container( - height: 88.w, - alignment: Alignment.center, - color: _currentIndex == index ? Colors.white : Colors.transparent, - padding: EdgeInsets.symmetric(vertical: 24.w), - child: Text( - _leftNav[index], - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333), - ), - ), - ), - _currentIndex == index - ? Positioned( - top: 24.w, - left: 1, - child: SizedBox( - width: 4.w, - height: 40.w, - child: DecoratedBox( - decoration: BoxDecoration(color: Color(0xffffd000)), - ), - ), - ) - : SizedBox(), - ], - ), - onTap: () { - setState(() { - _currentIndex = index; - }); - }, - ); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: PreferredSize( - child: ApplicationsBar(), - preferredSize: Size.fromHeight(kToolbarHeight), - ), - body: ListView( - children: [ - Container( - color: Colors.white, - child: _myApp(), - ), - Container( - color: Colors.white, - child: _myAppGrid(AssetsImage.mineAppList, 4), - ), - Container( - margin: EdgeInsets.only(top: 32.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 172.w, - child: ListView.builder( - shrinkWrap: true, - itemCount: _leftNav.length, - itemBuilder: (BuildContext context, int index) { - return _leftInkWellNav(index); - }), - ), - Container( - width: 578.w, - color: Colors.white, - child: ListView( - shrinkWrap: true, - children: [ - Builder(builder: (_) { - switch (_currentIndex) { - case 0: - return _myAppGrid(AssetsImage.recommendGridList, 3); - break; - case 1: - return _myAppGrid(AssetsImage.propertyGridList, 3); - break; - case 2: - return _myAppGrid(AssetsImage.shopGridList, 3); - break; - default: - return SizedBox(); - } - }), - ], - ), - ), - ], - ), - ), - ], - ), - ); - } -} diff --git a/lib/pages/total_application_page/widget/applications_bar.dart b/lib/pages/total_application_page/widget/applications_bar.dart deleted file mode 100644 index 3ace0cdc..00000000 --- a/lib/pages/total_application_page/widget/applications_bar.dart +++ /dev/null @@ -1,66 +0,0 @@ -// Flutter imports: -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:get/get.dart'; - -// Project imports: -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/search_bar_delegate.dart'; - -class ApplicationsBar extends StatelessWidget { - const ApplicationsBar({Key key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - child: AppBar( - elevation: 0, - titleSpacing: 0, - backgroundColor: Colors.white, - leading: InkWell( - onTap: () => Get.back(), - child: Icon( - AntDesign.left, - size: 45.sp, - color: Color(0xff333333), - ), - ), - centerTitle: true, - title: InkWell( - onTap: () { - showSearch(context: context, delegate: SearchBarDelegate()); - }, - child: Container( - margin: EdgeInsets.only(right: 32.w), - padding: EdgeInsets.only( - left: 40.w, - top: 15.w, - bottom: 15.w), - decoration: BoxDecoration( - color: Color(0xfff3f3f3), - borderRadius: BorderRadius.all(Radius.circular(36)), - ), - child: Row(children: [ - Icon( - AntDesign.search1, - size: 28.sp, - color: Color(0xff999999), - ), - SizedBox(width: 5), - Text( - '搜索商品、活动、帖子、应用', - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff999999), - ), - ) - ]), - ), - ), - ), - ); - } -}