张萌 4 years ago
commit 5532be4986

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

@ -84,6 +84,9 @@ class _Manager {
///
String get reportRepairDelete => '/user/reportRepair/falseDelete';
////app/ type (1.2.3.4.)
String get advice => '/user/advice/list';
}
class _Upload {

@ -0,0 +1,63 @@
import 'package:common_utils/common_utils.dart';
class SuggestionOrComplainModel {
int id;
int type;
int status;
String content;
int score;
DateTime createDate;
List<ImgUrls> imgUrls;
SuggestionOrComplainModel(
{this.id,
this.type,
this.status,
this.content,
this.score,
this.createDate,
this.imgUrls});
SuggestionOrComplainModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
status = json['status'];
content = json['content'];
score = json['score'];
createDate = DateUtil.getDateTime(json['createDate']);
if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
});
}
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

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

@ -10,16 +10,15 @@ 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/scan/scan_page.dart';
import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart';
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';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'widget/home_search.dart';
@ -30,8 +29,6 @@ import 'package:akuCommunity/widget/container_comment.dart';
import 'package:akuCommunity/widget/single_ad_space.dart';
import 'package:akuCommunity/service/base_model.dart';
import 'package:akuCommunity/model/aku_shop_model.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/extensions/page_router.dart';
@ -58,39 +55,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 +131,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 +181,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

