张萌 3 years ago
commit 0e559e575e

@ -0,0 +1,75 @@
import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../const/saas_api.dart';
import '../../saas_models/household_audit/household_audit_list_model.dart';
import '../../utils/network/net_util.dart';
import 'household_audit_card.dart';
class HouseholdAudioAgree extends StatefulWidget {
final EasyRefreshController refreshController;
const HouseholdAudioAgree({Key? key, required this.refreshController}) : super(key: key);
@override
_HouseholdAudioAgreeState createState() => _HouseholdAudioAgreeState();
}
class _HouseholdAudioAgreeState extends State<HouseholdAudioAgree> {
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
Widget build(BuildContext context) {
return EasyRefresh(
controller: widget.refreshController,
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_models = [];
_page = 1;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 3
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 3
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList());
setState(() {});
} else {
widget.refreshController.finishLoad();
}
},
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: _models
.mapIndexed((currentValue, index) => HouseholdAuditCard(
index: index,
refresh: () => widget.refreshController.callRefresh(),
model: currentValue,
))
.toList()
.sepWidget(separate: 24.w.heightBox),
));
}
}

@ -0,0 +1,78 @@
import 'package:aku_new_community_manager/new_ui/household_audit/household_audit_card.dart';
import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../const/saas_api.dart';
import '../../saas_models/household_audit/household_audit_list_model.dart';
import '../../utils/network/net_util.dart';
class HouseholdAudioAll extends StatefulWidget {
final EasyRefreshController refreshController;
HouseholdAudioAll(
{Key? key,required this.refreshController})
: super(key: key);
@override
_HouseholdAudioAllState createState() => _HouseholdAudioAllState();
}
class _HouseholdAudioAllState extends State<HouseholdAudioAll> {
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
Widget build(BuildContext context) {
return EasyRefresh(
controller: widget.refreshController,
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_models = [];
_page = 1;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList());
setState(() {});
} else {
widget.refreshController.finishLoad();
}
},
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: _models
.mapIndexed((currentValue, index) => HouseholdAuditCard(
index: index,
refresh: () => widget.refreshController.callRefresh(),
model: currentValue,
))
.toList()
.sepWidget(separate: 24.w.heightBox),
));
}
}

@ -0,0 +1,75 @@
import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../const/saas_api.dart';
import '../../saas_models/household_audit/household_audit_list_model.dart';
import '../../utils/network/net_util.dart';
import 'household_audit_card.dart';
class HouseholdAudioReject extends StatefulWidget {
final EasyRefreshController refreshController;
const HouseholdAudioReject({Key? key, required this.refreshController}) : super(key: key);
@override
_HouseholdAudioRejectState createState() => _HouseholdAudioRejectState();
}
class _HouseholdAudioRejectState extends State<HouseholdAudioReject> {
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
Widget build(BuildContext context) {
return EasyRefresh(
controller: widget.refreshController,
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_models = [];
_page = 1;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 2
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 2
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList());
setState(() {});
} else {
widget.refreshController.finishLoad();
}
},
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: _models
.mapIndexed((currentValue, index) => HouseholdAuditCard(
index: index,
refresh: () => widget.refreshController.callRefresh(),
model: currentValue,
))
.toList()
.sepWidget(separate: 24.w.heightBox),
));
}
}

@ -0,0 +1,75 @@
import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/tools/extensions/list_extension_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../const/saas_api.dart';
import '../../saas_models/household_audit/household_audit_list_model.dart';
import '../../utils/network/net_util.dart';
import 'household_audit_card.dart';
class HouseholdAudioVerify extends StatefulWidget {
final EasyRefreshController refreshController;
const HouseholdAudioVerify({Key? key, required this.refreshController}) : super(key: key);
@override
_HouseholdAudioVerifyState createState() => _HouseholdAudioVerifyState();
}
class _HouseholdAudioVerifyState extends State<HouseholdAudioVerify> {
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
Widget build(BuildContext context) {
return EasyRefresh(
controller: widget.refreshController,
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_models = [];
_page = 1;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 1
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
var base =
await NetUtil().getList(SAASAPI.householdAudit.list, params: {
'pageNum': _page,
'size': _size,
'status': 1
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList());
setState(() {});
} else {
widget.refreshController.finishLoad();
}
},
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: _models
.mapIndexed((currentValue, index) => HouseholdAuditCard(
index: index,
refresh: () => widget.refreshController.callRefresh(),
model: currentValue,
))
.toList()
.sepWidget(separate: 24.w.heightBox),
));
}
}

