修改功能入口跳转逻辑

hmxc
张萌 3 years ago
parent 5892afbcae
commit 2122755aee

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

@ -17,6 +17,7 @@ import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.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.dart';
import 'package:aku_new_community/pages/setting_page/settings_page.dart';
import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_page.dart';
import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart';
@ -46,10 +47,10 @@ class AO {
this.page,
);
AO.fromRaw(String raw) {
AO.fromRaw(String raw, {String? replaceTitle}) {
appObjects.forEach((element) {
if (element.title == raw) {
this.title = element.title;
this.title = replaceTitle ?? element.title;
this.path = element.path;
this.page = element.page;
}
@ -97,7 +98,7 @@ List<AO> appObjects = [
AO('地理信息', R.ASSETS_ICONS_FUNC_DLXX_PNG, () => GeographicInformationPage()),
AO('周边企业', R.ASSETS_ICONS_FUNC_ZBQY_PNG, () => SurroundingEnterprisesPage()),
AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()),
AO('智慧养老', Assets.icons.provideAged.path, null),
AO('智慧养老', Assets.icons.provideAged.path, () => OldAgeSupportPage()),
AO('周边服务', Assets.icons.nearbyService.path, null),
AO('小蜜蜂任务', Assets.icons.beeTask.path, null),
AO('自营商城', Assets.icons.shoppingMall.path, null),
@ -105,6 +106,7 @@ List<AO> appObjects = [
AO('共享停车', Assets.icons.sharePark.path, null),
AO('二手市场', Assets.icons.secondHandMarket.path, null),
AO('共享投屏', Assets.icons.projectionScreen.path, null),
AO('全部应用', Assets.icons.funcAll.path, () => AllApplicationPage()),
// AO(
// '小区教育',

@ -1111,6 +1111,10 @@ class $AssetsStaticGen {
AssetGenImage get integralBackground =>
const AssetGenImage('assets/static/integral_background.png');
/// File path: assets/static/old_age_back.png
AssetGenImage get oldAgeBack =>
const AssetGenImage('assets/static/old_age_back.png');
/// File path: assets/static/parking_grey.webp
AssetGenImage get parkingGrey =>
const AssetGenImage('assets/static/parking_grey.webp');

@ -2,23 +2,19 @@
import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/constants/application_objects.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/model/community/activity_item_model.dart';
import 'package:aku_new_community/model/community/board_model.dart';
import 'package:aku_new_community/model/community/swiper_model.dart';
import 'package:aku_new_community/pages/home/widget/animate_app_bar.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_choose_page.dart';
import 'package:aku_new_community/pages/message_center_page/message_center_page.dart';
import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart';
import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/ui/community/activity/activity_card.dart';
import 'package:aku_new_community/ui/community/activity/activity_list_page.dart';
import 'package:aku_new_community/ui/community/community_func.dart';
import 'package:aku_new_community/ui/community/facility/facility_appointment_page.dart';
import 'package:aku_new_community/ui/home/application/all_application.dart';
import 'package:aku_new_community/ui/home/home_notification.dart';
import 'package:aku_new_community/ui/home/home_title.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart';
@ -514,14 +510,10 @@ class _HomePageState extends State<HomePage>
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
getFunctionBtn(
'报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => FixedSubmitPage()),
getFunctionBtn('设施预约', R.ASSETS_ICONS_FUNC_SSYY_PNG,
() => FacilityAppointmentPage()),
getFunctionBtn('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG,
() => LifePayChoosePage()),
getFunctionBtn('智慧养老', Assets.icons.provideAged.path, null,
unComplete: true),
getFunctionBtn(AO.fromRaw('报事报修')),
getFunctionBtn(AO.fromRaw('设施预约')),
getFunctionBtn(AO.fromRaw('生活缴费')),
getFunctionBtn(AO.fromRaw('智慧养老')),
],
),
32.hb,
@ -529,44 +521,39 @@ class _HomePageState extends State<HomePage>
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
getFunctionBtn('周边服务', Assets.icons.nearbyService.path, null,
unComplete: true),
getFunctionBtn('任务发布', Assets.icons.beeTask.path, null,
unComplete: true),
getFunctionBtn('邻家宠物', Assets.icons.nearbyPet.path, null,
unComplete: true),
getFunctionBtn('全部应用', R.ASSETS_ICONS_FUNC_ALL_PNG,
() => AllApplicationPage()),
getFunctionBtn(AO.fromRaw('周边服务')),
getFunctionBtn(AO.fromRaw('小蜜蜂任务', replaceTitle: '任务发布')),
getFunctionBtn(AO.fromRaw('邻家宠物')),
getFunctionBtn(AO.fromRaw('全部应用')),
],
),
],
);
}
Widget getFunctionBtn(String title, String path, dynamic page,
{bool unComplete = false}) {
Widget getFunctionBtn(AO ao) {
return MaterialButton(
shape: StadiumBorder(),
padding: EdgeInsets.zero,
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(title)) return;
if (unComplete) {
if (!LoginUtil.haveRoom(ao.title)) return;
if (ao.page == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
Get.to(page);
Get.to(ao.page);
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
path,
ao.path,
height: 80.w,
width: 80.w,
),
16.hb,
title.text.size(22.sp).color(Color(0xA6000000)).bold.make(),
ao.title.text.size(22.sp).color(Color(0xA6000000)).bold.make(),
],
),
);

