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