@ -11,9 +11,9 @@ 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/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/ui/manager/advice/advice_page.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/grid_buttons.dart';
import 'package:flutter/material.dart';
@ -57,41 +57,19 @@ class _PropertyIndexState extends State<PropertyIndex>
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_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(
bundle: Bundle()..putBool('isVote', true),
));
Get.to(ActivitiesPage());
}),
GridButton('物品出户', R.ASSETS_ICONS_TOOL_WPCM_PNG, () {
GoodsDetoPage().to();
}),
GridButton('投诉表扬', R.ASSETS_ICONS_TOOL_TSBY_PNG, () {
Get.to(ThingsPage(
bundle: Bundle()
..putMap('things', {
'title': '投诉表扬',
'treeList': <Map<String, dynamic>>[
{'name': '您的表扬'},
{'name': '您的投诉'},
]
}),
));
}),
GridButton('投诉表扬', R.ASSETS_ICONS_TOOL_TSBY_PNG,
AdvicePage(type: AdviceType.SUGGESTION).to),
GridButton('问卷调查', R.ASSETS_ICONS_TOOL_WJDC_PNG, () {
QuestionnairePage().to();
}),
@ -165,9 +143,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(

@ -1,200 +0,0 @@
import 'package:akuCommunity/pages/things_page/things_create_page/things_create_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/common_app_bar.dart';
import 'widget/things_app_bar.dart';
import 'widget/things_list.dart';
class ThingsPage extends StatefulWidget {
final Bundle bundle;
ThingsPage({Key key, this.bundle}) : super(key: key);
@override
_ThingsPageState createState() => _ThingsPageState();
}
class _ThingsPageState extends State<ThingsPage> with TickerProviderStateMixin {
List<Map<String, dynamic>> _listCard = [
{
'time': '2020年10月13日',
'tag': '已提交',
'content': '我觉得我们小区的绿化可以再多一点',
'imageList': <String>[
'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=111636878,534819054&fm=26&gp=0.jpg',
'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3834533673,769780989&fm=26&gp=0.jpg',
'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1683501076,3787404077&fm=26&gp=0.jpg',
'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1040644610,2290865162&fm=26&gp=0.jpg',
]
},
{
'time': '2020年09月23日',
'tag': '已审阅',
'content': '我觉得外面的小摊贩还是不要来了,毕竟为了环保,还有小区的孩子很多,大狗什么的希望主人能管好它',
'imageList': <String>[]
},
{
'time': '2020年08月12日',
'tag': '已反馈',
'content': '夏天蛇蚁虫属真多,希望小区能组队给整个小区保洁一下',
'imageList': <String>[
'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1696975393,2205543181&fm=26&gp=0.jpg',
'https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3220834958,1457978756&fm=26&gp=0.jpg',
]
},
];
List<Map<String, dynamic>> _listRepair = [
{
'time': '公区报修',
'tag': '已处理',
'content': '小区花园的健身器材坏了请注意抓紧时间维修。还有一些健身器材年限到了麻烦注意更换,因为怕出现安全隐患。',
'imageList': <String>[
'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2390449629,3468003032&fm=26&gp=0.jpg',
'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=123602716,1727529947&fm=26&gp=0.jpg',
'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3789981542,2569571902&fm=26&gp=0.jpg',
]
},
{
'time': '家庭维修',
'tag': '待分配',
'content': '家里的洗衣机坏了请师傅抓紧时间,赶快支援。',
'imageList': <String>[
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1199114124,190063793&fm=26&gp=0.jpg',
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1009468563,227812083&fm=26&gp=0.jpg',
]
},
{
'time': '家庭维修',
'tag': '维修中',
'content': '家里的空调坏了,热死人了,请师傅火速来修。',
'imageList': <String>[
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1349979411,865756316&fm=26&gp=0.jpg',
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2162579969,1968776994&fm=26&gp=0.jpg',
]
},
{
'time': '家庭维修',
'tag': '已完成',
'content': '家里的冰箱坏了,师傅赶紧来看看',
'imageList': <String>[
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=466219337,2269488732&fm=15&gp=0.jpg',
'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=907707978,1526051881&fm=26&gp=0.jpg',
]
},
{
'time': '家庭维修',
'tag': '已取消',
'content': '家里的电饭煲坏了,师傅快上门修一下。',
'imageList': <String>[
'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=61782379,2829421550&fm=26&gp=0.jpg',
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=921027380,3023940375&fm=15&gp=0.jpg',
]
},
];
TabController _controller;
@override
void initState() {
if (widget.bundle.getMap('things')['treeList'] != null) {
_controller = TabController(
length: widget.bundle.getMap('things')['treeList'].length,
vsync: this);
}
super.initState();
}
@override
void dispose() {
if (widget.bundle.getMap('things')['treeList'] != null) {
_controller.dispose();
}
super.dispose();
}
Widget _positionedButton() {
return Positioned(
bottom: 0,
child: InkWell(
onTap: () {
bool isIdea;
switch (widget.bundle.getMap('things')['title']) {
case '建议咨询':
isIdea = true;
break;
case '投诉表扬':
isIdea = false;
break;
case '报事报修':
break;
default:
}
ThingsCreatePage(
bundle: Bundle()
..putMap('create', {
'title': widget.bundle.getMap('things')['title'],
'isIdea': isIdea
}),
).to;
},
child: Container(
alignment: Alignment.center,
height: 98.w,
width: 750.w,
padding: EdgeInsets.symmetric(vertical: 26.5.w),
color: Color(0xffffc40c),
child: Text(
'新增',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32.sp,
color: Color(0xff333333),
),
),
),
),
);
}
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
child: widget.bundle.getMap('things')['title'] == '报事报修'
? CommonAppBar(
title: '${widget.bundle.getMap('things')['title']}',
)
: ThingsAppBar(
title: '${widget.bundle.getMap('things')['title']}',
tabController: _controller,
treeList: widget.bundle.getMap('things')['treeList'],
),
preferredSize: Size.fromHeight(
widget.bundle.getMap('things')['title'] == '报事报修'
? kToolbarHeight
: kToolbarHeight * 1.8),
),
body: Stack(
children: [
widget.bundle.getMap('things')['title'] == '报事报修'
? ThingsList(
listCard: _listRepair,
isRepair: true,
)
: TabBarView(
controller: _controller,
children: List.generate(
widget.bundle.getMap('things')['treeList'].length,
(index) => ThingsList(
listCard: _listCard,
isRepair: false,
),
),
),
_positionedButton(),
],
),
);
}
}

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

