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

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

@ -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<ToDoOutDoorCard> {
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,6 +72,9 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
],
),
),
...widget.homeDisplay
? []
: [
Row(
children: [
Image.asset(
@ -88,6 +94,7 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
),
],
),
],
12.w.heightBox,
Row(
children: [
@ -125,6 +132,9 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
),
],
),
...widget.homeDisplay
? []
: [
12.w.heightBox,
Row(
children: [
@ -145,6 +155,7 @@ class _ToDoOutDoorCardState extends State<ToDoOutDoorCard> {
),
],
),
],
12.w.heightBox,
Row(
children: [

@ -560,7 +560,7 @@ class _HomePageState extends State<HomePage> {
!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<HomePage> {
.runtimeType ==
BussinessAndFixModel) {
return BusinessFixCard(
homeDisplay: true,
callRefresh: () {
_refreshController
.callRefresh();
@ -588,6 +589,11 @@ class _HomePageState extends State<HomePage> {
.runtimeType ==
ToDoOutDoorModel) {
return ToDoOutDoorCard(
homeDisplay: true,
callRefresh: () {
_refreshController
.callRefresh();
},
model: _todoModelList[index]
.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/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<BusinessFixCard> {
),
],
),
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<BusinessFixCard> {
!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<BusinessFixCard> {
}
_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,9 +234,10 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
},
)
: SizedBox(),
widget.model.status == 3 ? AkuBox.w(24) : SizedBox(),
widget.model.status == 3
? AkuMaterialButton(
...widget.model.status == 3 && (userInfoModel.canPickUpTicket)
? [
AkuBox.w(24),
AkuMaterialButton(
onPressed: () async {
await Get.to(() => BusinessAndFixDetailPage(
model: widget.model,
@ -223,18 +255,11 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
),
)
: SizedBox(),
]
: [SizedBox()],
(widget.model.status == 2) && (userInfoModel.canPickUpTicket)
? AkuMaterialButton(
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(
model: widget.model,
));
@ -255,37 +280,30 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
)
: SizedBox(),
],
),
],
);
} else {
return Column(
children: [
widget.homeDisplay ? Divider(height: 24.w) : Divider(height: 48.w),
Align(
alignment: Alignment.centerRight,
child: AkuMaterialButton(
height: 64.w,
(widget.model.status == 1)
? AkuMaterialButton(
onPressed: () async {
Get.to(() => BusinessAndFixDetailPage(model: widget.model));
await Get.to(() => BusinessAndFixDetailPage(
model: widget.model,
));
if (widget.callRefresh != null) {
widget.callRefresh();
}
},
radius: 4,
radius: 4.w,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
minWidth: 160.w,
height: 64.w,
child: Text(
'查看详情',
'${(userInfoModel.canSendTicket) ? '立即派单' : '查看详情'}',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
)
: SizedBox(),
],
),
],
);

@ -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<ItemsOutdoorCard> {
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,

@ -31,6 +31,9 @@ class _ItemsOutdoorViewState extends State<ItemsOutdoorView>
itemBuilder: (context, index) {
return ItemsOutdoorCard(
model: items[index],
callRefresh: () {
_refreshController.callRefresh();
},
);
},
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()
buildIos() async {
await runAsync('flutter',

Loading…
Cancel
Save