@ -0,0 +1,184 @@
import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../const/saas_api.dart';
import '../../gen/assets.gen.dart';
import '../../saas_models/household_audit/household_audit_list_model.dart';
import '../../ui/widgets/common/bee_divider.dart';
import '../../ui/widgets/common/car_bottom_button.dart';
import '../../utils/network/net_util.dart';
class HouseholdAuditCard extends StatelessWidget {
final int index;
final HouseholdAuditListModel model;
final VoidCallback refresh;
HouseholdAuditCard({Key? key, required this.model, required this.refresh, required this.index})
: super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w), color: Colors.white),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w),
height: 77.w,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
// stops: [
// 0.4,
// 0.6,
// 0.8
// ],
colors: [
Color(0xFFFFEAC3).withOpacity(0.31),
Color(0xFFFEE1AE).withOpacity(0.24),
Color(0xFFFFFFFF),
])),
child: Row(
children: [
'${model.houseName}'
.text
.size(32.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'类型:${model.estateTypeName}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
SizedBox(
width: 160.w,
child: '申请人'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
model.name.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
24.w.heightBox,
Row(
children: [
SizedBox(
width: 160.w,
child: '联系方式'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
model.tel.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
24.w.heightBox,
Row(
children: [
SizedBox(
width: 160.w,
child: '申请身份'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
_identity[model.identity]!
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
],
),
),
Offstage(
offstage: model.status != 1,
child: Column(
children: [
BeeDivider.horizontal(),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 32.w, vertical: 24.w),
child: Row(
children: [
Spacer(),
CardBottomButton.yellow(
text: '通过',
onPressed: () async {
var base = await NetUtil().post(
SAASAPI.householdAudit.review,
params: {
'operate': 1,
'estateReviewId': model.estateReviewId
});
if (base.success) {
refresh();
}
}),
24.w.widthBox,
CardBottomButton.white(
text: '驳回',
onPressed: () async {
var base = await NetUtil().post(
SAASAPI.householdAudit.review,
params: {
'operate': 2,
'estateReviewId': model.estateReviewId
});
if (base.success) {
refresh();
}
}),
],
),
),
],
),
),
],
),
),
Positioned(
right: 24.w,
bottom: 24.w,
child: Offstage(
offstage: model.status == 1,
child: Image.asset(
model.status == 2
? Assets.manage.rejected.path
: Assets.manage.passed.path,
width: 160.w,
height: 160.w,
),
),
),
],
);
}
Map<int, String> _identity = {1: '业主', 2: '业主亲属', 3: '租户', 4: '租户亲属'};
}

@ -1,5 +1,9 @@
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/gen/assets.gen.dart';
import 'package:aku_new_community_manager/new_ui/household_audit/household_audio_agree.dart';
import 'package:aku_new_community_manager/new_ui/household_audit/household_audio_all.dart';
import 'package:aku_new_community_manager/new_ui/household_audit/household_audio_reject.dart';
import 'package:aku_new_community_manager/new_ui/household_audit/household_audio_verify.dart';
import 'package:aku_new_community_manager/saas_models/household_audit/household_audit_list_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_divider.dart';
@ -26,9 +30,6 @@ class _HouseholdAuditPageState extends State<HouseholdAuditPage>
List<String> _tabs = ['全部', '待审核', '已驳回', '已同意'];
List<EasyRefreshController> _refreshControllers = [];
late TabController _tabController;
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
void initState() {
@ -58,218 +59,13 @@ class _HouseholdAuditPageState extends State<HouseholdAuditPage>
)),
body: TabBarView(
controller: _tabController,
children: List.generate(_tabs.length, (index) => _getView(index))),
children: [
HouseholdAudioAll(refreshController: _refreshControllers[0]),
HouseholdAudioVerify(refreshController: _refreshControllers[1]),
HouseholdAudioReject(refreshController: _refreshControllers[2]),
HouseholdAudioAgree(refreshController: _refreshControllers[3]),
],
),
);
}
Widget _getView(int index) {
return EasyRefresh(
controller: _refreshControllers[index],
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_models = [];
_page = 1;
var base = await NetUtil().getList(SAASAPI.householdAudit.list,
params: {
'pageNum': _page,
'size': _size,
'status': index == 0 ? null : index
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
var base = await NetUtil().getList(SAASAPI.householdAudit.list,
params: {
'pageNum': _page,
'size': _size,
'status': index == 0 ? null : index
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList());
setState(() {});
} else {
_refreshControllers[index].finishLoad();
}
},
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: _models
.mapIndexed((currentValue, index) => _card(currentValue, index))
.toList()
.sepWidget(separate: 24.w.heightBox),
));
}
Widget _card(HouseholdAuditListModel model, int index) {
return Stack(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w), color: Colors.white),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w),
height: 77.w,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
// stops: [
// 0.4,
// 0.6,
// 0.8
// ],
colors: [
Color(0xFFFFEAC3).withOpacity(0.31),
Color(0xFFFEE1AE).withOpacity(0.24),
Color(0xFFFFFFFF),
])),
child: Row(
children: [
'${model.houseName}'
.text
.size(32.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
'类型:${model.estateTypeName}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
],
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
child: Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
SizedBox(
width: 160.w,
child: '申请人'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
model.name.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
24.w.heightBox,
Row(
children: [
SizedBox(
width: 160.w,
child: '联系方式'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
model.tel.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
24.w.heightBox,
Row(
children: [
SizedBox(
width: 160.w,
child: '申请身份'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make()),
_identity[model.identity]!
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
],
)
],
),
),
Offstage(
offstage: model.status != 1,
child: Column(
children: [
BeeDivider.horizontal(),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 32.w, vertical: 24.w),
child: Row(
children: [
Spacer(),
CardBottomButton.yellow(
text: '通过',
onPressed: () async {
var base = await NetUtil().post(
SAASAPI.householdAudit.review,
params: {
'operate': 1,
'estateReviewId': model.estateReviewId
});
if (base.success) {
_refreshControllers[index].callRefresh();
}
}),
24.w.widthBox,
CardBottomButton.white(
text: '驳回',
onPressed: () async {
var base = await NetUtil().post(
SAASAPI.householdAudit.review,
params: {
'operate': 2,
'estateReviewId': model.estateReviewId
});
if (base.success) {
_refreshControllers[index].callRefresh();
}
}),
],
),
),
],
),
)
],
),
),
Positioned(
right: 24.w,
bottom: 24.w,
child: Offstage(
offstage: model.status == 1,
child: Image.asset(
model.status == 2
? Assets.manage.rejected.path
: Assets.manage.passed.path,
width: 160.w,
height: 160.w,
),
),
)
],
);
}
Map<int, String> _identity = {1: '业主', 2: '业主亲属', 3: '租户', 4: '租户亲属'};
}

