remove mock models

hmxc
张萌 4 years ago
parent 27fd4e306c
commit 5fa0586230

@ -13,8 +13,6 @@ import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/provider/app_provider.dart'; import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/fix_provider.dart';
import 'package:aku_community_manager/provider/manage_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/apptheme.dart'; import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/ui/splash/splash_page.dart'; import 'package:aku_community_manager/ui/splash/splash_page.dart';
@ -64,13 +62,13 @@ class MyApp extends StatelessWidget {
providers: [ providers: [
ChangeNotifierProvider(create: (context) => UserProvider()), ChangeNotifierProvider(create: (context) => UserProvider()),
ChangeNotifierProvider(create: (context) => AppProvider()), ChangeNotifierProvider(create: (context) => AppProvider()),
ChangeNotifierProvider(create: (context) => FixProvider()), // ChangeNotifierProvider(create: (context) => FixProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()), // ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider( // ChangeNotifierProvider(
create: (context) => InspectionManageProvider()), // create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()), // ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider( // ChangeNotifierProvider(
create: (context) => InspectionManageProvider()), // create: (context) => InspectionManageProvider()),
], ],
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {

@ -1,55 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_data.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart';
@Deprecated('this mock model should be removed')
class AllModel {
BuildContext context;
AllModel(this.context);
List get allThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels,
...DecorationData.allModels,
];
}
List get waitThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.WAIT_PICKUP;
}).toList(),
...DecorationData.getModels(DecorationType.WAIT_HAND_OUT),
];
}
List get processingThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.PROCESSING;
}).toList(),
...DecorationData.getModels(DecorationType.HAND_OUT),
];
}
List get doneThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.DONE;
}).toList(),
...DecorationData.getModels(DecorationType.DONE),
];
}
}

@ -1,95 +0,0 @@
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("borrow_data need to be cleaned.")
class BorrowData {
static List<BorrowModel> get checkModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.WAIT_CHECK;
}).toList();
static List<BorrowModel> get borrowModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.BORROWING;
}).toList();
static List<BorrowModel> get doneModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.DONE;
}).toList();
static List<BorrowModel> models = [
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.WAIT_CHECK,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.DONE,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '借用电钻一把',
borrowPerson: '刘虎门',
borrowTime: 12,
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '电钻',
assetpath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
code: '31937293841',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 4, 5, 12, 35, 45),
),
BorrowModel(
borrowPerson: '刘海保',
borrowTime: 5,
title: '借用榔头一把',
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '榔头',
assetpath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
code: '3193794102481',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 3, 5, 12, 35, 45),
),
];
static List<BorrowObject> borrowObjects = [
BorrowObject.init(
name: '电钻',
assetPath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
allNumber: 5,
),
BorrowObject.init(
name: '梯子',
assetPath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
allNumber: 3,
),
BorrowObject.init(
name: '三角榔头',
assetPath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
allNumber: 8,
),
];
}

@ -1,92 +0,0 @@
// Dart imports:
import 'dart:math';
// Package imports:
import 'package:meta/meta.dart';
enum BORROW_STATUS {
///
BORROWING,
///
WAIT_CHECK,
///
NOT_BORROW,
///
DONE,
}
enum GOODS_STATUS {
NORMAL,
BROKEN,
LOST,
}
//TODO CLEAN BOTTOM CODES.
@Deprecated(" borrow_model need to be cleaned.")
class BorrowModel {
String borrowPerson;
String phone;
int borrowTime;
GOODS_STATUS goodsStatus;
String title;
SingleBorrowGoods borrowGoods;
DateTime date;
BorrowModel({
@required this.borrowPerson,
@required this.phone,
@required this.borrowTime,
@required this.goodsStatus,
@required this.borrowGoods,
@required this.title,
@required this.date,
});
}
class BorrowObject {
String name;
int allNumber;
dynamic assetPath;
int borrowNumber;
int get restNumber => allNumber - borrowNumber;
List<SingleBorrowGoods> items;
BorrowObject.init({
this.name,
this.allNumber,
this.assetPath,
}) {
this.borrowNumber = 0;
items = List.generate(
this.allNumber,
(index) => SingleBorrowGoods(
name: '${this.name}${index + 1}',
code: (179264234 + Random().nextInt(999999)).toString(),
status: BORROW_STATUS.NOT_BORROW,
assetpath: this.assetPath,
),
);
}
}
class SingleBorrowGoods {
String name;
String code;
dynamic assetpath;
BORROW_STATUS status;
String get borrowValue => {
BORROW_STATUS.BORROWING: '出借中',
BORROW_STATUS.DONE: '已归还',
BORROW_STATUS.NOT_BORROW: '未出借',
BORROW_STATUS.WAIT_CHECK: '待检查',
}[status];
SingleBorrowGoods({
this.name,
this.code,
this.assetpath,
this.status,
});
}

@ -1,230 +0,0 @@
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
@Deprecated('this should be removed')
class DecorationData {
static List<DecorationModel> allModels = [
DecorationModel(
type: DecorationType.WAIT_HAND_OUT,
statusType: DecorationStatusType.PROGRESS,
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
userHomeModel: UserHomeModel(
userName: '林居明',
plot: '深圳华茂悦峰',
detailAddr: '2幢-2单元-501室',
phone: '19995430126',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(),
),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.HAND_OUT,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
userName: '李慧珍',
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkCycle: 7,
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
),
workFinishCheck: WorkFinishCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
],
),
checkInfomations: [
CheckInfomation(
checkDate: DateTime(2020, 3, 20, 12, 00),
info: '正常',
checkType: '完工检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 14, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 7, 12, 00),
info: '厨房水路异常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER, status: false),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 30, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 23, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
],
),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.DONE,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
userName: '李慧珍',
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkCycle: 7,
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
),
workFinishCheck: WorkFinishCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
],
),
checkInfomations: [
CheckInfomation(
checkDate: DateTime(2020, 3, 20, 12, 00),
info: '正常',
checkType: '完工检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 14, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 7, 12, 00),
info: '厨房水路异常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER, status: false),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 30, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 23, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
],
),
];
static List<DecorationModel> getModels(DecorationType type) {
return allModels.where((element) => element.type == type).toList();
}
static List<DecorationModel> getTypeModels(DecorationStatusType type) {
return allModels.where((element) => element.statusType == type).toList();
}
static List<DecorationModel> get allPropertyModels {
return allModels
.where((element) => element.type != DecorationType.WAIT_HAND_OUT)
.toList();
}
}

