From ade2438315a82a1518abfed259138c72dbc75ddf Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 10 Nov 2020 10:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/application/applications_page.dart | 70 ++++++++------ lib/ui/home/home_page.dart | 88 +++++++++--------- lib/ui/home/search_workorder_page.dart | 93 +++++++++++++++++++ 3 files changed, 179 insertions(+), 72 deletions(-) create mode 100644 lib/ui/home/search_workorder_page.dart diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index fa693ea..4111574 100644 --- a/lib/ui/home/application/applications_page.dart +++ b/lib/ui/home/application/applications_page.dart @@ -77,33 +77,39 @@ class _ApplicationPageState extends State width: 89.w, child: AkuBackButton(), ), - titleSpacing: 0, - title: Container( - margin: EdgeInsets.only(right: 37.w), - padding: EdgeInsets.symmetric(horizontal: 32.w), - height: 72.w, - child: Row( - children: [ - Image.asset( - R.ASSETS_HOME_IC_SEARCH_PNG, - height: 40.w, - width: 40.w, - ), - AkuBox.w(16), - Text( - '搜索应用', - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 28.sp, - ), - ), - ], - ), - decoration: BoxDecoration( - color: Color(0xFFF9F9F9), - borderRadius: BorderRadius.circular(8.w), - ), + // titleSpacing: 0, + // title: Container( + // margin: EdgeInsets.only(right: 37.w), + // padding: EdgeInsets.symmetric(horizontal: 32.w), + // height: 72.w, + // child: Row( + // children: [ + // Image.asset( + // R.ASSETS_HOME_IC_SEARCH_PNG, + // height: 40.w, + // width: 40.w, + // ), + // AkuBox.w(16), + // Text( + // '搜索应用', + // style: TextStyle( + // color: AppStyle.minorTextColor, + // fontSize: 28.sp, + // ), + // ), + // ], + // ), + // decoration: BoxDecoration( + // color: Color(0xFFF9F9F9), + // borderRadius: BorderRadius.circular(8.w), + // ), + // ), + // ), + title: Text( + '全部应用', + style: AppStyle().barTitleStyle, ), + centerTitle: true, ), body: Column( children: [ @@ -274,11 +280,17 @@ class _ApplicationPageState extends State children: [ Image.asset( application.assetPath, - height: 72.w, - width: 72.w, + height: 60.w, + width: 60.w, ), AkuBox.h(8), - Text(application.name), + Text( + application.name, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold), + ), ], ), ); diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 9761fe6..bafbf27 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -13,6 +13,7 @@ import 'package:aku_community_manager/ui/home/business/business_page.dart'; import 'package:aku_community_manager/ui/home/messages/message.dart'; import 'package:aku_community_manager/ui/home/application/applications_page.dart'; import 'package:aku_community_manager/ui/home/personal_draw.dart'; +import 'package:aku_community_manager/ui/home/search_workorder_page.dart'; import 'package:aku_community_manager/ui/login/login_page.dart'; import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_fix_card.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart'; @@ -206,7 +207,9 @@ class _HomePageState extends State { child: AkuButton( //搜索框按钮 color: Color(0xFFFFFFFF), - onPressed: () {}, + onPressed: () { + Get.to(SearchWorkOrderPage()); + }, radius: 8.w, child: Row(children: [ AkuBox.w(21.w), @@ -398,48 +401,47 @@ class _HomePageState extends State { width: double.infinity, height: 172.w, child: Stack(children: [ - CarouselSlider( - items: _anouncementProvider.anouncementCardModels - .map((e) => AllAnouncementState.anounceCard(e)) - .toList(), - options: CarouselOptions( - viewportFraction: 1.0, - aspectRatio: 686 / 172, - autoPlay: true, - onPageChanged: (index, _) { - setState(() { - _currentIndicator = index; - }); - }, - ), - ), - Positioned( - top: 144.w, - left: 0, - bottom: 16.w, - right: 0, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: - _anouncementProvider.anouncementCardModels.map((e) { - int index = _anouncementProvider.anouncementCardModels - .indexOf(e); - return Container( - width: 12.w, - height: 12.w, - margin: EdgeInsets.symmetric( - horizontal: 12.w), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _currentIndicator == index - ? Color(0xFFFFC40C) - : Color(0xFFE8E8E8), - ), - ); - }).toList(), - ), - ), + CarouselSlider( + items: _anouncementProvider.anouncementCardModels + .map((e) => AllAnouncementState.anounceCard(e)) + .toList(), + options: CarouselOptions( + viewportFraction: 1.0, + aspectRatio: 686 / 172, + autoPlay: true, + onPageChanged: (index, _) { + setState(() { + _currentIndicator = index; + }); + }, + ), + ), + Positioned( + top: 144.w, + left: 0, + bottom: 16.w, + right: 0, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: + _anouncementProvider.anouncementCardModels.map((e) { + int index = + _anouncementProvider.anouncementCardModels.indexOf(e); + return Container( + width: 12.w, + height: 12.w, + margin: EdgeInsets.symmetric(horizontal: 12.w), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _currentIndicator == index + ? Color(0xFFFFC40C) + : Color(0xFFE8E8E8), + ), + ); + }).toList(), + ), + ), ]), ), SizedBox(height: 16.w), diff --git a/lib/ui/home/search_workorder_page.dart b/lib/ui/home/search_workorder_page.dart new file mode 100644 index 0000000..eaad046 --- /dev/null +++ b/lib/ui/home/search_workorder_page.dart @@ -0,0 +1,93 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:aku_community_manager/const/resource.dart'; + +class SearchWorkOrderPage extends StatefulWidget { + SearchWorkOrderPage({Key key}) : super(key: key); + + @override + _SearchWorkOrderpageState createState() => _SearchWorkOrderpageState(); +} + +class _SearchWorkOrderpageState extends State { + TextEditingController _textController; + @override + void initState() { + super.initState(); + _textController = TextEditingController(); + } + + @override + void dispose() { + _textController?.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AkuScaffold( + appBar: AppBar( + brightness: Brightness.light, + elevation: 0, + backgroundColor: Colors.white, + leading: SizedBox( + width: 89.w, + child: AkuBackButton(), + ), + titleSpacing: 0, + title: Container( + margin: EdgeInsets.only(right: 37.w), + padding: EdgeInsets.symmetric(horizontal: 32.w), + height: 72.w, + child: Row( + children: [ + Image.asset( + R.ASSETS_HOME_IC_SEARCH_PNG, + height: 40.w, + width: 40.w, + ), + AkuBox.w(16), + Expanded( + child: TextFormField( + controller: _textController, + decoration: InputDecoration( + hintText: '搜索工单、手机号', + hintStyle: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp, + ), + onChanged: (text) { + setState(() {}); + }, + ), + ), + ], + ), + decoration: BoxDecoration( + color: Color(0xFFF9F9F9), + borderRadius: BorderRadius.circular(8.w), + ), + ), + ), + body: Center( + child: _textController.text.isEmpty + ? SizedBox() + : Text( + '无结果', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 36.sp), + ), + ), + ); + } +}