From e10f19ddd17a70e324e8e443fe45469a7afd9120 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 26 May 2021 16:10:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=AF=E4=BB=98=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/application_objects.dart | 2 +- lib/pages/life_pay/life_pay_page.dart | 32 ++++++------ lib/pages/life_pay/pay_finish_page.dart | 50 +++++++++++++++++++ .../renovation_manage_page.dart | 31 ++++++++---- 4 files changed, 87 insertions(+), 28 deletions(-) create mode 100644 lib/pages/life_pay/pay_finish_page.dart diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index 76199d0f..d822e8b5 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -80,7 +80,7 @@ List appObjects = [ AO('投诉表扬', R.ASSETS_APPLICATIONS_COMPLAINT_PNG, () => AdvicePage(type: AdviceType.COMPLAIN)), AO('问卷调查', R.ASSETS_APPLICATIONS_QUESTION_PNG, () => QuestionnairePage()), - AO('装修管理', R.ASSETS_APPLICATIONS_DECORATION_PNG, RenovationManagePage()), + AO('装修管理', R.ASSETS_APPLICATIONS_DECORATION_PNG,()=> RenovationManagePage()), AO('借还管理', R.ASSETS_APPLICATIONS_BORROW_PNG, () => SelectBorrowReturnPage()), AO('一键报警', R.ASSETS_APPLICATIONS_POLICE_PNG, () => AlarmPage()), AO('设施预约', R.ASSETS_ICONS_TOOL_FACILITY_PNG, () => FacilityAppointmentPage()), diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index bdff8ee3..49f0ad0e 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -1,3 +1,4 @@ +import 'package:aku_community/pages/life_pay/pay_finish_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -41,7 +42,8 @@ class _LifePayPageState extends State { double _totalCost = 0; int _count = 0; - bool get allSelect => ((_models.length == _selectYears.length)&&(_models.length!=0)); + bool get allSelect => + ((_models.length == _selectYears.length) && (_models.length != 0)); @override void initState() { super.initState(); @@ -313,12 +315,8 @@ class _LifePayPageState extends State { decoration: BoxDecoration( border: Border.all( width: 1.w, - color: allSelect - ? kPrimaryColor - : kDarkSubColor), - color:allSelect - ? kPrimaryColor - : Colors.transparent, + color: allSelect ? kPrimaryColor : kDarkSubColor), + color: allSelect ? kPrimaryColor : Colors.transparent, borderRadius: BorderRadius.circular(20.w)), curve: Curves.easeInOutCubic, width: 40.w, @@ -356,15 +354,17 @@ class _LifePayPageState extends State { ], ), 24.w.widthBox, - // MaterialButton( - // elevation: 0, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(37.w)), - // color: kPrimaryColor, - // padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), - // onPressed: () {}, - // child: '去缴费'.text.black.size(32.sp).bold.make(), - // ), + MaterialButton( + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(37.w)), + color: kPrimaryColor, + padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), + onPressed: () { + Get.off(() => PayFinishPage()); + }, + child: '去缴费'.text.black.size(32.sp).bold.make(), + ), ], ), ), diff --git a/lib/pages/life_pay/pay_finish_page.dart b/lib/pages/life_pay/pay_finish_page.dart new file mode 100644 index 00000000..89094e53 --- /dev/null +++ b/lib/pages/life_pay/pay_finish_page.dart @@ -0,0 +1,50 @@ +import 'package:aku_community/utils/headers.dart'; +import 'package:aku_community/widget/bee_back_button.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PayFinishPage extends StatelessWidget { + const PayFinishPage({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: PreferredSize( + preferredSize: Size.fromHeight(ScreenUtil().statusBarHeight + 88.w), + child: AppBar( + backgroundColor: Color(0xFF2A2A2A), + centerTitle: true, + title: '支付完成'.text.size(32.sp).bold.color(Colors.white).make(), + leading: BeeBackButton( + color: Colors.white, + ), + ), + ), + backgroundColor: Color(0xFF2A2A2A), + body: Center( + child: Column( + children: [ + 200.w.heightBox, + Container( + width: 200.w, + height: 200.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100.w), + gradient: LinearGradient( + colors: [Color(0xFFFFE16B), Color(0xFFFFC40D)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter), + ), + alignment: Alignment.center, + child: Icon(CupertinoIcons.checkmark_alt,size:150.w ,color: Colors.white,), + ), + 70.w.heightBox, + '支付成功'.text.size(48.sp).color(Colors.white).bold.make(), + 16.w.heightBox, + 'Payment successful'.text.size(20.sp).color(Colors.white).make(), + ], + ), + ), + ); + } +} diff --git a/lib/pages/renovation_manage/renovation_manage_page.dart b/lib/pages/renovation_manage/renovation_manage_page.dart index 99ab0491..a9d921b1 100644 --- a/lib/pages/renovation_manage/renovation_manage_page.dart +++ b/lib/pages/renovation_manage/renovation_manage_page.dart @@ -10,31 +10,40 @@ class RenovationManagePage extends StatefulWidget { _RenovationManagePageState createState() => _RenovationManagePageState(); } -class _RenovationManagePageState extends State with TickerProviderStateMixin { - List _tabs = [ - '待处理', - '处理中', - '已完成', - '全部' - ]; +class _RenovationManagePageState extends State + with TickerProviderStateMixin { + List _tabs = ['待处理', '处理中', '已完成', '全部']; late TabController _tabController; @override void initState() { super.initState(); _tabController = TabController(length: _tabs.length, vsync: this); } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { - return BeeScaffold( + return BeeScaffold( title: '装修管理', - appBarBottom: BeeTabBar(controller: _tabController, tabs: _tabs,scrollable: true,), + appBarBottom: BeeTabBar( + controller: _tabController, + tabs: _tabs, + scrollable: true, + ), body: TabBarView( controller: _tabController, children: List.generate( _tabs.length, - (index) => RenovationManageView(index: index,), + (index) => RenovationManageView( + index: index, + ), ), ), ); } -} \ No newline at end of file +}