From cc262b2d53f5118804201b5d8ccd1108c0eb8726 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 11:09:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=8C=89=E9=92=AEUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/settings/settings_page.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ui/settings/settings_page.dart b/lib/ui/settings/settings_page.dart index 543d634..e264d03 100644 --- a/lib/ui/settings/settings_page.dart +++ b/lib/ui/settings/settings_page.dart @@ -61,12 +61,20 @@ class _SettingsPageState extends State { ? Padding( padding: EdgeInsets.symmetric(horizontal: 64.w), child: AkuMaterialButton( + radius: 8.w, color: AppStyle.primaryColor, onPressed: () { userProvider.setisSigned(false); Get.offAll(HomePage()); }, - child: Text('退出登录'), + child: Text( + '退出登录', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontWeight: FontWeight.bold, + fontSize: 32.w, + ), + ), ), ) : SizedBox(), From 1113679ad7f51f7a7db4b7f57c94f0989bad03c8 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 11:47:00 +0800 Subject: [PATCH 2/7] update decoration detail page --- .../decoration_manager_card.dart | 62 ++--- .../decoration_manager_detail_page.dart | 217 ++++++++++++++++++ .../decoration_manager/decoration_util.dart | 58 +++++ 3 files changed, 289 insertions(+), 48 deletions(-) create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_util.dart diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart index 08b36db..c279cde 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart @@ -3,12 +3,15 @@ import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/const/resource.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; class DecorationManagerCard extends StatefulWidget { @@ -45,9 +48,15 @@ class _DecorationManagerCardState extends State { ), Spacer(), Text( - _getTagName(), + DecorationUIUtil(context).getTagName( + widget.model.type, + widget.model.statusType, + ), style: TextStyle( - color: _getTagColor(), + color: DecorationUIUtil(context).getTagColor( + widget.model.type, + widget.model.statusType, + ), fontSize: 24.w, ), ), @@ -83,7 +92,9 @@ class _DecorationManagerCardState extends State { Align( alignment: Alignment.centerRight, child: AkuMaterialButton( - onPressed: () {}, + onPressed: () { + Get.to(DecorationManagerDetailPage(model: widget.model)); + }, height: 64.w, minWidth: 160.w, color: AppStyle.primaryColor, @@ -134,49 +145,4 @@ class _DecorationManagerCardState extends State { ], ); } - - _getTagName() { - Map managerMap = { - DecorationType.WAIT_HAND_OUT: '待指派', - DecorationType.HAND_OUT: '已指派', - DecorationType.DONE: '已执行', - }; - - Map fixerMap = { - DecorationType.HAND_OUT: '待执行', - DecorationType.DONE: '已执行', - }; - - Map defaultMap = { - DecorationStatusType.DONE: '装修完成', - DecorationStatusType.PROGRESS: '装修中', - }; - - switch (role) { - case USER_ROLE.MANAGER: - return managerMap[widget.model.type]; - break; - case USER_ROLE.PROPERTY: - return fixerMap[widget.model.type]; - break; - default: - return defaultMap[widget.model.statusType]; - break; - } - } - - Color _getTagColor() { - if (role == USER_ROLE.MANAGER || role == USER_ROLE.PROPERTY) { - if (widget.model.type == DecorationType.WAIT_HAND_OUT || - widget.model.type == DecorationType.HAND_OUT) { - return Color(0xFFFF4501); - } else - return AppStyle.minorTextColor; - } else { - if (widget.model.statusType == DecorationStatusType.PROGRESS) { - return Color(0xFFFF4501); - } else - return Color(0xFF32B814); - } - } } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart new file mode 100644 index 0000000..33d6ca3 --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart @@ -0,0 +1,217 @@ +import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:aku_community_manager/const/resource.dart'; +import 'package:flutter/material.dart'; + +class DecorationManagerDetailPage extends StatefulWidget { + final DecorationModel model; + DecorationManagerDetailPage({Key key, @required this.model}) + : super(key: key); + + @override + _DecorationManagerDetailStatePage createState() => + _DecorationManagerDetailStatePage(); +} + +class _DecorationManagerDetailStatePage + extends State { + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '装修详情', + body: ListView( + padding: EdgeInsets.symmetric(vertical: 16.w), + children: [ + _buildInfo(), + _buildFinishWorkCheck(), + _buildCycleCheck(), + _buildCheckDetail(), + ], + ), + ); + } + + _buildInfo() { + return AkuTitleBox( + title: '装修信息', + spacing: 24, + suffix: Text( + DecorationUIUtil(context).getTagName( + widget.model.type, + widget.model.statusType, + ), + style: TextStyle( + color: DecorationUIUtil(context).getTagColor( + widget.model.type, + widget.model.statusType, + ), + fontSize: 24.w, + ), + ), + children: [ + _buildInfoCard( + tag: '家', + midTop: widget.model.userHomeModel.plot, + midBottom: widget.model.userHomeModel.detailAddr, + name: '业主:' + widget.model.userHomeModel.userName, + phone: widget.model.userHomeModel.phone, + rightTopWidget: Placeholder(), + ), + AkuBox.h(16), + _buildInfoCard( + tag: '装', + midTop: widget.model.decorationTeamModel.name, + name: '负责人:' + widget.model.decorationTeamModel.userName, + phone: widget.model.decorationTeamModel.phone, + ), + ], + ); + } + + _buildInfoCard({ + String tag, + String midTop, + String midBottom, + String name, + String phone, + Widget rightTopWidget = const SizedBox(), + }) { + return Stack( + children: [ + Container( + child: Column( + children: [ + Expanded( + child: Row( + children: [ + AkuBox.w(32), + Container( + height: 96.w, + width: 96.w, + alignment: Alignment.center, + child: Text( + tag, + style: TextStyle( + color: AppStyle.secondaryColor, + fontWeight: FontWeight.bold, + fontSize: 32.sp, + ), + ), + decoration: BoxDecoration( + color: Color(0xFFE9F2FF), + borderRadius: BorderRadius.circular(48.w), + ), + ), + AkuBox.w(24), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + midTop, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + midBottom == null + ? SizedBox() + : Text( + midBottom, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ], + )), + Divider( + height: 1.w, + thickness: 1.w, + ), + Row( + children: [ + AkuBox.h(88), + AkuBox.w(32), + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + height: 40.w, + width: 40.w, + ), + Text( + name, + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + ), + ), + Spacer(), + Image.asset( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + height: 40.w, + width: 40.w, + ), + Text( + '电话:$phone', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + ), + ), + AkuBox.w(42), + ], + ), + ], + ), + height: 248.w, + decoration: BoxDecoration( + color: Color(0xFFF9F9F9), + borderRadius: BorderRadius.circular(8.w), + ), + ), + Positioned( + top: -30.w, + right: -30.w, + width: 140.w, + height: 140.w, + child: rightTopWidget, + ), + ], + ); + } + + _buildFinishWorkCheck() { + return AkuTitleBox( + title: '完工检查', + spacing: 24, + children: [], + ); + } + + _buildCycleCheck() { + return AkuTitleBox( + title: '周期检查', + spacing: 24, + children: [], + ); + } + + _buildCheckDetail() { + return AkuTitleBox( + title: '执行信息', + spacing: 24, + children: [], + ); + } +} diff --git a/lib/ui/sub_pages/decoration_manager/decoration_util.dart b/lib/ui/sub_pages/decoration_manager/decoration_util.dart new file mode 100644 index 0000000..e939efa --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_util.dart @@ -0,0 +1,58 @@ +import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +import 'package:aku_community_manager/mock_models/users/user_info_model.dart'; +import 'package:aku_community_manager/provider/user_provider.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class DecorationUIUtil { + BuildContext context; + USER_ROLE get role => + Provider.of(context, listen: false).userInfoModel.role; + + DecorationUIUtil(this.context); + String getTagName(DecorationType type, DecorationStatusType statusType) { + Map managerMap = { + DecorationType.WAIT_HAND_OUT: '待指派', + DecorationType.HAND_OUT: '已指派', + DecorationType.DONE: '已执行', + }; + + Map fixerMap = { + DecorationType.HAND_OUT: '待执行', + DecorationType.DONE: '已执行', + }; + + Map defaultMap = { + DecorationStatusType.DONE: '装修完成', + DecorationStatusType.PROGRESS: '装修中', + }; + + switch (role) { + case USER_ROLE.MANAGER: + return managerMap[type]; + break; + case USER_ROLE.PROPERTY: + return fixerMap[type]; + break; + default: + return defaultMap[statusType]; + break; + } + } + + Color getTagColor(DecorationType type, DecorationStatusType statusType) { + if (role == USER_ROLE.MANAGER || role == USER_ROLE.PROPERTY) { + if (type == DecorationType.WAIT_HAND_OUT || + type == DecorationType.HAND_OUT) { + return Color(0xFFFF4501); + } else + return AppStyle.minorTextColor; + } else { + if (statusType == DecorationStatusType.PROGRESS) { + return Color(0xFFFF4501); + } else + return Color(0xFF32B814); + } + } +} From 488c6a2337bd2e1068ae1c1b50950d01055a353f Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 14:25:09 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/manage/circuit.png | Bin 0 -> 2949 bytes assets/manage/security.png | Bin 0 -> 3233 bytes assets/manage/wall.png | Bin 0 -> 1612 bytes assets/manage/waterway.png | Bin 0 -> 1287 bytes assets/manage/window.png | Bin 0 -> 1821 bytes .../decoration/decoration_model.dart | 10 + lib/style/app_style.dart | 10 + .../decoration_check_card_widget.dart | 44 ++++ .../decoration_check_row.dart | 29 +++ .../decoration_checkbox.dart | 109 +++++++++ .../decoration_manager_detail_page.dart | 227 +++++++++++++++++- 11 files changed, 426 insertions(+), 3 deletions(-) create mode 100644 assets/manage/circuit.png create mode 100644 assets/manage/security.png create mode 100644 assets/manage/wall.png create mode 100644 assets/manage/waterway.png create mode 100644 assets/manage/window.png create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_check_row.dart create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_checkbox.dart diff --git a/assets/manage/circuit.png b/assets/manage/circuit.png new file mode 100644 index 0000000000000000000000000000000000000000..f488f4a61fcda05013ab1f23b706ea9aabdc434b GIT binary patch literal 2949 zcmb7G`#;l<_kV429kN7CF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q2lLP+hIo~wzw?=|4;=#HV=2mSqD D^fr5V literal 0 HcmV?d00001 diff --git a/assets/manage/security.png b/assets/manage/security.png new file mode 100644 index 0000000000000000000000000000000000000000..b4f4c6bd4ec115bce44e56e05bf459960458ffe6 GIT binary patch literal 3233 zcma)9`9IVP_y5euHpontT)W9OByPr*HH`>k88ott?Xi`y#W40I8kfgBg~}F<$QGdn zk(n;C-AEIX-56_S8@u%Q{sZ6F^TRpkhjV^7%lmcC`()VJmp*}(YPN)iT{x_6X}^L9G@@=uMwTY%-v5re>KH~m;H~_C*ho!;EpYm(+J4($v9Rr#Is+-qV=GkLxi5I`k(Oa zJZ_bwK8Mn_Hhpu{5ji_M*yd^Erps$vqGw3RI_0Hn^NAR63H((^CAPi1oRxwu)Hal< z59+JJmw;Mgc2+rEsX?t|l98L@I$yrEpYJofecSMVk%u0}gFTH(hOBLD&VuOqxX-fl zcgKSWBOUveXhRdYDFc~khFZc#*Om0M!Vl)==Ej(@Cxspkt00J6Fh|l*T5dRFzB|+S zwO41ll-#zGk!v+bJblw0e&`~c2MhCYb)5(lG}xfmDYG6H=)3{apkn}iXM`t{lo*7^ z8^%UQM@MO~avT-&PF;^dbn@{%R2L08JOlDXn>=khJUSYZk(7*hct*Zjt%^hW-mKoV z`XuowHnGILC3LR3-0E?#gpACRI)ltKC~>NZeNL9Ax#?tx84U!>Lt6i`1m)^4`` z=93cz)2{)qKHG|+8Fg^PP5KjF{hAD{yG&=-@=Gq#W zcG+4X5~Xjp%P&|VO&CbBBBh5E&>+~ZqlG@QXmFO~z2FxWwfDY_@FS*(^eujC`}~R? z6~EnMtAg=9oy0UBz`rOfqwqott>4*L%U!07FIc?X6V@`F8sGm>c0M1|e^mBmqP9Kb z%-4~T$X+&^%>*{2WrkEibfxFHw3_QJLbe8*mHGL9BouGmiNu+9>A=F?_}(HrIV4^f zkU#5bYim0(Sge0*l9k{i0=NZD?5f{^S@MK|;YQ*bR2%p_;*syIH?JMm8#BPY9+`EO zJx7s}F!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.png b/assets/manage/wall.png new file mode 100644 index 0000000000000000000000000000000000000000..244eecf1dfe3581b2436235a0f847fdd90592fb8 GIT binary patch literal 1612 zcmbW2=~t2o6vkgvP$30Wq>|7$O_?;(WNs4%8ZKx`i(!~yI%#U*l2)(j*jsLBg{2uy zBHC)xkGlbKB@zGt z1EvRK*OEs6GkS=n{ai8a1po+RCd1hm3+@Wj>W?}de<+_6lOQD`|@?l$HRjtxLntuAIv)3 z#)P^|X61`FZLPGt`Hu?;Lqg%H?@{0Fqe8i%m}yoVVn^KcN~&d{DxVI+?En!e>7}?k zP`!->HL;iuHxa{zhY!Q83RTPW(1GL~u+&3z@U#DEq$O3mzM%){OCMf=AwFRjY9VEi zO66574V8R3P};La7dXTpPf-PgAkDEK0qKX-)YQCU_GH0!^Y)Ia%~H!u>$S{J)&Nzs znuyOMT8wOoAq2WHMK*PrQ<$!gxF1ebS2V6UQOi9Q7aOYyw034MMO@Ba^CgY!fd8g{=76JM zG^+aHd9!FIW;R-YNaxoXb)o~DS>r`WKn9~<_~cXrsD5F_Q1yXBMKh~(o;ErNXrfo` zvy1nj^KPRdq(_^^T4-N4QLi85XAYE09QJsmfwyV!)^z)M6LK({3g3{{lzBy$1#=J0Gxgis zy@F@KVA5G%7&Z#iX|_JI8go_=j}EgL(1B`-kV_YPlTPNL?pum`AdWgMEPzh{ zOKZz^9iN7XLXJkB|}LcsE=TGTUptQHBeKkA8;Qd?uMGq3$^cW6iXmUy%{MjDC{z| zL}+_NFgrQ;;iiA_@gTX-`J7xP$>;e*C|4@*{Lincr9s2bVq^4d&n9-Ux62X@&T&MY4>ScFO zkbI;X7`GM2(Lbu!Xiu@NavM366H2Pg=2wHzJmYm6ti6LhzobU4IMKzss8KLW=*Q_9 zAkx7S4FmV_K@SG2<|s+VK5e9msOa~s9I!=idGzrbYL`r#1Kd(n_!n>MiCl+6TuM=n zG`@F%x>P37Z~mlUSul8;U0X^cK_h6ltED0QeZ?<0MmkTuL^5JabZW?9Bk>$AEW>{A z9S8ekY1z$@c!Mk0EZjwuY@bvFZs3bRu9n-*^6iYV=I=M%?XKdwg&E_vn&eCR`21Ld zqCrp&^Y@hxy`4Jmc7w^VufnuQHOP%9dD+C0t=AwnqKWw6-#{*4`jnix*KVl|0vM0Y z(w2qOeIDQA{}nNllT=6J8MM62iOUPY`*1zU+7uKCnAZYWH-R#RBj>a;CSd(&IOfK3 zQ%QIENKiv8HX4s*3DukVH%N|HjygbR`+$a%l*27F>Qg6b9c(glT)Wk#DmeB?!`L{! z+Ad>-@L88iFzLIRC&TD3ckS#I2732)yap7v+b&TLn=z6FkZIxSMm}V z0c);zyAQ}_T1uy9V!PvYvzq54PkPmu-lNoQqBu<*uc@0vS*%;TSja7<*;P^?LhBPQ z9GZJSYhLFMcUA=xn&xT)?|Yc;C3omNc=(XrH!x7M_3i#7*Wk-v`wr*(DB)9zK3F;| zEeO;Hq4 uA&uyOU+`}Fa5nOPBeX*6KMGqCRHp=-?sw*wNjghk0${rOFiKnwocSB+`0RH8 literal 0 HcmV?d00001 diff --git a/assets/manage/waterway.png b/assets/manage/waterway.png new file mode 100644 index 0000000000000000000000000000000000000000..1906a070003137570673e69c2eb9dbd1926fbd23 GIT binary patch literal 1287 zcmV+i1^D`jP)gw!{)MxNhw&wMzj+P?QB%Au&@vd!N$Ty5JW_)U?FNF zf>QOvF zz`z#)1cZQr69~L~I1mB`P9X5|;Xnu&IDx>+hXWyC-~<9M9}a|offES4d^ivS22LRG z^5H-T7&w8z%ZCFYVBiD-FW*ZCHk-}UA~NbL+gh#mVP$3Ig%9<4DPR;uABkwE4}c14 zc&?N>?n8YL&`bpg*pC|=sK2V)BD!YAyz;0~ z5xI$7Xk~6hMVlCAexD@CeuF7151E~v-L|&2_7wtFMh5|_APed}5Dx5>76KM5ceKzd zeV{8A?}7U8;6OM~f3@gF_Hp1JB3jm+XOnRa5jlcgr~yTsh3Z2Ks)g#`*1#ii5@T`_ zGjLh-6F@)+sJ~kJMWTh8afAcmK(m$8J<3Z5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HcmV?d00001 diff --git a/assets/manage/window.png b/assets/manage/window.png new file mode 100644 index 0000000000000000000000000000000000000000..eaa7c05a716869e50597863c5bf0807c9e46b7d7 GIT binary patch literal 1821 zcmai#c{JOJ7RM7ys>D;jM%9fwTzNb2dxyfwZofp-aqe;_s6~WpU=79d%pMFb7?Nl_R^9{k`M?) z+TjA|dRTuv3JKU@el_>W5dwiNIDoe9H~+cn=XBlOL(W>z9;d@pcNJ5oezx0B$tk-* zwm5jMWa1N;NwXyumeGtNiOo?Jg`77zVe=zlnaab8emO;f;uwc;J>iT_y8e)Nvde9x zjLwtQ7`{q0GYwtRB#fTDb}BJX2HCc4DM*^NoV5%^Kg<-v!fIKA_qwD+b?jf% zdrnG_c57`U6#oUomRjq|h@=&#zqY%(o2KxX(n4MG1NMJ^=&czt^NzcwN2b;o(cQ~n1kG>ju;m}bFcplQs}F^Q zx|xewqpJls@#3E_4*r7!lmtI4fBgnwax4~_VLWhxx8J(L4eth>lZ-Po`ikRi`4lQ_gzc)>0%8l^EG7B^3wT2hV{CD6f zYL9bAF5Gh*32-d~wdIHb<>A1eX zF4L!=Z;`B*^@0~loEV??+-!*OB}8Q6D;!6cKi%{w8#SG5I=~ zgx^x4K`m{z%RjT3ht`#m_r~{^({{3<@Qs24W6xeh*d~GBj=~Xb%`mL_Z5u6j&zWcQmLsguzJCe+g30V zd?VUJx?Rd(&}}I77b)C-_%IUrN}&9I$$)YunqsT^H_hCA#oIiR`5SKh0d>?Yp!_$N zqrqHZhCO@6J@K)zb)}`H!8?gx5>H>=x7NmYXmtx)D-L(`Xyo2}(N1_$Lc-p!A3uH! zK}=#nWn7R3Vj2%l4934#$8^Zhz;EDi_`d7u=PD{Hu^Jj0rkGi6poJDT`42^(&dVWR z@~COxg7(3AM3OumUlL<+?ww65+p{wWO{x%(N`MUtwUWBDMd(E}e6bI)uFSV^(UIeZ zvK6PACcb5mO@we0io`aL7#=OnVDIf$MFlG0@F1Cw{RIjW0{Qv znZ~hp$b>EF5FQ=Oltru8Ae!=rwyq!HCCeNIaMS6ftsS-EW2p10%F33$=6;p4 z4?h?nlI+3VuDx{)M$crJ@lTQOW2+7==)>FFd+AhpDoBbSTpU%YB$v+U0iNtnk1Z90}PUE>ozLbIL|w(?t=`0LnMwW+4fy#Qsw@!g-vLl~g|j2Vh5c3afC(#ol-3f}DMx!-(Y1J~-=Y~SRC9>&RT zSFePF(e0B6Lu5wVX#j=P?&4|V7VJXEv$50lPMX9_#s$sDO{?`_;3qt&l>UWtQ|eNSs&=;^)?&UKiycpqn`Oi4*HcMh$K0 zR%v!2>ArQ{bbVI_%1Sl6e)uedYJ~;+SUa*IQXL_>+N(oq|Px_?>By%R8Kf3%VgAO_Em z6h2ogBRPxW?od)jBCHj~j0eNZs4|8w-2P*?DSUHjIfMv|@N~ytX2_~01;BRNESsK! pixdfrT|fy%ooW7U+y52$D*mC7*tfQwCw2JtAPzWZkc0KV^%viLTp$1d literal 0 HcmV?d00001 diff --git a/lib/mock_models/decoration/decoration_model.dart b/lib/mock_models/decoration/decoration_model.dart index 091bcbc..4e6049d 100644 --- a/lib/mock_models/decoration/decoration_model.dart +++ b/lib/mock_models/decoration/decoration_model.dart @@ -1,5 +1,6 @@ import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; import 'package:flutter/material.dart'; +import 'package:aku_community_manager/const/resource.dart'; enum DecorationType { ///待指派 @@ -41,6 +42,14 @@ Map checkTypeStringMap = { '安防': CHECK_TYPE.SECURITY, }; +Map checkAssetMap = { + CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG, + CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG, + CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG, + CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG, + CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG, +}; + class DecorationModel { DecorationType type; DecorationStatusType statusType; @@ -152,6 +161,7 @@ class CheckInfomation { class CheckDetail { CHECK_TYPE type; bool status; + String get assetpath => checkAssetMap[type]; CheckDetail({ @required this.type, this.status = true, diff --git a/lib/style/app_style.dart b/lib/style/app_style.dart index abf1225..05536e0 100644 --- a/lib/style/app_style.dart +++ b/lib/style/app_style.dart @@ -20,6 +20,16 @@ class AppStyle { ///背景色 static const backgroundColor = Color(0xFFF9F9F9); + ///成功色 + static const successColor = Color(0xFF32B814); + + static const subSuccessColor = Color(0xFFE5FFDF); + + ///失败色 + static const failColor = Color(0xFFFF4501); + + static const subFailColor = Color(0xFFFFE5DB); + ///字体格式 final barTitleStyle = TextStyle( color: primaryTextColor, diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart new file mode 100644 index 0000000..56c79dd --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart @@ -0,0 +1,44 @@ +import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; + +class DecorationCheckCardWidget extends StatelessWidget { + final CHECK_TYPE type; + const DecorationCheckCardWidget({Key key, @required this.type}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + height: 160.w, + width: 124.w, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + checkAssetMap[type], + height: 56.w, + width: 56.w, + ), + AkuBox.h(4), + Text( + checkTypeMap[type], + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 24.sp, + ), + ), + ], + ), + decoration: BoxDecoration( + border: Border.all( + color: Color(0xFFE8E8E8), + width: 3.w, + ), + borderRadius: BorderRadius.circular(8.w), + ), + ); + } +} diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart new file mode 100644 index 0000000..719a524 --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart @@ -0,0 +1,29 @@ +import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:flutter/material.dart'; + +class DecorationCheckRow extends StatelessWidget { + final List details; + const DecorationCheckRow({Key key, @required this.details}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: 160.w, + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) { + return DecorationCheckCardWidget( + type: details[index], + ); + }, + itemCount: details.length, + separatorBuilder: (context, index) { + return AkuBox.w(16); + }, + ), + ); + } +} diff --git a/lib/ui/sub_pages/decoration_manager/decoration_checkbox.dart b/lib/ui/sub_pages/decoration_manager/decoration_checkbox.dart new file mode 100644 index 0000000..e5978b3 --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_checkbox.dart @@ -0,0 +1,109 @@ +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:flutter/material.dart'; + +class DecorationCheckBox extends StatefulWidget { + final bool initValue; + final Function(bool state) onChange; + DecorationCheckBox({Key key, this.initValue = true, this.onChange}) + : super(key: key); + + @override + _DecorationCheckBoxState createState() => _DecorationCheckBoxState(); +} + +class _DecorationCheckBoxState extends State { + bool _nowValue; + @override + void initState() { + super.initState(); + _nowValue = widget.initValue; + } + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + _buildBox( + rawChecked: true, + color: AppStyle.successColor, + subColor: AppStyle.subSuccessColor, + title: '正常', + icon: Icons.check, + ), + AkuBox.w(56), + _buildBox( + rawChecked: false, + color: AppStyle.failColor, + subColor: AppStyle.subFailColor, + title: '异常', + icon: Icons.check, + ), + ], + ); + } + + _buildBox( + {bool rawChecked, + Color color, + Color subColor, + String title, + IconData icon}) { + final checked = _nowValue == rawChecked; + return GestureDetector( + onTap: widget.onChange == null + ? null + : () { + setState(() { + _nowValue = rawChecked; + }); + widget.onChange(_nowValue); + }, + child: Material( + color: Colors.transparent, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + AnimatedContainer( + height: 40.w, + width: 40.w, + curve: Curves.easeInOutCubic, + child: _buildIcon(icon, color, checked), + duration: Duration(milliseconds: 300), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.w), + border: Border.all( + color: checked ? color : Color(0xFFE8E8E8), + ), + color: checked ? subColor : subColor.withOpacity(0), + ), + ), + AkuBox.w(16), + AkuBox.h(96), + _buildText(title, color, checked), + ], + ), + ), + ); + } + + _buildText(String title, Color color, bool checked) { + return Text( + title, + style: TextStyle( + color: checked ? color : AppStyle.minorTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold, + ), + ); + } + + _buildIcon(IconData icon, Color color, bool checked) { + return Icon( + icon, + color: checked ? color : Color(0xFFE8E8E8), + size: 32.w, + ); + } +} diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart index 33d6ca3..66a9b88 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart @@ -1,11 +1,15 @@ import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/const/resource.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class DecorationManagerDetailPage extends StatefulWidget { @@ -195,7 +199,40 @@ class _DecorationManagerDetailStatePage return AkuTitleBox( title: '完工检查', spacing: 24, - children: [], + children: [ + _buildRow( + title: '开始装修时间', + subTitle: DateUtil.formatDate( + widget.model.workFinishCheck.decorationDate, + format: 'yyyy-MM-dd', + ), + ), + _buildRow( + title: '接受人', + subTitle: widget.model.workFinishCheck.authPerson.name, + ), + _buildRow(title: '所属项目', subTitle: '装修管理'), + _buildRow( + title: '开始日期', + subTitle: DateUtil.formatDate( + widget.model.workFinishCheck.startDate, + format: 'yyyy-MM-dd', + ), + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 28.w, + ), + child: Text( + '检查内容', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + ), + ), + ), + DecorationCheckRow(details: widget.model.workFinishCheck.checkDetails), + ], ); } @@ -203,7 +240,40 @@ class _DecorationManagerDetailStatePage return AkuTitleBox( title: '周期检查', spacing: 24, - children: [], + children: [ + _buildRow( + title: '开始装修时间', + subTitle: DateUtil.formatDate( + widget.model.cycleCheck.decorationDate, + format: 'yyyy-MM-dd', + ), + ), + _buildRow( + title: '接受人', + subTitle: widget.model.cycleCheck.authPerson.name, + ), + _buildRow(title: '所属项目', subTitle: '装修管理'), + _buildRow( + title: '开始日期', + subTitle: DateUtil.formatDate( + widget.model.cycleCheck.startDate, + format: 'yyyy-MM-dd', + ), + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 28.w, + ), + child: Text( + '检查内容', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + ), + ), + ), + DecorationCheckRow(details: widget.model.cycleCheck.checkDetails), + ], ); } @@ -211,7 +281,158 @@ class _DecorationManagerDetailStatePage return AkuTitleBox( title: '执行信息', spacing: 24, - children: [], + children: widget.model.checkInfomations.map((e) { + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Color(0xFFE8E8E8), + width: 1.w, + ), + ), + ), + child: ExpandablePanel( + theme: ExpandableThemeData( + tapHeaderToExpand: true, + iconPlacement: ExpandablePanelIconPlacement.right, + iconPadding: EdgeInsets.only(top: 32.w), + iconSize: 32.w, + iconColor: AppStyle.minorTextColor, + ), + header: Row( + children: [ + AkuBox.h(96), + Text( + '${DateUtil.formatDate(e.checkDate, format: 'yyyy-MM-dd')} ' + + e.checkType, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontWeight: FontWeight.bold, + fontSize: 28.sp, + ), + ), + Spacer(), + Text( + e.checkAllResult ? '正常' : '异常', + style: TextStyle( + color: e.checkAllResult + ? Color(0xFF32B814) + : Color(0xFFFF4501), + fontSize: 28.sp, + ), + ), + ], + ), + expanded: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ...e.details.map((e) { + return Container( + height: 96.w, + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Color(0xFFE8E8E8), + width: 1.w, + ), + ), + ), + child: Row( + children: [ + AkuBox.w(48), + Image.asset( + e.assetpath, + height: 40.w, + ), + Text( + e.typeValue, + style: TextStyle( + fontSize: 28.sp, + color: AppStyle.primaryTextColor, + fontWeight: FontWeight.bold, + ), + ), + Spacer(), + DecorationCheckBox( + initValue: e.status, + ), + Spacer(), + ], + ), + ); + }).toList(), + Container( + decoration: BoxDecoration( + border: Border( + top: BorderSide( + width: 1.w, + color: Color(0xFFE8E8E8), + ), + ), + ), + height: 96.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + alignment: Alignment.centerLeft, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: '检查描述:', + style: TextStyle( + color: AppStyle.minorTextColor, + ), + ), + TextSpan( + text: e.info, + ), + ], + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + ), + ), + ), + ), + ], + ), + ), + ); + }).toList(), + ); + } + + _buildRow({ + String title, + String subTitle, + }) { + return Container( + decoration: BoxDecoration( + border: + Border(bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)), + ), + child: InkWell( + child: Row( + children: [ + AkuBox.h(96), + Text( + title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + ), + ), + Spacer(), + Text( + subTitle, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), ); } } From ffd34620f6783e57b66ba3f64f59713293c5fd77 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 14:33:30 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=AB=E4=B8=80?= =?UTF-8?q?=E6=89=AB=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/tool_pages/scan_page.dart | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/ui/tool_pages/scan_page.dart b/lib/ui/tool_pages/scan_page.dart index cd7c3c7..429bd06 100644 --- a/lib/ui/tool_pages/scan_page.dart +++ b/lib/ui/tool_pages/scan_page.dart @@ -1,3 +1,5 @@ +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; @@ -12,6 +14,7 @@ class ScanPage extends StatefulWidget { class _ScanPageState extends State { GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); QRViewController _qrViewController; + String tempText; @override void dispose() { @@ -29,7 +32,10 @@ class _ScanPageState extends State { onQRViewCreated: (controller) { _qrViewController = controller; controller.scannedDataStream.listen((event) { - BotToast.showText(text: event); + if (tempText != event) { + tempText = event; + BotToast.showText(text: event); + } }); }, ), @@ -38,6 +44,7 @@ class _ScanPageState extends State { height: 200, width: 200, decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), border: Border.all( color: Colors.red, width: 1, @@ -45,6 +52,15 @@ class _ScanPageState extends State { ), ), ), + Positioned( + left: 10, + top: 10 + statusBarHeight, + child: Material( + color: Colors.black45, + borderRadius: BorderRadius.circular(40), + child: AkuBackButton.close(brightness: Brightness.dark), + ), + ), ], ), ); From 0bdb559a0959f116b3360017d29b3b99817b6338 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 14:39:55 +0800 Subject: [PATCH 5/7] qr page add animated bar --- lib/ui/tool_pages/scan_page.dart | 48 ++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/lib/ui/tool_pages/scan_page.dart b/lib/ui/tool_pages/scan_page.dart index 429bd06..ac7ebaf 100644 --- a/lib/ui/tool_pages/scan_page.dart +++ b/lib/ui/tool_pages/scan_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -15,10 +17,24 @@ class _ScanPageState extends State { GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); QRViewController _qrViewController; String tempText; + Timer _timer; + bool _barMove = false; + + @override + void initState() { + super.initState(); + _timer = Timer.periodic(Duration(milliseconds: 1000), (timer) { + if (mounted) + setState(() { + _barMove = !_barMove; + }); + }); + } @override void dispose() { _qrViewController?.dispose(); + _timer?.cancel(); super.dispose(); } @@ -40,16 +56,30 @@ class _ScanPageState extends State { }, ), Center( - child: Container( - height: 200, - width: 200, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: Colors.red, - width: 1, + child: Stack( + children: [ + Container( + height: 200, + width: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: Colors.red, + width: 1, + ), + ), + ), + AnimatedPositioned( + top: _barMove ? 10 : 190, + child: Container( + width: 200, + height: 2, + color: Colors.red, + ), + curve: Curves.easeInOutCubic, + duration: Duration(milliseconds: 300), ), - ), + ], ), ), Positioned( From deb19085ebf97d4076ae9128ace6f66df402ccb1 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 15:03:10 +0800 Subject: [PATCH 6/7] update decoration model --- .../decoration/decoration_data.dart | 20 ++++++-- .../decoration/decoration_model.dart | 8 +--- .../decoration_check_card_widget.dart | 7 ++- .../decoration_check_row.dart | 48 ++++++++++++++++--- .../decoration_manager_card.dart | 2 +- .../decoration_manager_detail_page.dart | 9 ++-- 6 files changed, 73 insertions(+), 21 deletions(-) diff --git a/lib/mock_models/decoration/decoration_data.dart b/lib/mock_models/decoration/decoration_data.dart index 73344b0..bc321b3 100644 --- a/lib/mock_models/decoration/decoration_data.dart +++ b/lib/mock_models/decoration/decoration_data.dart @@ -4,6 +4,23 @@ import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; class DecorationData { static List allModels = [ DecorationModel( + type: DecorationType.WAIT_HAND_OUT, + statusType: DecorationStatusType.PROGRESS, + decorationDate: DateTime(2020, 1, 23, 12, 23, 0), + userHomeModel: UserHomeModel( + userName: '林居明', + plot: '深圳华茂悦峰', + detailAddr: '2幢-2单元-501室', + phone: '19995430126', + ), + decorationTeamModel: DecorationTeamModel( + name: '深圳莫川装修有限公司', + userName: '李惠政', + phone: '19298540192', + ), + ), + DecorationModel( + decorationDate: DateTime(2020, 1, 23, 12, 23, 0), type: DecorationType.DONE, statusType: DecorationStatusType.DONE, userHomeModel: UserHomeModel( @@ -11,7 +28,6 @@ class DecorationData { plot: '深圳华茂悦峰', detailAddr: '1幢-1单元-302室', phone: '18201939840', - decorationStatus: false, ), decorationTeamModel: DecorationTeamModel( name: '深圳莫川装修有限公司', @@ -19,7 +35,6 @@ class DecorationData { phone: '19298540192', ), cycleCheck: CycleCheck( - decorationDate: DateTime(2020, 1, 23, 12, 23, 0), authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), startDate: DateTime(2020, 1, 23, 20, 23, 0), checkCycle: 7, @@ -31,7 +46,6 @@ class DecorationData { ], ), workFinishCheck: WorkFinishCheck( - decorationDate: DateTime(2020, 1, 23, 12, 23, 0), authPerson: FixerModel(name: '林鸿章', phone: '18294859301'), startDate: DateTime(2020, 1, 23, 20, 23, 0), checkDetails: [ diff --git a/lib/mock_models/decoration/decoration_model.dart b/lib/mock_models/decoration/decoration_model.dart index 4e6049d..5ebf0eb 100644 --- a/lib/mock_models/decoration/decoration_model.dart +++ b/lib/mock_models/decoration/decoration_model.dart @@ -53,6 +53,7 @@ Map checkAssetMap = { class DecorationModel { DecorationType type; DecorationStatusType statusType; + DateTime decorationDate; UserHomeModel userHomeModel; DecorationTeamModel decorationTeamModel; CycleCheck cycleCheck; @@ -71,6 +72,7 @@ class DecorationModel { @required this.statusType, @required this.userHomeModel, @required this.decorationTeamModel, + @required this.decorationDate, this.cycleCheck, this.workFinishCheck, this.checkInfomations, @@ -83,13 +85,11 @@ class UserHomeModel { String detailAddr; String userName; String phone; - bool decorationStatus; UserHomeModel({ this.plot, this.detailAddr, this.userName, this.phone, - this.decorationStatus, }); } @@ -107,7 +107,6 @@ class DecorationTeamModel { ///周期检查 class CycleCheck { - DateTime decorationDate; FixerModel authPerson; DateTime startDate; @@ -115,7 +114,6 @@ class CycleCheck { int checkCycle; List checkDetails; CycleCheck({ - this.decorationDate, this.authPerson, this.startDate, this.checkCycle, @@ -124,12 +122,10 @@ class CycleCheck { } class WorkFinishCheck { - DateTime decorationDate; FixerModel authPerson; DateTime startDate; List checkDetails; WorkFinishCheck({ - this.decorationDate, this.authPerson, this.startDate, this.checkDetails, diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart index 56c79dd..a8aa760 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart @@ -6,7 +6,9 @@ import 'package:aku_community_manager/tools/screen_tool.dart'; class DecorationCheckCardWidget extends StatelessWidget { final CHECK_TYPE type; - const DecorationCheckCardWidget({Key key, @required this.type}) + final bool checked; + const DecorationCheckCardWidget( + {Key key, @required this.type, this.checked = false}) : super(key: key); @override @@ -34,10 +36,11 @@ class DecorationCheckCardWidget extends StatelessWidget { ), decoration: BoxDecoration( border: Border.all( - color: Color(0xFFE8E8E8), + color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8), width: 3.w, ), borderRadius: BorderRadius.circular(8.w), + color: checked ? Color(0xFFFFF3CC) : Colors.white, ), ); } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart index 719a524..43514c1 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart @@ -1,12 +1,31 @@ import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart'; -import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:flutter/material.dart'; -class DecorationCheckRow extends StatelessWidget { +import 'package:aku_community_manager/tools/screen_tool.dart'; + +class DecorationCheckRow extends StatefulWidget { final List details; - const DecorationCheckRow({Key key, @required this.details}) : super(key: key); + final Function(List details) onChange; + DecorationCheckRow({Key key, @required this.details, this.onChange}) + : super(key: key); + + @override + _DecorationCheckRowState createState() => _DecorationCheckRowState(); +} + +class _DecorationCheckRowState extends State { + List _tempCheckDetails = []; + List _checkedDetails = []; + @override + void initState() { + super.initState(); + _tempCheckDetails = widget.details; + widget.details.forEach((element) { + _checkedDetails.add(element); + }); + } @override Widget build(BuildContext context) { @@ -15,11 +34,28 @@ class DecorationCheckRow extends StatelessWidget { child: ListView.separated( scrollDirection: Axis.horizontal, itemBuilder: (context, index) { - return DecorationCheckCardWidget( - type: details[index], + return GestureDetector( + onTap: widget.onChange == null + ? null + : () { + setState(() { + _checkedDetails.indexOf(_tempCheckDetails[index]) != -1 + ? _checkedDetails.remove(_tempCheckDetails[index]) + : _checkedDetails.add(_tempCheckDetails[index]); + }); + }, + child: Material( + color: Colors.transparent, + child: DecorationCheckCardWidget( + type: _tempCheckDetails[index], + checked: widget.onChange == null + ? false + : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1, + ), + ), ); }, - itemCount: details.length, + itemCount: _tempCheckDetails.length, separatorBuilder: (context, index) { return AkuBox.w(16); }, diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart index c279cde..1072249 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_card.dart @@ -38,7 +38,7 @@ class _DecorationManagerCardState extends State { AkuBox.w(16), Text( DateUtil.formatDate( - widget.model.cycleCheck.decorationDate, + widget.model.decorationDate, format: 'yyyy-MM-dd HH:mm:ss', ), style: TextStyle( diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart index 66a9b88..e2fa350 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart @@ -203,7 +203,7 @@ class _DecorationManagerDetailStatePage _buildRow( title: '开始装修时间', subTitle: DateUtil.formatDate( - widget.model.workFinishCheck.decorationDate, + widget.model.decorationDate, format: 'yyyy-MM-dd', ), ), @@ -231,7 +231,10 @@ class _DecorationManagerDetailStatePage ), ), ), - DecorationCheckRow(details: widget.model.workFinishCheck.checkDetails), + DecorationCheckRow( + details: widget.model.workFinishCheck.checkDetails, + onChange: (details) {}, + ), ], ); } @@ -244,7 +247,7 @@ class _DecorationManagerDetailStatePage _buildRow( title: '开始装修时间', subTitle: DateUtil.formatDate( - widget.model.cycleCheck.decorationDate, + widget.model.decorationDate, format: 'yyyy-MM-dd', ), ), From 4bbf39baba746deb1cde4370b7ffb542ab25d0e0 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 16:18:18 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E7=82=B9=E5=87=BB=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 14 +- .../decoration/decoration_data.dart | 1 + lib/mock_models/fix/fixer_model.dart | 15 ++ lib/provider/fix_provider.dart | 2 + .../decoration_check_row.dart | 9 +- .../decoration_department_page.dart | 188 +++++++++++++ .../decoration_manager_detail_page.dart | 253 +++++++++++++++--- lib/ui/widgets/inner/show_bottom_sheet.dart | 60 +++-- pubspec.lock | 12 + pubspec.yaml | 2 + 10 files changed, 492 insertions(+), 64 deletions(-) create mode 100644 lib/ui/sub_pages/decoration_manager/decoration_department_page.dart diff --git a/lib/main.dart b/lib/main.dart index 9206018..ffb8505 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,7 +4,9 @@ import 'package:aku_community_manager/provider/manage_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/ui/home/home_page.dart'; import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; @@ -21,8 +23,8 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider(create: (context) => UserProvider()), ChangeNotifierProvider(create: (context) => AppProvider()), ChangeNotifierProvider(create: (context) => FixProvider()), - ChangeNotifierProvider(create: (context)=> GreenManageProvider()), - ChangeNotifierProvider(create: (context)=>InspectionManageProvider()), + ChangeNotifierProvider(create: (context) => GreenManageProvider()), + ChangeNotifierProvider(create: (context) => InspectionManageProvider()), ], child: GetMaterialApp( title: '小蜜蜂管家', @@ -31,6 +33,14 @@ class MyApp extends StatelessWidget { navigatorObservers: [ BotToastNavigatorObserver(), ], + localizationsDelegates: [ + GlobalCupertinoLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + supportedLocales: [ + const Locale('zh'), + ], ), ); } diff --git a/lib/mock_models/decoration/decoration_data.dart b/lib/mock_models/decoration/decoration_data.dart index bc321b3..e607017 100644 --- a/lib/mock_models/decoration/decoration_data.dart +++ b/lib/mock_models/decoration/decoration_data.dart @@ -18,6 +18,7 @@ class DecorationData { userName: '李惠政', phone: '19298540192', ), + cycleCheck: CycleCheck(), ), DecorationModel( decorationDate: DateTime(2020, 1, 23, 12, 23, 0), diff --git a/lib/mock_models/fix/fixer_model.dart b/lib/mock_models/fix/fixer_model.dart index dbf0528..1c8834b 100644 --- a/lib/mock_models/fix/fixer_model.dart +++ b/lib/mock_models/fix/fixer_model.dart @@ -7,6 +7,9 @@ enum FIXER_TYPE { ///水泥组 CEMENT, + + ///物业组 + PROPERTY, } class FixerModel { @@ -28,6 +31,8 @@ class FixerTypedModel { case FIXER_TYPE.CEMENT: return '水泥组'; break; + case FIXER_TYPE.PROPERTY: + return '物业组'; default: return ''; } @@ -66,4 +71,14 @@ class FixerTypedModel { ], ), ]; + + static List propertyModels = [ + FixerTypedModel( + type: FIXER_TYPE.PROPERTY, + fixers: [ + FixerModel(name: '李国师傅', phone: '18923747283'), + FixerModel(name: '章则林师傅', phone: '18910298345'), + ], + ), + ]; } diff --git a/lib/provider/fix_provider.dart b/lib/provider/fix_provider.dart index 7a91953..9633809 100644 --- a/lib/provider/fix_provider.dart +++ b/lib/provider/fix_provider.dart @@ -58,5 +58,7 @@ class FixProvider extends ChangeNotifier { } List _fixerModels = FixerTypedModel.models; + List _propertyModels = FixerTypedModel.propertyModels; List get fixerModels => _fixerModels; + List get propertyModels => _propertyModels; } diff --git a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart index 43514c1..3fcaf9e 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_check_row.dart @@ -8,7 +8,9 @@ import 'package:aku_community_manager/tools/screen_tool.dart'; class DecorationCheckRow extends StatefulWidget { final List details; final Function(List details) onChange; - DecorationCheckRow({Key key, @required this.details, this.onChange}) + final bool canTap; + DecorationCheckRow( + {Key key, @required this.details, this.onChange, this.canTap = false}) : super(key: key); @override @@ -35,9 +37,10 @@ class _DecorationCheckRowState extends State { scrollDirection: Axis.horizontal, itemBuilder: (context, index) { return GestureDetector( - onTap: widget.onChange == null + onTap: !widget.canTap ? null : () { + widget.onChange(_checkedDetails); setState(() { _checkedDetails.indexOf(_tempCheckDetails[index]) != -1 ? _checkedDetails.remove(_tempCheckDetails[index]) @@ -48,7 +51,7 @@ class _DecorationCheckRowState extends State { color: Colors.transparent, child: DecorationCheckCardWidget( type: _tempCheckDetails[index], - checked: widget.onChange == null + checked: !widget.canTap ? false : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1, ), diff --git a/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart new file mode 100644 index 0000000..c981799 --- /dev/null +++ b/lib/ui/sub_pages/decoration_manager/decoration_department_page.dart @@ -0,0 +1,188 @@ +import 'package:aku_community_manager/const/resource.dart'; +import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; +import 'package:aku_community_manager/mock_models/fix/fix_model.dart'; +import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; +import 'package:aku_community_manager/provider/fix_provider.dart'; +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_scaffold.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:aku_ui/common_widgets/aku_material_button.dart'; +import 'package:expandable/expandable.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; + +class DecorationDepartmentPage extends StatefulWidget { + final DecorationModel model; + DecorationDepartmentPage({Key key, @required this.model}) : super(key: key); + + @override + _DecorationDepartmentPageState createState() => + _DecorationDepartmentPageState(); +} + +class _DecorationDepartmentPageState extends State { + FixerModel _pickedFixer; + @override + Widget build(BuildContext context) { + final fixProvider = Provider.of(context); + + return AkuScaffold( + title: '装修指派', + body: ListView.builder( + padding: EdgeInsets.symmetric(vertical: 16.w), + itemBuilder: (context, index) { + return _buildItem(fixProvider.propertyModels[index], index); + }, + itemCount: fixProvider.propertyModels.length, + ), + bottom: AkuMaterialButton( + height: 96.w, + onPressed: _pickedFixer == null + ? null + : () { + widget.model.cycleCheck.authPerson = _pickedFixer; + Get.back(); + }, + color: AppStyle.primaryColor, + nullColor: AppStyle.primaryColor.withOpacity(0.5), + child: Text( + '选择完成', + style: TextStyle( + color: _pickedFixer == null + ? AppStyle.minorTextColor + : AppStyle.primaryTextColor, + fontSize: 32.w, + fontWeight: FontWeight.bold, + ), + ), + ), + ); + } + + _buildItem(FixerTypedModel model, int index) { + return Container( + decoration: BoxDecoration( + border: Border( + top: index == 0 + ? BorderSide.none + : BorderSide(color: Color(0xFFE8E8E8), width: 1.w), + bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w), + ), + ), + child: Material( + color: Colors.white, + child: ExpandablePanel( + controller: ExpandableController(initialExpanded: true), + header: Container( + height: 96.w, + alignment: Alignment.centerLeft, + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: Text( + model.typeName, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + collapsed: SizedBox(), + expanded: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Divider( + color: Color(0xFFE8E8E8), + height: 1.w, + thickness: 1.w, + ), + ...model.fixers.map((e) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + AkuMaterialButton( + height: 96.w, + onPressed: () { + if (_pickedFixer?.name != e.name) { + _pickedFixer = e; + } else { + _pickedFixer = null; + } + setState(() {}); + }, + child: Row( + children: [ + AkuBox.w(72), + Checkbox( + checkColor: AppStyle.primaryTextColor, + activeColor: AppStyle.primaryColor, + value: _pickedFixer?.name == e.name, + onChanged: (state) { + if (_pickedFixer == null) { + _pickedFixer = e; + } else { + _pickedFixer = null; + } + setState(() {}); + }, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + height: 40.w, + width: 40.w, + ), + Text( + e.name, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + Spacer(), + Image.asset( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + height: 40.w, + width: 40.w, + ), + Text( + e.phone, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + AkuBox.w(101), + ], + ), + ), + model.fixers.last == e + ? SizedBox() + : Divider( + indent: 32.w, + endIndent: 32.w, + height: 1.w, + thickness: 1.w, + color: Color(0xFFE8E8E8), + ), + ], + ); + }).toList() + ], + ), + theme: ExpandableThemeData( + tapHeaderToExpand: true, + iconPlacement: ExpandablePanelIconPlacement.right, + iconPadding: EdgeInsets.only(top: 32.w, right: 32.w), + iconSize: 32.w, + iconColor: AppStyle.minorTextColor, + ), + ), + ), + ); + } +} diff --git a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart index e2fa350..e44f94b 100644 --- a/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart +++ b/lib/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart @@ -3,14 +3,20 @@ import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; +import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_department_page.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.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:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/const/resource.dart'; +import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart'; +import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:common_utils/common_utils.dart'; import 'package:expandable/expandable.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:get/get.dart'; class DecorationManagerDetailPage extends StatefulWidget { final DecorationModel model; @@ -24,6 +30,7 @@ class DecorationManagerDetailPage extends StatefulWidget { class _DecorationManagerDetailStatePage extends State { + bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT; @override Widget build(BuildContext context) { return AkuScaffold( @@ -32,9 +39,13 @@ class _DecorationManagerDetailStatePage padding: EdgeInsets.symmetric(vertical: 16.w), children: [ _buildInfo(), - _buildFinishWorkCheck(), + widget.model.workFinishCheck == null + ? SizedBox() + : _buildFinishWorkCheck(), _buildCycleCheck(), - _buildCheckDetail(), + widget.model.type == DecorationType.WAIT_HAND_OUT + ? SizedBox() + : _buildCheckDetail(), ], ), ); @@ -209,13 +220,13 @@ class _DecorationManagerDetailStatePage ), _buildRow( title: '接受人', - subTitle: widget.model.workFinishCheck.authPerson.name, + subTitle: widget.model.workFinishCheck?.authPerson?.name, ), _buildRow(title: '所属项目', subTitle: '装修管理'), _buildRow( title: '开始日期', subTitle: DateUtil.formatDate( - widget.model.workFinishCheck.startDate, + widget.model.workFinishCheck?.startDate, format: 'yyyy-MM-dd', ), ), @@ -232,7 +243,7 @@ class _DecorationManagerDetailStatePage ), ), DecorationCheckRow( - details: widget.model.workFinishCheck.checkDetails, + details: widget.model.workFinishCheck?.checkDetails, onChange: (details) {}, ), ], @@ -253,15 +264,164 @@ class _DecorationManagerDetailStatePage ), _buildRow( title: '接受人', - subTitle: widget.model.cycleCheck.authPerson.name, + subTitle: widget.model.cycleCheck?.authPerson?.name, + onTap: isWaitHandOut + ? () { + Get.to(DecorationDepartmentPage( + model: widget.model, + )).then((value) => setState(() {})); + } + : null, ), _buildRow(title: '所属项目', subTitle: '装修管理'), _buildRow( title: '开始日期', subTitle: DateUtil.formatDate( - widget.model.cycleCheck.startDate, + widget.model.cycleCheck?.startDate, format: 'yyyy-MM-dd', ), + onTap: isWaitHandOut + ? () { + showAkuSheet( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + AkuBox.h(96), + AkuBackButton.text(), + Spacer(), + Text( + '开始日期', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + Spacer(), + AkuMaterialButton( + minWidth: (64 + 56).w, + onPressed: () { + Get.back(); + }, + child: Text( + '确定', + style: TextStyle( + color: AppStyle.secondaryColor, + fontSize: 28.sp, + ), + ), + ), + ], + ), + Container( + height: 500.w, + child: CupertinoDatePicker( + onDateTimeChanged: (dateTime) { + widget.model.cycleCheck.startDate = dateTime; + }, + ), + ), + ], + ), + ).then((value) { + setState(() {}); + }); + } + : null, + ), + _buildRow( + title: '检查周期', + subTitle: widget.model.cycleCheck.checkCycle == null + ? null + : '${widget.model.cycleCheck.checkCycle}天', + onTap: isWaitHandOut + ? () { + showAkuSheet( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + AkuBox.h(96), + AkuBackButton.text(), + Spacer(), + Text( + '检查周期', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + Spacer(), + AkuMaterialButton( + minWidth: (64 + 56).w, + onPressed: () { + Get.back(); + }, + child: Text( + '确定', + style: TextStyle( + color: AppStyle.secondaryColor, + fontSize: 28.sp, + ), + ), + ), + ], + ), + Container( + height: 500.w, + child: CupertinoPicker( + children: [ + Center( + child: Text('1天'), + ), + Center( + child: Text('3天'), + ), + Center( + child: Text('7天'), + ), + Center( + child: Text('14天'), + ), + Center( + child: Text('30天'), + ), + ], + itemExtent: 88.w, + onSelectedItemChanged: (int value) { + int realValue = 0; + switch (value) { + case 0: + realValue = 1; + break; + case 1: + realValue = 3; + break; + case 2: + realValue = 7; + break; + case 3: + realValue = 14; + break; + case 4: + realValue = 30; + break; + } + widget.model.cycleCheck.checkCycle = realValue; + }, + ), + ), + ], + ), + ).then((value) { + setState(() {}); + }); + } + : null, ), Padding( padding: EdgeInsets.symmetric( @@ -275,7 +435,19 @@ class _DecorationManagerDetailStatePage ), ), ), - DecorationCheckRow(details: widget.model.cycleCheck.checkDetails), + DecorationCheckRow( + details: [ + CHECK_TYPE.ELECTRIC, + CHECK_TYPE.WATER, + CHECK_TYPE.WALL, + CHECK_TYPE.DOOR_AND_WINDOWS, + CHECK_TYPE.SECURITY, + ], + onChange: (details) { + widget.model.cycleCheck.checkDetails = details; + }, + canTap: isWaitHandOut, + ) ], ); } @@ -407,33 +579,50 @@ class _DecorationManagerDetailStatePage _buildRow({ String title, String subTitle, + VoidCallback onTap, }) { - return Container( - decoration: BoxDecoration( - border: - Border(bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)), - ), + return Material( + color: Colors.transparent, child: InkWell( - child: Row( - children: [ - AkuBox.h(96), - Text( - title, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - ), - ), - Spacer(), - Text( - subTitle, - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.w, - fontWeight: FontWeight.bold, - ), + onTap: onTap, + child: Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w)), + ), + child: InkWell( + child: Row( + children: [ + AkuBox.h(96), + Text( + title, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + ), + ), + Spacer(), + Text( + TextUtil.isEmpty(subTitle) ? '请选择' : subTitle, + style: TextStyle( + color: TextUtil.isEmpty(subTitle) + ? AppStyle.minorTextColor + : AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + onTap == null ? SizedBox() : AkuBox.w(24), + onTap == null + ? SizedBox() + : Icon( + Icons.arrow_forward_ios, + size: 32.w, + color: AppStyle.minorTextColor, + ), + ], ), - ], + ), ), ), ); diff --git a/lib/ui/widgets/inner/show_bottom_sheet.dart b/lib/ui/widgets/inner/show_bottom_sheet.dart index e1c3d6c..bdc51a9 100644 --- a/lib/ui/widgets/inner/show_bottom_sheet.dart +++ b/lib/ui/widgets/inner/show_bottom_sheet.dart @@ -6,7 +6,7 @@ import 'package:get/get.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; ///show bottom sheet -showAkuSheet({ +Future showAkuSheet({ Widget child, }) async { await Get.bottomSheet( @@ -20,12 +20,7 @@ showAkuSheet({ ); } -Future showItemSheet({ - String title, - List items, - String selectItem, - Function(String result) onTap, -}) async { +Future showNormalSheet(String title, List children) async { await showAkuSheet( child: Column( mainAxisSize: MainAxisSize.min, @@ -49,27 +44,38 @@ Future showItemSheet({ Spacer(), ], ), - ...items.map((e) { - return AkuMaterialButton( - height: 96.w, - minWidth: double.infinity, - onPressed: () { - Get.back(); - onTap(e); - }, - child: Text( - e, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 32.sp, - color: e == selectItem - ? AppStyle.secondaryColor - : AppStyle.primaryTextColor, - ), - ), - ); - }).toList(), + ...children, ], ), ); } + +Future showItemSheet({ + String title, + List items, + String selectItem, + Function(String result) onTap, +}) async { + await showNormalSheet( + title, + items.map((e) { + return AkuMaterialButton( + height: 96.w, + minWidth: double.infinity, + onPressed: () { + Get.back(); + onTap(e); + }, + child: Text( + e, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 32.sp, + color: e == selectItem + ? AppStyle.secondaryColor + : AppStyle.primaryTextColor, + ), + ), + ); + }).toList()); +} diff --git a/pubspec.lock b/pubspec.lock index f59367b..d2f6c2f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -141,6 +141,11 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.6" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -202,6 +207,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.16.1" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d5ad5f5..e0b15bf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,6 +23,8 @@ environment: dependencies: flutter: sdk: flutter + flutter_localizations: + sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.