pull/1/head
张萌 3 years ago
parent bb487bb22d
commit 0df7dfb76c

@ -107,13 +107,14 @@ class _AnnounceViewState extends State<AnnounceView> {
header: MaterialHeader(), header: MaterialHeader(),
footer: MaterialFooter(), footer: MaterialFooter(),
scrollController: _autoScrollController, scrollController: _autoScrollController,
controller: _refreshController,
onRefresh: () async { onRefresh: () async {
_page = 1; _page = 1;
_modelLists.clear(); _modelLists.clear();
_innerModelList.clear(); _innerModelList.clear();
var base = var base =
await NetUtil().getList(SAASAPI.announce.list, params: { await NetUtil().getList(SAASAPI.announce.list, params: {
'page': _page, 'pageNum': _page,
'size': _size, 'size': _size,
}); });
_innerModelList = _innerModelList =
@ -129,13 +130,19 @@ class _AnnounceViewState extends State<AnnounceView> {
_page++; _page++;
var base = var base =
await NetUtil().getList(SAASAPI.announce.list, params: { await NetUtil().getList(SAASAPI.announce.list, params: {
'page': _page, 'pageNum': _page,
'size': _size, 'size': _size,
}); });
if (base.total > _innerModelList.length) {} if (base.total > _modelLists.length) {
_innerModelList = _innerModelList = base.rows
base.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(); .map((e) => HomeAnnounceModel.fromJson(e))
monthListDepart(_innerModelList); .toList();
monthListDepart(_innerModelList);
setState(() {});
} else {
print('1111111');
_refreshController.finishLoadCallBack!(noMore: true);
}
}, },
child: _modelLists.isEmpty child: _modelLists.isEmpty
? Container() ? Container()

@ -237,7 +237,7 @@ class _OpeningCodePageState extends State<OpeningCodePage> {
? Get.off(() => CertificationPage()) ? Get.off(() => CertificationPage())
: BotToast.showText(text: '已实名认证'); : BotToast.showText(text: '已实名认证');
}, },
text: '开门记录', text: '住户认证',
suffix: UserTool.userProvider.userInfoModel! suffix: UserTool.userProvider.userInfoModel!
.idCard == .idCard ==
null null

@ -422,10 +422,7 @@ class _PersonalIndexState extends State<PersonalIndex>
// () => HouseOwnersPage( // () => HouseOwnersPage(
// identify: 4, // identify: 4,
// ), // ),
'${UserTool.userProvider.defaultHouse?.communityName ?? ''} ' '${UserTool.userProvider.defaultHouseString}',
'${UserTool.userProvider.defaultHouse?.buildingName ?? ''}'
'${UserTool.userProvider.defaultHouse?.unitName ?? ''}'
'${UserTool.userProvider.defaultHouse?.estateName ?? ''}',
), ),
_function('我的家庭', Assets.newIcon.icWdjt.path, () { _function('我的家庭', Assets.newIcon.icWdjt.path, () {
Get.to(() => MyFamilyPage()); Get.to(() => MyFamilyPage());

@ -9,7 +9,7 @@ import 'package:get/get.dart';
import 'activity_detail_page.dart'; import 'activity_detail_page.dart';
class ActivityCard extends StatelessWidget { class ActivityCard extends StatelessWidget {
final bool? home; final bool home;
final HomeActivityModel? model; final HomeActivityModel? model;
const ActivityCard({ const ActivityCard({
@ -22,10 +22,9 @@ class ActivityCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ConstrainedBox( return ConstrainedBox(
constraints: BoxConstraints(maxHeight: home! ? 450.w : 540.w), constraints: BoxConstraints(maxHeight: home ? 450.w : 540.w),
child: MaterialButton( child: MaterialButton(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
color: Colors.white,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () => Get.to(() => ActivityDetailPage(id: model!.id)), onPressed: () => Get.to(() => ActivityDetailPage(id: model!.id)),
elevation: 0, elevation: 0,
@ -46,7 +45,7 @@ class ActivityCard extends StatelessWidget {
child: BeeImageNetwork( child: BeeImageNetwork(
imgs: model!.imgList ?? [], imgs: model!.imgList ?? [],
width: double.infinity, width: double.infinity,
height: home! ? 250.w : 340.w, height: home ? 250.w : 340.w,
), ),
), ),
), ),
@ -78,54 +77,46 @@ class ActivityCard extends StatelessWidget {
], ],
), ),
24.hb, 24.hb,
Padding( Row(
padding: EdgeInsets.symmetric(horizontal: 32.w), crossAxisAlignment: CrossAxisAlignment.start,
child: Row( children: [
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: [ constraints: BoxConstraints(maxWidth: 340.w),
Container( child: Text(
constraints: BoxConstraints(maxWidth: 340.w), model == null ? '' : model!.title,
child: Text( maxLines: 2,
model == null ? '' : model!.title, overflow: TextOverflow.ellipsis,
maxLines: 2, style: TextStyle(
overflow: TextOverflow.ellipsis, color: Color(0xD9000000),
style: TextStyle( fontSize: 28.sp,
color: Color(0xD9000000), fontWeight: FontWeight.bold),
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
), ),
Spacer(), ),
], Spacer(),
), ],
), ),
Spacer(), 24.hb,
Row(
Padding( children: [
padding: home!?EdgeInsets.only(left: 32.w,right: 32.w,): EdgeInsets.only(left: 32.w,right: 32.w,bottom: 32.w), Flexible(
child: Row( child: AvatarsParticipate(
children: [ avatars:
Flexible( (model?.avatarImgList?.map((e) => e.url).toList() ??
child: AvatarsParticipate( []),
avatars: pNum: model?.registrationNum ?? 0,
(model?.avatarImgList?.map((e) => e.url).toList() ?? []), hasIcon: false,
pNum: model?.registrationNum ?? 0,
hasIcon: false,
),
), ),
// Spacer(), ),
Offstage( // Spacer(),
offstage: ActivityFunc.dateCheck(model!.end) == '已结束', Offstage(
child: ActivityFunc.dateCheck(model!.end) offstage: ActivityFunc.dateCheck(model!.end) == '已结束',
.text child: ActivityFunc.dateCheck(model!.end)
.size(24.sp) .text
.black .size(24.sp)
.make()), .black
], .make()),
), ],
) )
], ],
), ),
), ),

@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
class ActivityListPage extends StatefulWidget { class ActivityListPage extends StatefulWidget {
ActivityListPage({Key? key}) : super(key: key); ActivityListPage({Key? key}) : super(key: key);
@override @override
_ActivityListPageState createState() => _ActivityListPageState(); _ActivityListPageState createState() => _ActivityListPageState();
@ -44,9 +44,15 @@ class _ActivityListPageState extends State<ActivityListPage> {
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final HomeActivityModel model = items[index]; final HomeActivityModel model = items[index];
return ActivityCard(model: model); return Container(
padding:
EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w)),
child: ActivityCard(model: model));
}, },
separatorBuilder: (_, __) => 20.hb, separatorBuilder: (_, __) => 32.hb,
itemCount: items.length, itemCount: items.length,
); );
}, },