@ -1,186 +1,185 @@
// Flutter imports: // // Flutter imports:
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/const/resource.dart'; // import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
// enum DecorationType {
enum DecorationType { // ///
/// // WAIT_HAND_OUT,
WAIT_HAND_OUT,
// ///&
///& // HAND_OUT,
HAND_OUT,
// ///
/// // DONE,
DONE, // }
}
// enum DecorationStatusType {
enum DecorationStatusType { // PROGRESS,
PROGRESS, // DONE,
DONE, // }
}
// enum CHECK_TYPE {
enum CHECK_TYPE { // ELECTRIC,
ELECTRIC, // WATER,
WATER, // WALL,
WALL, // DOOR_AND_WINDOWS,
DOOR_AND_WINDOWS, // SECURITY,
SECURITY, // }
}
// Map<CHECK_TYPE, String> checkTypeMap = {
Map<CHECK_TYPE, String> checkTypeMap = { // CHECK_TYPE.ELECTRIC: '电路',
CHECK_TYPE.ELECTRIC: '电路', // CHECK_TYPE.WATER: '水路',
CHECK_TYPE.WATER: '水路', // CHECK_TYPE.WALL: '墙面',
CHECK_TYPE.WALL: '墙面', // CHECK_TYPE.DOOR_AND_WINDOWS: '门窗',
CHECK_TYPE.DOOR_AND_WINDOWS: '门窗', // CHECK_TYPE.SECURITY: '安防',
CHECK_TYPE.SECURITY: '安防', // };
};
// Map<String, CHECK_TYPE> checkTypeStringMap = {
Map<String, CHECK_TYPE> checkTypeStringMap = { // '电路': CHECK_TYPE.ELECTRIC,
'电路': CHECK_TYPE.ELECTRIC, // '水路': CHECK_TYPE.WATER,
'水路': CHECK_TYPE.WATER, // '墙面': CHECK_TYPE.WALL,
'墙面': CHECK_TYPE.WALL, // '门窗': CHECK_TYPE.DOOR_AND_WINDOWS,
'门窗': CHECK_TYPE.DOOR_AND_WINDOWS, // '安防': CHECK_TYPE.SECURITY,
'安防': CHECK_TYPE.SECURITY, // };
};
// Map<CHECK_TYPE, String> checkAssetMap = {
Map<CHECK_TYPE, String> checkAssetMap = { // CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG,
CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG, // CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG,
CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG, // CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG,
CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG, // CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG, // CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG, // };
};
// @Deprecated('under should be removed')
@Deprecated('under should be removed') // class DecorationModel {
class DecorationModel { // DecorationType type;
DecorationType type; // DecorationStatusType statusType;
DecorationStatusType statusType; // DateTime decorationDate;
DateTime decorationDate; // UserHomeModel userHomeModel;
UserHomeModel userHomeModel; // DecorationTeamModel decorationTeamModel;
DecorationTeamModel decorationTeamModel; // CycleCheck cycleCheck;
CycleCheck cycleCheck; // WorkFinishCheck workFinishCheck;
WorkFinishCheck workFinishCheck; // List<CheckInfomation> checkInfomations;
List<CheckInfomation> checkInfomations;
// String get statusTypeValue {
String get statusTypeValue { // if (statusType == DecorationStatusType.PROGRESS)
if (statusType == DecorationStatusType.PROGRESS) // return '装修中';
return '装修中'; // else
else // return '装修完成';
return '装修完成'; // }
}
// DecorationModel({
DecorationModel({ // @required this.type,
@required this.type, // @required this.statusType,
@required this.statusType, // @required this.userHomeModel,
@required this.userHomeModel, // @required this.decorationTeamModel,
@required this.decorationTeamModel, // @required this.decorationDate,
@required this.decorationDate, // this.cycleCheck,
this.cycleCheck, // this.workFinishCheck,
this.workFinishCheck, // this.checkInfomations,
this.checkInfomations, // });
}); // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed')
// ///
/// // class UserHomeModel {
class UserHomeModel { // String plot;
String plot; // String detailAddr;
String detailAddr; // String userName;
String userName; // String phone;
String phone; // UserHomeModel({
UserHomeModel({ // this.plot,
this.plot, // this.detailAddr,
this.detailAddr, // this.userName,
this.userName, // this.phone,
this.phone, // });
}); // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed')
// ///
/// // class DecorationTeamModel {
class DecorationTeamModel { // String name;
String name; // String userName;
String userName; // String phone;
String phone; // DecorationTeamModel({
DecorationTeamModel({ // this.name,
this.name, // this.userName,
this.userName, // this.phone,
this.phone, // });
}); // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed')
// ///
/// // class CycleCheck {
class CycleCheck { // FixerModel authPerson;
FixerModel authPerson; // DateTime startDate;
DateTime startDate;
// ///check cycle in days
///check cycle in days // int checkCycle;
int checkCycle; // List<CHECK_TYPE> checkDetails = [
List<CHECK_TYPE> checkDetails = [ // CHECK_TYPE.ELECTRIC,
CHECK_TYPE.ELECTRIC, // CHECK_TYPE.WATER,
CHECK_TYPE.WATER, // CHECK_TYPE.WALL,
CHECK_TYPE.WALL, // CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.DOOR_AND_WINDOWS, // CHECK_TYPE.SECURITY,
CHECK_TYPE.SECURITY, // ];
]; // CycleCheck({
CycleCheck({ // this.authPerson,
this.authPerson, // this.startDate,
this.startDate, // this.checkCycle,
this.checkCycle, // this.checkDetails,
this.checkDetails, // });
}); // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed') // class WorkFinishCheck {
class WorkFinishCheck { // FixerModel authPerson;
FixerModel authPerson; // DateTime startDate;
DateTime startDate; // List<CHECK_TYPE> checkDetails;
List<CHECK_TYPE> checkDetails; // WorkFinishCheck({
WorkFinishCheck({ // this.authPerson,
this.authPerson, // this.startDate,
this.startDate, // this.checkDetails,
this.checkDetails, // });
}); // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed')
// ///
/// // class CheckInfomation {
class CheckInfomation { // DateTime checkDate;
DateTime checkDate; // List<CheckDetail> details;
List<CheckDetail> details; // String info;
String info; // String checkType;
String checkType; // CheckInfomation({
CheckInfomation({ // this.checkDate,
this.checkDate, // this.info,
this.info, // this.details,
this.details, // this.checkType,
this.checkType, // });
});
// ///
/// // bool get checkAllResult {
bool get checkAllResult { // for (var item in details) {
for (var item in details) { // if (!item.status) return false;
if (!item.status) return false; // }
} // return true;
return true; // }
} // }
}
// @Deprecated('under should be removed')
@Deprecated('under should be removed') // class CheckDetail {
class CheckDetail { // CHECK_TYPE type;
CHECK_TYPE type; // bool status;
bool status; // String get assetpath => checkAssetMap[type];
String get assetpath => checkAssetMap[type]; // CheckDetail({
CheckDetail({ // @required this.type,
@required this.type, // this.status = true,
this.status = true, // });
}); // String get typeValue => checkTypeMap[type];
String get typeValue => checkTypeMap[type]; // }
}

@ -1,286 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
enum FIX_ENUM {
///
HAND_OUT,
///&&
WAIT_PICKUP,
///
PROCESSING,
///
DONE,
}
@deprecated
class FixModel {
static Map<FIX_ENUM, String> managerRoleMap = {
FIX_ENUM.HAND_OUT: '待派单',
FIX_ENUM.WAIT_PICKUP: '已派单',
FIX_ENUM.PROCESSING: '处理中',
FIX_ENUM.DONE: '已处理',
};
static Map<FIX_ENUM, String> otherRoleMap = {
FIX_ENUM.HAND_OUT: '',
FIX_ENUM.WAIT_PICKUP: '待接单',
FIX_ENUM.PROCESSING: '处理中',
FIX_ENUM.DONE: '已处理',
};
String title;
DateTime dateStart;
FIX_ENUM type;
///dynamic type
///
///img Stringassetimg File File
List imgs;
FixDetailModel detail;
FixModel({
@required this.title,
@required this.dateStart,
@required this.type,
@required this.imgs,
@required this.detail,
});
static List<FixModel> initList() {
return [
FixModel(
title: '小区大道路灯坏了。',
dateStart: DateTime(2020, 10, 25, 14, 28, 56),
type: FIX_ENUM.HAND_OUT,
imgs: [
R.ASSETS_STATIC_FIX_LIGHT1_PNG,
R.ASSETS_STATIC_FIX_LIGHT2_PNG,
R.ASSETS_STATIC_FIX_LIGHT3_PNG,
],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882928888',
fixArea: 'C区',
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
],
),
),
FixModel(
title: '小区西大门车栏坏了,请物业尽快修理更换。',
dateStart: DateTime(2020, 10, 21, 7, 28, 56),
type: FIX_ENUM.WAIT_PICKUP,
imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882928888',
fixArea: 'B区',
type: FIX_PAYMENT_TYPE.FREE,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
],
result: FixResult(
detail: '电饭煲插头没插',
material: '',
imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG],
),
),
),
FixModel(
title: '家里空调坏了,请师傅抓紧时间尽快维修。',
dateStart: DateTime(2020, 10, 21, 7, 28, 56),
type: FIX_ENUM.PROCESSING,
imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882929292',
fixArea: 'A区',
type: FIX_PAYMENT_TYPE.FREE,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
],
),
),
FixModel(
title: '家中电饭煲出问题了,请师傅速来。',
dateStart: DateTime(2020, 10, 22, 9, 28, 56),
type: FIX_ENUM.DONE,
imgs: [R.ASSETS_STATIC_FIX_FOOD2_PNG, R.ASSETS_STATIC_FIX_FOOD_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882929292',
fixArea: 'A区',
type: FIX_PAYMENT_TYPE.PAY,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
FixStatus(title: '处理完成', date: DateTime(2020, 10, 23, 11, 01, 08)),
],
result: FixResult(
detail: '电饭煲插头没插',
material: '',
imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG],
),
review: UserReviewInfo(
rate: 5,
content: '师傅太用心了',
),
priceDetail: FixPriceDetail(
humanPrice: 10,
materialPrice: 0,
),
),
),
];
}
}
///
enum FIX_PAYMENT_TYPE {
FREE,
PAY,
}
Map<FIX_PAYMENT_TYPE, String> fixPaymentMap = {
FIX_PAYMENT_TYPE.FREE: '无偿服务',
FIX_PAYMENT_TYPE.PAY: '有偿服务',
};
Map<String, FIX_PAYMENT_TYPE> fixPaymentStringMap = {
'无偿服务': FIX_PAYMENT_TYPE.FREE,
'有偿服务': FIX_PAYMENT_TYPE.PAY,
};
///
enum FIX_SUB_TYPE {
///
NORMAL,
///
HURRY,
}
Map<FIX_SUB_TYPE, String> fixSubTypeMap = {
FIX_SUB_TYPE.NORMAL: '一般单',
FIX_SUB_TYPE.HURRY: '加急单',
};
Map<String, FIX_SUB_TYPE> fixSubTypeStringMap = {
'一般单': FIX_SUB_TYPE.NORMAL,
'加急单': FIX_SUB_TYPE.HURRY,
};
///
enum FIX_DATE_LIMIT {
HOUR_24,
HOUR_12,
HOUR_8,
}
Map<FIX_DATE_LIMIT, String> fixDateLimitMap = {
FIX_DATE_LIMIT.HOUR_24: '24小时内处理',
FIX_DATE_LIMIT.HOUR_12: '12小时内处理',
FIX_DATE_LIMIT.HOUR_8: '8小时内处理',
};
Map<String, FIX_DATE_LIMIT> fixDateLimitStringMap = {
'24小时内处理': FIX_DATE_LIMIT.HOUR_24,
'12小时内处理': FIX_DATE_LIMIT.HOUR_12,
'8小时内处理': FIX_DATE_LIMIT.HOUR_8,
};
@deprecated
class FixDetailModel {
///
String userName;
String userPhoneNumber;
String fixArea;
FIX_PAYMENT_TYPE type;
FIX_DATE_LIMIT limit;
FIX_SUB_TYPE subType;
List<FixStatus> fixStatuses;
FixResult result;
UserReviewInfo review;
FixPriceDetail priceDetail;
FixDetailModel({
this.userName,
this.userPhoneNumber,
this.fixArea,
this.type,
this.limit,
this.subType,
this.fixStatuses,
this.result,
this.review,
this.priceDetail,
});
}
class FixStatus {
String title;
DateTime date;
FixStatus({
this.title,
this.date,
});
}
class FixResult {
String detail;
String material;
///dynamic img
List imgs;
FixResult({
this.detail,
this.material,
this.imgs,
});
}
class UserReviewInfo {
double rate;
String content;
UserReviewInfo({
this.rate,
this.content,
});
}
class FixPriceDetail {
double humanPrice;
double materialPrice;
FixPriceDetail({
this.humanPrice,
this.materialPrice,
});
double get allPrice => humanPrice + materialPrice;
}

