From 076da662cc1fbe91297572f12bf14089f5dfc4e6 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 12 May 2021 16:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E9=A1=B9=E6=BA=A2=E5=87=BA=E3=80=81=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=A2=E5=A4=B1=E7=AD=89=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E7=89=A9=E5=93=81=E5=87=BA=E6=88=B7=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/business/todo_outdoor_card.dart | 93 ++++++++------ lib/ui/home/home_page.dart | 8 +- .../business_and_fix/business_fix_card.dart | 118 ++++++++++-------- .../items_outdoor/items_outdoor_card.dart | 11 +- .../items_outdoor/items_outdoor_view.dart | 3 + tool/grind.dart | 11 ++ 6 files changed, 149 insertions(+), 95 deletions(-) diff --git a/lib/ui/home/business/todo_outdoor_card.dart b/lib/ui/home/business/todo_outdoor_card.dart index 3ac84b0..35427b8 100644 --- a/lib/ui/home/business/todo_outdoor_card.dart +++ b/lib/ui/home/business/todo_outdoor_card.dart @@ -10,7 +10,10 @@ import 'package:velocity_x/velocity_x.dart'; class ToDoOutDoorCard extends StatefulWidget { final ToDoOutDoorModel model; final VoidCallback callRefresh; - ToDoOutDoorCard({Key key, this.model, this.callRefresh}) : super(key: key); + final bool homeDisplay; + ToDoOutDoorCard( + {Key key, this.model, this.callRefresh, this.homeDisplay = false}) + : super(key: key); @override _ToDoOutDoorCardState createState() => _ToDoOutDoorCardState(); @@ -23,7 +26,7 @@ class _ToDoOutDoorCardState extends State { TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp); return Container( color: Color(0xFFFFFFFF), - margin: EdgeInsets.only(top: 16.w), + margin: widget.homeDisplay ? EdgeInsets.zero : EdgeInsets.only(top: 16.w), padding: EdgeInsets.only(left: 24.w, right: 24.w), child: Column( children: [ @@ -69,25 +72,29 @@ class _ToDoOutDoorCardState extends State { ], ), ), - Row( - children: [ - Image.asset( - R.ASSETS_OUTDOOR_IC_HOME_PNG, - width: 40.w, - height: 40.w, - ), - 4.w.widthBox, - Text( - '小区名称', - style: _textStyle, - ), - Spacer(), - Text( - '五象新区人才公寓', - style: AppStyle().primaryStyle, - ), - ], - ), + ...widget.homeDisplay + ? [] + : [ + Row( + children: [ + Image.asset( + R.ASSETS_OUTDOOR_IC_HOME_PNG, + width: 40.w, + height: 40.w, + ), + 4.w.widthBox, + Text( + '小区名称', + style: _textStyle, + ), + Spacer(), + Text( + '五象新区人才公寓', + style: AppStyle().primaryStyle, + ), + ], + ), + ], 12.w.heightBox, Row( children: [ @@ -125,26 +132,30 @@ class _ToDoOutDoorCardState extends State { ), ], ), - 12.w.heightBox, - Row( - children: [ - Image.asset( - R.ASSETS_OUTDOOR_IC_PEOPLE_PNG, - width: 40.w, - height: 40.w, - ), - 4.w.widthBox, - Text( - '身份', - style: _textStyle, - ), - Spacer(), - Text( - widget.model.identityValue, - style: AppStyle().primaryStyle, - ), - ], - ), + ...widget.homeDisplay + ? [] + : [ + 12.w.heightBox, + Row( + children: [ + Image.asset( + R.ASSETS_OUTDOOR_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + 4.w.widthBox, + Text( + '身份', + style: _textStyle, + ), + Spacer(), + Text( + widget.model.identityValue, + style: AppStyle().primaryStyle, + ), + ], + ), + ], 12.w.heightBox, Row( children: [ diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 59569be..c8230ba 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -560,7 +560,7 @@ class _HomePageState extends State { !userProvider.isLogin ? SizedBox() : Container( - height: 500.w, + height: 450.w, child: ListView.separated( padding: EdgeInsets.zero, separatorBuilder: (context, index) { @@ -577,6 +577,7 @@ class _HomePageState extends State { .runtimeType == BussinessAndFixModel) { return BusinessFixCard( + homeDisplay: true, callRefresh: () { _refreshController .callRefresh(); @@ -588,6 +589,11 @@ class _HomePageState extends State { .runtimeType == ToDoOutDoorModel) { return ToDoOutDoorCard( + homeDisplay: true, + callRefresh: () { + _refreshController + .callRefresh(); + }, model: _todoModelList[index] .dynamicModel, ); diff --git a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart index 4e3bbd3..93ca892 100644 --- a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart +++ b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart @@ -3,6 +3,7 @@ import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart'; import 'package:aku_community_manager/models/user/user_info_model.dart'; import 'package:aku_community_manager/provider/user_provider.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; import 'package:aku_community_manager/tools/aku_map.dart'; import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart'; import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fix_more_time_page.dart'; @@ -115,7 +116,7 @@ class _BusinessFixCardState extends State { ), ], ), - widget.homeDisplay ? AkuBox.h(12) : AkuBox.h(24), + AkuBox.h(24), Text( widget.model.reportDetail, maxLines: widget.homeDisplay ? 1 : null, @@ -133,7 +134,8 @@ class _BusinessFixCardState extends State { !widget.canSeeBottomButton ? SizedBox() : _buildBottomCard(), ], ), - margin: EdgeInsets.only(top: 16.w), + margin: + widget.homeDisplay ? EdgeInsets.zero : EdgeInsets.only(top: 16.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8.w), @@ -168,17 +170,46 @@ class _BusinessFixCardState extends State { } _buildBottomCard() { - if (userInfoModel.canPickUpTicket) { - if (widget.model.status > 4) return SizedBox(); + if (widget.model.status > 4) { return Column( children: [ - Divider( - height: 48.w, + Divider(height: 48.w), + Align( + alignment: Alignment.centerRight, + child: AkuMaterialButton( + height: 64.w, + onPressed: () async { + Get.to(() => BusinessAndFixDetailPage(model: widget.model)); + if (widget.callRefresh != null) { + widget.callRefresh(); + } + }, + radius: 4, + color: AppStyle.primaryColor, + padding: EdgeInsets.symmetric(horizontal: 24.w), + child: Text( + '查看详情', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontWeight: FontWeight.bold, + fontSize: 28.sp, + height: 40 / 28, + ), + ), + ), ), + ], + ); + } else { + return Column( + children: [ + AkuBox.h(24), + AkuDivider.horizontal(), + AkuBox.h(24), Row( children: [ Spacer(), - widget.model.status == 3 + (widget.model.status == 3) && (userInfoModel.canPickUpTicket) ? MaterialButton( padding: EdgeInsets.zero, height: 64.w, @@ -203,20 +234,45 @@ class _BusinessFixCardState extends State { }, ) : SizedBox(), - widget.model.status == 3 ? AkuBox.w(24) : SizedBox(), - widget.model.status == 3 + ...widget.model.status == 3 && (userInfoModel.canPickUpTicket) + ? [ + AkuBox.w(24), + AkuMaterialButton( + onPressed: () async { + await Get.to(() => BusinessAndFixDetailPage( + model: widget.model, + )); + }, + radius: 4.w, + color: AppStyle.primaryColor, + minWidth: 160.w, + height: 64.w, + child: Text( + '处理完成', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 28.sp, + ), + ), + ) + ] + : [SizedBox()], + (widget.model.status == 2) && (userInfoModel.canPickUpTicket) ? AkuMaterialButton( onPressed: () async { await Get.to(() => BusinessAndFixDetailPage( model: widget.model, )); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, radius: 4.w, color: AppStyle.primaryColor, minWidth: 160.w, height: 64.w, child: Text( - '处理完成', + '立即接单', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 28.sp, @@ -224,17 +280,9 @@ class _BusinessFixCardState extends State { ), ) : SizedBox(), - (widget.model.status == 2) && (userInfoModel.canPickUpTicket) + (widget.model.status == 1) ? AkuMaterialButton( onPressed: () async { - // final userProvider = - // Provider.of(context, listen: false); - // widget.model.detail.fixStatuses.add(FixStatus( - // title: '${userProvider.userInfoModel.nickName}已接单', - // date: DateTime.now(), - // )); - // widget.model.type = FIX_ENUM.PROCESSING; - // Get.back(); await Get.to(() => BusinessAndFixDetailPage( model: widget.model, )); @@ -247,7 +295,7 @@ class _BusinessFixCardState extends State { minWidth: 160.w, height: 64.w, child: Text( - '立即接单', + '${(userInfoModel.canSendTicket) ? '立即派单' : '查看详情'}', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 28.sp, @@ -259,36 +307,6 @@ class _BusinessFixCardState extends State { ), ], ); - } else { - return Column( - children: [ - widget.homeDisplay ? Divider(height: 24.w) : Divider(height: 48.w), - Align( - alignment: Alignment.centerRight, - child: AkuMaterialButton( - height: 64.w, - onPressed: () async { - Get.to(() => BusinessAndFixDetailPage(model: widget.model)); - if (widget.callRefresh != null) { - widget.callRefresh(); - } - }, - radius: 4, - color: AppStyle.primaryColor, - padding: EdgeInsets.symmetric(horizontal: 24.w), - child: Text( - '查看详情', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontWeight: FontWeight.bold, - fontSize: 28.sp, - height: 40 / 28, - ), - ), - ), - ), - ], - ); } } } diff --git a/lib/ui/sub_pages/items_outdoor/items_outdoor_card.dart b/lib/ui/sub_pages/items_outdoor/items_outdoor_card.dart index 5e72fe2..05dade3 100644 --- a/lib/ui/sub_pages/items_outdoor/items_outdoor_card.dart +++ b/lib/ui/sub_pages/items_outdoor/items_outdoor_card.dart @@ -16,7 +16,9 @@ import 'package:velocity_x/velocity_x.dart'; class ItemsOutdoorCard extends StatefulWidget { final GoodsOutItemModel model; - ItemsOutdoorCard({Key key, @required this.model}) : super(key: key); + final VoidCallback callRefresh; + ItemsOutdoorCard({Key key, @required this.model, this.callRefresh}) + : super(key: key); @override _ItemsOutdoorCardState createState() => _ItemsOutdoorCardState(); @@ -199,8 +201,11 @@ class _ItemsOutdoorCardState extends State { height: 112.w, alignment: Alignment.centerRight, child: AkuButton( - onPressed: () { - Get.to(ItemsOutdoorDetailsPage(id: widget.model.id)); + onPressed: () async { + await Get.to(ItemsOutdoorDetailsPage(id: widget.model.id)); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, child: Container( alignment: Alignment.center, diff --git a/lib/ui/sub_pages/items_outdoor/items_outdoor_view.dart b/lib/ui/sub_pages/items_outdoor/items_outdoor_view.dart index b3403b2..2bc709f 100644 --- a/lib/ui/sub_pages/items_outdoor/items_outdoor_view.dart +++ b/lib/ui/sub_pages/items_outdoor/items_outdoor_view.dart @@ -31,6 +31,9 @@ class _ItemsOutdoorViewState extends State itemBuilder: (context, index) { return ItemsOutdoorCard( model: items[index], + callRefresh: () { + _refreshController.callRefresh(); + }, ); }, padding: EdgeInsets.only(left: 32.w, right: 32.w), diff --git a/tool/grind.dart b/tool/grind.dart index caa93b4..8ad1070 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -25,6 +25,17 @@ buildApk() async { ]); } +@Task() +buildApkDev() async { + await runAsync('flutter', arguments: [ + 'build', + 'apk', + '--target-platform=android-arm64', + '--dart-define', + 'ISPRODUCT=false' + ]); +} + @Task() buildIos() async { await runAsync('flutter',