LIFE IS SHORT

BUT WE ARE WASTING TIME  TO DELETE THOSE SHHHHH*T CODES.
hmxc
小赖 4 years ago
parent 942f1a94f0
commit e5714f6865

@ -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';

@ -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<ActivitiesPage> {
List<String> 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<String> images = [];
List<Map<String, dynamic>> _listView = [];
List<Map<String, dynamic>> _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<Map<String, dynamic>> _listVote = [];
List<Map<String, dynamic>> _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<Map<String, dynamic>> _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<ActivitiesPage> {
void detailsRouter(String imagePath, title, bool isOver, isVote, isVoteOver,
List<String> 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<ActivitiesPage> {
subtitleSecond: _listView[index]['subtitleSecond'],
memberList: images,
isOver: _listView[index]['isOver'],
isVote: widget.bundle.getBool('isVote'),
isVote: false,
isVoteOver: _listView[index]['isVoteOver'],
fun: detailsRouter,
),

@ -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<DetoCreatePage> {
),
),
),
GridImagePicker(),
GridImagePicker(onChange: (files) {}),
],
),
),

@ -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';

@ -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<HomePage>
int page = 1;
List<GridButton> _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': <Map<String, dynamic>>[
{'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<HomePage>
_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<HomePage>
tag: '活动',
isShowImage: false,
fun: () {
ActivitiesPage(
bundle: Bundle()..putBool('isVote', false),
).to;
ActivitiesPage().to;
},
),
HomeCard(

@ -52,9 +52,7 @@ class _PersonalIndexState extends State<PersonalIndex>
));
}),
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();

@ -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<UserProfilePage> {
_pickAvatar() async {
final userProvider = Provider.of<UserProvider>(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

@ -73,9 +73,7 @@ class _PropertyIndexState extends State<PropertyIndex>
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<PropertyIndex>
}
void activityRouter() {
ActivitiesPage(
bundle: Bundle()..putBool('isVote', false),
).to;
ActivitiesPage().to;
}
void activityDetailsRouter(String imagePath, title, bool isOver, isVote,

@ -48,7 +48,7 @@ class _AccountManagerPageState extends State<AccountManagerPage> {
},
);
},
),
).material(color: Colors.white),
],
),
);

@ -105,13 +105,13 @@ class _SettingsPageState extends State<SettingsPage> {
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(),

@ -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<TabNavigator> {
Widget build(BuildContext context) {
//
List<BottomNavigationBarItem> _bottomNav = <BottomNavigationBarItem>[
_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(

@ -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);

@ -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<Map<String, dynamic>> treeList;

@ -165,14 +165,10 @@ class _TotalApplicationsPageState extends State<TotalApplicationsPage> {
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();

@ -1,5 +1,5 @@
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t page_routers need to be cleaned.")
class Bundle {
Map<String, dynamic> _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();
}
}

@ -14,6 +14,7 @@ class BeeScaffold extends StatefulWidget {
final List<Widget> 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<BeeScaffold> {
centerTitle: true,
leading: widget.leading ?? BeeBackButton(),
actions: widget.actions,
bottom: widget.appBarBottom,
),
body: widget.body,
bottomNavigationBar: widget.bottomNavi,

@ -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<Map<String, dynamic>> treeList;

@ -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(

Loading…
Cancel
Save