@ -10,8 +10,9 @@ 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/things_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/ui/manager/advice/advice_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/headers.dart';
@ -135,12 +136,7 @@ class _TotalApplicationsPageState extends State<TotalApplicationsPage> {
VisitorAccessPage().to();
break;
case '报事报修':
ThingsPage(
bundle: Bundle()
..putMap('things', {
'title': '报事报修',
}),
).to;
FixedSubmitPage().to();
break;
case '生活缴费':
case '我的缴费':
@ -150,44 +146,22 @@ class _TotalApplicationsPageState extends State<TotalApplicationsPage> {
IndustryCommitteePage().to();
break;
case '建议咨询':
ThingsPage(
bundle: Bundle()
..putMap('things', {
'title': '建议咨询',
'treeList': <Map<String, dynamic>>[
{'name': '您的建议'},
{'name': '您的咨询'},
]
}),
).to();
AdvicePage(type: AdviceType.SUGGESTION).to();
break;
case '便民电话':
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();
break;
case '投诉表扬':
ThingsPage(
bundle: Bundle()
..putMap('things', {
'title': '投诉表扬',
'treeList': <Map<String, dynamic>>[
{'name': '您的表扬'},
{'name': '您的投诉'},
]
}),
).to;
AdvicePage(type: AdviceType.COMPLAIN).to();
break;
case '问卷调查':
QuestionnairePage().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();
}
}

@ -0,0 +1,113 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/suggestion_or_complain_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/tab_bar/bee_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
enum AdviceType {
SUGGESTION,
COMPLAIN,
}
enum _adviceInnerType {
SUGGESTION,
QUESTION,
COMPLAIN,
PRAISE,
}
class AdvicePage extends StatefulWidget {
final AdviceType type;
AdvicePage({Key key, @required this.type}) : super(key: key);
@override
_AdvicePageState createState() => _AdvicePageState();
}
class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
EasyRefreshController _refreshController = EasyRefreshController();
TabController _tabController;
String get title {
switch (widget.type) {
case AdviceType.SUGGESTION:
return '建议咨询';
break;
case AdviceType.COMPLAIN:
return '投诉表扬';
break;
}
return '';
}
List<String> get tabs {
switch (widget.type) {
case AdviceType.SUGGESTION:
return ['您的建议', '您的咨询'];
break;
case AdviceType.COMPLAIN:
return ['您的投诉', '您的表扬'];
break;
}
return [];
}
int adviceValue(int index) {
switch (widget.type) {
case AdviceType.SUGGESTION:
return index == 0 ? 2 : 1;
break;
case AdviceType.COMPLAIN:
return index == 0 ? 4 : 3;
break;
}
}
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: title,
appBarBottom: BeeTabBar(
controller: _tabController,
tabs: tabs,
),
body: TabBarView(
controller: _tabController,
children: List.generate(2, (index) {
return BeeListView(
path: API.manager.advice,
extraParams: {'adviceType': adviceValue(index)},
controller: _refreshController,
convert: (model) => model.tableList
.map((e) => SuggestionOrComplainModel.fromJson(e))
.toList(),
builder: (items) {
return ListView.separated(
itemBuilder: (context, index) {
return SizedBox();
},
separatorBuilder: (_, __) => 20.hb,
itemCount: items.length,
);
},
);
}).toList(),
),
);
}
}

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

@ -0,0 +1,35 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BeeTabBar extends StatefulWidget with PreferredSizeWidget {
final TabController controller;
final List<String> tabs;
BeeTabBar({Key key, @required this.controller, @required this.tabs})
: super(key: key);
@override
_BeeTabBarState createState() => _BeeTabBarState();
@override
Size get preferredSize => Size.fromHeight(96.w);
}
class _BeeTabBarState extends State<BeeTabBar> {
@override
Widget build(BuildContext context) {
return TabBar(
controller: widget.controller,
unselectedLabelStyle: TextStyle(
fontSize: BaseStyle.fontSize28,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize28,
),
indicatorColor: Color(0xffffc40c),
indicatorSize: TabBarIndicatorSize.label,
tabs: widget.tabs.map((e) => Tab(text: e)).toList(),
);
}
}
Loading…
Cancel
Save