@ -13,74 +13,74 @@ enum FIXER_TYPE {
} }
//TODO CLEAN BOTTOM CODES. //TODO CLEAN BOTTOM CODES.
@Deprecated("fixer_model need to be cleaned.") // @Deprecated("fixer_model need to be cleaned.")
class FixerModel { // class FixerModel {
String name; // String name;
String phone; // String phone;
FixerModel({this.name, this.phone}); // FixerModel({this.name, this.phone});
} // }
class FixerTypedModel { // class FixerTypedModel {
FIXER_TYPE type; // FIXER_TYPE type;
String get typeName { // String get typeName {
switch (type) { // switch (type) {
case FIXER_TYPE.AIR_CONDITION: // case FIXER_TYPE.AIR_CONDITION:
return '空调组'; // return '空调组';
break; // break;
case FIXER_TYPE.ELECTRIC: // case FIXER_TYPE.ELECTRIC:
return '电力组'; // return '电力组';
break; // break;
case FIXER_TYPE.CEMENT: // case FIXER_TYPE.CEMENT:
return '水泥组'; // return '水泥组';
break; // break;
case FIXER_TYPE.PROPERTY: // case FIXER_TYPE.PROPERTY:
return '物业组'; // return '物业组';
default: // default:
return ''; // return '';
} // }
} // }
List<FixerModel> fixers; // List<FixerModel> fixers;
FixerTypedModel({ // FixerTypedModel({
this.type, // this.type,
this.fixers, // this.fixers,
}); // });
static List<FixerTypedModel> models = [ // static List<FixerTypedModel> models = [
FixerTypedModel( // FixerTypedModel(
type: FIXER_TYPE.AIR_CONDITION, // type: FIXER_TYPE.AIR_CONDITION,
fixers: [ // fixers: [
FixerModel(name: '刘能建师傅', phone: '18923747283'), // FixerModel(name: '刘能建师傅', phone: '18923747283'),
FixerModel(name: '李惠政师傅', phone: '18910298345'), // FixerModel(name: '李惠政师傅', phone: '18910298345'),
FixerModel(name: '李慧珍师傅', phone: '17872342382'), // FixerModel(name: '李慧珍师傅', phone: '17872342382'),
FixerModel(name: '林 芝师傅', phone: '18292847752'), // FixerModel(name: '林 芝师傅', phone: '18292847752'),
], // ],
), // ),
FixerTypedModel( // FixerTypedModel(
type: FIXER_TYPE.CEMENT, // type: FIXER_TYPE.CEMENT,
fixers: [ // fixers: [
FixerModel(name: '李雷师傅', phone: '18923747283'), // FixerModel(name: '李雷师傅', phone: '18923747283'),
FixerModel(name: '林智师傅', phone: '18910298345'), // FixerModel(name: '林智师傅', phone: '18910298345'),
FixerModel(name: '刘凯欣师傅', phone: '17872342382'), // FixerModel(name: '刘凯欣师傅', phone: '17872342382'),
FixerModel(name: '张亮师傅', phone: '18292847752'), // FixerModel(name: '张亮师傅', phone: '18292847752'),
], // ],
), // ),
FixerTypedModel( // FixerTypedModel(
type: FIXER_TYPE.ELECTRIC, // type: FIXER_TYPE.ELECTRIC,
fixers: [ // fixers: [
FixerModel(name: '李建国师傅', phone: '18923747283'), // FixerModel(name: '李建国师傅', phone: '18923747283'),
FixerModel(name: '李历程师傅', phone: '18910298345'), // FixerModel(name: '李历程师傅', phone: '18910298345'),
], // ],
), // ),
]; // ];
static List<FixerTypedModel> propertyModels = [ // static List<FixerTypedModel> propertyModels = [
FixerTypedModel( // FixerTypedModel(
type: FIXER_TYPE.PROPERTY, // type: FIXER_TYPE.PROPERTY,
fixers: [ // fixers: [
FixerModel(name: '李国师傅', phone: '18923747283'), // FixerModel(name: '李国师傅', phone: '18923747283'),
FixerModel(name: '章则林师傅', phone: '18910298345'), // FixerModel(name: '章则林师傅', phone: '18910298345'),
], // ],
), // ),
]; // ];
} // }

