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

@ -1,10 +1,13 @@
enum HKAUTH { enum HKAUTH {
/// ///
SEND, SEND,
/// ///
PICK, PICK,
/// ///
HIDE } HIDE
}
class UserInfoModel { class UserInfoModel {
int? id; int? id;
@ -33,6 +36,10 @@ class UserInfoModel {
/// ///
bool get manager => canSendTicket && canPickUpTicket; bool get manager => canSendTicket && canPickUpTicket;
///
bool get hideFix =>
(!jurisdiction!.contains(53)) && (!jurisdiction!.contains(52));
HKAUTH get houseKeepingAuthority { HKAUTH get houseKeepingAuthority {
if (jurisdiction!.contains(68)) { if (jurisdiction!.contains(68)) {
return HKAUTH.PICK; 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_POLICE_PNG, () => WarningPage()),
AppApplication( AppApplication(
'访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()), '访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()),
if (UserTool.userProvider.infoModel!.manager) if (!UserTool.userProvider.infoModel!.hideFix)
AppApplication( AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()), '报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication( AppApplication(
@ -97,7 +97,7 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication( AppApplication(
'考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()), '考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()), AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()),
if (UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.HIDE) if (UserTool.userProvider.infoModel!.houseKeepingAuthority != HKAUTH.HIDE)
AppApplication( AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), '家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
]; ];

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

@ -107,7 +107,9 @@ class _MessageState extends State<Message> {
children: [ children: [
Text(text, style: AppStyle().minorStyle), Text(text, style: AppStyle().minorStyle),
Spacer(), Spacer(),
Container( number == 0
? SizedBox()
: Container(
alignment: Alignment.center, alignment: Alignment.center,
width: 32.w, width: 32.w,
height: 32.w, height: 32.w,

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

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

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

@ -9,7 +9,8 @@ import 'package:bot_toast/bot_toast.dart';
class HouseKeepingFunc { class HouseKeepingFunc {
/// ///
static Future getHouseKeepingProcess(int id) async { static Future<List<HouseKeepingProcessModel>> getHouseKeepingProcess(
int id) async {
BaseModel baseModel = await NetUtil().get(API.manage.newHouseKeepingProcess, BaseModel baseModel = await NetUtil().get(API.manage.newHouseKeepingProcess,
params: {"housekeepingServiceId": id}); params: {"housekeepingServiceId": id});
if (baseModel.status ?? false) { if (baseModel.status ?? false) {

@ -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/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/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class HouseKeepingPage extends StatefulWidget { class HouseKeepingPage extends StatefulWidget {
@ -16,7 +16,17 @@ class HouseKeepingPage extends StatefulWidget {
class _HouseKeepingPageState extends State<HouseKeepingPage> class _HouseKeepingPageState extends State<HouseKeepingPage>
with TickerProviderStateMixin { 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; late TabController _tabController;
@override @override
void initState() { void initState() {
@ -36,7 +46,11 @@ class _HouseKeepingPageState extends State<HouseKeepingPage>
title: '家政服务', title: '家政服务',
appBarBottom: PreferredSize( appBarBottom: PreferredSize(
preferredSize: Size.fromHeight(88.w), preferredSize: Size.fromHeight(88.w),
child: AkuTabBar(controller: _tabController, tabs: _tabs,isScrollable: true,), child: AkuTabBar(
controller: _tabController,
tabs: _tabs,
isScrollable: true,
),
), ),
body: TabBarView( body: TabBarView(
controller: _tabController, controller: _tabController,
@ -48,20 +62,17 @@ class _HouseKeepingPageState extends State<HouseKeepingPage>
), ),
), ),
actions: [ actions: [
IconButton( // IconButton(
iconSize: 40.w, // iconSize: 40.w,
icon: Icon( // icon: Icon(
CupertinoIcons.plus_circle, // CupertinoIcons.plus_circle,
size: 40.w, // size: 40.w,
color: Colors.black, // color: Colors.black,
),
onPressed: () {
Get.to(() => HouseKeepingAddPage());
})
],
// body: HouseKeepingView(
// index: 0,
// ), // ),
// onPressed: () {
// Get.to(() => HouseKeepingAddPage());
// })
],
); );
} }
} }

@ -1,5 +1,7 @@
import 'package:aku_community_manager/const/api.dart'; 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/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/manage_pages/house_keeping/house_keeping_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,12 +32,27 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
super.dispose(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeListView( return BeeListView(
path: API.manage.newHouseKeepingList, path: API.manage.newHouseKeepingList,
extraParams: { extraParams: {
"housekeepingServiceStatus": widget.index == 0 ? null : widget.index "housekeepingServiceStatus": housekeepingServiceStatus,
}, },
controller: _refreshController, controller: _refreshController,
convert: (models) { convert: (models) {

Loading…
Cancel
Save