@ -50,6 +50,7 @@ class DataProvider extends ChangeNotifier {
_loginHistories.removeAt(_loginHistories.length - 1);
}
HiveStore.dataBox!.put('historyLogin', _loginHistories);
}
}
}

@ -36,7 +36,6 @@ class UserProvider extends ChangeNotifier {
///
logout() async {
await NetUtil().post(SAASAPI.login.logOut, showMessage: true);
WebSocketUtil().closeWebSocket();
NetUtil().logout();
_isLogin = false;

@ -1,5 +1,6 @@
// Flutter imports:
// Project imports:
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/auth/other_login_page.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart';
@ -10,6 +11,7 @@ import 'package:aku_new_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -85,7 +87,8 @@ class _SettingsPageState extends State<SettingsPage> {
child: AkuMaterialButton(
radius: 8.w,
color: AppStyle.primaryColor,
onPressed: () {
onPressed: ()async {
await NetUtil().post(SAASAPI.login.logOut, showMessage: true);
userProvider.logout();
Get.offAll(() => OtherLoginPage());
},

@ -42,9 +42,11 @@ class BeePickerBox extends StatelessWidget {
SizedBox(
height: 88.w,
child: NavigationToolbar(
leading: _buildButton(
title: '取消',
leading: TextButton(
onPressed: () => Navigator.pop(context),
child: Text(
'取消',
),
),
middle: Text(
title ?? '',
@ -53,9 +55,11 @@ class BeePickerBox extends StatelessWidget {
fontSize: 28.sp,
),
),
trailing: _buildButton(
title: confirmString,
trailing: TextButton(
onPressed: onPressed,
child: Text(
'${confirmString}',
),
),
),
),

@ -1,5 +1,6 @@
// Package imports:
import 'package:aku_new_community_manager/saas_models/login/china_region_model.dart';
import 'package:aku_new_community_manager/saas_models/login/community_model.dart';
import 'package:aku_new_community_manager/saas_models/login/history_login_model.dart';
import 'package:aku_new_community_manager/saas_models/login/picked_city_model.dart';
import 'package:flutter/foundation.dart';
@ -21,6 +22,8 @@ class HiveStore {
Hive.registerAdapter(ChinaRegionModelAdapter()); //HiveTypeId:3
Hive.registerAdapter(HistoryLoginModelAdapter()); //HiveTypeId:4
Hive.registerAdapter(PickedCityModelAdapter()); //HiveTypeId:6
Hive.registerAdapter(CommunityModelAdapter());//HiveTypeId:7
Hive.init(dir.path);
_appBox = await Hive.openBox('app');
_dataBox = await Hive.openBox('dataBox');

Loading…
Cancel
Save