@ -1,59 +0,0 @@
class GreenManageCardModel {
String title;
String task;
String timestart;
String timeend;
String name;
String body;
GreenManageCardModel(this.title, this.task, this.timestart, this.timeend,
this.name, this.body);
static List<GreenManageCardModel> initList() {
return [
GreenManageCardModel(
'中部广场周围绿化调整', '除杂草、松土、培土', '2020-10-08', '2020-10-18', '陈晖洁', '''详细描述
1.
使
2.绿
绿'''),
GreenManageCardModel(
'东区周围绿化调整', '修剪、造型', '2020-10-08', '2020-10-18', '刘小青', ''),
GreenManageCardModel(
'西区周围绿化调整', '修剪、造型', '2020-10-10', '2020-10-20', '张空间', ''),
GreenManageCardModel(
'北区周围绿化调整', '修剪造型', '2020-10-15', '2020-10-25', '凯尔希', ''),
];
}
}
class InspectionManageCardModel {
String title;
String date;
String cycle;
String time;
List<String> persons;
List<String> stations;
InspectionManageCardModel(this.title, this.date, this.cycle, this.time,
this.persons, this.stations);
static List<InspectionManageCardModel> initList() {
return [
InspectionManageCardModel(
'1号巡检任务',
'2020.1-2020.12',
'每周一、三、五',
'8:00-12:00',
['王珂', '陈晖洁', '凯尔希', '王铁锤', '李狗蛋', '尼古拉斯'],
['小区东门入口', '1号南门', '3号门站', '3号闸门', '4号门站']),
InspectionManageCardModel(
'2号巡检任务', '2020.1-2020.12', '每周二', '8:00-12:00', ['史尔特尔'], []),
InspectionManageCardModel(
'3号巡检任务', '2020.1-2020.12', '每周二、四、六', '8:00-12:00', ['叶莲娜'], []),
];
}
}

@ -1,84 +0,0 @@
// Dart imports:
import 'dart:io';
@Deprecated('use canOpertion/canSendTicket/canPickUpTicke/canPass instead')
enum USER_ROLE {
///
MANAGER,
///
FIXER,
///
SECURITY,
///
PROPERTY,
///
EMPTY,
}
@Deprecated('use infoModel instead')
class UserInfoModel {
String nickName;
File avatar;
USER_ROLE role;
String phone;
String get securePhone {
if (phone.length < 8)
return phone;
else
return '${phone.substring(0, 3)}****${phone.substring(7)}';
}
UserInfoModel({
this.nickName,
this.avatar,
this.role,
this.phone,
});
UserInfoModel.empty({
this.nickName = '',
this.avatar,
this.role = USER_ROLE.MANAGER,
this.phone = '',
});
///
///password 000000
UserInfoModel.manager({
this.nickName = '李管家',
this.avatar,
this.role = USER_ROLE.MANAGER,
this.phone = '18819289976',
});
///
///password 000001
UserInfoModel.fixer({
this.nickName = '王师傅',
this.avatar,
this.role = USER_ROLE.FIXER,
this.phone = '18927139123',
});
///
///password 000002
UserInfoModel.security({
this.nickName = '林保安',
this.avatar,
this.role = USER_ROLE.SECURITY,
this.phone = '13918237877',
});
///
///password 000003
UserInfoModel.property({
this.nickName = '刘物业',
this.avatar,
this.role = USER_ROLE.PROPERTY,
this.phone = '18965438676',
});
}

@ -1,71 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("fix_provider need to be cleaned.")
class FixProvider extends ChangeNotifier {
List<FixModel> _fixModels = FixModel.initList();
List<FixModel> get fixModels => _fixModels;
addFixModel(FixModel model) {
_fixModels.insert(0, model);
notifyListeners();
}
List<FixModel> getFixModel(int index, BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
USER_ROLE role = userProvider.userInfoModel.role;
List<FixModel> _doneModels =
_fixModels.where((element) => element.type == FIX_ENUM.DONE).toList();
List<FixModel> _processingModels = _fixModels
.where((element) => element.type == FIX_ENUM.PROCESSING)
.toList();
List<FixModel> _handOutModels = _fixModels
.where((element) => element.type == FIX_ENUM.HAND_OUT)
.toList();
List<FixModel> _waitPickUpModels = _fixModels
.where((element) => element.type == FIX_ENUM.WAIT_PICKUP)
.toList();
List<FixModel> _fixerModels = _fixModels
.where((element) => element.type != FIX_ENUM.HAND_OUT)
.toList();
switch (role) {
case USER_ROLE.MANAGER:
return [
_handOutModels,
_waitPickUpModels,
_processingModels,
_doneModels,
_fixModels,
][index];
break;
default:
return [
_waitPickUpModels,
_processingModels,
_doneModels,
_fixerModels,
][index];
break;
}
}
List<FixerTypedModel> _fixerModels = FixerTypedModel.models;
List<FixerTypedModel> _propertyModels = FixerTypedModel.propertyModels;
List<FixerTypedModel> get fixerModels => _fixerModels;
List<FixerTypedModel> get propertyModels => _propertyModels;
}

@ -1,20 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
class GreenManageProvider extends ChangeNotifier {
List<GreenManageCardModel> _greenManageModel =
GreenManageCardModel.initList();
List<GreenManageCardModel> get greenManageModels => _greenManageModel;
notifyListeners();
}
class InspectionManageProvider extends ChangeNotifier {
List<InspectionManageCardModel> _inspectionManageModel =
InspectionManageCardModel.initList();
List<InspectionManageCardModel> get inspectionManageModels =>
_inspectionManageModel;
notifyListeners();
}