@ -1,15 +1,81 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_list_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/src/extensions/num_ext.dart';
import '../work_order_card.dart';
class AllOrderView extends StatefulWidget { class AllOrderView extends StatefulWidget {
const AllOrderView({Key? key}) : super(key: key); final EasyRefreshController refreshController;
final int index;
const AllOrderView(
{Key? key, required this.refreshController, required this.index})
: super(key: key);
@override @override
_AllOrderViewState createState() => _AllOrderViewState(); _AllOrderViewState createState() => _AllOrderViewState();
} }
class _AllOrderViewState extends State<AllOrderView> { class _AllOrderViewState extends State<AllOrderView>
with SingleTickerProviderStateMixin {
int _page = 1;
int _size = 10;
List<WorkOrderListModel> _models = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container(); return EasyRefresh(
firstRefresh: true,
controller: widget.refreshController,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_page = 1;
try {
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index,
});
_models =
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
} catch (e) {
LoggerData.addData(e.toString());
}
setState(() {});
},
onLoad: () async {
_page++;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index,
});
if (_models.length < base.total) {
_models.addAll(
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {});
} else {
widget.refreshController.finishLoad(noMore: true);
}
},
child: _models.isEmpty
? Container()
: ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return WorkOrderCard(
model: _models[index],
refresh: widget.refreshController.callRefresh,
);
},
separatorBuilder: (context, index) {
return 24.w.heightBox;
},
itemCount: _models.length));
;
} }
} }

