修复首页待办事项溢出、按钮丢失等显示问题

物品出户自动刷新
hmxc
张萌 4 years ago
parent f9d4911149
commit 076da662cc

@ -10,7 +10,10 @@ import 'package:velocity_x/velocity_x.dart';
class ToDoOutDoorCard extends StatefulWidget { class ToDoOutDoorCard extends StatefulWidget {
final ToDoOutDoorModel model; final ToDoOutDoorModel model;
final VoidCallback callRefresh; 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 @override
_ToDoOutDoorCardState createState() => _ToDoOutDoorCardState(); _ToDoOutDoorCardState createState() => _ToDoOutDoorCardState();
@ -23,7 +26,7 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp); TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
return Container( return Container(
color: Color(0xFFFFFFFF), 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), padding: EdgeInsets.only(left: 24.w, right: 24.w),
child: Column( child: Column(
children: [ children: [
@ -69,25 +72,29 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
], ],
), ),
), ),
Row( ...widget.homeDisplay
children: [ ? []
Image.asset( : [
R.ASSETS_OUTDOOR_IC_HOME_PNG, Row(
width: 40.w, children: [
height: 40.w, Image.asset(
), R.ASSETS_OUTDOOR_IC_HOME_PNG,
4.w.widthBox, width: 40.w,
Text( height: 40.w,
'小区名称', ),
style: _textStyle, 4.w.widthBox,
), Text(
Spacer(), '小区名称',
Text( style: _textStyle,
'五象新区人才公寓', ),
style: AppStyle().primaryStyle, Spacer(),
), Text(
], '五象新区人才公寓',
), style: AppStyle().primaryStyle,
),
],
),
],
12.w.heightBox, 12.w.heightBox,
Row( Row(
children: [ children: [
@ -125,26 +132,30 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
), ),
], ],
), ),
12.w.heightBox, ...widget.homeDisplay
Row( ? []
children: [ : [
Image.asset( 12.w.heightBox,
R.ASSETS_OUTDOOR_IC_PEOPLE_PNG, Row(
width: 40.w, children: [
height: 40.w, Image.asset(
), R.ASSETS_OUTDOOR_IC_PEOPLE_PNG,
4.w.widthBox, width: 40.w,
Text( height: 40.w,
'身份', ),
style: _textStyle, 4.w.widthBox,
), Text(
Spacer(), '身份',
Text( style: _textStyle,
widget.model.identityValue, ),
style: AppStyle().primaryStyle, Spacer(),
), Text(
], widget.model.identityValue,
), style: AppStyle().primaryStyle,
),
],
),
],
12.w.heightBox, 12.w.heightBox,
Row( Row(
children: [ children: [

@ -560,7 +560,7 @@ class _HomePageState extends State<HomePage> {
!userProvider.isLogin !userProvider.isLogin
? SizedBox() ? SizedBox()
: Container( : Container(
height: 500.w, height: 450.w,
child: ListView.separated( child: ListView.separated(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
@ -577,6 +577,7 @@ class _HomePageState extends State<HomePage> {
.runtimeType == .runtimeType ==
BussinessAndFixModel) { BussinessAndFixModel) {
return BusinessFixCard( return BusinessFixCard(
homeDisplay: true,
callRefresh: () { callRefresh: () {
_refreshController _refreshController
.callRefresh(); .callRefresh();
@ -588,6 +589,11 @@ class _HomePageState extends State<HomePage> {
.runtimeType == .runtimeType ==
ToDoOutDoorModel) { ToDoOutDoorModel) {
return ToDoOutDoorCard( return ToDoOutDoorCard(
homeDisplay: true,
callRefresh: () {
_refreshController
.callRefresh();
},
model: _todoModelList[index] model: _todoModelList[index]
.dynamicModel, .dynamicModel,
); );

@ -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/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/models/user/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.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/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/business_and_fix_detail_page.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fix_more_time_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<BusinessFixCard> {
), ),
], ],
), ),
widget.homeDisplay ? AkuBox.h(12) : AkuBox.h(24), AkuBox.h(24),
Text( Text(
widget.model.reportDetail, widget.model.reportDetail,
maxLines: widget.homeDisplay ? 1 : null, maxLines: widget.homeDisplay ? 1 : null,
@ -133,7 +134,8 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
!widget.canSeeBottomButton ? SizedBox() : _buildBottomCard(), !widget.canSeeBottomButton ? SizedBox() : _buildBottomCard(),
], ],
), ),
margin: EdgeInsets.only(top: 16.w), margin:
widget.homeDisplay ? EdgeInsets.zero : EdgeInsets.only(top: 16.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
@ -168,17 +170,46 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
} }
_buildBottomCard() { _buildBottomCard() {
if (userInfoModel.canPickUpTicket) { if (widget.model.status > 4) {
if (widget.model.status > 4) return SizedBox();
return Column( return Column(
children: [ children: [
Divider( Divider(height: 48.w),
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( Row(
children: [ children: [
Spacer(), Spacer(),
widget.model.status == 3 (widget.model.status == 3) && (userInfoModel.canPickUpTicket)
? MaterialButton( ? MaterialButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
height: 64.w, height: 64.w,
@ -203,20 +234,45 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
}, },
) )
: SizedBox(), : SizedBox(),
widget.model.status == 3 ? AkuBox.w(24) : SizedBox(), ...widget.model.status == 3 && (userInfoModel.canPickUpTicket)
widget.model.status == 3 ? [
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( ? AkuMaterialButton(
onPressed: () async { onPressed: () async {
await Get.to(() => BusinessAndFixDetailPage( await Get.to(() => BusinessAndFixDetailPage(
model: widget.model, model: widget.model,
)); ));
if (widget.callRefresh != null) {
widget.callRefresh();
}
}, },
radius: 4.w, radius: 4.w,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
minWidth: 160.w, minWidth: 160.w,
height: 64.w, height: 64.w,
child: Text( child: Text(
'处理完成', '立即接单',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 28.sp, fontSize: 28.sp,
@ -224,17 +280,9 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
) )
: SizedBox(), : SizedBox(),
(widget.model.status == 2) && (userInfoModel.canPickUpTicket) (widget.model.status == 1)
? AkuMaterialButton( ? AkuMaterialButton(
onPressed: () async { onPressed: () async {
// final userProvider =
// Provider.of<UserProvider>(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( await Get.to(() => BusinessAndFixDetailPage(
model: widget.model, model: widget.model,
)); ));
@ -247,7 +295,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
minWidth: 160.w, minWidth: 160.w,
height: 64.w, height: 64.w,
child: Text( child: Text(
'立即接单', '${(userInfoModel.canSendTicket) ? '立即派单' : '查看详情'}',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 28.sp, fontSize: 28.sp,
@ -259,36 +307,6 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
], ],
); );
} 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,
),
),
),
),
],
);
} }
} }
} }

@ -16,7 +16,9 @@ import 'package:velocity_x/velocity_x.dart';
class ItemsOutdoorCard extends StatefulWidget { class ItemsOutdoorCard extends StatefulWidget {
final GoodsOutItemModel model; 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 @override
_ItemsOutdoorCardState createState() => _ItemsOutdoorCardState(); _ItemsOutdoorCardState createState() => _ItemsOutdoorCardState();
@ -199,8 +201,11 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
height: 112.w, height: 112.w,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AkuButton( child: AkuButton(
onPressed: () { onPressed: () async {
Get.to(ItemsOutdoorDetailsPage(id: widget.model.id)); await Get.to(ItemsOutdoorDetailsPage(id: widget.model.id));
if (widget.callRefresh != null) {
widget.callRefresh();
}
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,

@ -31,6 +31,9 @@ class _ItemsOutdoorViewState extends State<ItemsOutdoorView>
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ItemsOutdoorCard( return ItemsOutdoorCard(
model: items[index], model: items[index],
callRefresh: () {
_refreshController.callRefresh();
},
); );
}, },
padding: EdgeInsets.only(left: 32.w, right: 32.w), padding: EdgeInsets.only(left: 32.w, right: 32.w),

@ -25,6 +25,17 @@ buildApk() async {
]); ]);
} }
@Task()
buildApkDev() async {
await runAsync('flutter', arguments: [
'build',
'apk',
'--target-platform=android-arm64',
'--dart-define',
'ISPRODUCT=false'
]);
}
@Task() @Task()
buildIos() async { buildIos() async {
await runAsync('flutter', await runAsync('flutter',

Loading…
Cancel
Save