@ -2,6 +2,7 @@
import 'dart:io'; import 'dart:io';
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
@ -12,7 +13,6 @@ import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/models/user/user_profile_model.dart'; import 'package:aku_community_manager/models/user/user_profile_model.dart';
import 'package:aku_community_manager/provider/app_provider.dart'; import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/utils/hive_store.dart'; import 'package:aku_community_manager/utils/hive_store.dart';
@ -20,8 +20,6 @@ import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart'
as USER_INFO;
// //
class UserProvider extends ChangeNotifier { class UserProvider extends ChangeNotifier {
@ -45,8 +43,8 @@ class UserProvider extends ChangeNotifier {
UserProfileModel _profileModel; UserProfileModel _profileModel;
UserProfileModel get profileModel => _profileModel; UserProfileModel get profileModel => _profileModel;
USER_INFO.UserInfoModel _infoModel; UserInfoModel _infoModel;
USER_INFO.UserInfoModel get infoModel => _infoModel; UserInfoModel get infoModel => _infoModel;
///profile ///profile
Future<UserProfileModel> updateProfile() async { Future<UserProfileModel> updateProfile() async {
@ -59,13 +57,13 @@ class UserProvider extends ChangeNotifier {
return UserProfileModel.fromJson(model.data); return UserProfileModel.fromJson(model.data);
} }
Future<USER_INFO.UserInfoModel> updateUserInfo() async { Future<UserInfoModel> updateUserInfo() async {
BaseModel model = await NetUtil().get(API.user.info); BaseModel model = await NetUtil().get(API.user.info);
if (model == null) if (model == null)
return null; return null;
else { else {
var userModel = USER_INFO.UserInfoModel.fromJson(model.data); var userModel = UserInfoModel.fromJson(model.data);
JPush().setAlias(userModel.id.toString()); JPush().setAlias(userModel.id.toString());
return userModel; return userModel;
} }
@ -92,15 +90,9 @@ class UserProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
UserInfoModel _userInfoModel = UserInfoModel.empty();
UserInfoModel get userInfoModel => _userInfoModel;
setUserInfo(UserInfoModel model) {
_userInfoModel = model;
_isSigned = true;
notifyListeners();
}
/// ///
setNickName(String name) { setNickName(String name) {

@ -21,7 +21,8 @@ class ClockInOutMainPage extends StatefulWidget {
_ClockInOutMainPageState createState() => _ClockInOutMainPageState(); _ClockInOutMainPageState createState() => _ClockInOutMainPageState();
} }
class _ClockInOutMainPageState extends State<ClockInOutMainPage> with AutomaticKeepAliveClientMixin { class _ClockInOutMainPageState extends State<ClockInOutMainPage>
with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController; EasyRefreshController _refreshController;
Timer _clockSetState; Timer _clockSetState;
DateTime _lastPressed; DateTime _lastPressed;
@ -57,6 +58,7 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage> with AutomaticK
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return EasyRefresh( return EasyRefresh(
firstRefresh: true, firstRefresh: true,
header: MaterialHeader(), header: MaterialHeader(),

@ -144,7 +144,6 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
radius: 4.w, radius: 4.w,
onPressed: () async { onPressed: () async {
//TODO unknown param `butlerMessage`
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
await NetUtil().post( await NetUtil().post(
API.manage.remindUserReturn, API.manage.remindUserReturn,

@ -6,7 +6,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
@ -23,8 +22,7 @@ class BorrowManagerPage extends StatefulWidget {
class _BorrowManagerPageState extends State<BorrowManagerPage> class _BorrowManagerPageState extends State<BorrowManagerPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
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);

@ -60,7 +60,6 @@ class _BusinessAndFixPageState extends State<BusinessAndFixPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return AkuScaffold( return AkuScaffold(
title: '报事报修', title: '报事报修',
appBarBottom: PreferredSize( appBarBottom: PreferredSize(

@ -1,50 +1,49 @@
// Flutter imports: // // Flutter imports:
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; // import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/style/app_style.dart'; // import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; // import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
class DecorationCheckCardWidget extends StatelessWidget { // class DecorationCheckCardWidget extends StatelessWidget {
final CHECK_TYPE type; // final CHECK_TYPE type;
final bool checked; // final bool checked;
const DecorationCheckCardWidget( // const DecorationCheckCardWidget(
{Key key, @required this.type, this.checked = false}) // {Key key, @required this.type, this.checked = false})
: super(key: key); // : super(key: key);
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return Container( // return Container(
height: 160.w, // height: 160.w,
width: 124.w, // width: 124.w,
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: [ // children: [
Image.asset( // Image.asset(
checkAssetMap[type], // checkAssetMap[type],
height: 56.w, // height: 56.w,
width: 56.w, // width: 56.w,
), // ),
AkuBox.h(4), // AkuBox.h(4),
Text( // Text(
checkTypeMap[type], // checkTypeMap[type],
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 24.sp, // fontSize: 24.sp,
), // ),
), // ),
], // ],
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
border: Border.all( // border: Border.all(
color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8), // color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8),
width: 3.w, // width: 3.w,
), // ),
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
color: checked ? Color(0xFFFFF3CC) : Colors.white, // color: checked ? Color(0xFFFFF3CC) : Colors.white,
), // ),
); // );
} // }
} // }

@ -1,70 +1,70 @@
// Flutter imports: // // Flutter imports:
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; // import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; // import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; // import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart';
class DecorationCheckRow extends StatefulWidget { // class DecorationCheckRow extends StatefulWidget {
final List<CHECK_TYPE> details; // final List<CHECK_TYPE> details;
final Function(List<CHECK_TYPE> details) onChange; // final Function(List<CHECK_TYPE> details) onChange;
final bool canTap; // final bool canTap;
DecorationCheckRow( // DecorationCheckRow(
{Key key, @required this.details, this.onChange, this.canTap = false}) // {Key key, @required this.details, this.onChange, this.canTap = false})
: super(key: key); // : super(key: key);
@override // @override
_DecorationCheckRowState createState() => _DecorationCheckRowState(); // _DecorationCheckRowState createState() => _DecorationCheckRowState();
} // }
class _DecorationCheckRowState extends State<DecorationCheckRow> { // class _DecorationCheckRowState extends State<DecorationCheckRow> {
List<CHECK_TYPE> _tempCheckDetails = []; // List<CHECK_TYPE> _tempCheckDetails = [];
List<CHECK_TYPE> _checkedDetails = []; // List<CHECK_TYPE> _checkedDetails = [];
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_tempCheckDetails = widget.details; // _tempCheckDetails = widget.details;
widget.details.forEach((element) { // widget.details.forEach((element) {
_checkedDetails.add(element); // _checkedDetails.add(element);
}); // });
} // }
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SizedBox( // return SizedBox(
height: 160.w, // height: 160.w,
child: ListView.separated( // child: ListView.separated(
scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
itemBuilder: (context, index) { // itemBuilder: (context, index) {
return GestureDetector( // return GestureDetector(
onTap: !widget.canTap // onTap: !widget.canTap
? null // ? null
: () { // : () {
widget.onChange(_checkedDetails); // widget.onChange(_checkedDetails);
setState(() { // setState(() {
_checkedDetails.indexOf(_tempCheckDetails[index]) != -1 // _checkedDetails.indexOf(_tempCheckDetails[index]) != -1
? _checkedDetails.remove(_tempCheckDetails[index]) // ? _checkedDetails.remove(_tempCheckDetails[index])
: _checkedDetails.add(_tempCheckDetails[index]); // : _checkedDetails.add(_tempCheckDetails[index]);
}); // });
}, // },
child: Material( // child: Material(
color: Colors.transparent, // color: Colors.transparent,
child: DecorationCheckCardWidget( // child: DecorationCheckCardWidget(
type: _tempCheckDetails[index], // type: _tempCheckDetails[index],
checked: !widget.canTap // checked: !widget.canTap
? false // ? false
: _checkedDetails.indexOf(_tempCheckDetails[index]) != -1, // : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1,
), // ),
), // ),
); // );
}, // },
itemCount: _tempCheckDetails.length, // itemCount: _tempCheckDetails.length,
separatorBuilder: (context, index) { // separatorBuilder: (context, index) {
return AkuBox.w(16); // return AkuBox.w(16);
}, // },
), // ),
); // );
} // }
} // }

@ -1,192 +1,190 @@
// Flutter imports: // // Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; // import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Package imports: // // Package imports:
import 'package:expandable/expandable.dart'; // import 'package:expandable/expandable.dart';
import 'package:get/get.dart'; // import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/const/resource.dart'; // import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; // import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; // import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart'; // import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/style/app_style.dart'; // import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; // import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; // import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class DecorationDepartmentPage extends StatefulWidget { // class DecorationDepartmentPage extends StatefulWidget {
final DecorationModel model; // final DecorationModel model;
DecorationDepartmentPage({Key key, @required this.model}) : super(key: key); // DecorationDepartmentPage({Key key, @required this.model}) : super(key: key);
@override // @override
_DecorationDepartmentPageState createState() => // _DecorationDepartmentPageState createState() =>
_DecorationDepartmentPageState(); // _DecorationDepartmentPageState();
} // }
class _DecorationDepartmentPageState extends State<DecorationDepartmentPage> { // class _DecorationDepartmentPageState extends State<DecorationDepartmentPage> {
FixerModel _pickedFixer; // FixerModel _pickedFixer;
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
final fixProvider = Provider.of<FixProvider>(context); // // final fixProvider = Provider.of<FixProvider>(context);
return AkuScaffold( // return AkuScaffold(
title: '装修指派', // title: '装修指派',
body: ListView.builder( // // body: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 16.w), // // padding: EdgeInsets.symmetric(vertical: 16.w),
itemBuilder: (context, index) { // // itemBuilder: (context, index) {
return _buildItem(fixProvider.propertyModels[index], index); // // return _buildItem(fixProvider.propertyModels[index], index);
}, // // },
itemCount: fixProvider.propertyModels.length, // // itemCount: fixProvider.propertyModels.length,
), // // ),
bottom: AkuMaterialButton( // bottom: AkuMaterialButton(
height: 96.w, // height: 96.w,
onPressed: _pickedFixer == null // onPressed: _pickedFixer == null
? null // ? null
: () { // : () {
widget.model.cycleCheck.authPerson = _pickedFixer; // widget.model.cycleCheck.authPerson = _pickedFixer;
Get.back(); // Get.back();
}, // },
color: AppStyle.primaryColor, // color: AppStyle.primaryColor,
nullColor: AppStyle.primaryColor.withOpacity(0.5), // nullColor: AppStyle.primaryColor.withOpacity(0.5),
child: Text( // child: Text(
'选择完成', // '选择完成',
style: TextStyle( // style: TextStyle(
color: _pickedFixer == null // color: _pickedFixer == null
? AppStyle.minorTextColor // ? AppStyle.minorTextColor
: AppStyle.primaryTextColor, // : AppStyle.primaryTextColor,
fontSize: 32.w, // fontSize: 32.w,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
), // ),
); // );
} // }
_buildItem(FixerTypedModel model, int index) { // _buildItem(FixerTypedModel model, int index) {
return Container( // return Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
border: Border( // border: Border(
top: index == 0 // top: index == 0
? BorderSide.none // ? BorderSide.none
: BorderSide(color: Color(0xFFE8E8E8), width: 1.w), // : BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w), // bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
), // ),
), // ),
child: Material( // child: Material(
color: Colors.white, // color: Colors.white,
child: ExpandablePanel( // child: ExpandablePanel(
controller: ExpandableController(initialExpanded: true), // controller: ExpandableController(initialExpanded: true),
header: Container( // header: Container(
height: 96.w, // height: 96.w,
alignment: Alignment.centerLeft, // alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 32.w), // padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text( // child: Text(
model.typeName, // model.typeName,
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 32.sp, // fontSize: 32.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
), // ),
collapsed: SizedBox(), // collapsed: SizedBox(),
expanded: Column( // expanded: Column(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ // children: [
Divider( // Divider(
color: Color(0xFFE8E8E8), // color: Color(0xFFE8E8E8),
height: 1.w, // height: 1.w,
thickness: 1.w, // thickness: 1.w,
), // ),
...model.fixers.map((e) { // ...model.fixers.map((e) {
return Column( // return Column(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ // children: [
AkuMaterialButton( // AkuMaterialButton(
height: 96.w, // height: 96.w,
onPressed: () { // onPressed: () {
if (_pickedFixer?.name != e.name) { // if (_pickedFixer?.name != e.name) {
_pickedFixer = e; // _pickedFixer = e;
} else { // } else {
_pickedFixer = null; // _pickedFixer = null;
} // }
setState(() {}); // setState(() {});
}, // },
child: Row( // child: Row(
children: [ // children: [
AkuBox.w(72), // AkuBox.w(72),
Checkbox( // Checkbox(
checkColor: AppStyle.primaryTextColor, // checkColor: AppStyle.primaryTextColor,
activeColor: AppStyle.primaryColor, // activeColor: AppStyle.primaryColor,
value: _pickedFixer?.name == e.name, // value: _pickedFixer?.name == e.name,
onChanged: (state) { // onChanged: (state) {
if (_pickedFixer == null) { // if (_pickedFixer == null) {
_pickedFixer = e; // _pickedFixer = e;
} else { // } else {
_pickedFixer = null; // _pickedFixer = null;
} // }
setState(() {}); // setState(() {});
}, // },
materialTapTargetSize: // materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap, // MaterialTapTargetSize.shrinkWrap,
), // ),
Image.asset( // Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG, // R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
height: 40.w, // height: 40.w,
width: 40.w, // width: 40.w,
), // ),
Text( // Text(
e.name, // e.name,
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 28.w, // fontSize: 28.w,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
Spacer(), // Spacer(),
Image.asset( // Image.asset(
R.ASSETS_MESSAGE_IC_PHONE_PNG, // R.ASSETS_MESSAGE_IC_PHONE_PNG,
height: 40.w, // height: 40.w,
width: 40.w, // width: 40.w,
), // ),
Text( // Text(
e.phone, // e.phone,
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 28.w, // fontSize: 28.w,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
AkuBox.w(101), // AkuBox.w(101),
], // ],
), // ),
), // ),
model.fixers.last == e // model.fixers.last == e
? SizedBox() // ? SizedBox()
: Divider( // : Divider(
indent: 32.w, // indent: 32.w,
endIndent: 32.w, // endIndent: 32.w,
height: 1.w, // height: 1.w,
thickness: 1.w, // thickness: 1.w,
color: Color(0xFFE8E8E8), // color: Color(0xFFE8E8E8),
), // ),
], // ],
); // );
}).toList() // }).toList()
], // ],
), // ),
theme: ExpandableThemeData( // theme: ExpandableThemeData(
tapHeaderToExpand: true, // tapHeaderToExpand: true,
iconPlacement: ExpandablePanelIconPlacement.right, // iconPlacement: ExpandablePanelIconPlacement.right,
iconPadding: EdgeInsets.only(top: 32.w, right: 32.w), // iconPadding: EdgeInsets.only(top: 32.w, right: 32.w),
iconSize: 32.w, // iconSize: 32.w,
iconColor: AppStyle.minorTextColor, // iconColor: AppStyle.minorTextColor,
), // ),
), // ),
), // ),
); // );
} // }
} // }

@ -1,275 +1,275 @@
// Flutter imports: // // Flutter imports:
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Package imports: // // Package imports:
import 'package:common_utils/common_utils.dart'; // import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart'; // import 'package:get/get.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; // import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; // import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; // import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; // import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; // import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
class DecorationFollowCheck extends StatefulWidget { // class DecorationFollowCheck extends StatefulWidget {
final DecorationModel model; // final DecorationModel model;
DecorationFollowCheck({Key key, @required this.model}) : super(key: key); // DecorationFollowCheck({Key key, @required this.model}) : super(key: key);
@override // @override
_DecorationFollowCheckState createState() => _DecorationFollowCheckState(); // _DecorationFollowCheckState createState() => _DecorationFollowCheckState();
} // }
class _DecorationFollowCheckState extends State<DecorationFollowCheck> { // class _DecorationFollowCheckState extends State<DecorationFollowCheck> {
Map<CHECK_TYPE, bool> checkStatus = { // Map<CHECK_TYPE, bool> checkStatus = {
CHECK_TYPE.ELECTRIC: true, // CHECK_TYPE.ELECTRIC: true,
CHECK_TYPE.WATER: true, // CHECK_TYPE.WATER: true,
CHECK_TYPE.WALL: true, // CHECK_TYPE.WALL: true,
CHECK_TYPE.DOOR_AND_WINDOWS: true, // CHECK_TYPE.DOOR_AND_WINDOWS: true,
CHECK_TYPE.SECURITY: true, // CHECK_TYPE.SECURITY: true,
}; // };
bool get success { // bool get success {
for (var item in checkStatus.keys) { // for (var item in checkStatus.keys) {
if (checkStatus[item] == false) return false; // if (checkStatus[item] == false) return false;
} // }
return true; // return true;
} // }
TextEditingController _textEditingController = TextEditingController(); // TextEditingController _textEditingController = TextEditingController();
@override // @override
void dispose() { // void dispose() {
_textEditingController?.dispose(); // _textEditingController?.dispose();
super.dispose(); // super.dispose();
} // }
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return AkuScaffold( // return AkuScaffold(
title: '跟踪检查', // title: '跟踪检查',
body: ListView( // body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w), // padding: EdgeInsets.symmetric(vertical: 16.w),
children: [ // children: [
Container( // Container(
color: Colors.white, // color: Colors.white,
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
horizontal: 32.w, // horizontal: 32.w,
vertical: 16.w, // vertical: 16.w,
), // ),
child: Column( // child: Column(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ // children: [
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
Container( // Container(
height: 56.w, // height: 56.w,
width: 56.w, // width: 56.w,
alignment: Alignment.center, // alignment: Alignment.center,
child: Text( // child: Text(
'', // '',
style: TextStyle( // style: TextStyle(
color: AppStyle.secondaryColor, // color: AppStyle.secondaryColor,
fontSize: 24.sp, // fontSize: 24.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w), // borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF), // color: Color(0xFFE9F2FF),
), // ),
), // ),
AkuBox.w(30), // AkuBox.w(30),
Expanded( // Expanded(
child: Column( // child: Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Text( // Text(
widget.model.userHomeModel.plot, // widget.model.userHomeModel.plot,
style: TextStyle( // style: TextStyle(
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 24.sp, // fontSize: 24.sp,
), // ),
), // ),
Text( // Text(
widget.model.userHomeModel.detailAddr, // widget.model.userHomeModel.detailAddr,
style: TextStyle( // style: TextStyle(
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 24.sp, // fontSize: 24.sp,
), // ),
), // ),
], // ],
), // ),
), // ),
], // ],
), // ),
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
vertical: 26.w, // vertical: 26.w,
horizontal: 32.w, // horizontal: 32.w,
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9), // color: Color(0xFFF9F9F9),
), // ),
), // ),
AkuBox.h(16), // AkuBox.h(16),
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
Container( // Container(
height: 56.w, // height: 56.w,
width: 56.w, // width: 56.w,
alignment: Alignment.center, // alignment: Alignment.center,
child: Text( // child: Text(
'', // '',
style: TextStyle( // style: TextStyle(
color: AppStyle.secondaryColor, // color: AppStyle.secondaryColor,
fontSize: 24.sp, // fontSize: 24.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w), // borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF), // color: Color(0xFFE9F2FF),
), // ),
), // ),
AkuBox.w(30), // AkuBox.w(30),
Expanded( // Expanded(
child: Text( // child: Text(
widget.model.decorationTeamModel.name, // widget.model.decorationTeamModel.name,
style: TextStyle( // style: TextStyle(
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 24.sp, // fontSize: 24.sp,
), // ),
), // ),
), // ),
], // ],
), // ),
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
vertical: 26.w, // vertical: 26.w,
horizontal: 32.w, // horizontal: 32.w,
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9), // color: Color(0xFFF9F9F9),
), // ),
), // ),
AkuBox.h(16), // AkuBox.h(16),
Row( // Row(
children: [ // children: [
Text( // Text(
'${DateUtil.formatDate( // '${DateUtil.formatDate(
DateTime.now(), // DateTime.now(),
format: 'yyyy-MM-dd', // format: 'yyyy-MM-dd',
)} ', // )} ',
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 28.w, // fontSize: 28.w,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
Spacer(), // Spacer(),
AkuBox.h(96), // AkuBox.h(96),
Text( // Text(
success ? '正常' : '异常', // success ? '正常' : '异常',
style: TextStyle( // style: TextStyle(
color: success // color: success
? AppStyle.successColor // ? AppStyle.successColor
: AppStyle.failColor, // : AppStyle.failColor,
fontSize: 28.w, // fontSize: 28.w,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
], // ],
), // ),
_buildRow(CHECK_TYPE.ELECTRIC), // _buildRow(CHECK_TYPE.ELECTRIC),
_buildRow(CHECK_TYPE.WATER), // _buildRow(CHECK_TYPE.WATER),
_buildRow(CHECK_TYPE.WALL), // _buildRow(CHECK_TYPE.WALL),
_buildRow(CHECK_TYPE.DOOR_AND_WINDOWS), // _buildRow(CHECK_TYPE.DOOR_AND_WINDOWS),
_buildRow(CHECK_TYPE.SECURITY), // _buildRow(CHECK_TYPE.SECURITY),
TextField( // TextField(
minLines: 3, // minLines: 3,
maxLines: 99, // maxLines: 99,
controller: _textEditingController, // controller: _textEditingController,
decoration: InputDecoration( // decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric( // contentPadding: EdgeInsets.symmetric(
vertical: 16.w, // vertical: 16.w,
horizontal: 24.w, // horizontal: 24.w,
), // ),
hintText: '请输入检查描述', // hintText: '请输入检查描述',
border: OutlineInputBorder( // border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide( // borderSide: BorderSide(
width: 2.w, // width: 2.w,
color: Color(0xFFE8E8E8), // color: Color(0xFFE8E8E8),
), // ),
), // ),
focusedBorder: OutlineInputBorder( // focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide( // borderSide: BorderSide(
width: 2.w, // width: 2.w,
color: Color(0xFFE8E8E8), // color: Color(0xFFE8E8E8),
), // ),
), // ),
), // ),
), // ),
], // ],
), // ),
), // ),
], // ],
), // ),
bottom: AkuBottomButton( // bottom: AkuBottomButton(
onTap: () { // onTap: () {
widget.model.checkInfomations.add( // widget.model.checkInfomations.add(
CheckInfomation( // CheckInfomation(
checkDate: DateTime.now(), // checkDate: DateTime.now(),
checkType: '周期检查', // checkType: '周期检查',
info: _textEditingController.text, // info: _textEditingController.text,
details: checkStatus.entries.map((e) { // details: checkStatus.entries.map((e) {
return CheckDetail(type: e.key, status: e.value); // return CheckDetail(type: e.key, status: e.value);
}).toList(), // }).toList(),
), // ),
); // );
widget.model.type = DecorationType.DONE; // widget.model.type = DecorationType.DONE;
Get.off(DecorationSuccessPage()); // Get.off(DecorationSuccessPage());
}, // },
title: '确认提交', // title: '确认提交',
), // ),
); // );
} // }
_buildRow( // _buildRow(
CHECK_TYPE type, // CHECK_TYPE type,
) { // ) {
return Row( // return Row(
children: [ // children: [
Image.asset( // Image.asset(
checkAssetMap[type], // checkAssetMap[type],
height: 40.w, // height: 40.w,
width: 40.w, // width: 40.w,
), // ),
Text( // Text(
checkTypeMap[type], // checkTypeMap[type],
style: TextStyle( // style: TextStyle(
fontSize: 28.w, // fontSize: 28.w,
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
), // ),
), // ),
Spacer(), // Spacer(),
DecorationCheckBox( // DecorationCheckBox(
initValue: checkStatus[type], // initValue: checkStatus[type],
onChange: (state) { // onChange: (state) {
checkStatus[type] = state; // checkStatus[type] = state;
setState(() {}); // setState(() {});
}, // },
), // ),
Spacer(), // Spacer(),
], // ],
); // );
} // }
} // }

