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

@ -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,
@ -28,13 +26,13 @@ class HouseCard extends StatelessWidget {
Key? key, Key? key,
required this.model, required this.model,
required this.isOwner, required this.isOwner,
}) : type = CardAuthType.FAIL, }) : type = CardAuthType.FAIL,
super(key: key); super(key: key);
const HouseCard.success({ const HouseCard.success({
Key? key, Key? key,
required this.model, required this.model,
required this.isOwner, required this.isOwner,
}) : type = CardAuthType.SUCCESS, }) : type = CardAuthType.SUCCESS,
super(key: key); super(key: key);
String get _assetPath { String get _assetPath {
@ -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