fix some issues

hmxc
张萌 3 years ago
parent 633946636f
commit 74b267541c

@ -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 23
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 23
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;
// }
// }

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'passed_house_list_model.g.dart'; part 'passed_house_list_model.g.dart';
@ -39,6 +39,9 @@ class PassedHouseListModel extends Equatable {
factory PassedHouseListModel.fromJson(Map<String, dynamic> json) => factory PassedHouseListModel.fromJson(Map<String, dynamic> json) =>
_$PassedHouseListModelFromJson(json); _$PassedHouseListModelFromJson(json);
DateTime? get effectiveStartDate => DateUtil.getDateTime(effectiveTimeStart!);
DateTime? get effectiveEndDate => DateUtil.getDateTime(effectiveTimeEnd!);
String get houseStatus { String get houseStatus {
if (type == 1) return '业主'; if (type == 1) return '业主';
if (type == 2) return '亲属'; if (type == 2) return '亲属';

@ -8,13 +8,13 @@ part 'user_info_model.g.dart';
class UserInfoModel { class UserInfoModel {
int id; int id;
List<ImgModel> imgUrls; List<ImgModel> imgUrls;
String name; String? name;
String nickName; String nickName;
String tel; String tel;
/// 1. 2. /// 1. 2.
int? sex; int? sex;
String birthday; String? birthday;
String get sexValue { String get sexValue {
if (sex == null) return '未设置'; if (sex == null) return '未设置';
@ -23,7 +23,7 @@ class UserInfoModel {
return '未设置'; return '未设置';
} }
DateTime? get birthdayDate => DateUtil.getDateTime(birthday); DateTime? get birthdayDate => DateUtil.getDateTime(birthday ?? '');
String get birthdayValue { String get birthdayValue {
if (TextUtil.isEmpty(birthday)) if (TextUtil.isEmpty(birthday))
@ -38,10 +38,10 @@ class UserInfoModel {
UserInfoModel({ UserInfoModel({
required this.id, required this.id,
required this.imgUrls, required this.imgUrls,
required this.name, this.name,
required this.nickName, required this.nickName,
required this.tel, required this.tel,
this.sex, this.sex,
required this.birthday, this.birthday,
}); });
} }

@ -12,10 +12,10 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) {
imgUrls: (json['imgUrls'] as List<dynamic>) imgUrls: (json['imgUrls'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) .map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
name: json['name'] as String, name: json['name'] as String?,
nickName: json['nickName'] as String, nickName: json['nickName'] as String,
tel: json['tel'] as String, tel: json['tel'] as String,
sex: json['sex'] as int?, sex: json['sex'] as int?,
birthday: json['birthday'] as String, birthday: json['birthday'] as String?,
); );
} }

@ -74,7 +74,7 @@ class _PersonalIndexState extends State<PersonalIndex>
image: API.image(userProvider image: API.image(userProvider
.userInfoModel!.imgUrls.isNotEmpty .userInfoModel!.imgUrls.isNotEmpty
? userProvider ? userProvider
.userInfoModel?.imgUrls.first.url .userInfoModel!.imgUrls.first.url
: ''), : ''),
height: 106.w, height: 106.w,
width: 106.w, width: 106.w,

@ -1,14 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
@ -27,6 +16,15 @@ import 'package:aku_community/widget/bee_back_button.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/user_tool.dart'; import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
/// ///
class GoodsDetailPage extends StatefulWidget { class GoodsDetailPage extends StatefulWidget {
@ -55,7 +53,9 @@ class _GoodsDetailPageState extends State<GoodsDetailPage> {
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
_refreshController = EasyRefreshController(); _refreshController = EasyRefreshController();
_pageController = PageController(); _pageController = PageController();
_nameController.text = userProvider.userInfoModel?.name ?? ''; _nameController.text = userProvider.userInfoModel?.name ??
userProvider.userInfoModel?.nickName ??
'';
_phoneController.text = userProvider.userInfoModel?.tel ?? ''; _phoneController.text = userProvider.userInfoModel?.tel ?? '';
} }

@ -25,7 +25,7 @@ class _AddHousePageState extends State<AddHousePage> {
TextEditingController _idController = TextEditingController(); TextEditingController _idController = TextEditingController();
GlobalKey<FormState> _formKey = GlobalKey<FormState>(); GlobalKey<FormState> _formKey = GlobalKey<FormState>();
HouseItem? _item; HouseItem? _item;
int? _roleType; int _roleType = 1;
DateTimeRange? _range; DateTimeRange? _range;
TextStyle get _hintStyle => TextStyle( TextStyle get _hintStyle => TextStyle(
@ -44,7 +44,6 @@ class _AddHousePageState extends State<AddHousePage> {
_nameController.text.isNotEmpty && _nameController.text.isNotEmpty &&
_idController.text.isNotEmpty && _idController.text.isNotEmpty &&
_item != null && _item != null &&
_roleType != null &&
_rentCheck; _rentCheck;
_renderTile({ _renderTile({

@ -1,12 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart';
import 'package:get/get.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/models/user/passed_house_list_model.dart'; import 'package:aku_community/models/user/passed_house_list_model.dart';
import 'package:aku_community/ui/profile/house/pick_my_house_page.dart'; import 'package:aku_community/ui/profile/house/pick_my_house_page.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
enum CardAuthType { enum CardAuthType {
FAIL, FAIL,
@ -48,7 +46,7 @@ class HouseCard extends StatelessWidget {
} }
String get _roleName { String get _roleName {
switch (model!.type) { switch (model?.type ?? 2) {
case 1: case 1:
return '业主'; return '业主';
case 2: case 2:
@ -130,7 +128,7 @@ class HouseCard extends StatelessWidget {
), ),
10.hb, 10.hb,
Text( Text(
model!.roomName, model?.roomName ?? '',
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
Spacer(), Spacer(),
@ -158,7 +156,7 @@ class HouseCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'到期时间:${_isOverDate(DateUtil.getDateTime(model!.effectiveTimeEnd ?? ''))}', '到期时间:${_isOverDate(DateUtil.getDateTime(model?.effectiveTimeEnd ?? ''))}',
style: style:
Theme.of(context).textTheme.subtitle2!.copyWith( Theme.of(context).textTheme.subtitle2!.copyWith(
color: Color(0xFF666666), color: Color(0xFF666666),
@ -166,7 +164,7 @@ class HouseCard extends StatelessWidget {
), ),
Text( Text(
DateUtil.formatDateStr( DateUtil.formatDateStr(
model!.effectiveTimeEnd ?? '', model?.effectiveTimeEnd ?? '',
format: 'yyyy-MM-dd'), format: 'yyyy-MM-dd'),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),

@ -1,10 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:bot_toast/bot_toast.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/user/house_model.dart';
import 'package:aku_community/models/house/lease_detail_model.dart'; import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/models/house/lease_echo_model.dart'; import 'package:aku_community/models/house/lease_echo_model.dart';
import 'package:aku_community/models/house/submit_model.dart'; import 'package:aku_community/models/house/submit_model.dart';
@ -12,13 +9,16 @@ import 'package:aku_community/models/user/passed_house_list_model.dart';
import 'package:aku_community/utils/network/base_file_model.dart'; import 'package:aku_community/utils/network/base_file_model.dart';
import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart'; import 'package:aku_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
class HouseFunc { class HouseFunc {
/// ///
static Future<List<HouseModel>> get examineHouses async { static Future<List<PassedHouseListModel>> get examineHouses async {
BaseModel model = await NetUtil().get(API.user.examineHouseList); BaseModel model = await NetUtil().get(API.user.examineHouseList);
if (!model.status!) return []; if (!model.status!) return [];
return (model.data as List).map((e) => HouseModel.fromJson(e)).toList(); return (model.data as List)
.map((e) => PassedHouseListModel.fromJson(e))
.toList();
} }
/// ///

@ -149,7 +149,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
}, },
child: ListView( child: ListView(
children: [ children: [
_emptyHouse UserTool.appProveider.selectedHouse == null
? 280.hb ? 280.hb
: Padding( : Padding(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),

@ -26,7 +26,6 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
TextEditingController _nameController = TextEditingController(); TextEditingController _nameController = TextEditingController();
TextEditingController _indentifyCodeController = TextEditingController(); TextEditingController _indentifyCodeController = TextEditingController();
String _sex = '请选择性别'; String _sex = '请选择性别';
String _identify = '请选择身份';
String _tel = ''; String _tel = '';
@override @override
void initState() { void initState() {

@ -1,19 +1,17 @@
import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/model/user/house_model.dart'; import 'package:aku_community/models/user/passed_house_list_model.dart';
import 'package:aku_community/ui/profile/house/add_house_page.dart'; import 'package:aku_community/ui/profile/house/add_house_page.dart';
import 'package:aku_community/ui/profile/house/house_func.dart'; import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/widget/bee_divider.dart'; import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/others/bee_row_tile.dart'; import 'package:aku_community/widget/others/bee_row_tile.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class MyHouseList extends StatefulWidget { class MyHouseList extends StatefulWidget {
MyHouseList({Key? key}) : super(key: key); MyHouseList({Key? key}) : super(key: key);
@ -25,7 +23,7 @@ class MyHouseList extends StatefulWidget {
class _MyHouseListState extends State<MyHouseList> { class _MyHouseListState extends State<MyHouseList> {
late EasyRefreshController _refreshController; late EasyRefreshController _refreshController;
List<HouseModel> models = []; List<PassedHouseListModel> models = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -74,7 +72,7 @@ class _MyHouseListState extends State<MyHouseList> {
); );
} }
Widget _buildCard(HouseModel model) { Widget _buildCard(PassedHouseListModel model) {
return Container( return Container(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
width: double.infinity, width: double.infinity,
@ -90,7 +88,7 @@ class _MyHouseListState extends State<MyHouseList> {
children: [ children: [
Row( Row(
children: [ children: [
model.roomName!.text.size(32.sp).color(ktextPrimary).bold.make(), model.roomName.text.size(32.sp).color(ktextPrimary).bold.make(),
Spacer(), Spacer(),
// model.houseStatus.text // model.houseStatus.text
// .size(30.sp) // .size(30.sp)

@ -2,7 +2,7 @@ name: aku_community
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
version: 1.6.0-dev+42 version: 1.7.0-dev+43
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"

Loading…
Cancel
Save