@ -1,140 +1,140 @@
// Flutter imports: // // Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; // import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Package imports: // // Package imports:
import 'package:common_utils/common_utils.dart'; // import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart'; // import 'package:get/get.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/const/resource.dart'; // import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; // import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; // import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; // import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; // import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart'; // import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
class DecorationManagerCard extends StatefulWidget { // class DecorationManagerCard extends StatefulWidget {
final DecorationListModel model; // final DecorationListModel model;
DecorationManagerCard({Key key, @required this.model}) : super(key: key); // DecorationManagerCard({Key key, @required this.model}) : super(key: key);
@override // @override
_DecorationManagerCardState createState() => _DecorationManagerCardState(); // _DecorationManagerCardState createState() => _DecorationManagerCardState();
} // }
class _DecorationManagerCardState extends State<DecorationManagerCard> { // class _DecorationManagerCardState extends State<DecorationManagerCard> {
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return Container( // return Container(
margin: EdgeInsets.only(top: 16.w), // margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.all(24.w), // padding: EdgeInsets.all(24.w),
child: Column( // child: Column(
children: [ // children: [
Row( // Row(
children: [ // children: [
AkuChipBox(title: '装修管理'), // AkuChipBox(title: '装修管理'),
AkuBox.w(16), // AkuBox.w(16),
Text( // Text(
DateUtil.formatDateStr(widget.model.applicationDate, // DateUtil.formatDateStr(widget.model.applicationDate,
format: 'yyyy-MM-dd HH:mm:ss'), // format: 'yyyy-MM-dd HH:mm:ss'),
style: TextStyle( // style: TextStyle(
color: AppStyle.minorTextColor, // color: AppStyle.minorTextColor,
fontSize: 22.w, // fontSize: 22.w,
), // ),
), // ),
Spacer(), // Spacer(),
Text( // Text(
DecorationUIUtil(context).getTagName( // DecorationUIUtil(context).getTagName(
widget.model.operationStatus, widget.model.status, // widget.model.operationStatus, widget.model.status,
tracker: widget.model.tracker), // tracker: widget.model.tracker),
style: TextStyle( // style: TextStyle(
color: DecorationUIUtil(context) // color: DecorationUIUtil(context)
.getTagColor(widget.model.operationStatus), // .getTagColor(widget.model.operationStatus),
fontSize: 24.w, // fontSize: 24.w,
), // ),
), // ),
], // ],
), // ),
AkuBox.h(24), // AkuBox.h(24),
_buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName), // _buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName),
AkuBox.h(12), // AkuBox.h(12),
_buildTile( // _buildTile(
R.ASSETS_MANAGE_ADDRESS_PNG, // R.ASSETS_MANAGE_ADDRESS_PNG,
'详细地址', // '详细地址',
widget.model.roomName, // widget.model.roomName,
), // ),
AkuBox.h(12), // AkuBox.h(12),
_buildTile( // _buildTile(
R.ASSETS_MANAGE_DECORATION_PNG, // R.ASSETS_MANAGE_DECORATION_PNG,
'装修公司', // '装修公司',
widget.model.constructionUnit, // widget.model.constructionUnit,
), // ),
AkuBox.h(12), // AkuBox.h(12),
_buildTile( // _buildTile(
R.ASSETS_MANAGE_STATUS_PNG, // R.ASSETS_MANAGE_STATUS_PNG,
'装修状态', // '装修状态',
DecorationUIUtil(context).getDecorationStatus(widget.model.status), // DecorationUIUtil(context).getDecorationStatus(widget.model.status),
), // ),
Divider( // Divider(
height: 48.w, // height: 48.w,
), // ),
Align( // Align(
alignment: Alignment.centerRight, // alignment: Alignment.centerRight,
child: AkuMaterialButton( // child: AkuMaterialButton(
onPressed: () { // onPressed: () {
Get.to( // Get.to(
DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,)); // DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,));
}, // },
height: 64.w, // height: 64.w,
minWidth: 160.w, // minWidth: 160.w,
color: AppStyle.primaryColor, // color: AppStyle.primaryColor,
child: Text( // child: Text(
'查看详情', // '查看详情',
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 28.w, // fontSize: 28.w,
), // ),
), // ),
radius: 4.w, // radius: 4.w,
), // ),
), // ),
], // ],
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
), // ),
); // );
} // }
_buildTile(String path, String title, String subTitle) { // _buildTile(String path, String title, String subTitle) {
return Row( // return Row(
children: [ // children: [
Image.asset( // Image.asset(
path, // path,
height: 40.w, // height: 40.w,
width: 40.w, // width: 40.w,
), // ),
Text( // Text(
title, // title,
style: TextStyle( // style: TextStyle(
color: AppStyle.minorTextColor, // color: AppStyle.minorTextColor,
fontSize: 28.sp, // fontSize: 28.sp,
), // ),
), // ),
Spacer(), // Spacer(),
Text( // Text(
subTitle, // subTitle,
style: TextStyle( // style: TextStyle(
color: AppStyle.primaryTextColor, // color: AppStyle.primaryTextColor,
fontSize: 28.sp, // fontSize: 28.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
], // ],
); // );
} // }
} // }

@ -1,128 +1,128 @@
// Flutter imports: // // Flutter imports:
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// Package imports: // // Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart'; // import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:provider/provider.dart'; // import 'package:provider/provider.dart';
// Project imports: // // Project imports:
import 'package:aku_community_manager/const/api.dart'; // import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; // import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; // import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; // import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart'; // import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; // import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; // import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; // import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
class DecorationManagerPage extends StatefulWidget { // class DecorationManagerPage extends StatefulWidget {
DecorationManagerPage({Key key}) : super(key: key); // DecorationManagerPage({Key key}) : super(key: key);
@override // @override
_DecorationManagerPageState createState() => _DecorationManagerPageState(); // _DecorationManagerPageState createState() => _DecorationManagerPageState();
} // }
class _DecorationManagerPageState extends State<DecorationManagerPage> // class _DecorationManagerPageState extends State<DecorationManagerPage>
with TickerProviderStateMixin { // with TickerProviderStateMixin {
TabController _tabController; // TabController _tabController;
EasyRefreshController _refreshController; // EasyRefreshController _refreshController;
List<String> get tabs { // List<String> get tabs {
final userProvider = Provider.of<UserProvider>(context, listen: false); // final userProvider = Provider.of<UserProvider>(context, listen: false);
if (userProvider?.infoModel?.canSendTicket != null && // if (userProvider?.infoModel?.canSendTicket != null &&
userProvider.infoModel.canSendTicket) { // userProvider.infoModel.canSendTicket) {
return ['待指派', '已指派', '已执行', '全部']; // return ['待指派', '已指派', '已执行', '全部'];
} else { // } else {
return ['待执行', '已执行', '全部']; // return ['待执行', '已执行', '全部'];
} // }
} // }
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_tabController = TabController(length: tabs.length, vsync: this); // _tabController = TabController(length: tabs.length, vsync: this);
_refreshController = EasyRefreshController(); // _refreshController = EasyRefreshController();
} // }
@override // @override
void dispose() { // void dispose() {
_refreshController?.dispose(); // _refreshController?.dispose();
super.dispose(); // super.dispose();
} // }
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return AkuScaffold( // return AkuScaffold(
title: '装修管理', // title: '装修管理',
appBarBottom: PreferredSize( // appBarBottom: PreferredSize(
child: AkuTabBar( // child: AkuTabBar(
controller: _tabController, // controller: _tabController,
tabs: tabs, // tabs: tabs,
), // ),
preferredSize: Size.fromHeight(96.w), // preferredSize: Size.fromHeight(96.w),
), // ),
body: TabBarView( // body: TabBarView(
controller: _tabController, // controller: _tabController,
children: _getViews(), // children: _getViews(),
), // ),
); // );
} // }
List<Widget> _getViews() { // List<Widget> _getViews() {
final userProvider = Provider.of<UserProvider>(context); // final userProvider = Provider.of<UserProvider>(context);
if (userProvider?.infoModel?.canSendTicket != null && // if (userProvider?.infoModel?.canSendTicket != null &&
userProvider.infoModel.canSendTicket) { // userProvider.infoModel.canSendTicket) {
return [...List.generate(4, (index) => _getSingleListView(index))]; // return [...List.generate(4, (index) => _getSingleListView(index))];
} else { // } else {
return [...List.generate(3, (index) => _getSingleListView(index))]; // return [...List.generate(3, (index) => _getSingleListView(index))];
} // }
// switch (role) { // // switch (role) {
// case USER_ROLE.MANAGER: // // case USER_ROLE.MANAGER:
// return [ // // return [
// _getSingleListView( // // _getSingleListView(
// DecorationData.getModels(DecorationType.WAIT_HAND_OUT)), // // DecorationData.getModels(DecorationType.WAIT_HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), // // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.DONE)), // // _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// _getSingleListView(DecorationData.allModels), // // _getSingleListView(DecorationData.allModels),
// ]; // // ];
// break; // // break;
// case USER_ROLE.PROPERTY: // // case USER_ROLE.PROPERTY:
// return [ // // return [
// _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)), // // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.DONE)), // // _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// _getSingleListView(DecorationData.allPropertyModels), // // _getSingleListView(DecorationData.allPropertyModels),
// ]; // // ];
// default: // // default:
// return [ // // return [
// _getSingleListView( // // _getSingleListView(
// DecorationData.getTypeModels(DecorationStatusType.PROGRESS)), // // DecorationData.getTypeModels(DecorationStatusType.PROGRESS)),
// _getSingleListView( // // _getSingleListView(
// DecorationData.getTypeModels(DecorationStatusType.DONE)), // // DecorationData.getTypeModels(DecorationStatusType.DONE)),
// _getSingleListView(DecorationData.allPropertyModels), // // _getSingleListView(DecorationData.allPropertyModels),
// ]; // // ];
// break; // // break;
// } // // }
} // }
_getSingleListView(int index) { // _getSingleListView(int index) {
return BeeListView( // return BeeListView(
extraParams: {'operationStatus': index}, // extraParams: {'operationStatus': index},
path: API.manage.decorationList, // path: API.manage.decorationList,
controller: _refreshController, // controller: _refreshController,
convert: (models) { // convert: (models) {
return models.tableList // return models.tableList
.map((e) => DecorationListModel.fromJson(e)) // .map((e) => DecorationListModel.fromJson(e))
.toList(); // .toList();
}, // },
builder: (items) { // builder: (items) {
return ListView.builder( // return ListView.builder(
itemBuilder: (context, index) { // itemBuilder: (context, index) {
return DecorationManagerCard(model: items[index]); // return DecorationManagerCard(model: items[index]);
}, // },
itemCount: items.length, // itemCount: items.length,
padding: EdgeInsets.symmetric(horizontal: 32.w), // padding: EdgeInsets.symmetric(horizontal: 32.w),
); // );
}); // });
} // }
} // }

@ -32,6 +32,7 @@ class _NewRenovationState extends State<NewRenovationView>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return BeeListView( return BeeListView(
path: API.manage.newRenovationList, path: API.manage.newRenovationList,
controller: _refreshController, controller: _refreshController,

@ -150,7 +150,6 @@ class NetUtil {
} }
_parseErr(DioError err) { _parseErr(DioError err) {
final userProvider = Provider.of<UserProvider>(Get.context, listen: false);
LoggerData.addData(err); LoggerData.addData(err);
_makeToast(String message) { _makeToast(String message) {
BotToast.showText(text: '$message\_${err?.response?.statusCode ?? ''}'); BotToast.showText(text: '$message\_${err?.response?.statusCode ?? ''}');

Loading…
Cancel
Save