fix some issues about house keeping

hmxc
张萌 3 years ago
parent cedd52d0e2
commit f99c70f633

@ -23,6 +23,7 @@ import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/ui/splash/splash_page.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/jpush_message_parse.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@ -98,6 +99,7 @@ class MyApp extends StatelessWidget {
BotToastNavigatorObserver(),
],
localizationsDelegates: [
S.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,

@ -1,10 +1,13 @@
enum HKAUTH {
enum HKAUTH {
///
SEND,
SEND,
///
PICK,
PICK,
///
HIDE }
HIDE
}
class UserInfoModel {
int? id;
@ -33,6 +36,10 @@ class UserInfoModel {
///
bool get manager => canSendTicket && canPickUpTicket;
///
bool get hideFix =>
(!jurisdiction!.contains(53)) && (!jurisdiction!.contains(52));
HKAUTH get houseKeepingAuthority {
if (jurisdiction!.contains(68)) {
return HKAUTH.PICK;

@ -71,7 +71,7 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, () => WarningPage()),
AppApplication(
'访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()),
if (UserTool.userProvider.infoModel!.manager)
if (!UserTool.userProvider.infoModel!.hideFix)
AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication(
@ -97,7 +97,7 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication(
'考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()),
if (UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.HIDE)
if (UserTool.userProvider.infoModel!.houseKeepingAuthority != HKAUTH.HIDE)
AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
];

@ -295,6 +295,7 @@ class _CommentMessageCardState extends State<CommentMessageCard> {
// color: AppStyle.primaryTextColor,
// fontSize: 28.sp)),
RatingBar.builder(
ignoreGestures: true,
initialRating: model.level!.toDouble(),
itemSize: 40.w,
allowHalfRating: true,

@ -107,21 +107,23 @@ class _MessageState extends State<Message> {
children: [
Text(text, style: AppStyle().minorStyle),
Spacer(),
Container(
alignment: Alignment.center,
width: 32.w,
height: 32.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Color(0xFFFF4501)),
child: Text(
number.toString(),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 20.sp,
),
),
),
number == 0
? SizedBox()
: Container(
alignment: Alignment.center,
width: 32.w,
height: 32.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Color(0xFFFF4501)),
child: Text(
number.toString(),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 20.sp,
),
),
),
],
),
],

@ -170,6 +170,7 @@ class HouseKeepingCard extends StatelessWidget {
: await HouseKeepingFunc.newHouseKeepingOrderReceive(
model.id);
cancel();
callRefresh();
},
radius: 4,
color: AppStyle.primaryColor,
@ -190,7 +191,7 @@ class HouseKeepingCard extends StatelessWidget {
];
case 3:
return [
UserTool.userProvider.infoModel!.canPickUpTicket
UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.PICK
? AkuMaterialButton(
height: 64.w,
onPressed: () async {},
@ -207,25 +208,24 @@ class HouseKeepingCard extends StatelessWidget {
),
),
)
: SizedBox(),
AkuMaterialButton(
height: 64.w,
onPressed: () async {
await launch(model.proposerTel);
},
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,
),
),
),
: AkuMaterialButton(
height: 64.w,
onPressed: () async {
await launch('tel:${model.proposerTel}');
},
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,
),
),
),
];
case 4:
return [

@ -37,7 +37,9 @@ class _HouseKeepingDepartmentPageState
onRefresh: () async {
_models = await HouseKeepingFunc.newHouseKeepingPickStaffList();
},
child: ListView(children: _buildItem(_models))),
child: ListView(
padding: EdgeInsets.all(32.w),
children: [_buildItem(_models)])),
bottom: AkuBottomButton(
title: '立即派单',
onTap: () async {
@ -108,9 +110,9 @@ class _HouseKeepingDepartmentPageState
value: _selectId == e.id,
onChanged: (state) {
if (state ?? false) {
_selectId = 0;
} else {
_selectId = e.id;
} else {
_selectId = 0;
}
setState(() {});
},

@ -58,9 +58,10 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
children: <Widget>[
_buildInfo(),
_buildProcess(),
_serviceFeedBack(),
payfeePrice,
_buildEvaluate(),
if (widget.model.handlingTime != null) _serviceFeedBack(),
if (widget.model.payFee != null) payfeePrice,
if (widget.model.evaluationTime != null) _buildEvaluate(),
16.w.heightBox,
].sepWidget(separate: 16.w.heightBox),
),
bottom: _getBottomButtons(widget.model.status),
@ -97,16 +98,14 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
title: '提交报告',
onTap: () {
Get.to(() => HouseKeepingFeedBackPage(
model: widget.model,
callRefresh: widget.callRefresh
));
model: widget.model, callRefresh: widget.callRefresh));
},
);
case 4:
return AkuBottomButton(
title: '联系用户',
onTap: () async {
await launch(widget.model.proposerTel);
await launch('tel:${widget.model.proposerTel}');
},
);
default:
@ -243,7 +242,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
_buildTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', widget.model.proposerTel),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '地址',
'${S.of(context)!.tempPlotName}·${widget.model.roomName}'),
'${S.of(Get.context!)?.tempPlotName ?? ''}·${widget.model.roomName}'),
8.w.heightBox,
Text(
widget.model.content,

@ -9,7 +9,8 @@ import 'package:bot_toast/bot_toast.dart';
class HouseKeepingFunc {
///
static Future getHouseKeepingProcess(int id) async {
static Future<List<HouseKeepingProcessModel>> getHouseKeepingProcess(
int id) async {
BaseModel baseModel = await NetUtil().get(API.manage.newHouseKeepingProcess,
params: {"housekeepingServiceId": id});
if (baseModel.status ?? false) {
@ -105,7 +106,7 @@ class HouseKeepingFunc {
"materialFee": materialFee,
"serviceFee": serviceFee,
"payFee": payFee,
"handlerImgList":urls,
"handlerImgList": urls,
});
if (baseModel.status ?? false) {
BotToast.showText(text: '提交成功');

@ -1,10 +1,10 @@
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_add_page.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_view.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class HouseKeepingPage extends StatefulWidget {
@ -16,7 +16,17 @@ class HouseKeepingPage extends StatefulWidget {
class _HouseKeepingPageState extends State<HouseKeepingPage>
with TickerProviderStateMixin {
List<String> _tabs = ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成'];
List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) {
case HKAUTH.SEND:
return ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成'];
case HKAUTH.PICK:
return ['全部', '已派单', '处理中', '待支付', '待评价', '已完成'];
default:
return [];
}
}
late TabController _tabController;
@override
void initState() {
@ -36,7 +46,11 @@ class _HouseKeepingPageState extends State<HouseKeepingPage>
title: '家政服务',
appBarBottom: PreferredSize(
preferredSize: Size.fromHeight(88.w),
child: AkuTabBar(controller: _tabController, tabs: _tabs,isScrollable: true,),
child: AkuTabBar(
controller: _tabController,
tabs: _tabs,
isScrollable: true,
),
),
body: TabBarView(
controller: _tabController,
@ -48,20 +62,17 @@ class _HouseKeepingPageState extends State<HouseKeepingPage>
),
),
actions: [
IconButton(
iconSize: 40.w,
icon: Icon(
CupertinoIcons.plus_circle,
size: 40.w,
color: Colors.black,
),
onPressed: () {
Get.to(() => HouseKeepingAddPage());
})
// IconButton(
// iconSize: 40.w,
// icon: Icon(
// CupertinoIcons.plus_circle,
// size: 40.w,
// color: Colors.black,
// ),
// onPressed: () {
// Get.to(() => HouseKeepingAddPage());
// })
],
// body: HouseKeepingView(
// index: 0,
// ),
);
}
}

@ -1,5 +1,7 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
@ -30,12 +32,27 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
super.dispose();
}
int? get housekeepingServiceStatus {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) {
case HKAUTH.PICK:
if (widget.index == 0) {
return null;
} else {
return widget.index + 1;
}
case HKAUTH.SEND:
return widget.index == 0 ? null : widget.index;
default:
return widget.index == 0 ? null : widget.index;
}
}
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manage.newHouseKeepingList,
extraParams: {
"housekeepingServiceStatus": widget.index == 0 ? null : widget.index
"housekeepingServiceStatus": housekeepingServiceStatus,
},
controller: _refreshController,
convert: (models) {

Loading…
Cancel
Save