@ -1,8 +1,6 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_list_model.dart'; import 'package:aku_new_community/saas_model/work_order/work_order_list_model.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/publish_work_order_page.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/publish_work_order_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_view.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -10,7 +8,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class WorkOrderPage extends StatefulWidget { class WorkOrderPage extends StatefulWidget {
@ -62,68 +59,16 @@ class _WorkOrderPageState extends State<WorkOrderPage>
], ],
appBarBottom: BeeTabBar( appBarBottom: BeeTabBar(
tabs: _tabs, tabs: _tabs,
onTap: (index) {
_models.clear();
setState(() {});
},
controller: _tabController, controller: _tabController,
), ),
body: TabBarView( body: TabBarView(
controller: _tabController, controller: _tabController,
children: children: _tabs
_tabs.mapIndexed((e, index) => _getOrderView(index)).toList()), .mapIndexed((e, index) => WorkOrderView(
refreshController: _refreshControllers[index],
index: index,
))
.toList()),
); );
} }
Widget _getOrderView(int index) {
return EasyRefresh(
firstRefresh: true,
controller: _refreshControllers[index],
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_page = 1;
try {
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': index == 0 ? null : index,
});
_models =
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
} catch (e) {
LoggerData.addData(e.toString());
}
setState(() {});
},
onLoad: () async {
_page++;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': index == 0 ? null : index,
});
if (_models.length < base.total) {
_models.addAll(
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {});
} else {
_refreshControllers[index].finishLoad(noMore: true);
}
},
child: _models.isEmpty
? Container()
: ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return WorkOrderCard(
model: _models[index],
refresh: _refreshControllers[index].callRefresh,
);
},
separatorBuilder: (context, index) {
return 24.w.heightBox;
},
itemCount: _models.length));
}
} }

@ -0,0 +1,79 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_list_model.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/src/extensions/num_ext.dart';
class WorkOrderView extends StatefulWidget {
final EasyRefreshController refreshController;
final int index;
const WorkOrderView(
{Key? key, required this.refreshController, required this.index})
: super(key: key);
@override
_WorkOrderViewState createState() => _WorkOrderViewState();
}
class _WorkOrderViewState extends State<WorkOrderView> {
int _page = 1;
int _size = 10;
List<WorkOrderListModel> _models = [];
@override
Widget build(BuildContext context) {
return EasyRefresh(
firstRefresh: true,
controller: widget.refreshController,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
_page = 1;
try {
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index,
});
_models =
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
} catch (e) {
LoggerData.addData(e.toString());
}
setState(() {});
},
onLoad: () async {
_page++;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index,
});
if (_models.length < base.total) {
_models.addAll(
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {});
} else {
widget.refreshController.finishLoad(noMore: true);
}
},
child: _models.isEmpty
? Container()
: ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return WorkOrderCard(
model: _models[index],
refresh: widget.refreshController.callRefresh,
);
},
separatorBuilder: (context, index) {
return 24.w.heightBox;
},
itemCount: _models.length));
;
}
}
Loading…
Cancel
Save