parent
4c3ea317c3
commit
a9822f6833
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,114 @@
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/extensions/widget_list_ext.dart';
|
||||
import 'package:aku_new_community/utils/application_utils.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/iterable_ext.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
|
||||
class AllApplicationNewPage extends StatefulWidget {
|
||||
const AllApplicationNewPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllApplicationNewPageState createState() => _AllApplicationNewPageState();
|
||||
}
|
||||
|
||||
class _AllApplicationNewPageState extends State<AllApplicationNewPage> {
|
||||
List<String> rootTypes = ['物业服务', '出行安全', '居民生活', '关于社区', '智慧服务', '附近市场'];
|
||||
|
||||
List<String> getApplications(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return ['报事报修', '设施预约', '生活缴费', '装修管理'];
|
||||
case 1:
|
||||
return [
|
||||
'开门码',
|
||||
'物品出门',
|
||||
'地理信息',
|
||||
'小蜜蜂任务',
|
||||
];
|
||||
case 2:
|
||||
return ['便民电话', '问卷调查', '活动投票', '快递包裹', '投诉表扬', '业委会', '社区介绍', '借还管理'];
|
||||
case 3:
|
||||
return ['服务浏览', '周边企业', '住房说明', '电子商务'];
|
||||
case 4:
|
||||
return ['智慧养老', '任务发布', '周边服务', '共享投屏'];
|
||||
case 5:
|
||||
return ['自营商城', '邻家宠物', '共享停车', '二手市场'];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '全部应用',
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
|
||||
children: rootTypes
|
||||
.mapIndexed((e, index) => _applicationTile(index))
|
||||
.toList()
|
||||
.sepWidget(separate: 16.hb),
|
||||
));
|
||||
}
|
||||
|
||||
Container _applicationTile(int index) {
|
||||
return Container(
|
||||
width: 686.w,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 32.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 32.w, bottom: 24.w),
|
||||
child: rootTypes[index]
|
||||
.text
|
||||
.size(32.sp)
|
||||
.color(Color(0xFF2B2B2B))
|
||||
.bold
|
||||
.make(),
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: getApplications(index).length ~/ 4 * 140.w +
|
||||
((getApplications(index).length - 4) ~/ 4 * 30.w)),
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 4,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: ApplicationUtil(getApplications(index))
|
||||
.elements
|
||||
.map((e) => applicationItem(e))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget applicationItem(AppElement appElement) {
|
||||
return GestureDetector(
|
||||
onTap: appElement.onTap,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Image.asset(
|
||||
appElement.imgPath,
|
||||
width: 96.w,
|
||||
height: 96.w,
|
||||
),
|
||||
8.hb,
|
||||
appElement.title.text.size(24.sp).color(Color(0xFF333333)).make(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,308 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aku_new_community/gen/assets.gen.dart';
|
||||
import 'package:aku_new_community/pages/community_introduce/community_introduce_page.dart';
|
||||
import 'package:aku_new_community/pages/convenient_phone/convenient_phone_page.dart';
|
||||
import 'package:aku_new_community/pages/electronic_commerc/electronic_commerc_page.dart';
|
||||
import 'package:aku_new_community/pages/event_activity/event_voting_page.dart';
|
||||
import 'package:aku_new_community/pages/express_packages/express_package_page.dart';
|
||||
import 'package:aku_new_community/pages/geographic_information/geograhic_information.dart';
|
||||
import 'package:aku_new_community/pages/goods_deto_page/goods_deto_page.dart';
|
||||
import 'package:aku_new_community/pages/goods_manage_page/select_borrow_return_page.dart';
|
||||
import 'package:aku_new_community/pages/house_introduce/house_introduce.dart';
|
||||
import 'package:aku_new_community/pages/industry_committee/industry_committee_page.dart';
|
||||
import 'package:aku_new_community/pages/life_pay/life_pay_page_new.dart';
|
||||
import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart';
|
||||
import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_page.dart';
|
||||
import 'package:aku_new_community/pages/service_browse/service_browse_page.dart';
|
||||
import 'package:aku_new_community/pages/services/old_age/old_age_support_page_simple.dart';
|
||||
import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_page.dart';
|
||||
import 'package:aku_new_community/ui/community/facility/facility_appointment_page.dart';
|
||||
import 'package:aku_new_community/ui/function_and_service/task/task_page.dart';
|
||||
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_page.dart';
|
||||
import 'package:aku_new_community/ui/home/application/all_application.dart';
|
||||
import 'package:aku_new_community/ui/manager/advice/advice_page.dart';
|
||||
import 'package:aku_new_community/ui/manager/questionnaire/questionnaire_page.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ApplicationUtil {
|
||||
ApplicationUtil(this.titles);
|
||||
|
||||
List<String> titles = [];
|
||||
|
||||
List<AppElement> get elements {
|
||||
var list = <AppElement>[];
|
||||
this.titles.forEach((element) {
|
||||
var re = _findByTitle(element);
|
||||
if (re != null) {
|
||||
list.add(re);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
AppElement? _findByTitle(String title) {
|
||||
for (var item in allApplications) {
|
||||
if (title == item.title) {
|
||||
return item;
|
||||
} else if (item.nickTitles.contains(title)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<AppElement> get allApplications => [
|
||||
AppElement(
|
||||
title: '开门码',
|
||||
imgPath: Assets.newIcon.icKmm.path,
|
||||
onTap: () => Get.to(() => OpeningCodePage())),
|
||||
// AppElement('访客邀请', R.ASSETS_ICONS_FUNC_FKYQ_PNG, () => Get.to(()=>VisitorAccessPage()),
|
||||
AppElement(
|
||||
title: '报事报修',
|
||||
imgPath: Assets.home.icBsbx.path,
|
||||
onTap: () => Get.to(() => WorkOrderPage())),
|
||||
AppElement(
|
||||
title: '生活缴费',
|
||||
imgPath: Assets.home.icShjf.path,
|
||||
onTap: () => Get.to(() => LifePayPageNew())),
|
||||
AppElement(
|
||||
title: '业委会',
|
||||
imgPath: Assets.newIcon.icYwh.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => IndustryCommitteePage());
|
||||
}),
|
||||
// AppElement('建议咨询', R.ASSETS_ICONS_FUNC_JYZX_PNG,
|
||||
// () => AdvicePage(type: AdviceType.SUGGESTION)),
|
||||
AppElement(
|
||||
title: '便民电话',
|
||||
imgPath: Assets.newIcon.imgBmdh.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => ConvenientPhonePage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '活动投票',
|
||||
imgPath: Assets.newIcon.icHdtp.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => EventVotingPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '物品出门',
|
||||
imgPath: Assets.newIcon.imgWpcm.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => GoodsDetoPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '投诉表扬',
|
||||
imgPath: Assets.newIcon.icTsby.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => AdvicePage(type: AdviceType.COMPLAIN));
|
||||
}),
|
||||
AppElement(
|
||||
title: '问卷调查',
|
||||
imgPath: Assets.newIcon.icWjdc.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(() => QuestionnairePage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '装修管理',
|
||||
imgPath: Assets.newIcon.imgZxgl.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => NewRenovationPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '借还管理',
|
||||
imgPath: Assets.newIcon.icJhgl.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
Get.to(SelectBorrowReturnPage());
|
||||
}),
|
||||
// AppElement('一键报警', Assets.newIcon.yj, () => AlarmPage()),
|
||||
AppElement(
|
||||
title: '设施预约',
|
||||
imgPath: Assets.home.icSsyy.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => FacilityAppointmentPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '快递包裹',
|
||||
imgPath: Assets.newIcon.icKdbg.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => ExpressPackagePage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '电子商务',
|
||||
imgPath: Assets.newIcon.icDzsw.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => ElectronicCommercPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '服务浏览',
|
||||
imgPath: Assets.newIcon.icFwll.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => ServiceBrowsePage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '社区介绍',
|
||||
imgPath: Assets.newIcon.icSqjs.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => CommunityIntroducePage());
|
||||
}),
|
||||
// AppElement('家政服务', R.ASSETS_ICONS_FUNC_JZFW_PNG, () => HouseKeepingPage()),
|
||||
|
||||
AppElement(
|
||||
title: '地理信息',
|
||||
imgPath: Assets.newIcon.icDlxx.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => GeographicInformationPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '周边企业',
|
||||
imgPath: Assets.newIcon.icZbqy.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => SurroundingEnterprisesPage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '住房说明',
|
||||
imgPath: Assets.newIcon.icRwsm.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能升级中,敬请期待');
|
||||
return;
|
||||
Get.to(() => HouseIntroducePage());
|
||||
}),
|
||||
AppElement(
|
||||
title: '智慧养老',
|
||||
imgPath: Assets.home.icZhyl.path,
|
||||
onTap: () {
|
||||
Get.to(() => OldAgeSupportPageSimple());
|
||||
}),
|
||||
AppElement(
|
||||
title: '周边服务',
|
||||
imgPath: Assets.home.icZbfw.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '任务发布',
|
||||
imgPath: Assets.home.icRwfb.path,
|
||||
onTap: () => Get.to(() => TaskPage()),
|
||||
nickTitles: ['小蜜蜂任务']),
|
||||
AppElement(
|
||||
title: '自营商城',
|
||||
imgPath: Assets.icons.shoppingMall.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '邻家宠物',
|
||||
imgPath: Assets.home.icLjcw.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '共享停车',
|
||||
imgPath: Assets.icons.sharePark.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '二手市场',
|
||||
imgPath: Assets.icons.secondHandMarket.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '共享投屏',
|
||||
imgPath: Assets.icons.projectionScreen.path,
|
||||
onTap: () {
|
||||
BotToast.showText(text: '此功能暂未上线');
|
||||
return;
|
||||
}),
|
||||
AppElement(
|
||||
title: '全部应用',
|
||||
imgPath: Assets.home.icQbyy.path,
|
||||
onTap: () => Get.to(() => AllApplicationPage())),
|
||||
|
||||
// AppElement(
|
||||
// '小区教育',
|
||||
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
// () => BeeScaffold(title: '小区教育'),
|
||||
// ),
|
||||
// AppElement(
|
||||
// '健康运动',
|
||||
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
// () => BeeScaffold(title: '健康运动'),
|
||||
// ),
|
||||
// AppElement(
|
||||
// '家政服务',
|
||||
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
// () => BeeScaffold(title: '家政服务'),
|
||||
// ),
|
||||
// AppElement(
|
||||
// '居家养老',
|
||||
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
// () => BeeScaffold(title: '居家养老'),
|
||||
// ),
|
||||
// AppElement(
|
||||
// '物业租赁',
|
||||
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
// () => BeeScaffold(title: '物业租赁'),
|
||||
// ),
|
||||
];
|
||||
}
|
||||
|
||||
class AppElement extends Equatable {
|
||||
final String title;
|
||||
final String imgPath;
|
||||
final VoidCallback onTap;
|
||||
final List<String> nickTitles;
|
||||
|
||||
const AppElement({
|
||||
required this.title,
|
||||
required this.imgPath,
|
||||
required this.onTap,
|
||||
this.nickTitles = const [],
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
title,
|
||||
imgPath,
|
||||
onTap,
|
||||
];
|
||||
}
|
Loading…
Reference in new issue