接入用户详情

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

@ -11,7 +11,7 @@ class SAASAPI {
///
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';
@ -30,6 +30,9 @@ class SAASAPI {
}
class _Login {
///
String get userInfo => '/butlerApp/user/findDetail';
///
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:equatable/equatable.dart';
import 'package:aku_new_community_manager/models/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'house_keeping_list_model.g.dart';
@JsonSerializable()
@ -58,8 +57,7 @@ class HouseKeepingListModel extends Equatable {
case 1:
return '待派单';
case 2:
if (UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.PICK) {
if (UserTool.userProvider.userInfoModel!.type == 1) {
return '已派单';
} else {
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/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_psd_page.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/ui/home/home_page.dart';
@ -45,13 +43,6 @@ class SignFunc {
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 {
BaseModel baseModel = await NetUtil().get(SAASAPI.user.settingPsd,
@ -91,9 +82,7 @@ class SignFunc {
}
static Future checkNameAndAccount() async {
if (!UserTool.userProvider.userInfoModel!.isExistPassword) {
await Get.to(() => SetPsdPage());
} else if (UserTool.userProvider.userInfoModel!.nickName == null) {
if (UserTool.userProvider.userInfoModel!.nickName == null) {
await Get.to(() => SetNickNamePage());
} else {
Get.offAll(() => HomePage());

@ -1,13 +1,10 @@
// Dart imports:
import 'dart:io';
// Project imports:
import 'package:aku_new_community_manager/const/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/user/user_info_model.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:
import 'package:bot_toast/bot_toast.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 {
@ -32,50 +26,14 @@ class UserProvider extends ChangeNotifier {
NetUtil().auth(token);
await HiveStore.appBox!.put('token', token);
await HiveStore.appBox!.put('login', true);
_profileModel = await updateProfile();
_infoModel = await updateUserInfo();
if (isLogin) {
WebSocketUtil().setUser(_infoModel?.id.toString() ?? '');
await updateUserInfo();
WebSocketUtil().setUser(_userInfoModel!.id.toString());
WebSocketUtil().startWebSocket();
}
// await setCurrentHouse((_userDetailModel?.estateNames?.isEmpty ?? true)
// ? ''
// : _userDetailModel?.estateNames?.first);
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 {
await NetUtil().get(API.auth.logout, showMessage: true);
@ -92,39 +50,14 @@ class UserProvider extends ChangeNotifier {
///
get isSigned => _isSigned;
///
setisSigned(bool state) {
_isSigned = state;
notifyListeners();
}
///
setNickName(String name) {
_infoModel!.nickName = name;
// _infoModel!.nickName = name;
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) {
_profileModel!.tel = tel;
notifyListeners();
}
@ -135,11 +68,20 @@ class UserProvider extends ChangeNotifier {
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(
SAASAPI.user.updateAvatar,
params: {
'fileUrls': [path]
'fileUrls': [url]
},
showMessage: true,
);
@ -147,4 +89,14 @@ class UserProvider extends ChangeNotifier {
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:common_utils/common_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'user_info_model.g.dart';
@JsonSerializable()
class UserInfoModel {
class UserInfoModel extends Equatable {
final int id;
final int communityId;
final String communityCode;
final String? name;
final String? idCard;
final String userName;
final int type;
final String actualName;
final String tel;
// 1. 2. 3.
final int? sex;
final int sex;
final String userCode;
final String? birthDay;
final String? email;
final int status;
final int? lastLoginIp;
final String? lastLoginDate;
final String? nickName;
final bool isExistPassword;
final bool isPointsSignSetting;
final bool isSign;
final int? points;
final List<ImgModel> imgList;
final String? address;
final String entryDate;
final String? remake;
final List<ImgModel>? imgList;
String get sexValue {
if (sex == 1) return '';
@ -28,31 +32,56 @@ class UserInfoModel {
return '未设置';
}
// DateTime? get birthdayDate => DateUtil.getDateTime(birthday ?? '');
DateTime? get birthdayDate => DateUtil.getDateTime(birthDay ?? '');
// String get birthdayValue {
// if (TextUtil.isEmpty(birthday))
// return '未设置';
// else
// return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
// }
String get birthdayValue {
if (TextUtil.isEmpty(birthDay))
return '未设置';
else
return DateUtil.formatDate(birthdayDate, format: 'yyyy-MM-dd');
}
factory UserInfoModel.fromJson(Map<String, dynamic> 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({
required this.id,
required this.communityId,
required this.communityCode,
this.name,
this.idCard,
required this.userName,
required this.type,
required this.actualName,
required this.tel,
this.sex,
required this.sex,
required this.userCode,
this.birthDay,
this.email,
required this.status,
this.lastLoginIp,
this.lastLoginDate,
this.nickName,
required this.isExistPassword,
required this.isPointsSignSetting,
required this.isSign,
this.points,
required this.imgList,
this.address,
required this.entryDate,
this.remake,
this.imgList,
});
}

@ -9,18 +9,22 @@ part of 'user_info_model.dart';
UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
UserInfoModel(
id: json['id'] as int,
communityId: json['communityId'] as int,
communityCode: json['communityCode'] as String,
name: json['name'] as String?,
idCard: json['idCard'] as String?,
userName: json['userName'] as String,
type: json['type'] as int,
actualName: json['actualName'] 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?,
isExistPassword: json['isExistPassword'] as bool,
isPointsSignSetting: json['isPointsSignSetting'] as bool,
isSign: json['isSign'] as bool,
points: json['points'] as int?,
imgList: (json['imgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
address: json['address'] as String?,
entryDate: json['entryDate'] as String,
remake: json['remake'] as String?,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.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/style/app_style.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_VISITORS_PNG, () => VisitorManagerPage()),
if (!UserTool.userProvider.infoModel!.hideFix)
if (!(UserTool.userProvider.userInfoModel!.type == 1))
AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication(
@ -97,11 +93,10 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication(
'考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()),
if (UserTool.userProvider.infoModel!.houseKeepingAuthority != HKAUTH.HIDE)
if (UserTool.userProvider.userInfoModel!.type == 1)
AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
if (UserTool.userProvider.infoModel!.engineeringRepairAuthority !=
ERAUTH.HIDE)
if (UserTool.userProvider.userInfoModel!.type == 1)
AppApplication(
'工程维修', R.ASSETS_HOME_IC_SERVICE_PNG, () => EngineerRepairPage()),
];

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

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

@ -1,38 +1,36 @@
// 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:
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/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/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/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/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/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/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/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/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/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: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 {
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_VISITORS_PNG, () => VisitorManagerPage()),
if (UserTool.userProvider.infoModel!.manager)
if (UserTool.userProvider.userInfoModel!.type == 1)
AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
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_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/models/user/user_info_model.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/ui/manage_pages/engineer_repair/engineer_repair_acceptance_page.dart';
@ -130,8 +129,7 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton(
height: 64.w,
onPressed: () async {
(UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY)
(true)
? await Get.to(
() => EngineerRepairDepartCompany(repairId: model.id))
: await Get.to(() =>
@ -142,8 +140,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
(UserTool.userProvider.userInfoModel!.type == 1
? '分派单位'
: '查看详情'),
style: TextStyle(
@ -160,8 +157,7 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton(
height: 64.w,
onPressed: () async {
(UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOPERSON)
(UserTool.userProvider.userInfoModel!.type == 1)
? await Get.to(() =>
EngineerRepairDetailPage(repairEngineerId: model.id))
: await Get.to(() =>
@ -172,8 +168,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOPERSON
(UserTool.userProvider.userInfoModel!.type == 1
? '指派人员'
: '查看详情'),
style: TextStyle(
@ -187,8 +182,7 @@ class EngineerRepairCard extends StatelessWidget {
];
case 3:
return [
UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.PICK
UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton(
height: 64.w,
onPressed: () async {
@ -258,9 +252,7 @@ class EngineerRepairCard extends StatelessWidget {
return [
AkuMaterialButton(
height: 64.w,
onPressed: UserTool
.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
onPressed: UserTool.userProvider.userInfoModel!.type == 1
? () async {
EngineerRepairResultModel? resultModel =
await EngineerRepairFunc.getRepairResult(model.id);
@ -285,10 +277,7 @@ class EngineerRepairCard extends StatelessWidget {
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
? '验收审核'
: '验收记录',
UserTool.userProvider.userInfoModel!.type == 1 ? '验收审核' : '验收记录',
style: TextStyle(
color: AppStyle.primaryTextColor,
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_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/models/user/user_info_model.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';
@ -127,8 +126,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
if (_model != null) {
switch (_model!.status) {
case 1:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
return UserTool.userProvider.userInfoModel!.type == 1
? AkuBottomButton(
title: '立即派单',
onTap: () async {
@ -138,10 +136,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
)
: SizedBox();
case 2:
print(UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOPERSON);
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOPERSON
return UserTool.userProvider.userInfoModel!.type == 1
? AkuBottomButton(
title: '立即派单',
onTap: () async {
@ -153,8 +148,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
)
: SizedBox();
case 3:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.PICK
return UserTool.userProvider.userInfoModel!.type == 1
? AkuBottomButton(
title: '立即接单',
onTap: () async {
@ -167,8 +161,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
)
: SizedBox();
case 4:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.PICK
return UserTool.userProvider.userInfoModel!.type == 1
? Row(
children: [
AkuMaterialButton(
@ -193,8 +186,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
)
: SizedBox();
case 5:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
return UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton(
color: kPrimaryColor,
onPressed: () async {
@ -213,8 +205,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
'验收审核'.text.size(32.sp).bold.color(Colors.black).make())
: SizedBox();
case 6:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.PICK
return UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton(
color: kPrimaryColor,
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/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';
@ -21,13 +20,13 @@ class EngineerRepairPage extends StatefulWidget {
class _EngineerRepairPageState extends State<EngineerRepairPage>
with TickerProviderStateMixin {
List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.engineeringRepairAuthority) {
case ERAUTH.SENDTOCOMPANY:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.SENDTOPERSON:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.PICK:
return ['全部', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
switch (UserTool.userProvider.userInfoModel!.type == 1) {
// case ERAUTH.SENDTOCOMPANY:
// return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
// case ERAUTH.SENDTOPERSON:
// return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
// case ERAUTH.PICK:
// return ['全部', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
default:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
}

@ -1,6 +1,5 @@
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/models/user/user_info_model.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/widgets/common/bee_list_view.dart';
@ -24,19 +23,19 @@ class _EngineerRepairViewState extends State<EngineerRepairView> {
if (widget.index == 0) {
return null;
} else if (widget.index == 1) {
switch (UserTool.userProvider.infoModel!.engineeringRepairAuthority) {
case ERAUTH.SENDTOCOMPANY:
return 1;
case ERAUTH.SENDTOPERSON:
return 2;
case ERAUTH.PICK:
return 3;
case ERAUTH.HIDE:
break;
switch (UserTool.userProvider.userInfoModel!.type == 1) {
// case ERAUTH.SENDTOCOMPANY:
// return 1;
// case ERAUTH.SENDTOPERSON:
// return 2;
// case ERAUTH.PICK:
// return 3;
// case ERAUTH.HIDE:
// break;
default:
}
} else {
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.PICK
return UserTool.userProvider.userInfoModel!.type == 1
? widget.index + 2
: widget.index + 1;
}

@ -1,7 +1,6 @@
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_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/tools/user_tool.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(
height: 64.w,
onPressed: () async {
(UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.SEND)
(UserTool.userProvider.userInfoModel!.type == 1)
? Get.to(() => HouseKeepingDepartmentPage(
id: model.id,
callRefresh: callRefresh,
@ -157,8 +155,7 @@ class HouseKeepingCard extends StatelessWidget {
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.SEND
(UserTool.userProvider.userInfoModel!.type == 1
? '立即派单'
: '查看详情'),
style: TextStyle(
@ -176,8 +173,7 @@ class HouseKeepingCard extends StatelessWidget {
height: 64.w,
onPressed: () async {
Function cancel = BotToast.showLoading();
(UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.SEND)
(UserTool.userProvider.userInfoModel!.type == 1)
? await HouseKeepingFunc.newHouseKeepingUrgeWork(model.id)
: await HouseKeepingFunc.newHouseKeepingOrderReceive(
model.id);
@ -188,10 +184,7 @@ class HouseKeepingCard extends StatelessWidget {
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.PICK
? '立即接单'
: '催单'),
(UserTool.userProvider.userInfoModel!.type == 1 ? '立即接单' : '催单'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
@ -203,7 +196,7 @@ class HouseKeepingCard extends StatelessWidget {
];
case 3:
return [
UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.PICK
UserTool.userProvider.userInfoModel!.type == 1
? AkuMaterialButton(
height: 64.w,
onPressed: () async {

@ -1,7 +1,6 @@
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_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/tools/aku_divider.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/inner/aku_bottom_button.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:flutter/cupertino.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_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.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 {
final HouseKeepingListModel model;
@ -79,8 +78,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
},
);
case 2:
return UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.PICK
return UserTool.userProvider.userInfoModel!.type == 1
? AkuBottomButton(
title: '立即接单',
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/ui/manage_pages/house_keeping/house_keeping_view.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>
with TickerProviderStateMixin {
List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) {
case HKAUTH.SEND:
switch (UserTool.userProvider.userInfoModel!.type == 1) {
// case HKAUTH.SEND:
case true:
return ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成'];
case HKAUTH.PICK:
// case HKAUTH.PICK:
case false:
return ['全部', '已派单', '处理中', '待支付', '待评价', '已完成'];
default:
return [];

@ -1,6 +1,5 @@
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/models/user/user_info_model.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/widgets/common/bee_list_view.dart';
@ -33,14 +32,16 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
}
int? get housekeepingServiceStatus {
switch (UserTool.userProvider.infoModel!.houseKeepingAuthority) {
case HKAUTH.PICK:
switch (UserTool.userProvider.userInfoModel!.type) {
// case HKAUTH.PICK:
case 1:
if (widget.index == 0) {
return null;
} else {
return widget.index + 1;
}
case HKAUTH.SEND:
// case HKAUTH.SEND:
case 2:
return widget.index == 0 ? null : widget.index;
default:
return widget.index == 0 ? null : widget.index;

@ -1,19 +1,17 @@
// 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:
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/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/widgets/common/aku_button.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 {
final InspectionListModel cardModel;
@ -48,7 +46,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
bool get isManager {
UserProvider userProvider = Provider.of<UserProvider>(context);
return userProvider.infoModel!.canOperation;
return userProvider.userInfoModel!.type == 1;
}
@override

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

@ -1,20 +1,18 @@
// 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:
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.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 {
NickNameChangePage({Key? key}) : super(key: key);
@ -54,7 +52,7 @@ class _NickNameChangePageState extends State<NickNameChangePage> {
controller: _textEditingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: '${userProvider.infoModel!.nickName}',
hintText: '${userProvider.userInfoModel!.nickName}',
hintStyle:
TextStyle(color: Color(0xFF999999), fontSize: 34.sp),
border: UnderlineInputBorder(

@ -1,13 +1,6 @@
// Dart imports:
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:
import 'package:aku_new_community_manager/provider/user_provider.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_tile.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 {
UserInfoPage({Key? key}) : super(key: key);
@ -40,7 +38,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
AkuTile(
onTap: () async {
File? file = await akuPickImage();
if (file != null) await userProvider.setAvatar(file);
if (file != null) await userProvider.updateAvatar(file);
},
title: Text('头像'),
height: 168.w,
@ -52,7 +50,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
setState(() {});
},
title: Text('昵称'),
suffix: Text(userProvider.infoModel!.nickName!),
suffix: Text(userProvider.userInfoModel!.nickName!),
),
AkuTile(
onTap: () async {
@ -60,7 +58,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
setState(() {});
},
title: Text('手机'),
suffix: Text(TextUtil.hideNumber(userProvider.profileModel!.tel!)),
suffix: Text(TextUtil.hideNumber(userProvider.userInfoModel!.tel)),
),
].sepWidget(separate: AkuDivider.horizontal()),
),

@ -1,11 +1,11 @@
// Flutter 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/user_provider.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/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/hive_store.dart';
// Package imports:
@ -43,6 +43,8 @@ class _SplashPageState extends State<SplashPage> {
final userProvider = Provider.of<UserProvider>(context, listen: false);
if (HiveStore.appBox!.containsKey('token')) {
await userProvider.setLogin(HiveStore.appBox!.get('token'));
} else {
Get.to(() => LoginPage());
}
//AMap
// await AmapLocation.instance.init(iosKey: 'ios key');
@ -122,7 +124,6 @@ class _SplashPageState extends State<SplashPage> {
}
if (mounted) PowerLogger.start(context, debug: DevUtil.isDev);
await _initOp();
Get.off(() => HomePage());
});
}

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

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

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

@ -1,14 +1,4 @@
// 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:
import 'package:aku_new_community_manager/const/api.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/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/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/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';
@ -57,13 +55,19 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
Text(
widget.model.borrowStatusValue,
style: TextStyle(
color: widget.model.borrowStatus==-1?Color(0xFFFB7302):
widget.model.borrowStatus==0?Color(0xD9E60E0E):
widget.model.borrowStatus==1?Color(0xD9000000):
widget.model.borrowStatus==2?Color(0x73000000):
widget.model.borrowStatus==3?Color(0xD9FB7402):
widget.model.borrowStatus==4?Color(0xD9E60E0E):
AppStyle.failColor,
color: widget.model.borrowStatus == -1
? Color(0xFFFB7302)
: widget.model.borrowStatus == 0
? Color(0xD9E60E0E)
: widget.model.borrowStatus == 1
? Color(0xD9000000)
: widget.model.borrowStatus == 2
? Color(0x73000000)
: widget.model.borrowStatus == 3
? Color(0xD9FB7402)
: widget.model.borrowStatus == 4
? Color(0xD9E60E0E)
: AppStyle.failColor,
fontWeight: FontWeight.bold,
fontSize: 24.sp,
),
@ -85,12 +89,17 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
children: [
FadeInImage.assetNetwork(
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,
width: 184.w,
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(R.ASSETS_PLACEHOLDER_WEBP,height: 184.w,
width: 184.w,);
return Image.asset(
R.ASSETS_PLACEHOLDER_WEBP,
height: 184.w,
width: 184.w,
);
},
),
AkuBox.w(24),
@ -122,7 +131,7 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
List<Widget> _buildCard() {
final userProvider = Provider.of<UserProvider>(context);
if (!userProvider.infoModel!.canOperation)
if (!(userProvider.userInfoModel!.type == 1))
return [];
else if (widget.model.borrowStatus == 2) {
return [];
@ -190,7 +199,8 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
color: AppStyle.primaryColor,
radius: 4.w,
onPressed: () async {
await Get.to(BorrowManagerCheckPage(id: widget.model.id!));
await Get.to(
BorrowManagerCheckPage(id: widget.model.id!));
},
child: Text(
'检查信息',
@ -209,7 +219,11 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
color: AppStyle.primaryColor,
radius: 4.w,
onPressed: () async {
await Get.to(BorrowManagerExaminePage(id: widget.model.id!, model: widget.model, type: 1,));
await Get.to(BorrowManagerExaminePage(
id: widget.model.id!,
model: widget.model,
type: 1,
));
},
child: Text(
'点击审核',

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

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

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

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

@ -1,12 +1,10 @@
// Flutter imports:
// Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_new_community_manager/provider/user_provider.dart';
class DecorationUIUtil {
BuildContext context;
UserProvider get userProvider =>
@ -50,8 +48,7 @@ class DecorationUIUtil {
}
case 2:
if (status < 5) {
if (userProvider.infoModel?.canOperation != null &&
userProvider.infoModel!.canOperation) {
if (userProvider.userInfoModel!.type == 1) {
return '已指派';
} else {
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/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/saas_models/net_model/base_model.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/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_material_button.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';
// Package imports:
import 'package:common_utils/common_utils.dart';
@ -277,7 +277,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
final userProvider = Provider.of<UserProvider>(context);
switch (_model!.status) {
case 1:
return userProvider.infoModel!.canPass
return userProvider.userInfoModel!.type == 1
? Container(
height: 98.w,
decoration: BoxDecoration(

@ -1,14 +1,13 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_new_community_manager/const/api.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:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
class AkuAvatar extends StatelessWidget {
final double? size;
@ -24,7 +23,8 @@ class AkuAvatar extends StatelessWidget {
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(userProvider.profileModel!.firstImg?.url ?? ''),
image: API.image(
ImgModel.first(userProvider.userInfoModel!.imgList) ?? ''),
height: size ?? 72.w,
width: size ?? 72.w,
fit: BoxFit.cover,

Loading…
Cancel
Save