修改功能入口跳转逻辑

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

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

@ -2,23 +2,19 @@
import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/constants/api.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/common/img_model.dart';
import 'package:aku_new_community/model/community/activity_item_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/board_model.dart';
import 'package:aku_new_community/model/community/swiper_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/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/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/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/pages/visitor_access_page/visitor_access_page.dart';
import 'package:aku_new_community/provider/app_provider.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_card.dart';
import 'package:aku_new_community/ui/community/activity/activity_list_page.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/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_notification.dart';
import 'package:aku_new_community/ui/home/home_title.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'; 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, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
getFunctionBtn( getFunctionBtn(AO.fromRaw('报事报修')),
'报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => FixedSubmitPage()), getFunctionBtn(AO.fromRaw('设施预约')),
getFunctionBtn('设施预约', R.ASSETS_ICONS_FUNC_SSYY_PNG, getFunctionBtn(AO.fromRaw('生活缴费')),
() => FacilityAppointmentPage()), getFunctionBtn(AO.fromRaw('智慧养老')),
getFunctionBtn('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG,
() => LifePayChoosePage()),
getFunctionBtn('智慧养老', Assets.icons.provideAged.path, null,
unComplete: true),
], ],
), ),
32.hb, 32.hb,
@ -529,44 +521,39 @@ class _HomePageState extends State<HomePage>
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
getFunctionBtn('周边服务', Assets.icons.nearbyService.path, null, getFunctionBtn(AO.fromRaw('周边服务')),
unComplete: true), getFunctionBtn(AO.fromRaw('小蜜蜂任务', replaceTitle: '任务发布')),
getFunctionBtn('任务发布', Assets.icons.beeTask.path, null, getFunctionBtn(AO.fromRaw('邻家宠物')),
unComplete: true), getFunctionBtn(AO.fromRaw('全部应用')),
getFunctionBtn('邻家宠物', Assets.icons.nearbyPet.path, null,
unComplete: true),
getFunctionBtn('全部应用', R.ASSETS_ICONS_FUNC_ALL_PNG,
() => AllApplicationPage()),
], ],
), ),
], ],
); );
} }
Widget getFunctionBtn(String title, String path, dynamic page, Widget getFunctionBtn(AO ao) {
{bool unComplete = false}) {
return MaterialButton( return MaterialButton(
shape: StadiumBorder(), shape: StadiumBorder(),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () { onPressed: () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(title)) return; if (!LoginUtil.haveRoom(ao.title)) return;
if (unComplete) { if (ao.page == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5)); BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else { } else {
Get.to(page); Get.to(ao.page);
} }
}, },
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
path, ao.path,
height: 80.w, height: 80.w,
width: 80.w, width: 80.w,
), ),
16.hb, 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( SliverToBoxAdapter(
child: _getFunctionView( child: _getFunctionView(
wisdomServiceApp, '智慧服务', Color(0xFFFA5858), wisdomServiceApp,
unComplete: true), '智慧服务',
Color(0xFFFA5858),
),
), ),
SliverToBoxAdapter( SliverToBoxAdapter(
child: _getFunctionView( child: _getFunctionView(
nearbyShoppingApp, '附近市场', Color(0xFFFA5858), nearbyShoppingApp,
unComplete: true), '附近市场',
Color(0xFFFA5858),
),
) )
], ],
), ),
@ -458,8 +462,11 @@ class _PropertyPageState extends State<PropertyPage>
); );
} }
_getFunctionView(List<AO> item, String title, Color color, _getFunctionView(
{bool unComplete = false}) { List<AO> item,
String title,
Color color,
) {
return Container( return Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 32.w), margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 32.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -497,7 +504,6 @@ class _PropertyPageState extends State<PropertyPage>
ApplicationView.custom( ApplicationView.custom(
items: item, items: item,
needAllApp: false, 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( _buildTile(
AO object, { AO object, {
bool editMode = false, bool editMode = false,
bool unComplete = false,
}) { }) {
return MaterialButton( return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
@ -39,7 +38,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
: () { : () {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return; if (!LoginUtil.haveRoom(object.title)) return;
if (unComplete) { if (object.page == null) {
BotToast.showText( BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5)); text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else { } else {
@ -94,8 +93,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Stack( return Stack(
children: [ children: [
_buildTile(appProvider.myApplications[index], _buildTile(appProvider.myApplications[index], editMode: _editMode),
editMode: _editMode, unComplete: index > 3),
Positioned( Positioned(
right: 0, right: 0,
top: 0, top: 0,

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

Loading…
Cancel
Save