接入用户详情

删除旧用户详情
master
张萌 3 years ago
parent 883013fef0
commit ad17ad1593

@ -11,7 +11,7 @@ class SAASAPI {
/// ///
static String get resource => static String get resource =>
'https://saas.kaidalai.cn/resource/${UserTool.userProvider.infoModel!.id}/'; 'https://saas.kaidalai.cn/resource/${UserTool.userProvider.userInfoModel!.id}/';
static String image(String? path) => '$resource$path'; static String image(String? path) => '$resource$path';
@ -30,6 +30,9 @@ class SAASAPI {
} }
class _Login { class _Login {
///
String get userInfo => '/butlerApp/user/findDetail';
/// ///
String get allCommunity => '/butlerApp/login/findAllCommunity'; String get allCommunity => '/butlerApp/login/findAllCommunity';

@ -1,9 +1,8 @@
import 'package:aku_new_community_manager/models/user/user_info_model.dart'; import 'package:aku_new_community_manager/models/common/img_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:aku_new_community_manager/models/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'house_keeping_list_model.g.dart'; part 'house_keeping_list_model.g.dart';
@JsonSerializable() @JsonSerializable()
@ -58,8 +57,7 @@ class HouseKeepingListModel extends Equatable {
case 1: case 1:
return '待派单'; return '待派单';
case 2: case 2:
if (UserTool.userProvider.infoModel!.houseKeepingAuthority == if (UserTool.userProvider.userInfoModel!.type == 1) {
HKAUTH.PICK) {
return '已派单'; return '已派单';
} else { } else {
return '待接单'; return '待接单';

@ -1,102 +0,0 @@
enum HKAUTH {
///
SEND,
///
PICK,
///
HIDE
}
///
enum ERAUTH {
///
SENDTOCOMPANY,
///
SENDTOPERSON,
///
PICK,
///
HIDE
}
@Deprecated('逐步删除')
class UserInformationModel {
int? id;
String? roleId;
String? nickName;
List<int>? jurisdiction;
///()
bool get canSendTicket => jurisdiction!.contains(52);
///
bool get canPickUpTicket => jurisdiction!.contains(53);
///
bool get canPass => jurisdiction!.contains(55);
///
bool get canOperation => jurisdiction!.contains(57);
///
bool get canDecorationDispatch => jurisdiction!.contains(59);
///
bool get canDecorationTrack => jurisdiction!.contains(60);
///
bool get manager => canSendTicket && canPickUpTicket;
///
bool get hideFix =>
(!jurisdiction!.contains(53)) && (!jurisdiction!.contains(52));
HKAUTH get houseKeepingAuthority {
if (jurisdiction!.contains(68)) {
return HKAUTH.PICK;
} else if (jurisdiction!.contains(67)) {
return HKAUTH.SEND;
} else {
return HKAUTH.HIDE;
}
}
ERAUTH get engineeringRepairAuthority {
if (jurisdiction!.contains(69)) {
return ERAUTH.SENDTOCOMPANY;
} else if (jurisdiction!.contains(70)) {
return ERAUTH.SENDTOPERSON;
} else if (jurisdiction!.contains(71)) {
return ERAUTH.PICK;
} else {
return ERAUTH.HIDE;
}
}
UserInformationModel(
{required this.id, this.roleId, this.nickName, this.jurisdiction});
UserInformationModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
roleId = json['roleId'];
nickName = json['nickName'];
if (json['jurisdiction'] != null)
jurisdiction = json['jurisdiction'].cast<int>();
else
json['jurisdiction'] = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['roleId'] = this.roleId;
data['nickName'] = this.nickName;
data['jurisdiction'] = this.jurisdiction;
return data;
}
}

@ -1,43 +0,0 @@
// Project imports:
import 'package:aku_new_community_manager/models/common/img_model.dart';
@Deprecated('逐步删除')
class UserProfileModel {
int? id;
List<ImgModel>? imgUrls;
String? nickName;
String? tel;
UserProfileModel({required this.id, this.imgUrls, this.nickName, this.tel});
ImgModel? get firstImg {
if (imgUrls!.isEmpty)
return null;
else
return imgUrls!.first;
}
UserProfileModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
if (json['imgUrls'] != null) {
imgUrls = <ImgModel>[];
json['imgUrls'].forEach((v) {
imgUrls!.add(new ImgModel.fromJson(v));
});
}
nickName = json['nickName'];
tel = json['tel'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
} else
imgUrls = [];
data['nickName'] = this.nickName;
data['tel'] = this.tel;
return data;
}
}

@ -1,7 +1,5 @@
import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/new_ui/auth/set_nick_nage_page.dart'; import 'package:aku_new_community_manager/new_ui/auth/set_nick_nage_page.dart';
import 'package:aku_new_community_manager/new_ui/auth/set_psd_page.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart'; import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/home/home_page.dart'; import 'package:aku_new_community_manager/ui/home/home_page.dart';
@ -45,13 +43,6 @@ class SignFunc {
return response; return response;
} }
///
static Future<UserInformationModel?> getUserInfo() async {
BaseModel baseModel = await NetUtil().get(SAASAPI.user.userProfile);
if (baseModel.data == null || !baseModel.success) return null;
return UserInformationModel.fromJson(baseModel.data);
}
/// ///
static Future<bool> settingPsd(String psd) async { static Future<bool> settingPsd(String psd) async {
BaseModel baseModel = await NetUtil().get(SAASAPI.user.settingPsd, BaseModel baseModel = await NetUtil().get(SAASAPI.user.settingPsd,
@ -91,9 +82,7 @@ class SignFunc {
} }
static Future checkNameAndAccount() async { static Future checkNameAndAccount() async {
if (!UserTool.userProvider.userInfoModel!.isExistPassword) { if (UserTool.userProvider.userInfoModel!.nickName == null) {
await Get.to(() => SetPsdPage());
} else if (UserTool.userProvider.userInfoModel!.nickName == null) {
await Get.to(() => SetNickNamePage()); await Get.to(() => SetNickNamePage());
} else { } else {
Get.offAll(() => HomePage()); Get.offAll(() => HomePage());

@ -1,13 +1,10 @@
// Dart imports: // Dart imports:
import 'dart:io'; import 'dart:io';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/const/saas_api.dart';
// Flutter imports:
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/models/user/user_profile_model.dart';
import 'package:aku_new_community_manager/provider/message_provider.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart'; import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/saas_models/user/user_info_model.dart'; import 'package:aku_new_community_manager/saas_models/user/user_info_model.dart';
import 'package:aku_new_community_manager/utils/hive_store.dart'; import 'package:aku_new_community_manager/utils/hive_store.dart';
@ -16,9 +13,6 @@ import 'package:aku_new_community_manager/utils/websocket/web_socket_util.dart';
// Package imports: // Package imports:
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart';
// //
class UserProvider extends ChangeNotifier { class UserProvider extends ChangeNotifier {
@ -32,50 +26,14 @@ class UserProvider extends ChangeNotifier {
NetUtil().auth(token); NetUtil().auth(token);
await HiveStore.appBox!.put('token', token); await HiveStore.appBox!.put('token', token);
await HiveStore.appBox!.put('login', true); await HiveStore.appBox!.put('login', true);
_profileModel = await updateProfile();
_infoModel = await updateUserInfo();
if (isLogin) { if (isLogin) {
WebSocketUtil().setUser(_infoModel?.id.toString() ?? ''); await updateUserInfo();
WebSocketUtil().setUser(_userInfoModel!.id.toString());
WebSocketUtil().startWebSocket(); WebSocketUtil().startWebSocket();
} }
// await setCurrentHouse((_userDetailModel?.estateNames?.isEmpty ?? true)
// ? ''
// : _userDetailModel?.estateNames?.first);
notifyListeners(); notifyListeners();
} }
UserProfileModel? _profileModel;
UserProfileModel? get profileModel => _profileModel;
UserInformationModel? _infoModel;
UserInformationModel? get infoModel => _infoModel;
///profile
Future<UserProfileModel?> updateProfile() async {
final messageProvider =
Provider.of<MessageProvider>(Get.context!, listen: false);
messageProvider.updateMessage();
BaseModel? model = await NetUtil().get(API.user.profile);
if (model.data == null)
return null;
else
return UserProfileModel.fromJson(model.data);
}
Future<UserInformationModel?> updateUserInfo() async {
BaseModel? model = await NetUtil().get(API.user.info);
if (model.data == null)
return null;
else {
var userModel = UserInformationModel.fromJson(model.data);
JPush().setAlias(userModel.id.toString());
print('jpush alias is ${userModel.id}');
return userModel;
}
}
/// ///
logout() async { logout() async {
await NetUtil().get(API.auth.logout, showMessage: true); await NetUtil().get(API.auth.logout, showMessage: true);
@ -92,39 +50,14 @@ class UserProvider extends ChangeNotifier {
/// ///
get isSigned => _isSigned; get isSigned => _isSigned;
///
setisSigned(bool state) {
_isSigned = state;
notifyListeners();
}
/// ///
setNickName(String name) { setNickName(String name) {
_infoModel!.nickName = name; // _infoModel!.nickName = name;
notifyListeners(); notifyListeners();
} }
///
setAvatar(File file) async {
Function cancel = BotToast.showLoading();
BaseModel fileModel = await NetUtil().upload(API.upload.avatar, file);
if (fileModel.success) {
await NetUtil().post(
API.user.updateAvatar,
params: {
'fileUrls': [fileModel.data],
},
showMessage: true,
);
_profileModel = await updateProfile();
cancel();
notifyListeners();
}
}
/// ///
setTel(String tel) { setTel(String tel) {
_profileModel!.tel = tel;
notifyListeners(); notifyListeners();
} }
@ -135,11 +68,20 @@ class UserProvider extends ChangeNotifier {
UserInfoModel? get userInfoModel => _userInfoModel; UserInfoModel? get userInfoModel => _userInfoModel;
/// ///
Future updateAvatar(String? path) async { Future updateAvatar(File file) async {
var url = '';
try {
var base = await NetUtil().upload(SAASAPI.other.file.uploadImg, file);
if (base.success) {
url = base.data as String;
}
} catch (e) {
print(e.toString());
}
BaseModel model = await NetUtil().post( BaseModel model = await NetUtil().post(
SAASAPI.user.updateAvatar, SAASAPI.user.updateAvatar,
params: { params: {
'fileUrls': [path] 'fileUrls': [url]
}, },
showMessage: true, showMessage: true,
); );
@ -147,4 +89,14 @@ class UserProvider extends ChangeNotifier {
await updateUserInfo(); await updateUserInfo();
} }
} }
Future updateUserInfo() async {
var base = await NetUtil().get(SAASAPI.login.userInfo);
if (base.success) {
_userInfoModel = UserInfoModel.fromJson(base.data);
} else {
BotToast.showText(text: '用户信息更新失败');
}
notifyListeners();
}
} }

@ -1,25 +1,29 @@
import 'package:aku_new_community_manager/models/common/img_model.dart'; import 'package:aku_new_community_manager/models/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'user_info_model.g.dart'; part 'user_info_model.g.dart';
@JsonSerializable() @JsonSerializable()
class UserInfoModel { class UserInfoModel extends Equatable {
final int id; final int id;
final int communityId; final String userName;
final String communityCode; final int type;
final String? name; final String actualName;
final String? idCard;
final String tel; final String tel;
final int sex;
// 1. 2. 3. final String userCode;
final int? sex; final String? birthDay;
final String? email;
final int status;
final int? lastLoginIp;
final String? lastLoginDate;
final String? nickName; final String? nickName;
final bool isExistPassword; final String? address;
final bool isPointsSignSetting; final String entryDate;
final bool isSign; final String? remake;
final int? points; final List<ImgModel>? imgList;
final List<ImgModel> imgList;
String get sexValue { String get sexValue {
if (sex == 1) return ''; if (sex == 1) return '';
@ -28,31 +32,56 @@ class UserInfoModel {
return '未设置'; return '未设置';
} }
// DateTime? get birthdayDate => DateUtil.getDateTime(birthday ?? ''); DateTime? get birthdayDate => DateUtil.getDateTime(birthDay ?? '');
// String get birthdayValue { String get birthdayValue {
// if (TextUtil.isEmpty(birthday)) if (TextUtil.isEmpty(birthDay))
// return '未设置'; return '未设置';
// else else
// return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd'); return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
// } }
factory UserInfoModel.fromJson(Map<String, dynamic> json) => factory UserInfoModel.fromJson(Map<String, dynamic> json) =>
_$UserInfoModelFromJson(json); _$UserInfoModelFromJson(json);
@override
List<Object?> get props => [
id,
userName,
type,
actualName,
tel,
sex,
userCode,
birthDay,
email,
status,
lastLoginIp,
lastLoginDate,
nickName,
address,
entryDate,
remake,
imgList,
];
const UserInfoModel({ const UserInfoModel({
required this.id, required this.id,
required this.communityId, required this.userName,
required this.communityCode, required this.type,
this.name, required this.actualName,
this.idCard,
required this.tel, required this.tel,
this.sex, required this.sex,
required this.userCode,
this.birthDay,
this.email,
required this.status,
this.lastLoginIp,
this.lastLoginDate,
this.nickName, this.nickName,
required this.isExistPassword, this.address,
required this.isPointsSignSetting, required this.entryDate,
required this.isSign, this.remake,
this.points, this.imgList,
required this.imgList,
}); });
} }

@ -9,18 +9,22 @@ part of 'user_info_model.dart';
UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) => UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
UserInfoModel( UserInfoModel(
id: json['id'] as int, id: json['id'] as int,
communityId: json['communityId'] as int, userName: json['userName'] as String,
communityCode: json['communityCode'] as String, type: json['type'] as int,
name: json['name'] as String?, actualName: json['actualName'] as String,
idCard: json['idCard'] as String?,
tel: json['tel'] as String, tel: json['tel'] as String,
sex: json['sex'] as int?, sex: json['sex'] as int,
userCode: json['userCode'] as String,
birthDay: json['birthDay'] as String?,
email: json['email'] as String?,
status: json['status'] as int,
lastLoginIp: json['lastLoginIp'] as int?,
lastLoginDate: json['lastLoginDate'] as String?,
nickName: json['nickName'] as String?, nickName: json['nickName'] as String?,
isExistPassword: json['isExistPassword'] as bool, address: json['address'] as String?,
isPointsSignSetting: json['isPointsSignSetting'] as bool, entryDate: json['entryDate'] as String,
isSign: json['isSign'] as bool, remake: json['remake'] as String?,
points: json['points'] as int?, imgList: (json['imgList'] as List<dynamic>?)
imgList: (json['imgList'] as List<dynamic>) ?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
); );

@ -1,7 +1,3 @@
// Flutter imports:
// Project imports:
import 'package:aku_new_community_manager/const/resource.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/provider/app_provider.dart'; import 'package:aku_new_community_manager/provider/app_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/screen_tool.dart'; import 'package:aku_new_community_manager/tools/screen_tool.dart';
@ -71,7 +67,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!.hideFix) if (!(UserTool.userProvider.userInfoModel!.type == 1))
AppApplication( AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()), '报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication( AppApplication(
@ -97,11 +93,10 @@ 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.userInfoModel!.type == 1)
AppApplication( AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), '家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
if (UserTool.userProvider.infoModel!.engineeringRepairAuthority != if (UserTool.userProvider.userInfoModel!.type == 1)
ERAUTH.HIDE)
AppApplication( AppApplication(
'工程维修', R.ASSETS_HOME_IC_SERVICE_PNG, () => EngineerRepairPage()), '工程维修', R.ASSETS_HOME_IC_SERVICE_PNG, () => EngineerRepairPage()),
]; ];

@ -358,7 +358,7 @@ class _HomePageState extends State<HomePage> {
height: 67.w, height: 67.w,
child: Text( child: Text(
userProvider.isLogin userProvider.isLogin
? 'HI${userProvider.infoModel!.nickName}' ? 'HI${userProvider.userInfoModel!.nickName}'
: '登录/注册', : '登录/注册',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,

@ -83,7 +83,7 @@ class _PersonalDrawState extends State<PersonalDraw> {
// //
userProvider.isLogin userProvider.isLogin
? Text( ? Text(
userProvider.infoModel!.nickName!, userProvider.userInfoModel!.nickName!,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,

@ -1,38 +1,36 @@
// Flutter imports: // Flutter imports:
import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/interview/interview_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/resource.dart'; import 'package:aku_new_community_manager/const/resource.dart';
import 'package:aku_new_community_manager/provider/app_provider.dart'; import 'package:aku_new_community_manager/provider/app_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/tools/widget_tool.dart'; import 'package:aku_new_community_manager/tools/widget_tool.dart';
import 'package:aku_new_community_manager/ui/home/application/applications_page.dart'; import 'package:aku_new_community_manager/ui/home/application/applications_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/green_manage/green_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/green_manage/green_manage_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/interview/interview_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/key_manage/key_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/key_manage/key_manage_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/packages_manage/packages_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/packages_manage/packages_manage_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/rules_manage/rules_manage_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/rules_manage/rules_manage_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/business_and_fix/business_and_fix_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/business_and_fix/business_and_fix_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/decoration_manager/new_renovation/new_renovation_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/items_outdoor/items_outdoor_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/items_outdoor/items_outdoor_page.dart';
import 'package:aku_new_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart';
import 'package:aku_new_community_manager/ui/tool_pages/warning/warning_page.dart'; import 'package:aku_new_community_manager/ui/tool_pages/warning/warning_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class SearchWorkOrderPage extends StatefulWidget { class SearchWorkOrderPage extends StatefulWidget {
SearchWorkOrderPage({Key? key}) : super(key: key); SearchWorkOrderPage({Key? key}) : super(key: key);
@ -47,7 +45,7 @@ class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> {
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.userInfoModel!.type == 1)
AppApplication( AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()), '报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication( AppApplication(

@ -2,7 +2,6 @@ import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_list_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_list_model.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_new_acceptance_record_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_new_acceptance_record_model.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_acceptance_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_acceptance_page.dart';
@ -130,8 +129,7 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
(UserTool.userProvider.infoModel!.engineeringRepairAuthority == (true)
ERAUTH.SENDTOCOMPANY)
? await Get.to( ? await Get.to(
() => EngineerRepairDepartCompany(repairId: model.id)) () => EngineerRepairDepartCompany(repairId: model.id))
: await Get.to(() => : await Get.to(() =>
@ -142,8 +140,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.engineeringRepairAuthority == (UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.SENDTOCOMPANY
? '分派单位' ? '分派单位'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -160,8 +157,7 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
(UserTool.userProvider.infoModel!.engineeringRepairAuthority == (UserTool.userProvider.userInfoModel!.type == 1)
ERAUTH.SENDTOPERSON)
? await Get.to(() => ? await Get.to(() =>
EngineerRepairDetailPage(repairEngineerId: model.id)) EngineerRepairDetailPage(repairEngineerId: model.id))
: await Get.to(() => : await Get.to(() =>
@ -172,8 +168,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.engineeringRepairAuthority == (UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.SENDTOPERSON
? '指派人员' ? '指派人员'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -187,8 +182,7 @@ class EngineerRepairCard extends StatelessWidget {
]; ];
case 3: case 3:
return [ return [
UserTool.userProvider.infoModel!.engineeringRepairAuthority == UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.PICK
? AkuMaterialButton( ? AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
@ -258,9 +252,7 @@ class EngineerRepairCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: UserTool onPressed: UserTool.userProvider.userInfoModel!.type == 1
.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
? () async { ? () async {
EngineerRepairResultModel? resultModel = EngineerRepairResultModel? resultModel =
await EngineerRepairFunc.getRepairResult(model.id); await EngineerRepairFunc.getRepairResult(model.id);
@ -285,10 +277,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
UserTool.userProvider.infoModel!.engineeringRepairAuthority == UserTool.userProvider.userInfoModel!.type == 1 ? '验收审核' : '验收记录',
ERAUTH.SENDTOCOMPANY
? '验收审核'
: '验收记录',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -5,7 +5,6 @@ import 'package:aku_new_community_manager/json_models/manager/engineer_repair/en
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_process_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_process_model.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_work_report_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_work_report_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/tools/widget_tool.dart'; import 'package:aku_new_community_manager/tools/widget_tool.dart';
@ -127,8 +126,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
if (_model != null) { if (_model != null) {
switch (_model!.status) { switch (_model!.status) {
case 1: case 1:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.SENDTOCOMPANY
? AkuBottomButton( ? AkuBottomButton(
title: '立即派单', title: '立即派单',
onTap: () async { onTap: () async {
@ -138,10 +136,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
) )
: SizedBox(); : SizedBox();
case 2: case 2:
print(UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.SENDTOPERSON);
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOPERSON
? AkuBottomButton( ? AkuBottomButton(
title: '立即派单', title: '立即派单',
onTap: () async { onTap: () async {
@ -153,8 +148,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
) )
: SizedBox(); : SizedBox();
case 3: case 3:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.PICK
? AkuBottomButton( ? AkuBottomButton(
title: '立即接单', title: '立即接单',
onTap: () async { onTap: () async {
@ -167,8 +161,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
) )
: SizedBox(); : SizedBox();
case 4: case 4:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.PICK
? Row( ? Row(
children: [ children: [
AkuMaterialButton( AkuMaterialButton(
@ -193,8 +186,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
) )
: SizedBox(); : SizedBox();
case 5: case 5:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.SENDTOCOMPANY
? AkuMaterialButton( ? AkuMaterialButton(
color: kPrimaryColor, color: kPrimaryColor,
onPressed: () async { onPressed: () async {
@ -213,8 +205,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
'验收审核'.text.size(32.sp).bold.color(Colors.black).make()) '验收审核'.text.size(32.sp).bold.color(Colors.black).make())
: SizedBox(); : SizedBox();
case 6: case 6:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.PICK
? AkuMaterialButton( ? AkuMaterialButton(
color: kPrimaryColor, color: kPrimaryColor,
onPressed: () async { onPressed: () async {

@ -1,4 +1,3 @@
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/add_engineer_repair_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/add_engineer_repair_page.dart';
import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_view.dart'; import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_view.dart';
@ -21,13 +20,13 @@ class EngineerRepairPage extends StatefulWidget {
class _EngineerRepairPageState extends State<EngineerRepairPage> class _EngineerRepairPageState extends State<EngineerRepairPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
List<String> get _tabs { List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.engineeringRepairAuthority) { switch (UserTool.userProvider.userInfoModel!.type == 1) {
case ERAUTH.SENDTOCOMPANY: // case ERAUTH.SENDTOCOMPANY:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成']; // return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.SENDTOPERSON: // case ERAUTH.SENDTOPERSON:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成']; // return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.PICK: // case ERAUTH.PICK:
return ['全部', '已派单', '处理中', '待验收', '验收驳回', '已完成']; // return ['全部', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
default: default:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成']; return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
} }

@ -1,6 +1,5 @@
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_list_model.dart'; import 'package:aku_new_community_manager/json_models/manager/engineer_repair/engineer_repair_list_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_card.dart'; import 'package:aku_new_community_manager/ui/manage_pages/engineer_repair/engineer_repair_card.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart';
@ -24,19 +23,19 @@ class _EngineerRepairViewState extends State<EngineerRepairView> {
if (widget.index == 0) { if (widget.index == 0) {
return null; return null;
} else if (widget.index == 1) { } else if (widget.index == 1) {
switch (UserTool.userProvider.infoModel!.engineeringRepairAuthority) { switch (UserTool.userProvider.userInfoModel!.type == 1) {
case ERAUTH.SENDTOCOMPANY: // case ERAUTH.SENDTOCOMPANY:
return 1; // return 1;
case ERAUTH.SENDTOPERSON: // case ERAUTH.SENDTOPERSON:
return 2; // return 2;
case ERAUTH.PICK: // case ERAUTH.PICK:
return 3; // return 3;
case ERAUTH.HIDE: // case ERAUTH.HIDE:
break; // break;
default:
} }
} else { } else {
return UserTool.userProvider.infoModel!.engineeringRepairAuthority == return UserTool.userProvider.userInfoModel!.type == 1
ERAUTH.PICK
? widget.index + 2 ? widget.index + 2
: widget.index + 1; : widget.index + 1;
} }

@ -1,7 +1,6 @@
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart'; import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart'; import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_department_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_department_page.dart';
@ -134,8 +133,7 @@ class HouseKeepingCard extends StatelessWidget {
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
(UserTool.userProvider.infoModel!.houseKeepingAuthority == (UserTool.userProvider.userInfoModel!.type == 1)
HKAUTH.SEND)
? Get.to(() => HouseKeepingDepartmentPage( ? Get.to(() => HouseKeepingDepartmentPage(
id: model.id, id: model.id,
callRefresh: callRefresh, callRefresh: callRefresh,
@ -157,8 +155,7 @@ class HouseKeepingCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.houseKeepingAuthority == (UserTool.userProvider.userInfoModel!.type == 1
HKAUTH.SEND
? '立即派单' ? '立即派单'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -176,8 +173,7 @@ class HouseKeepingCard extends StatelessWidget {
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
(UserTool.userProvider.infoModel!.houseKeepingAuthority == (UserTool.userProvider.userInfoModel!.type == 1)
HKAUTH.SEND)
? await HouseKeepingFunc.newHouseKeepingUrgeWork(model.id) ? await HouseKeepingFunc.newHouseKeepingUrgeWork(model.id)
: await HouseKeepingFunc.newHouseKeepingOrderReceive( : await HouseKeepingFunc.newHouseKeepingOrderReceive(
model.id); model.id);
@ -188,10 +184,7 @@ class HouseKeepingCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.houseKeepingAuthority == (UserTool.userProvider.userInfoModel!.type == 1 ? '立即接单' : '催单'),
HKAUTH.PICK
? '立即接单'
: '催单'),
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -203,7 +196,7 @@ class HouseKeepingCard extends StatelessWidget {
]; ];
case 3: case 3:
return [ return [
UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.PICK UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {

@ -1,7 +1,6 @@
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart'; import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart'; import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/aku_divider.dart'; import 'package:aku_new_community_manager/tools/aku_divider.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
@ -12,16 +11,16 @@ import 'package:aku_new_community_manager/ui/widgets/app_widgets/bee_grid_image_
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_bottom_button.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_new_community_manager/utils/extension/list_extension.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community_manager/utils/extension/list_extension.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class HouseKeepingDetailPage extends StatefulWidget { class HouseKeepingDetailPage extends StatefulWidget {
final HouseKeepingListModel model; final HouseKeepingListModel model;
@ -79,8 +78,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
}, },
); );
case 2: case 2:
return UserTool.userProvider.infoModel!.houseKeepingAuthority == return UserTool.userProvider.userInfoModel!.type == 1
HKAUTH.PICK
? AkuBottomButton( ? AkuBottomButton(
title: '立即接单', title: '立即接单',
onTap: () async { onTap: () async {

@ -1,4 +1,3 @@
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_view.dart'; import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_view.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -17,10 +16,12 @@ class HouseKeepingPage extends StatefulWidget {
class _HouseKeepingPageState extends State<HouseKeepingPage> class _HouseKeepingPageState extends State<HouseKeepingPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
List<String> get _tabs { List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) { switch (UserTool.userProvider.userInfoModel!.type == 1) {
case HKAUTH.SEND: // case HKAUTH.SEND:
case true:
return ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成']; return ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成'];
case HKAUTH.PICK: // case HKAUTH.PICK:
case false:
return ['全部', '已派单', '处理中', '待支付', '待评价', '已完成']; return ['全部', '已派单', '处理中', '待支付', '待评价', '已完成'];
default: default:
return []; return [];

@ -1,6 +1,5 @@
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart'; import 'package:aku_new_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_card.dart'; import 'package:aku_new_community_manager/ui/manage_pages/house_keeping/house_keeping_card.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_new_community_manager/ui/widgets/common/bee_list_view.dart';
@ -33,14 +32,16 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
} }
int? get housekeepingServiceStatus { int? get housekeepingServiceStatus {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) { switch (UserTool.userProvider.userInfoModel!.type) {
case HKAUTH.PICK: // case HKAUTH.PICK:
case 1:
if (widget.index == 0) { if (widget.index == 0) {
return null; return null;
} else { } else {
return widget.index + 1; return widget.index + 1;
} }
case HKAUTH.SEND: // case HKAUTH.SEND:
case 2:
return widget.index == 0 ? null : widget.index; return widget.index == 0 ? null : widget.index;
default: default:
return widget.index == 0 ? null : widget.index; return widget.index == 0 ? null : widget.index;

@ -1,19 +1,17 @@
// Flutter imports: // Flutter imports:
import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/models/manager/inspection/inspection_list_model.dart'; import 'package:aku_new_community_manager/models/manager/inspection/inspection_list_model.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart'; import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart';
import 'package:aku_new_community_manager/utils/extension/aku_date.dart'; import 'package:aku_new_community_manager/utils/extension/aku_date.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
class InspectionManageCard extends StatefulWidget { class InspectionManageCard extends StatefulWidget {
final InspectionListModel cardModel; final InspectionListModel cardModel;
@ -48,7 +46,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
bool get isManager { bool get isManager {
UserProvider userProvider = Provider.of<UserProvider>(context); UserProvider userProvider = Provider.of<UserProvider>(context);
return userProvider.infoModel!.canOperation; return userProvider.userInfoModel!.type == 1;
} }
@override @override

@ -1,15 +1,13 @@
// Flutter imports: // Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_view.dart'; import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_manage_view.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
// Package imports: // Package imports:
@ -25,7 +23,7 @@ class _InspectionManagePageState extends State<InspectionManagePage>
List<String> get _tabs { List<String> get _tabs {
UserProvider _userProvider = UserProvider _userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
if (_userProvider.infoModel!.canOperation) { if (_userProvider.userInfoModel!.type == 1) {
return ['待巡检', '已巡检', '巡检中', '未巡检', '全部']; return ['待巡检', '已巡检', '巡检中', '未巡检', '全部'];
} else { } else {
return ['待巡检', '已巡检', '巡检中', '未巡检', '全部']; return ['待巡检', '已巡检', '巡检中', '未巡检', '全部'];

@ -1,20 +1,18 @@
// Flutter imports: // Flutter imports:
import 'package:flutter/material.dart'; // Project imports:
import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
// Package imports: // Package imports:
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
class NickNameChangePage extends StatefulWidget { class NickNameChangePage extends StatefulWidget {
NickNameChangePage({Key? key}) : super(key: key); NickNameChangePage({Key? key}) : super(key: key);
@ -54,7 +52,7 @@ class _NickNameChangePageState extends State<NickNameChangePage> {
controller: _textEditingController, controller: _textEditingController,
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
hintText: '${userProvider.infoModel!.nickName}', hintText: '${userProvider.userInfoModel!.nickName}',
hintStyle: hintStyle:
TextStyle(color: Color(0xFF999999), fontSize: 34.sp), TextStyle(color: Color(0xFF999999), fontSize: 34.sp),
border: UnderlineInputBorder( border: UnderlineInputBorder(

@ -1,13 +1,6 @@
// Dart imports: // Dart imports:
import 'dart:io'; import 'dart:io';
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/tools/aku_divider.dart'; import 'package:aku_new_community_manager/tools/aku_divider.dart';
@ -20,6 +13,11 @@ import 'package:aku_new_community_manager/ui/widgets/app_widgets/aku_avatar.dart
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_tile.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/pick_image.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/pick_image.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
// Flutter imports:
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class UserInfoPage extends StatefulWidget { class UserInfoPage extends StatefulWidget {
UserInfoPage({Key? key}) : super(key: key); UserInfoPage({Key? key}) : super(key: key);
@ -40,7 +38,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
AkuTile( AkuTile(
onTap: () async { onTap: () async {
File? file = await akuPickImage(); File? file = await akuPickImage();
if (file != null) await userProvider.setAvatar(file); if (file != null) await userProvider.updateAvatar(file);
}, },
title: Text('头像'), title: Text('头像'),
height: 168.w, height: 168.w,
@ -52,7 +50,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
setState(() {}); setState(() {});
}, },
title: Text('昵称'), title: Text('昵称'),
suffix: Text(userProvider.infoModel!.nickName!), suffix: Text(userProvider.userInfoModel!.nickName!),
), ),
AkuTile( AkuTile(
onTap: () async { onTap: () async {
@ -60,7 +58,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
setState(() {}); setState(() {});
}, },
title: Text('手机'), title: Text('手机'),
suffix: Text(TextUtil.hideNumber(userProvider.profileModel!.tel!)), suffix: Text(TextUtil.hideNumber(userProvider.userInfoModel!.tel)),
), ),
].sepWidget(separate: AkuDivider.horizontal()), ].sepWidget(separate: AkuDivider.horizontal()),
), ),

@ -1,11 +1,11 @@
// Flutter imports: // Flutter imports:
// Project imports: // Project imports:
import 'package:aku_new_community_manager/new_ui/auth/login_root_page.dart';
import 'package:aku_new_community_manager/provider/app_provider.dart'; import 'package:aku_new_community_manager/provider/app_provider.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/ui/agreements/agreement_page.dart'; import 'package:aku_new_community_manager/ui/agreements/agreement_page.dart';
import 'package:aku_new_community_manager/ui/agreements/privacy_page.dart'; import 'package:aku_new_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_new_community_manager/ui/home/home_page.dart';
import 'package:aku_new_community_manager/utils/dev_util.dart'; import 'package:aku_new_community_manager/utils/dev_util.dart';
import 'package:aku_new_community_manager/utils/hive_store.dart'; import 'package:aku_new_community_manager/utils/hive_store.dart';
// Package imports: // Package imports:
@ -43,6 +43,8 @@ class _SplashPageState extends State<SplashPage> {
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
if (HiveStore.appBox!.containsKey('token')) { if (HiveStore.appBox!.containsKey('token')) {
await userProvider.setLogin(HiveStore.appBox!.get('token')); await userProvider.setLogin(HiveStore.appBox!.get('token'));
} else {
Get.to(() => LoginPage());
} }
//AMap //AMap
// await AmapLocation.instance.init(iosKey: 'ios key'); // await AmapLocation.instance.init(iosKey: 'ios key');
@ -122,7 +124,6 @@ class _SplashPageState extends State<SplashPage> {
} }
if (mounted) PowerLogger.start(context, debug: DevUtil.isDev); if (mounted) PowerLogger.start(context, debug: DevUtil.isDev);
await _initOp(); await _initOp();
Get.off(() => HomePage());
}); });
} }

@ -32,7 +32,7 @@ class _AllBorrowGoodsState extends State<AllBorrowGoods> {
return AkuScaffold( return AkuScaffold(
title: '全部物品', title: '全部物品',
actions: [ actions: [
userProvider.infoModel!.canOperation userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
minWidth: 120.w, minWidth: 120.w,
onPressed: () { onPressed: () {

@ -45,7 +45,7 @@ class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
return AkuScaffold( return AkuScaffold(
title: '物品详情', title: '物品详情',
actions: [ actions: [
userProvider.infoModel!.canOperation userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
minWidth: 120.w, minWidth: 120.w,
onPressed: () async { onPressed: () async {

@ -33,7 +33,7 @@ class _BorrowItemPageState extends State<BorrowItemPage> {
return AkuScaffold( return AkuScaffold(
title: '物品查看', title: '物品查看',
actions: [ actions: [
userProvider.infoModel!.canOperation userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
minWidth: 120.w, minWidth: 120.w,
onPressed: () { onPressed: () {
@ -95,7 +95,7 @@ class _BorrowItemPageState extends State<BorrowItemPage> {
), ),
), ),
Spacer(), Spacer(),
userProvider.infoModel!.canOperation userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
onPressed: () { onPressed: () {

@ -1,14 +1,4 @@
// Flutter imports: // Flutter imports:
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/models/manager/borrow/borrow_status_item_model.dart'; import 'package:aku_new_community_manager/models/manager/borrow/borrow_status_item_model.dart';
@ -16,8 +6,16 @@ import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/widget_tool.dart'; import 'package:aku_new_community_manager/tools/widget_tool.dart';
import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_check_page.dart'; import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_check_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_chip_box.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart'; import 'package:aku_new_community_manager/utils/network/net_util.dart';
// Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'borrow_manager_examine_page.dart'; import 'borrow_manager_examine_page.dart';
@ -57,13 +55,19 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
Text( Text(
widget.model.borrowStatusValue, widget.model.borrowStatusValue,
style: TextStyle( style: TextStyle(
color: widget.model.borrowStatus==-1?Color(0xFFFB7302): color: widget.model.borrowStatus == -1
widget.model.borrowStatus==0?Color(0xD9E60E0E): ? Color(0xFFFB7302)
widget.model.borrowStatus==1?Color(0xD9000000): : widget.model.borrowStatus == 0
widget.model.borrowStatus==2?Color(0x73000000): ? Color(0xD9E60E0E)
widget.model.borrowStatus==3?Color(0xD9FB7402): : widget.model.borrowStatus == 1
widget.model.borrowStatus==4?Color(0xD9E60E0E): ? Color(0xD9000000)
AppStyle.failColor, : widget.model.borrowStatus == 2
? Color(0x73000000)
: widget.model.borrowStatus == 3
? Color(0xD9FB7402)
: widget.model.borrowStatus == 4
? Color(0xD9E60E0E)
: AppStyle.failColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 24.sp, fontSize: 24.sp,
), ),
@ -85,12 +89,17 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
children: [ children: [
FadeInImage.assetNetwork( FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(widget.model.imgUrls!.isEmpty?'':widget.model.imgUrls![0].url??''), image: API.image(widget.model.imgUrls!.isEmpty
? ''
: widget.model.imgUrls![0].url ?? ''),
height: 184.w, height: 184.w,
width: 184.w, width: 184.w,
imageErrorBuilder: (context, error, stackTrace) { imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(R.ASSETS_PLACEHOLDER_WEBP,height: 184.w, return Image.asset(
width: 184.w,); R.ASSETS_PLACEHOLDER_WEBP,
height: 184.w,
width: 184.w,
);
}, },
), ),
AkuBox.w(24), AkuBox.w(24),
@ -122,7 +131,7 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
List<Widget> _buildCard() { List<Widget> _buildCard() {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
if (!userProvider.infoModel!.canOperation) if (!(userProvider.userInfoModel!.type == 1))
return []; return [];
else if (widget.model.borrowStatus == 2) { else if (widget.model.borrowStatus == 2) {
return []; return [];
@ -190,7 +199,8 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
radius: 4.w, radius: 4.w,
onPressed: () async { onPressed: () async {
await Get.to(BorrowManagerCheckPage(id: widget.model.id!)); await Get.to(
BorrowManagerCheckPage(id: widget.model.id!));
}, },
child: Text( child: Text(
'检查信息', '检查信息',
@ -204,22 +214,26 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
: SizedBox(), : SizedBox(),
widget.model.borrowStatus == -1 widget.model.borrowStatus == -1
? AkuMaterialButton( ? AkuMaterialButton(
minWidth: 160.w, minWidth: 160.w,
height: 64.w, height: 64.w,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
radius: 4.w, radius: 4.w,
onPressed: () async { onPressed: () async {
await Get.to(BorrowManagerExaminePage(id: widget.model.id!, model: widget.model, type: 1,)); await Get.to(BorrowManagerExaminePage(
}, id: widget.model.id!,
child: Text( model: widget.model,
'点击审核', type: 1,
style: TextStyle( ));
color: AppStyle.primaryTextColor, },
fontWeight: FontWeight.bold, child: Text(
fontSize: 28.w, '点击审核',
), style: TextStyle(
), color: AppStyle.primaryTextColor,
) fontWeight: FontWeight.bold,
fontSize: 28.w,
),
),
)
: SizedBox(), : SizedBox(),
], ],
), ),

@ -1,17 +1,15 @@
// Flutter imports: // Flutter imports:
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart'; import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_view.dart'; import 'package:aku_new_community_manager/ui/sub_pages/borrow_manager/borrow_manager_view.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class BorrowManagerPage extends StatefulWidget { class BorrowManagerPage extends StatefulWidget {
BorrowManagerPage({Key? key}) : super(key: key); BorrowManagerPage({Key? key}) : super(key: key);
@ -22,14 +20,13 @@ class BorrowManagerPage extends StatefulWidget {
class _BorrowManagerPageState extends State<BorrowManagerPage> class _BorrowManagerPageState extends State<BorrowManagerPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
TabController? _tabController; TabController? _tabController;
List<String> get _tabs { List<String> get _tabs {
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
return [ return [
'全部', '全部',
...userProvider.infoModel!.canOperation ? ['待审核'] : [], ...userProvider.userInfoModel!.type == 1 ? ['待审核'] : [],
...userProvider.infoModel!.canOperation ? ['检查中'] : [], ...userProvider.userInfoModel!.type == 1 ? ['检查中'] : [],
'出借中', '出借中',
'已归还' '已归还'
]; ];
@ -77,14 +74,13 @@ class _BorrowManagerPageState extends State<BorrowManagerPage>
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
return [ return [
BorrowManagerView(), BorrowManagerView(),
...userProvider.infoModel!.canOperation ...userProvider.userInfoModel!.type == 1
? [BorrowManagerView(status: -1)] ? [BorrowManagerView(status: -1)]
: [], : [],
...userProvider.infoModel!.canOperation ...userProvider.userInfoModel!.type == 1
? [BorrowManagerView(status: 3)] ? [BorrowManagerView(status: 3)]
: [], : [],
BorrowManagerView(status: 1), BorrowManagerView(status: 1),
BorrowManagerView(status: 2), BorrowManagerView(status: 2),
]; ];
} }

@ -66,8 +66,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
UserProvider userProvider = UserProvider userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
return Text( return Text(
AkuMap.fixStatus(userProvider.infoModel!.canOperation, AkuMap.fixStatus(userProvider.userInfoModel!.type == 1,
userProvider.infoModel!.canPickUpTicket, widget.model.status!), userProvider.userInfoModel!.type == 1, widget.model.status!),
style: TextStyle( style: TextStyle(
color: widget.model.status! < 4 color: widget.model.status! < 4
? Color(0XFFFF4501) ? Color(0XFFFF4501)
@ -117,7 +117,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
final userProvider = final userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
// + = // + =
if (userProvider.infoModel!.canSendTicket && if (userProvider.userInfoModel!.type == 1 &&
widget.model.status! < 2) { widget.model.status! < 2) {
return AkuMaterialButton( return AkuMaterialButton(
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
@ -138,7 +138,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
); );
//+= //+=
} else if (widget.model.status == 2) { } else if (widget.model.status == 2) {
if (userProvider.infoModel!.canSendTicket) { if (userProvider.userInfoModel!.type == 1) {
return AkuMaterialButton( return AkuMaterialButton(
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor, nullColor: AppStyle.minorColor,
@ -179,7 +179,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
} }
//+= //+=
} else if ((widget.model.status == 3) && } else if ((widget.model.status == 3) &&
userProvider.infoModel!.canPickUpTicket) userProvider.userInfoModel!.type == 1)
return Container( return Container(
height: 96.w, height: 96.w,
alignment: Alignment.center, alignment: Alignment.center,

@ -1,15 +1,13 @@
// Flutter imports: // Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/tools/screen_tool.dart'; import 'package:aku_new_community_manager/tools/screen_tool.dart';
import 'package:aku_new_community_manager/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart'; import 'package:aku_new_community_manager/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
class BusinessAndFixPage extends StatefulWidget { class BusinessAndFixPage extends StatefulWidget {
BusinessAndFixPage({Key? key}) : super(key: key); BusinessAndFixPage({Key? key}) : super(key: key);
@ -35,11 +33,9 @@ class _BusinessAndFixPageState extends State<BusinessAndFixPage>
// return ['待接单', '处理中', '已处理', '全部']; // return ['待接单', '处理中', '已处理', '全部'];
// break; // break;
// } // }
if ((userProvider.infoModel!.canPickUpTicket) && if ((userProvider.userInfoModel!.type == 1)) {
(!userProvider.infoModel!.canSendTicket)) {
return ['待接单', '处理中', '已处理', '全部']; return ['待接单', '处理中', '已处理', '全部'];
} else if ((!userProvider.infoModel!.canPickUpTicket) && } else if ((userProvider.userInfoModel!.type == 1)) {
(userProvider.infoModel!.canSendTicket)) {
return ['待派单', '已派单', '处理中', '已处理', '全部']; return ['待派单', '已派单', '处理中', '已处理', '全部'];
} else { } else {
return ['未处理', '处理中', '已处理', '全部']; return ['未处理', '处理中', '已处理', '全部'];

@ -2,8 +2,8 @@
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart'; import 'package:aku_new_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_new_community_manager/models/user/user_info_model.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/saas_models/user/user_info_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/aku_map.dart'; import 'package:aku_new_community_manager/tools/aku_map.dart';
import 'package:aku_new_community_manager/tools/screen_tool.dart'; import 'package:aku_new_community_manager/tools/screen_tool.dart';
@ -41,9 +41,9 @@ class BusinessFixCard extends StatefulWidget {
} }
class _BusinessFixCardState extends State<BusinessFixCard> { class _BusinessFixCardState extends State<BusinessFixCard> {
UserInformationModel? get userInfoModel { UserInfoModel? get userInfoModel {
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
return userProvider.infoModel; return userProvider.userInfoModel;
} }
String get dateStart => DateUtil.formatDateStr(widget.model.repairDate!, String get dateStart => DateUtil.formatDateStr(widget.model.repairDate!,
@ -102,8 +102,8 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
Text( Text(
widget.hasFinished widget.hasFinished
? '已处理' ? '已处理'
: AkuMap.fixStatus(userInfoModel!.canSendTicket, : AkuMap.fixStatus(userInfoModel!.type == 1,
userInfoModel!.canPickUpTicket, widget.model.status!), userInfoModel!.type == 1, widget.model.status!),
style: widget.hasFinished style: widget.hasFinished
? TextStyle(color: AppStyle.minorTextColor) ? TextStyle(color: AppStyle.minorTextColor)
: TextStyle( : TextStyle(
@ -196,7 +196,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canSendTicket (UserTool.userProvider.userInfoModel!.type == 1
? '立即派单' ? '立即派单'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -222,9 +222,9 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canSendTicket (UserTool.userProvider.userInfoModel!.type == 1
? '改派' ? '改派'
: UserTool.userProvider.infoModel!.canPickUpTicket : UserTool.userProvider.userInfoModel!.type == 1
? '立即接单' ? '立即接单'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -238,7 +238,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
]; ];
case 3: case 3:
return [ return [
UserTool.userProvider.infoModel!.canPickUpTicket UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton( ? AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
@ -275,7 +275,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canPickUpTicket (UserTool.userProvider.userInfoModel!.type == 1
? '处理完成' ? '处理完成'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(

@ -1,12 +1,10 @@
// Flutter imports: // Flutter imports:
// Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart';
class DecorationUIUtil { class DecorationUIUtil {
BuildContext context; BuildContext context;
UserProvider get userProvider => UserProvider get userProvider =>
@ -50,8 +48,7 @@ class DecorationUIUtil {
} }
case 2: case 2:
if (status < 5) { if (status < 5) {
if (userProvider.infoModel?.canOperation != null && if (userProvider.userInfoModel!.type == 1) {
userProvider.infoModel!.canOperation) {
return '已指派'; return '已指派';
} else { } else {
return '待执行'; return '待执行';

@ -4,6 +4,7 @@ import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/const/resource.dart'; import 'package:aku_new_community_manager/const/resource.dart';
import 'package:aku_new_community_manager/models/manager/goods_out/goods_out_detail_model.dart'; import 'package:aku_new_community_manager/models/manager/goods_out/goods_out_detail_model.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart'; import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart';
import 'package:aku_new_community_manager/tools/widget_tool.dart'; import 'package:aku_new_community_manager/tools/widget_tool.dart';
@ -12,7 +13,6 @@ import 'package:aku_new_community_manager/ui/sub_pages/items_outdoor/outdoor_pas
import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart'; import 'package:aku_new_community_manager/utils/network/net_util.dart';
// Package imports: // Package imports:
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
@ -277,7 +277,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
switch (_model!.status) { switch (_model!.status) {
case 1: case 1:
return userProvider.infoModel!.canPass return userProvider.userInfoModel!.type == 1
? Container( ? Container(
height: 98.w, height: 98.w,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -1,18 +1,17 @@
// Flutter imports: // Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_new_community_manager/const/api.dart'; import 'package:aku_new_community_manager/const/api.dart';
import 'package:aku_new_community_manager/const/resource.dart'; import 'package:aku_new_community_manager/const/resource.dart';
import 'package:aku_new_community_manager/models/common/img_model.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart'; import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
class AkuAvatar extends StatelessWidget { class AkuAvatar extends StatelessWidget {
final double? size; final double? size;
AkuAvatar({Key? key, this.size}) : super(key: key); AkuAvatar({Key? key, this.size}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -24,7 +23,8 @@ class AkuAvatar extends StatelessWidget {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(userProvider.profileModel!.firstImg?.url ?? ''), image: API.image(
ImgModel.first(userProvider.userInfoModel!.imgList) ?? ''),
height: size ?? 72.w, height: size ?? 72.w,
width: size ?? 72.w, width: size ?? 72.w,
fit: BoxFit.cover, fit: BoxFit.cover,

Loading…
Cancel
Save