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

物品出户自动刷新
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,6 +72,9 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
], ],
), ),
), ),
...widget.homeDisplay
? []
: [
Row( Row(
children: [ children: [
Image.asset( Image.asset(
@ -88,6 +94,7 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
), ),
], ],
), ),
],
12.w.heightBox, 12.w.heightBox,
Row( Row(
children: [ children: [
@ -125,6 +132,9 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
), ),
], ],
), ),
...widget.homeDisplay
? []
: [
12.w.heightBox, 12.w.heightBox,
Row( Row(
children: [ children: [
@ -145,6 +155,7 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
), ),
], ],
), ),
],
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,9 +234,10 @@ 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 ? [
? AkuMaterialButton( AkuBox.w(24),
AkuMaterialButton(
onPressed: () async { onPressed: () async {
await Get.to(() => BusinessAndFixDetailPage( await Get.to(() => BusinessAndFixDetailPage(
model: widget.model, model: widget.model,
@ -223,18 +255,11 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
), ),
) )
: SizedBox(), ]
: [SizedBox()],
(widget.model.status == 2) && (userInfoModel.canPickUpTicket) (widget.model.status == 2) && (userInfoModel.canPickUpTicket)
? 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,
)); ));
@ -255,37 +280,30 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
) )
: SizedBox(), : SizedBox(),
], (widget.model.status == 1)
), ? AkuMaterialButton(
],
);
} 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 { onPressed: () async {
Get.to(() => BusinessAndFixDetailPage(model: widget.model)); await Get.to(() => BusinessAndFixDetailPage(
model: widget.model,
));
if (widget.callRefresh != null) { if (widget.callRefresh != null) {
widget.callRefresh(); widget.callRefresh();
} }
}, },
radius: 4, radius: 4.w,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), minWidth: 160.w,
height: 64.w,
child: Text( child: Text(
'查看详情', '${(userInfoModel.canSendTicket) ? '立即派单' : '查看详情'}',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 28.sp, fontSize: 28.sp,
height: 40 / 28,
),
), ),
), ),
)
: SizedBox(),
],
), ),
], ],
); );

@ -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