@ -444,13 +444,17 @@ class _PropertyPageState extends State<PropertyPage>
),
SliverToBoxAdapter(
child: _getFunctionView(
wisdomServiceApp, '智慧服务', Color(0xFFFA5858),
unComplete: true),
wisdomServiceApp,
'智慧服务',
Color(0xFFFA5858),
),
),
SliverToBoxAdapter(
child: _getFunctionView(
nearbyShoppingApp, '附近市场', Color(0xFFFA5858),
unComplete: true),
nearbyShoppingApp,
'附近市场',
Color(0xFFFA5858),
),
)
],
),
@ -458,8 +462,11 @@ class _PropertyPageState extends State<PropertyPage>
);
}
_getFunctionView(List<AO> item, String title, Color color,
{bool unComplete = false}) {
_getFunctionView(
List<AO> item,
String title,
Color color,
) {
return Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 32.w),
decoration: BoxDecoration(
@ -497,7 +504,6 @@ class _PropertyPageState extends State<PropertyPage>
ApplicationView.custom(
items: item,
needAllApp: false,
unComplete: unComplete,
),
],
),

@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class OldAgeSupportPage extends StatefulWidget {
const OldAgeSupportPage({Key? key}) : super(key: key);
@override
_OldAgeSupportPageState createState() => _OldAgeSupportPageState();
}
class _OldAgeSupportPageState extends State<OldAgeSupportPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: '智慧养老'.text.size(32.sp).black.make(),
backgroundColor: Colors.transparent,
),
extendBody: true,
extendBodyBehindAppBar: true,
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(),
),
);
}
}

@ -29,7 +29,6 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
_buildTile(
AO object, {
bool editMode = false,
bool unComplete = false,
}) {
return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
@ -39,7 +38,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (unComplete) {
if (object.page == null) {
BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
@ -94,8 +93,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
itemBuilder: (context, index) {
return Stack(
children: [
_buildTile(appProvider.myApplications[index],
editMode: _editMode, unComplete: index > 3),
_buildTile(appProvider.myApplications[index], editMode: _editMode),
Positioned(
right: 0,
top: 0,

@ -11,18 +11,18 @@ import 'package:velocity_x/velocity_x.dart';
class ApplicationView extends StatefulWidget {
final List<AO>? items;
final bool needAllApp;
final bool unComplete;
ApplicationView({Key? key, this.needAllApp = true, this.unComplete = false})
: items = null,
ApplicationView({
Key? key,
this.needAllApp = true,
}) : items = null,
super(key: key);
ApplicationView.custom(
{Key? key,
required List<AO> this.items,
this.needAllApp = true,
this.unComplete = false})
: super(key: key);
ApplicationView.custom({
Key? key,
required List<AO> this.items,
this.needAllApp = true,
}) : super(key: key);
@override
_ApplicationViewState createState() => _ApplicationViewState();
@ -36,7 +36,7 @@ class _ApplicationViewState extends State<ApplicationView> {
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (widget.unComplete) {
if (object.page == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
Get.to(object.page);

Loading…
Cancel
Save