diff --git a/lib/base/assets_image.dart b/lib/base/assets_image.dart index 57688cda..63d9f842 100644 --- a/lib/base/assets_image.dart +++ b/lib/base/assets_image.dart @@ -1,3 +1,5 @@ +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t assets_image need to be cleaned.") class AssetsImage { static const TAB_HOME_UNSELECT = 'assets/icons/tabbar_home_no.png'; diff --git a/lib/pages/activities_page/activities_page.dart b/lib/pages/activities_page/activities_page.dart index 99d83a96..c71bff98 100644 --- a/lib/pages/activities_page/activities_page.dart +++ b/lib/pages/activities_page/activities_page.dart @@ -7,87 +7,26 @@ import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/activity_card.dart'; class ActivitiesPage extends StatefulWidget { - final Bundle bundle; - ActivitiesPage({Key key, this.bundle}) : super(key: key); + ActivitiesPage({Key key}) : super(key: key); @override _ActivitiesPageState createState() => _ActivitiesPageState(); } class _ActivitiesPageState extends State { - List images = [ - "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1151143562,4115642159&fm=26&gp=0.jpg", - "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2551412680,857245643&fm=26&gp=0.jpg", - "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3604827221,1047385274&fm=26&gp=0.jpg", - ]; + List images = []; List> _listView = []; - List> _listVote = [ - { - 'imagePath': - 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600058454436&di=76f6d526c4108b582c540d24bad316d8&imgtype=0&src=http%3A%2F%2Fimg003.hc360.cn%2Fm2%2FM00%2FFD%2FB9%2FwKhQclRLWoqEAosNAAAAABnzxUo896.jpg', - 'title': '为优秀点赞!2020第一届最美服务之星评选', - 'subtitleFirst': '快来为你支持的保洁员投票吧!~', - 'subtitleSecond': '06月17日 12:00至06月27日18:30', - 'isOver': false, - 'isVoteOver': true, - }, - { - 'imagePath': - 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600058583164&di=04000bc0e0394edb0c74f7c8fa0efcb2&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Ftranslate%2F161%2Fw1080h681%2F20180814%2FzWKK-hhtfwqr0303774.jpg', - 'title': '投票!选出你心中“乘风破浪的绿化保卫员”', - 'subtitleFirst': '建设美丽的边疆,爱护我们的家园', - 'subtitleSecond': '04月17日 13:00至04月23日18:30', - 'isOver': false, - 'isVoteOver': true, - }, - { - 'imagePath': - 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600058626924&di=568c1c35b47e6c8bb762f71a883c9e09&imgtype=0&src=http%3A%2F%2Fimg.soufunimg.com%2Fnews%2F2015_11%2F26%2F1448505277039.jpg', - 'title': '特别忠诚,在生死抉择的时刻,他把人民利益举过他把人民利益举过……', - 'subtitleFirst': '平凡服务者,最美保安员', - 'subtitleSecond': '04月12日 12:00至04月15日18:30', - 'isOver': true, - 'isVoteOver': false, - } - ]; + List> _listVote = []; - List> _listEnter = [ - { - 'imagePath': - 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3786472598,2225627644&fm=26&gp=0.jpg', - 'title': '宁化社区第一届煎蛋比赛报名开始', - 'subtitleFirst': '活动室二楼', - 'subtitleSecond': '06月17日 12:00至06月27日18:30', - 'isOver': false, - 'isVoteOver': true, - }, - { - 'imagePath': - 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600339523640&di=be179b5e314f9e198c000e7726affef6&imgtype=0&src=http%3A%2F%2Fa.hiphotos.baidu.com%2Fbaike%2Fpic%2Fitem%2F7e3e6709c93d70cf7371f1f3f1dcd100bba12b40.jpg', - 'title': '美嘉社区第三届六一亲子活动开始啦', - 'subtitleFirst': '中央活动区', - 'subtitleSecond': '04月17日 13:00至04月23日18:30', - 'isOver': false, - 'isVoteOver': true, - }, - { - 'imagePath': - 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=347834970,829932821&fm=26&gp=0.jpg', - 'title': '生命在与运动,华侨小区拔河比赛开始', - 'subtitleFirst': '小区外围体育馆', - 'subtitleSecond': '04月12日 12:00至04月15日18:30', - 'isOver': true, - 'isVoteOver': false, - } - ]; + List> _listEnter = []; RefreshController _refreshController = RefreshController(initialRefresh: false); @override void initState() { super.initState(); - _listView = widget.bundle.getBool('isVote') ? _listVote : _listEnter; + _listView = _listVote; } void _onRefresh() async { @@ -105,17 +44,7 @@ class _ActivitiesPageState extends State { void detailsRouter(String imagePath, title, bool isOver, isVote, isVoteOver, List memberList) { - Get.to(ActivitiesPage( - bundle: Bundle() - ..putMap('details', { - 'title': title, - 'imagePath': imagePath, - 'isOver': isOver, - 'isVote': isVote, - 'isVoteOver': isVoteOver, - 'memberList': memberList - }), - )); + Get.to(ActivitiesPage()); } @override @@ -148,7 +77,7 @@ class _ActivitiesPageState extends State { subtitleSecond: _listView[index]['subtitleSecond'], memberList: images, isOver: _listView[index]['isOver'], - isVote: widget.bundle.getBool('isVote'), + isVote: false, isVoteOver: _listView[index]['isVoteOver'], fun: detailsRouter, ), diff --git a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart index 40c37dc7..7da44c25 100644 --- a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart +++ b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; -import 'package:akuCommunity/widget/common_image_picker.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; import 'widget/common_radio.dart'; import 'widget/common_picker.dart'; @@ -188,7 +187,7 @@ class _DetoCreatePageState extends State { ), ), ), - GridImagePicker(), + GridImagePicker(onChange: (files) {}), ], ), ), diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 1e4b0886..568849a9 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -7,7 +7,6 @@ import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; import 'widget/goods_info_card.dart'; diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index b69ab2b2..6e426746 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -14,6 +14,7 @@ import 'package:akuCommunity/pages/things_page/things_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/extensions/num_ext.dart'; +import 'package:akuCommunity/ui/manager/advice/advice_page.dart'; import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; @@ -58,39 +59,16 @@ class _HomePageState extends State int page = 1; 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, () { - Get.to(ThingsPage( - bundle: Bundle() - ..putMap('things', { - 'title': '建议咨询', - 'treeList': >[ - {'name': '您的建议'}, - {'name': '您的咨询'}, - ] - }), - )); - }), - GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, () { - ConvenientPhonePage().to(); - }), - GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, () { - TotalApplicationsPage().to(); - }), + 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, TotalApplicationsPage().to), ]; @override @@ -157,12 +135,12 @@ class _HomePageState extends State _buildColButton( icon: AntDesign.scan1, title: '扫一扫', - onTap: () => Get.to(ScanPage()), + onTap: ScanPage().to, ), _buildColButton( icon: AntDesign.bells, title: '消息', - onTap: () => Get.to(MessageCenterPage()), + onTap: MessageCenterPage().to, ), 16.wb, ], @@ -207,9 +185,7 @@ class _HomePageState extends State tag: '活动', isShowImage: false, fun: () { - ActivitiesPage( - bundle: Bundle()..putBool('isVote', false), - ).to; + ActivitiesPage().to; }, ), HomeCard( diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 064bdc9b..4a3725df 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -52,9 +52,7 @@ class _PersonalIndexState extends State )); }), GridButton('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, () { - Get.to(ActivitiesPage( - bundle: Bundle()..putBool('isVote', false), - )); + Get.to(ActivitiesPage()); }), GridButton('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, () { LifePayPage().to(); diff --git a/lib/pages/personal/user_profile_page.dart b/lib/pages/personal/user_profile_page.dart index 1e2d79fa..25a16dc8 100644 --- a/lib/pages/personal/user_profile_page.dart +++ b/lib/pages/personal/user_profile_page.dart @@ -10,6 +10,7 @@ import 'package:akuCommunity/utils/network/base_file_model.dart'; import 'package:akuCommunity/utils/network/net_util.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/utils/headers.dart'; +import 'package:akuCommunity/widget/picker/bee_image_picker.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; @@ -62,35 +63,14 @@ class _UserProfilePageState extends State { _pickAvatar() async { final userProvider = Provider.of(context, listen: false); - PickedFile file = await Get.bottomSheet(CupertinoActionSheet( - title: '选择头像'.text.isIntrinsic.make(), - actions: [ - CupertinoDialogAction( - onPressed: () async => Get.back( - result: await ImagePicker().getImage(source: ImageSource.gallery), - ), - child: '相册'.text.isIntrinsic.make(), - ), - CupertinoDialogAction( - onPressed: () async => Get.back( - result: await ImagePicker().getImage(source: ImageSource.camera), - ), - child: '相机'.text.isIntrinsic.make(), - ), - ], - cancelButton: CupertinoDialogAction( - onPressed: Get.back, - child: '取消'.text.isIntrinsic.make(), - ), - )); + File file = await BeeImagePicker.pick(title: '选择头像'); if (file == null) return; else { //Upload Avatar Function cancel = BotToast.showLoading(); - File rawFile = File(file.path); BaseFileModel model = - await NetUtil().upload(API.upload.uploadAvatar, rawFile); + await NetUtil().upload(API.upload.uploadAvatar, file); if (model.status) userProvider.updateAvatar(model.url); else diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index 91fdebe1..39f03f3c 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -73,9 +73,7 @@ class _PropertyIndexState extends State ConvenientPhonePage().to(); }), GridButton('活动投票', R.ASSETS_ICONS_TOOL_HDTP_PNG, () { - Get.to(ActivitiesPage( - bundle: Bundle()..putBool('isVote', true), - )); + Get.to(ActivitiesPage()); }), GridButton('物品出户', R.ASSETS_ICONS_TOOL_WPCM_PNG, () { GoodsDetoPage().to(); @@ -165,9 +163,7 @@ class _PropertyIndexState extends State } void activityRouter() { - ActivitiesPage( - bundle: Bundle()..putBool('isVote', false), - ).to; + ActivitiesPage().to; } void activityDetailsRouter(String imagePath, title, bool isOver, isVote, diff --git a/lib/pages/setting_page/account_manager_page.dart b/lib/pages/setting_page/account_manager_page.dart index b631262d..3c642ea8 100644 --- a/lib/pages/setting_page/account_manager_page.dart +++ b/lib/pages/setting_page/account_manager_page.dart @@ -48,7 +48,7 @@ class _AccountManagerPageState extends State { }, ); }, - ), + ).material(color: Colors.white), ], ), ); diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 80de4030..cc75a31e 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -105,13 +105,13 @@ class _SettingsPageState extends State { padding: EdgeInsets.zero, children: [ ...[ - _buildTile( - title: '是否接受信息通知', - suffix: CupertinoSwitch( - value: false, - onChanged: (state) {}, - ), - ), + // _buildTile( + // title: '是否接受信息通知', + // suffix: CupertinoSwitch( + // value: false, + // onChanged: (state) {}, + // ), + // ), _buildTile( title: '关于小蜜蜂智慧社区', onTap: () => AboutPage().to(), diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 22431361..1619967a 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/const/resource.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -62,16 +63,16 @@ class _TabNavigatorState extends State { Widget build(BuildContext context) { //底部导航来 List _bottomNav = [ - _buildBottomBar( - '首页', AssetsImage.TAB_HOME_UNSELECT, AssetsImage.TAB_HOME_SELECT), + _buildBottomBar('首页', R.ASSETS_ICONS_TABBAR_HOME_NO_PNG, + R.ASSETS_ICONS_TABBAR_HOME_PNG), // _buildBottomBar( // '商城', AssetsImage.TAB_MARKET_UNSELECT, AssetsImage.TAB_MARKET_SELECT), - _buildBottomBar( - '物业', AssetsImage.TAB_HOUSE_UNSELECT, AssetsImage.TAB_HOUSE_SELECT), - _buildBottomBar('社区', AssetsImage.TAB_MESSAGE_UNSELECT, - AssetsImage.TAB_MESSAGE_SELECT), - _buildBottomBar( - '我的', AssetsImage.TAB_USER_UNSELECT, AssetsImage.TAB_USER_SELECT), + _buildBottomBar('物业', R.ASSETS_ICONS_TABBAR_HOUSE_NO_PNG, + R.ASSETS_ICONS_TABBAR_HOUSE_PNG), + _buildBottomBar('社区', R.ASSETS_ICONS_TABBAR_MESSAGE_NO_PNG, + R.ASSETS_ICONS_TABBAR_MESSAGE_PNG), + _buildBottomBar('我的', R.ASSETS_ICONS_TABBAR_USER_NO_PNG, + R.ASSETS_ICONS_TABBAR_USER_PNG), ]; return Scaffold( body: WillPopScope( diff --git a/lib/pages/things_page/things_page.dart b/lib/pages/things_page/things_page.dart index 77536c1c..5789d39f 100644 --- a/lib/pages/things_page/things_page.dart +++ b/lib/pages/things_page/things_page.dart @@ -7,6 +7,8 @@ import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/things_app_bar.dart'; import 'widget/things_list.dart'; +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t page need to be cleaned.") class ThingsPage extends StatefulWidget { final Bundle bundle; ThingsPage({Key key, this.bundle}) : super(key: key); diff --git a/lib/pages/things_page/widget/things_app_bar.dart b/lib/pages/things_page/widget/things_app_bar.dart index 855267a5..11c945dc 100644 --- a/lib/pages/things_page/widget/things_app_bar.dart +++ b/lib/pages/things_page/widget/things_app_bar.dart @@ -4,6 +4,8 @@ import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:get/get.dart'; +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t app bar need to be cleaned.") class ThingsAppBar extends StatelessWidget { final String title, subtitle; final List> treeList; diff --git a/lib/pages/total_application_page/total_applications_page.dart b/lib/pages/total_application_page/total_applications_page.dart index 4dbe7e93..95d0cb20 100644 --- a/lib/pages/total_application_page/total_applications_page.dart +++ b/lib/pages/total_application_page/total_applications_page.dart @@ -165,14 +165,10 @@ class _TotalApplicationsPageState extends State { ConvenientPhonePage().to(); break; case '活动投票': - ActivitiesPage( - bundle: Bundle()..putBool('isVote', true), - ).to; + ActivitiesPage().to; break; case '社区活动': - ActivitiesPage( - bundle: Bundle()..putBool('isVote', false), - ).to; + ActivitiesPage().to; break; case '物品出户': GoodsDetoPage().to(); diff --git a/lib/routers/page_routers.dart b/lib/routers/page_routers.dart index 09a9f87d..0aed9284 100644 --- a/lib/routers/page_routers.dart +++ b/lib/routers/page_routers.dart @@ -1,5 +1,5 @@ - - +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t page_routers need to be cleaned.") class Bundle { Map _map = {}; @@ -12,7 +12,6 @@ class Bundle { return _map[k]; } - putString(String k, String v) => _setValue(k, v); putBool(String k, bool v) => _setValue(k, v); @@ -34,4 +33,3 @@ class Bundle { return _map.toString(); } } - diff --git a/lib/widget/bee_scaffold.dart b/lib/widget/bee_scaffold.dart index 35863d59..6ac9b5e3 100644 --- a/lib/widget/bee_scaffold.dart +++ b/lib/widget/bee_scaffold.dart @@ -14,6 +14,7 @@ class BeeScaffold extends StatefulWidget { final List actions; final Widget leading; final Widget bottomNavi; + final PreferredSizeWidget appBarBottom; BeeScaffold( {Key key, @required this.title, @@ -21,7 +22,8 @@ class BeeScaffold extends StatefulWidget { this.actions, this.leading, this.bgColor, - this.bottomNavi}) + this.bottomNavi, + this.appBarBottom}) : super(key: key); @override @@ -41,6 +43,7 @@ class _BeeScaffoldState extends State { centerTitle: true, leading: widget.leading ?? BeeBackButton(), actions: widget.actions, + bottom: widget.appBarBottom, ), body: widget.body, bottomNavigationBar: widget.bottomNavi, diff --git a/lib/widget/common_app_bar.dart b/lib/widget/common_app_bar.dart index 80996b6b..add237b8 100644 --- a/lib/widget/common_app_bar.dart +++ b/lib/widget/common_app_bar.dart @@ -12,6 +12,8 @@ import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/pages/one_alarm/widget/explain_template.dart'; import 'package:get/get.dart'; +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t common_app_bar need to be cleaned.") class CommonAppBar extends StatelessWidget { final String title, subtitle; final List> treeList; diff --git a/lib/widget/picker/bee_image_picker.dart b/lib/widget/picker/bee_image_picker.dart index fd7c7e38..9d7f0617 100644 --- a/lib/widget/picker/bee_image_picker.dart +++ b/lib/widget/picker/bee_image_picker.dart @@ -1,5 +1,5 @@ import 'dart:io'; - +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; import 'package:image_picker/image_picker.dart'; @@ -16,13 +16,21 @@ class BeeImagePicker { onPressed: () async => Get.back( result: await ImagePicker().getImage(source: ImageSource.gallery), ), - child: '相册'.text.isIntrinsic.make(), + child: [ + Icon(CupertinoIcons.photo), + 30.wb, + '相册'.text.isIntrinsic.make(), + ].row(), ), CupertinoDialogAction( onPressed: () async => Get.back( result: await ImagePicker().getImage(source: ImageSource.camera), ), - child: '相机'.text.isIntrinsic.make(), + child: [ + Icon(CupertinoIcons.camera), + 30.wb, + '相机'.text.isIntrinsic.make(), + ].row(), ), ], cancelButton: CupertinoDialogAction(