|
|
@ -1,114 +1,116 @@
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
// import 'package:flustars/flustars.dart';
|
|
|
|
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
import 'package:flustars/flustars.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HouseModel {
|
|
|
|
|
|
|
|
int? id;
|
|
|
|
|
|
|
|
String? roomName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int? estateId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///1.未审核,3.审核失败,4.审核成功
|
|
|
|
|
|
|
|
int? status;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///1 审核业主,2审核亲属,3审核租客
|
|
|
|
|
|
|
|
int? type;
|
|
|
|
|
|
|
|
String? effectiveTimeStart;
|
|
|
|
|
|
|
|
String? effectiveTimeEnd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime? get effectiveStartDate => DateUtil.getDateTime(effectiveTimeStart!);
|
|
|
|
|
|
|
|
DateTime? get effectiveEndDate => DateUtil.getDateTime(effectiveTimeEnd!);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
bool get reviewed => status == 4;
|
|
|
|
// class HouseModel {
|
|
|
|
String get typeValue {
|
|
|
|
// int? id;
|
|
|
|
switch (type) {
|
|
|
|
// String? roomName;
|
|
|
|
case 1:
|
|
|
|
//
|
|
|
|
return '业主';
|
|
|
|
// int? estateId;
|
|
|
|
case 2:
|
|
|
|
//
|
|
|
|
return '租客';
|
|
|
|
// ///1.未审核,3.审核失败,4.审核成功
|
|
|
|
case 3:
|
|
|
|
// int? status;
|
|
|
|
return '亲属';
|
|
|
|
//
|
|
|
|
}
|
|
|
|
// ///1 审核业主,2审核亲属,3审核租客
|
|
|
|
return '';
|
|
|
|
// int? type;
|
|
|
|
}
|
|
|
|
// String? effectiveTimeStart;
|
|
|
|
|
|
|
|
// String? effectiveTimeEnd;
|
|
|
|
String get houseStatus {
|
|
|
|
// int? sysLeaseId;
|
|
|
|
if (status == 1) return '审核中';
|
|
|
|
//
|
|
|
|
if (status == 3) return '未通过';
|
|
|
|
// DateTime? get effectiveStartDate => DateUtil.getDateTime(effectiveTimeStart!);
|
|
|
|
if (type == 1) return '业主';
|
|
|
|
// DateTime? get effectiveEndDate => DateUtil.getDateTime(effectiveTimeEnd!);
|
|
|
|
if (type == 2) return '亲属';
|
|
|
|
//
|
|
|
|
if (type == 3) return '租客';
|
|
|
|
// //
|
|
|
|
return '';
|
|
|
|
// bool get reviewed => status == 4;
|
|
|
|
}
|
|
|
|
// String get typeValue {
|
|
|
|
|
|
|
|
// switch (type) {
|
|
|
|
Color get houseStatusColor {
|
|
|
|
// case 1:
|
|
|
|
if (status != 4) return Color(0xFF666666);
|
|
|
|
// return '业主';
|
|
|
|
if (type == 1) return Color(0xFF333333);
|
|
|
|
// case 2:
|
|
|
|
return Colors.white;
|
|
|
|
// return '租客';
|
|
|
|
}
|
|
|
|
// case 3:
|
|
|
|
|
|
|
|
// return '亲属';
|
|
|
|
///我的房屋页面背景颜色
|
|
|
|
// }
|
|
|
|
///
|
|
|
|
// return '';
|
|
|
|
List<Color> get backgroundColor {
|
|
|
|
// }
|
|
|
|
if (status != 4)
|
|
|
|
//
|
|
|
|
return [
|
|
|
|
// String get houseStatus {
|
|
|
|
Color(0xFFF5F5F5),
|
|
|
|
// if (status == 1) return '审核中';
|
|
|
|
Color(0xFFEFEEEE),
|
|
|
|
// if (status == 3) return '未通过';
|
|
|
|
Color(0xFFE8E8E8),
|
|
|
|
// if (type == 1) return '业主';
|
|
|
|
];
|
|
|
|
// if (type == 2) return '亲属';
|
|
|
|
if (type == 1)
|
|
|
|
// if (type == 3) return '租客';
|
|
|
|
return [
|
|
|
|
// return '';
|
|
|
|
Color(0xFFFFDF7D),
|
|
|
|
// }
|
|
|
|
Color(0xFFFFD654),
|
|
|
|
//
|
|
|
|
Color(0xFFFFC40C),
|
|
|
|
// Color get houseStatusColor {
|
|
|
|
];
|
|
|
|
// if (status != 4) return Color(0xFF666666);
|
|
|
|
if (type == 2)
|
|
|
|
// if (type == 1) return Color(0xFF333333);
|
|
|
|
return [
|
|
|
|
// return Colors.white;
|
|
|
|
Color(0xFFFFA446),
|
|
|
|
// }
|
|
|
|
Color(0xFFFFA547),
|
|
|
|
//
|
|
|
|
Color(0xFFFF8200),
|
|
|
|
// ///我的房屋页面背景颜色
|
|
|
|
];
|
|
|
|
// ///
|
|
|
|
if (type == 3)
|
|
|
|
// List<Color> get backgroundColor {
|
|
|
|
return [
|
|
|
|
// if (status != 4)
|
|
|
|
Color(0xFF9ADE79),
|
|
|
|
// return [
|
|
|
|
Color(0xFF91DE6B),
|
|
|
|
// Color(0xFFF5F5F5),
|
|
|
|
Color(0xFF6ECB41),
|
|
|
|
// Color(0xFFEFEEEE),
|
|
|
|
];
|
|
|
|
// Color(0xFFE8E8E8),
|
|
|
|
return [
|
|
|
|
// ];
|
|
|
|
Color(0xFFF5F5F5),
|
|
|
|
// if (type == 1)
|
|
|
|
Color(0xFFEFEEEE),
|
|
|
|
// return [
|
|
|
|
Color(0xFFE8E8E8),
|
|
|
|
// Color(0xFFFFDF7D),
|
|
|
|
];
|
|
|
|
// Color(0xFFFFD654),
|
|
|
|
}
|
|
|
|
// Color(0xFFFFC40C),
|
|
|
|
|
|
|
|
// ];
|
|
|
|
HouseModel({
|
|
|
|
// if (type == 2)
|
|
|
|
this.id,
|
|
|
|
// return [
|
|
|
|
this.roomName,
|
|
|
|
// Color(0xFFFFA446),
|
|
|
|
this.status,
|
|
|
|
// Color(0xFFFFA547),
|
|
|
|
this.type,
|
|
|
|
// Color(0xFFFF8200),
|
|
|
|
this.effectiveTimeStart,
|
|
|
|
// ];
|
|
|
|
this.effectiveTimeEnd,
|
|
|
|
// if (type == 3)
|
|
|
|
this.estateId,
|
|
|
|
// return [
|
|
|
|
});
|
|
|
|
// Color(0xFF9ADE79),
|
|
|
|
|
|
|
|
// Color(0xFF91DE6B),
|
|
|
|
HouseModel.fromJson(Map<String, dynamic> json) {
|
|
|
|
// Color(0xFF6ECB41),
|
|
|
|
id = json['id'];
|
|
|
|
// ];
|
|
|
|
roomName = json['roomName'];
|
|
|
|
// return [
|
|
|
|
status = json['status'];
|
|
|
|
// Color(0xFFF5F5F5),
|
|
|
|
type = json['type'];
|
|
|
|
// Color(0xFFEFEEEE),
|
|
|
|
effectiveTimeStart = json['effectiveTimeStart'];
|
|
|
|
// Color(0xFFE8E8E8),
|
|
|
|
effectiveTimeEnd = json['effectiveTimeEnd'];
|
|
|
|
// ];
|
|
|
|
estateId = json['estateId'];
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// HouseModel(
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
// {this.id,
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// this.roomName,
|
|
|
|
data['id'] = this.id;
|
|
|
|
// this.status,
|
|
|
|
data['roomName'] = this.roomName;
|
|
|
|
// this.type,
|
|
|
|
data['status'] = this.status;
|
|
|
|
// this.effectiveTimeStart,
|
|
|
|
data['effectiveTimeStart'] = this.effectiveTimeStart;
|
|
|
|
// this.effectiveTimeEnd,
|
|
|
|
data['effectiveTimeEnd'] = this.effectiveTimeEnd;
|
|
|
|
// this.estateId,
|
|
|
|
return data;
|
|
|
|
// this.sysLeaseId});
|
|
|
|
}
|
|
|
|
//
|
|
|
|
}
|
|
|
|
// HouseModel.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
|
|
|
// id = json['id'];
|
|
|
|
|
|
|
|
// roomName = json['roomName'];
|
|
|
|
|
|
|
|
// status = json['status'];
|
|
|
|
|
|
|
|
// type = json['type'];
|
|
|
|
|
|
|
|
// effectiveTimeStart = json['effectiveTimeStart'];
|
|
|
|
|
|
|
|
// effectiveTimeEnd = json['effectiveTimeEnd'];
|
|
|
|
|
|
|
|
// estateId = json['estateId'];
|
|
|
|
|
|
|
|
// sysLeaseId = json['sysLeaseId'];
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
|
|
|
|
// data['id'] = this.id;
|
|
|
|
|
|
|
|
// data['roomName'] = this.roomName;
|
|
|
|
|
|
|
|
// data['status'] = this.status;
|
|
|
|
|
|
|
|
// data['effectiveTimeStart'] = this.effectiveTimeStart;
|
|
|
|
|
|
|
|
// data['effectiveTimeEnd'] = this.effectiveTimeEnd;
|
|
|
|
|
|
|
|
// data['sysLeaseId'] = this.sysLeaseId;
|
|
|
|
|
|
|
|
// return data;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|