极光;商城提醒;设施预约部分功能

pull/1/head
戴余标 3 years ago
parent 7e0da3ccf7
commit 14c196f071

@ -1,4 +1,4 @@
{
"flutterSdkVersion": "2.10.2",
"flutterSdkVersion": "2.8.1",
"flavors": {}
}

@ -94,11 +94,7 @@ List<AO> appObjects = [
AO('借还管理', Assets.newIcon.icJhgl.path,
() => Get.to(SelectBorrowReturnPage())),
// AO('一键报警', Assets.newIcon.yj, () => AlarmPage()),
AO('设施预约', Assets.home.icSsyy.path, () {
BotToast.showText(text: '此功能升级中,敬请期待');
return;
Get.to(() => FacilityAppointmentPage());
}),
AO('设施预约', Assets.home.icSsyy.path, () =>Get.to(() => FacilityAppointmentPage())),
AO('快递包裹', Assets.newIcon.icKdbg.path,
() => Get.to(() => ExpressPackagePage())),
AO('电子商务', Assets.newIcon.icDzsw.path,

@ -42,6 +42,7 @@ class SAASAPI {
static _CommitteeStaff committeeStaff = _CommitteeStaff();
static _Advice advice = _Advice();
static _Vote vote = _Vote();
static _Facilities facilities = _Facilities();
///
static _ProfileApi profile = _ProfileApi();
@ -382,4 +383,22 @@ class _Vote{
String get vote =>'/app/user/vote/vote';
///
String get details =>'/app/user/vote/details';
}
class _Facilities{
///
String get list =>'/app/user/facilities/list';
///
String get categoryList =>'/app/user/facilities/categoryList';
///id
String get manageList =>'/app/user/facilities/manageList';
///
String get insert =>'/app/user/facilities/insert';
///
String get allAppointmentPeriod =>'/app/user/facilities/allAppointmentPeriod';
///
String get signIn =>'/app/user/facilities/signIn';
///使
String get useStop =>'/app/user/facilities/useStop';
///
String get cancel =>'/app/user/facilities/cancel';
}

@ -21,9 +21,6 @@ void main() async {
const buildType = const String.fromEnvironment('BUILD_TYPE');
DeveloperUtil.setDev(!(buildType.contains('PRODUCT')));
WidgetsFlutterBinding.ensureInitialized();
await MainInitialize.initJPush();
runApp(MyApp());
}

@ -11,8 +11,7 @@ part 'facility_appointment_model.g.dart';
class FacilityAppointmentModel {
final int id;
final String code;
final String facilitiesName;
final String address;
///
///* 1.(30)
///* 2.
@ -20,22 +19,20 @@ class FacilityAppointmentModel {
///* 4.
///* 5.
final int status;
final String address;
final String appointmentStartDate;
final String appointmentEndDate;
final String reserveStartDate;
final String reserveEndDate;
final String? nullifyReason;
final String? useEndDate;
DateTime? get appointmentStart => DateUtil.getDateTime(appointmentStartDate);
DateTime? get reserveStartDt => DateUtil.getDateTime(reserveStartDate);
DateTime? get appointmentEnd => DateUtil.getDateTime(appointmentEndDate);
DateTime? get reserveEndDt => DateUtil.getDateTime(reserveEndDate);
String get displayDate {
return '${DateUtil.formatDate(
appointmentStart,
reserveStartDt,
format: 'yyyy-MM-dd HH:mm',
)}-${DateUtil.formatDate(
appointmentEnd,
reserveEndDt,
format: 'HH:mm',
)}';
}
@ -77,13 +74,11 @@ class FacilityAppointmentModel {
FacilityAppointmentModel({
required this.id,
required this.code,
required this.facilitiesName,
required this.status,
required this.address,
required this.appointmentStartDate,
required this.appointmentEndDate,
required this.reserveEndDate,
required this.reserveStartDate,
required this.nullifyReason,
required this.useEndDate,
});
factory FacilityAppointmentModel.fromJson(Map<String, dynamic> json) =>

@ -11,11 +11,9 @@ FacilityAppointmentModel _$FacilityAppointmentModelFromJson(
FacilityAppointmentModel(
id: json['id'] as int,
code: json['code'] as String,
facilitiesName: json['facilitiesName'] as String,
status: json['status'] as int,
address: json['address'] as String,
appointmentStartDate: json['appointmentStartDate'] as String,
appointmentEndDate: json['appointmentEndDate'] as String,
reserveStartDate: json['reserveStartDate'] as String,
reserveEndDate: json['reserveEndDate'] as String,
nullifyReason: json['nullifyReason'] as String?,
useEndDate: json['useEndDate'] as String?,
);

@ -1,21 +1,39 @@
import 'package:common_utils/common_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import '../../model/common/img_model.dart';
part 'facility_type_detail_model.g.dart';
@JsonSerializable()
class FacilityTypeDetailModel extends Equatable {
final int id;
final String code;
final String address;
final String name;
final String openStartDate;
final String openEndDate;
final List<ImgModel>? imgList;
DateTime? get openStartDt => DateUtil.getDateTime(openStartDate);
DateTime? get openEndDt => DateUtil.getDateTime(openEndDate);
FacilityTypeDetailModel({
required this.id,
required this.code,
required this.name,
required this.address,
required this.openStartDate,
required this.openEndDate,
required this.imgList,
});
factory FacilityTypeDetailModel.fromJson(Map<String, dynamic> json) =>
_$FacilityTypeDetailModelFromJson(json);
@override
List<Object?> get props => [id];
List<Object?> get props =>
[id, code, name, address, openStartDate, openEndDate, imgList];
}

@ -10,5 +10,12 @@ FacilityTypeDetailModel _$FacilityTypeDetailModelFromJson(
Map<String, dynamic> json) =>
FacilityTypeDetailModel(
id: json['id'] as int,
code: json['code'] as String,
name: json['name'] as String,
address: json['address'] as String,
openStartDate: json['openStartDate'] as String,
openEndDate: json['openEndDate'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -7,13 +7,9 @@ part 'facility_type_model.g.dart';
@JsonSerializable()
class FacilityTypeModel {
final int id;
final String code;
final String name;
final String openStartDate;
final String openEndDate;
String get startDateStr => openStartDate.split(':').getRange(0, 2).join(':');
String get endDateStr => openEndDate.split(':').getRange(0, 2).join(':');
final int type;
@JsonKey(name: 'num')
final int num_;
@ -21,9 +17,9 @@ class FacilityTypeModel {
FacilityTypeModel({
required this.id,
required this.code,
required this.name,
required this.openStartDate,
required this.openEndDate,
required this.type,
required this.num_,
required this.imgUrls,
});

@ -9,11 +9,11 @@ part of 'facility_type_model.dart';
FacilityTypeModel _$FacilityTypeModelFromJson(Map<String, dynamic> json) =>
FacilityTypeModel(
id: json['id'] as int,
code: json['code'] as String,
name: json['name'] as String,
openStartDate: json['openStartDate'] as String,
openEndDate: json['openEndDate'] as String,
type: json['type'] as int,
num_: json['num'] as int,
imgUrls: (json['imgUrls'] as List<dynamic>?)
imgUrls: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -113,6 +113,7 @@ class _SplashPageState extends State<SplashPage> {
// await Permission.locationWhenInUse.request();
// }
//
MainInitialize.initJPush();
EquatableConfig.stringify = true;
AMapFlutterLocation.updatePrivacyShow(true, true);
AMapFlutterLocation.updatePrivacyAgree(true);

@ -10,6 +10,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constants/saas_api.dart';
class FacilityAppointmentCard extends StatelessWidget {
final FacilityAppointmentModel model;
final VoidCallback onUpdate;
@ -49,9 +51,9 @@ class FacilityAppointmentCard extends StatelessWidget {
switch (model.status) {
case 1:
//1.(30)
if (model.appointmentStart == null) button = SizedBox();
if (model.reserveStartDt == null) button = SizedBox();
int diffTime =
model.appointmentStart!.difference(DateTime.now()).inMinutes;
model.reserveStartDt!.difference(DateTime.now()).inMinutes;
bool inTime = diffTime >= 0 && diffTime <= 30;
if (inTime)
button = _FacilityButton(
@ -60,7 +62,7 @@ class FacilityAppointmentCard extends StatelessWidget {
if (result != null) {
final cancel = BotToast.showLoading();
await NetUtil().get(
API.manager.facility.scan,
SAASAPI.facilities.signIn,
params: {'appointmentCode': result},
showMessage: true,
);
@ -92,7 +94,7 @@ class FacilityAppointmentCard extends StatelessWidget {
if (result == true) {
final cancel = BotToast.showLoading();
await NetUtil().get(
API.manager.facility.cancel,
SAASAPI.facilities.cancel,
params: {'facilitiesAppointmentId': model.id},
showMessage: true,
);
@ -108,7 +110,7 @@ class FacilityAppointmentCard extends StatelessWidget {
onPressed: () async {
final cancel = BotToast.showLoading();
await NetUtil().get(
API.manager.facility.stop,
SAASAPI.facilities.useStop,
params: {'facilitiesAppointmentId': model.id},
showMessage: true,
);
@ -152,7 +154,7 @@ class FacilityAppointmentCard extends StatelessWidget {
Row(
children: [
Text(
model.facilitiesName,
model.address,
style: TextStyle(
fontSize: 32.sp,
fontWeight: FontWeight.bold,

@ -1,4 +1,5 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/models/facility/facility_appointment_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/facility/facility_appointment_card.dart';
@ -48,7 +49,7 @@ class _FacilityAppointmentViewState extends State<FacilityAppointmentView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manager.facility.appointment,
path: SAASAPI.facilities.list,
controller: _refreshController,
convert: (model) =>
model.rows.map((e) => FacilityAppointmentModel.fromJson(e)).toList(),

@ -45,7 +45,7 @@ class _FacilityOrderDateListPageState extends State<FacilityOrderDateListPage> {
body: BeeListView(
path: SAASAPI.facilities.allAppointmentPeriod,
extraParams: {
"facilitiesManageId ": widget.facilitiesId,
"facilitiesManageId": widget.facilitiesId,
},
controller: _refreshController,
convert: (models) {

@ -0,0 +1,58 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import '../../../utils/network/net_util.dart';
import '../../../widget/buttons/bee_check_radio.dart';
class FacilityPreorderDatePicker extends StatefulWidget {
const FacilityPreorderDatePicker({Key? key}) : super(key: key);
@override
State<FacilityPreorderDatePicker> createState() =>
_FacilityPreorderDatePickerState();
}
class _FacilityPreorderDatePickerState extends State<FacilityPreorderDatePicker> {
List<int> get _num => List.generate(48, (index) => index + 1);
List? _models;
@override
void initState() async{
var base =
await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: {
'facilitiesManageId': widget,
'todayDate':DateTime.now(),
});
if (base.success) {
_models = (base.data as List).toList();
}
super.initState();
}
@override
Widget build(BuildContext context) {
return ListView(
children: _num
.map((e) => Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child:
Text(e.toString() + '', textAlign: TextAlign.center),
),
))
.toList());
}
Widget _datesList() {
DateTime date=DateTime.now();
return Row(
children: [
BeeCheckRadio(
value: _num,
// groupValue: SAASAPI.facilities.allAppointmentPeriod,
),
Text('${date}~${date.add(Duration(minutes: 30))}'),
],
);
}
}

@ -3,8 +3,9 @@ import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/app_theme.dart';
import 'package:aku_new_community/models/facility/facility_type_detail_model.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/community/facility/facility_type_detail_page.dart';
import 'package:aku_new_community/ui/community/facility/fcility_order_date_list_page.dart';
import 'package:aku_new_community/ui/community/facility/facility_order_date_list_page.dart';
import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
@ -19,25 +20,30 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import '../../../constants/saas_api.dart';
import '../../../models/facility/facility_type_model.dart';
import '../../../widget/picker/bee_day_picker.dart';
import '../../manager/advice/advice_house_page.dart';
class FacilityPreorderPage extends StatefulWidget {
final int id;
final FacilityTypeModel facilityModel;
final FacilityTypeDetailModel typeModel;
FacilityPreorderPage({Key? key, required this.id}) : super(key: key);
FacilityPreorderPage({Key? key, required this.facilityModel,required this.typeModel}) : super(key: key);
@override
_FacilityPreorderPageState createState() => _FacilityPreorderPageState();
}
class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
FacilityTypeDetailModel? typeModel;
DateTime? startDate;
DateTime? endDate;
bool get canTap => startDate != null && endDate != null && typeModel != null;
bool get canTap => startDate != null && endDate != null;
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
final userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '添加预订',
bodyColor: Colors.white,
@ -52,9 +58,9 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
height: 60.w,
width: 60.w,
),
onTap: () => Get.to(() => PickMyHousePage()),
onTap: () => Get.to(() => AdviceHousePage()),
title: Text(S.of(context)!.tempPlotName),
subtitle: Text(appProvider.selectedHouse?.roomName ?? '选择房间'),
subtitle: Text(userProvider.defaultHouse!.addressName),
trailing: Icon(CupertinoIcons.chevron_forward),
),
BeeDivider(
@ -69,14 +75,12 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
height: 60.w,
width: 60.w,
),
onTap: () async {
FacilityTypeDetailModel? model = await Get.to(() =>
FacilityTypeDetailPage(model: typeModel, id: widget.id));
if (model != null) typeModel = model;
onTap: () async {await Get.to(() =>
FacilityTypeDetailPage(facilityModel: widget.facilityModel));
setState(() {});
},
title: Text(S.of(context)!.tempPlotName),
subtitle: Text(typeModel?.name ?? '选择设施'),
subtitle: Text(widget.typeModel.name),
trailing: Icon(CupertinoIcons.chevron_forward),
),
BeeDivider(
@ -93,13 +97,8 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
height: 120.w,
onPressed: () async {
DateTime _currentTime = DateTime.now();
DateTime? date = await BeeDatePicker.pick(
_currentTime.add(Duration(minutes: 60)),
mode: CupertinoDatePickerMode.dateAndTime,
min: _currentTime.add(Duration(minutes: 30)),
max: _currentTime.add(Duration(days: 30)),
);
DateTime? date = await BeeDayPicker.pick(DateTime.now());
BeeDayPicker.pick(DateTime.now());
if (date != null) {
startDate = date;
setState(() {});
@ -110,7 +109,7 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
? '请选择开始时间'
: DateUtil.formatDate(
startDate,
format: 'yyyy-MM-dd HH:mm',
format: 'yyyy/MM/dd',
),
style: TextStyle(
color: ktextSubColor,
@ -166,12 +165,14 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
// if (dateDifferenceIsTrue) {
final cancel = BotToast.showLoading();
var model = await NetUtil().post(
API.manager.facility.add,
SAASAPI.facilities.insert,
params: {
'estateId': appProvider.selectedHouse?.estateId ?? 0,
'facilitiesManageId': typeModel!.id,
'appointmentStartDate': NetUtil.getDate(startDate!),
'appointmentEndDate': NetUtil.getDate(endDate!),
'estateId': userProvider.defaultHouse!.id,
'type':widget.facilityModel.type,
'facilitiesCategoryId':widget.facilityModel.id,
'facilitiesManageId':widget.typeModel.id,
'appointmentDate':1,
'appointmentPeriodList':1,
},
);
cancel();
@ -231,7 +232,7 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
CupertinoActionSheetAction(
onPressed: () {
Get.off(
() => FacilityOrderDateListPage(facilitiesId: typeModel!.id));
() => FacilityOrderDateListPage(facilitiesId: widget.typeModel.id));
},
child:
'查看'.text.size(30.sp).color(kPrimaryColor).isIntrinsic.make()),

@ -7,6 +7,8 @@ import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'facility_type_detail_page.dart';
class FacilityTypeCard extends StatelessWidget {
final FacilityTypeModel model;
@ -17,25 +19,28 @@ class FacilityTypeCard extends StatelessWidget {
return MaterialButton(
color: Colors.white,
elevation: 0,
padding: EdgeInsets.zero,
padding: EdgeInsets.all(30.w),
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
borderRadius: BorderRadius.circular(10.w),
),
child: Column(
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: SAASAPI.image(ImgModel.first(model.imgUrls)),
height: 320.w,
width: double.infinity,
fit: BoxFit.cover,
Material(
borderRadius: BorderRadius.circular(10.w),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: SAASAPI.image(ImgModel.first(model.imgUrls)),
height: 280.w,
width: double.infinity,
fit: BoxFit.cover,
),
),
24.hb,
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
32.wb,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -47,35 +52,39 @@ class FacilityTypeCard extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
32.hb,
Row(
children: [
Text(
'开放时段',
style: TextStyle(
color: ktextSubColor,
fontSize: 22.sp,
),
),
Text(
'${model.startDateStr}-${model.endDateStr}',
style: TextStyle(
fontSize: 22.sp,
),
),
],
),
15.hb,
'${model.type==1?'设备数量':'设施数量'} ${model.num_}'
.text
.size(15.sp)
.color(BaseStyle.color4a4b51.withOpacity(0.45))
.make(),
// Row(
// children: [
// Text(
// '开放时段',
// style: TextStyle(
// color: ktextSubColor,
// fontSize: 22.sp,
// ),
// ),
// Text(
// '${model.startDateStr}-${model.endDateStr}',
// style: TextStyle(
// fontSize: 22.sp,
// ),
// ),
// ],
// ),
],
),
),
32.wb,
],
),
24.hb,
],
),
onPressed: () {
Get.off(() => FacilityPreorderPage(id: model.id));
Get.off(() => FacilityTypeDetailPage(facilityModel: model,));
},
);
}

@ -0,0 +1,82 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../models/facility/facility_type_detail_model.dart';
import '../../../models/facility/facility_type_model.dart';
import 'facility_preorder_page.dart';
import 'facility_type_detail_page.dart';
class FacilityTypeDetailCard extends StatelessWidget {
final FacilityTypeDetailModel model;
final FacilityTypeModel facilityModel;
const FacilityTypeDetailCard(
{Key? key, required this.model, required this.facilityModel})
: super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
color: Colors.white,
elevation: 0,
padding: EdgeInsets.all(30.w),
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
),
child: Column(
children: [
Row(
children: [
Material(
borderRadius: BorderRadius.circular(10.w),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: SAASAPI.image(ImgModel.first(model.imgList)),
height: 120.h,
width: 150.w,
fit: BoxFit.cover,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.name,
style: TextStyle(
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
15.hb,
'${model.openStartDate.substring(0, model.openStartDate.length - 3)}-${model.openEndDate.substring(0, model.openEndDate.length - 3)} 开放'
.text
.size(20.sp)
.make(),
12.hb,
'${model.address}'
.text
.size(20.sp)
.color(BaseStyle.color474747)
.make(),
],
),
],
),
],
),
onPressed: () {
Get.off(() => FacilityPreorderPage(
facilityModel: facilityModel,
typeModel: model,
));
},
);
}
}

@ -1,5 +1,7 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/models/facility/facility_type_detail_model.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
@ -8,14 +10,17 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import '../../../constants/saas_api.dart';
import '../../../models/facility/facility_type_model.dart';
import 'facility_type_card.dart';
import 'facility_type_detail_card.dart';
class FacilityTypeDetailPage extends StatefulWidget {
final int id;
final FacilityTypeDetailModel? model;
final FacilityTypeModel facilityModel;
FacilityTypeDetailPage({
Key? key,
required this.model,
required this.id,
required this.facilityModel,
}) : super(key: key);
@override
@ -23,41 +28,57 @@ class FacilityTypeDetailPage extends StatefulWidget {
}
class _FacilityTypeDetailPageState extends State<FacilityTypeDetailPage> {
EasyRefreshController _refreshController = EasyRefreshController();
List<FacilityTypeDetailModel> _models = [];
int _page = 1;
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '选择设施',
body: EasyRefresh(
controller: _refreshController,
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
BaseModel model = await NetUtil().get(
API.manager.facility.detailType,
params: {'categoryId': widget.id},
);
_models = (model.data as List)
_page = 1;
BaseListModel model = await NetUtil()
.getList(SAASAPI.facilities.manageList, params: {
'pageNum': _page,
'size': 10,
'facilitiesCategoryId': widget.facilityModel.id
});
_models = model.rows
.map((e) => FacilityTypeDetailModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
_page++;
BaseListModel model = await NetUtil()
.getList(SAASAPI.facilities.manageList, params: {
'pageNum': _page,
'size': 10,
'facilitiesCategoryId': widget.facilityModel.id
});
_models=model.rows
.map((e) => FacilityTypeDetailModel.fromJson(e))
.toList();
setState(() {});
},
child: ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
final item = _models[index];
return ListTile(
onTap: () => selectModel(item),
leading: Radio(
value: item,
groupValue: widget.model,
onChanged: (_) {
selectModel(item);
},
),
title: Text(item.name),
);
return FacilityTypeDetailCard(model: _models[index],facilityModel:widget.facilityModel);
},
separatorBuilder: (_, __) => BeeDivider.horizontal(),
separatorBuilder: (context, index) => 32.hb,
itemCount: _models.length,
),
),

@ -4,8 +4,19 @@ import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/facility/facility_type_card.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import '../../../constants/saas_api.dart';
import '../../../utils/network/base_list_model.dart';
import '../../../utils/network/net_util.dart';
import '../../../widget/tab_bar/bee_tab_bar.dart';
import '../../market/market_home_goods_card.dart';
import 'facility_appointment_page.dart';
import 'facility_appointment_view.dart';
class PickFacilityPage extends StatefulWidget {
PickFacilityPage({Key? key}) : super(key: key);
@ -14,9 +25,15 @@ class PickFacilityPage extends StatefulWidget {
_PickFacilityPageState createState() => _PickFacilityPageState();
}
class _PickFacilityPageState extends State<PickFacilityPage> {
class _PickFacilityPageState extends State<PickFacilityPage> with TickerProviderStateMixin{
final EasyRefreshController _refreshController = EasyRefreshController();
late TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
_refreshController.dispose();
@ -26,23 +43,65 @@ class _PickFacilityPageState extends State<PickFacilityPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '选择设施',
body: BeeListView<FacilityTypeModel>(
path: API.manager.facility.type,
controller: _refreshController,
convert: (model) =>
model.rows.map((e) => FacilityTypeModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
return FacilityTypeCard(model: items[index]);
title: '选择设施类型',
// actions: [
// IconButton(
// icon: Icon(CupertinoIcons.doc_text),
// onPressed: () async {
// await Get.to(() => FacilityAppointmentPage());
// childKey.currentState!.callRefresh();
// },
// ),
// ],
appBarBottom: BeeTabBar(
controller: _tabController,
tabs: ['设备分类', '设施分类'],
),
body: TabBarView(
controller: _tabController,
children: List.generate(2, (index) {
return BeeListView<FacilityTypeModel>(
path: SAASAPI.facilities.categoryList,
extraParams: {'type': index+1},
controller: _refreshController,
convert: (model) => model.rows
.map((e) => FacilityTypeModel.fromJson(e))
.toList(),
builder: (items) {
return GridView.builder(
padding: EdgeInsets.all(30.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 0.72,
crossAxisSpacing: 30.w,
mainAxisSpacing: 30.w,
),
itemCount: items.length,
itemBuilder: (BuildContext context, int index) {
return FacilityTypeCard(model: items[index],);
},
);
},
separatorBuilder: (context, index) => 32.hb,
itemCount: items.length,
);
},
}).toList(),
),
// BeeListView<FacilityTypeModel>(
// path: SAASAPI.communityIntroduction.categoryList,
// controller: _refreshController,
// convert: (model) =>
// model.rows.map((e) => FacilityTypeModel.fromJson(e)).toList(),
// builder: (items) {
// return ListView.separated(
// padding: EdgeInsets.all(32.w),
// itemBuilder: (context, index) {
// return FacilityTypeCard(model: items[index]);
// },
// separatorBuilder: (context, index) => 32.hb,
// itemCount: items.length,
// );
// },
// ),
);
}
}

@ -32,11 +32,13 @@ class QuestionnaireDetailPage extends StatefulWidget {
}
class _QuestionnaireDetailPageState extends State<QuestionnaireDetailPage> {
late QuestionnaireDetialModel _model;
bool _onload = true;
List<AppQuestionnaireAnswerSubmits> _submitModels = [];
Widget _emptyWidget() {
return Container();
}

@ -314,10 +314,10 @@ class _MarketPageState extends State<MarketPage>
key: _sliverAppBarGlobalKey,
title: geSearch(),
backgroundColor: Color(0xFFF9F9F9),
expandedHeight: MessageHeight +
expandedHeight: MessageHeight+
bannerHeight +
buttonsHeight +
// searchHeight +
//searchHeight +
tabBarHeight +
hotGoodHeight +
ScreenUtil().statusBarHeight +
@ -326,7 +326,7 @@ class _MarketPageState extends State<MarketPage>
172 * 2.w,
flexibleSpace: _flexibleSpaceBar(context),
bottom: PreferredSize(
preferredSize: Size.fromHeight(tabBarHeight),
preferredSize: Size.fromHeight(tabBarHeight+50.h),
child: _goodsTitle(
normalTypeButton,
salesTypeButton,
@ -475,7 +475,7 @@ class _MarketPageState extends State<MarketPage>
height: ScreenUtil().statusBarHeight + kToolbarHeight,
),
// geSearch(),
20.hb,
50.hb,
// getNum(),
// 20.hb,
HomeSwiper(),
@ -597,36 +597,43 @@ class _MarketPageState extends State<MarketPage>
}
geSearch() {
return Row(
mainAxisSize: MainAxisSize.min,
return Column(
children: [
Expanded(
child: GestureDetector(
onTap: () async {
Get.to(() => SearchGoodsPage());
},
child: Container(
height: 72.w,
margin: EdgeInsets.only(left: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(36.w),
color: Colors.white),
child: Row(
children: [
32.wb,
Assets.home.icSearch.image(
width: 48.w,
height: 48.w,
16.hb,
'本商城所有商品来源于京东'.text.color(Color(0xFFACACAC)).normal.size(30.sp).make(),
16.hb,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: GestureDetector(
onTap: () async {
Get.to(() => SearchGoodsPage());
},
child: Container(
height: 72.w,
margin: EdgeInsets.only(left: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(36.w),
color: Colors.white),
child: Row(
children: [
32.wb,
Assets.home.icSearch.image(
width: 48.w,
height: 48.w,
),
10.wb,
'请输入关键字'.text.size(28.sp).color(ktextSubColor).make(),
],
),
10.wb,
'请输入关键字'.text.size(28.sp).color(ktextSubColor).make(),
],
),
),
),
),
),
32.wb,
..._actionsWidget()
32.wb,
..._actionsWidget()
],
)
],
);
}

@ -128,8 +128,6 @@ class ApplicationUtil {
title: '设施预约',
imgPath: Assets.home.icSsyy.path,
onTap: () {
BotToast.showText(text: '此功能升级中,敬请期待');
return;
Get.to(() => FacilityAppointmentPage());
}),
AppElement(

@ -1,3 +1,4 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/material.dart';
class HomeSliverAppBar extends StatefulWidget {
@ -8,15 +9,15 @@ class HomeSliverAppBar extends StatefulWidget {
final PreferredSizeWidget? bottom;
final double? expandedHeight;
HomeSliverAppBar(
{Key? key,
this.actions,
this.title,
this.backgroundColor,
this.flexibleSpace,
this.bottom,
this.expandedHeight})
: super(key: key);
HomeSliverAppBar({
Key? key,
this.actions,
this.title,
this.backgroundColor,
this.flexibleSpace,
this.bottom,
this.expandedHeight,
}) : super(key: key);
@override
HomeSliverAppBarState createState() => HomeSliverAppBarState();
@ -49,8 +50,9 @@ class HomeSliverAppBarState extends State<HomeSliverAppBar> {
elevation: 0,
backgroundColor: _displayColor,
flexibleSpace: widget.flexibleSpace,
collapsedHeight: kToolbarHeight + 10,
collapsedHeight: kToolbarHeight + 40.h,
expandedHeight: widget.expandedHeight,
toolbarHeight: kToolbarHeight+40.h,
bottom: widget.bottom,
);
}

@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:aku_new_community/utils/headers.dart';
class BeeChooseDatePicker extends StatefulWidget {
final Widget? body;
final VoidCallback? onPressed;
final double? height;
BeeChooseDatePicker({Key? key, this.body, this.onPressed, this.height}) : super(key: key);
@override
_BeeChooseDatePickerState createState() => _BeeChooseDatePickerState();
}
class _BeeChooseDatePickerState extends State<BeeChooseDatePicker> {
@override
Widget build(BuildContext context) {
return SizedBox(
child: Material(
borderRadius: BorderRadius.vertical(top: Radius.circular(10)),
child: Column(
children: [
SizedBox(
height: 48,
child: NavigationToolbar(
leading: Text(
'选择日期',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30.sp,
),
).paddingAll(25.w),
trailing: TextButton(
onPressed: widget.onPressed,
child: '下一步'.text.color(Colors.blue).make(),
),
),
),
widget.body!,
],
),
),
height: widget.height??Get.height / 3,
);
}
}

@ -7,6 +7,7 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/widget/picker/bee_custom_picker.dart';
class BeeDatePicker {
static Future<DateTime?> pick(DateTime initDate, {
CupertinoDatePickerMode mode = CupertinoDatePickerMode.date,
@ -35,6 +36,7 @@ class BeeDatePicker {
BeeMonthPickBody(initTime: initDate)
);
}
}
class _BeeDatePicker extends StatefulWidget {

@ -0,0 +1,76 @@
import 'package:aku_new_community/models/facility/facility_type_detail_model.dart';
import 'package:aku_new_community/ui/community/facility/facility_preorder_date_picker.dart';
import 'package:aku_new_community/widget/picker/bee_choose_date_picker.dart';
import 'package:aku_new_community/widget/picker/bee_month_pick_body.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/widget/picker/bee_custom_picker.dart';
class BeeDayPicker {
static Future<DateTime?> pick(
DateTime initDate, {
CupertinoDatePickerMode mode = CupertinoDatePickerMode.date,
DateTime? min,
DateTime? max,
}) async {
return await Get.bottomSheet(_BeeDayPicker(
date: initDate,
mode: mode,
min: min ?? DateTime.now().subtract(Duration(days: 1)),
max: max,
));
}
}
class _BeeDayPicker extends StatefulWidget {
final DateTime date;
final bool use24H;
final DateTime? max;
final DateTime? min;
final CupertinoDatePickerMode? mode;
_BeeDayPicker({
Key? key,
required this.date,
this.use24H = false,
this.max,
this.min,
this.mode,
}) : super(key: key);
@override
__BeeDayPickerState createState() => __BeeDayPickerState();
}
class __BeeDayPickerState extends State<_BeeDayPicker> {
DateTime _date = DateTime.now();
@override
void initState() {
super.initState();
_date = widget.date;
}
@override
Widget build(BuildContext context) {
return BeeChooseDatePicker(
onPressed: () async{
Get.back();
// await FacilityPreorderDatePicker();
},
body: CupertinoDatePicker(
use24hFormat: widget.use24H,
maximumDate: widget.max,
minimumDate: widget.min,
initialDateTime: _date,
onDateTimeChanged: (date) => _date = date,
mode: widget.mode ?? CupertinoDatePickerMode.date,
).expand(),
);
}
}

@ -5,6 +5,9 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../constants/saas_api.dart';
import '../../utils/network/base_list_model.dart';
import '../../utils/network/net_util.dart';
import 'bee_picker_box.dart';
class BeeMonthPickBody extends StatefulWidget {
@ -34,7 +37,8 @@ class _BeeMonthPickBodyState extends State<BeeMonthPickBody> {
(index) => index + 1);
@override
void initState() {
void initState() async{
setState(() {});
_pickYear = widget.initTime.year;
_pickMonth = 1;
super.initState();

@ -760,13 +760,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
@ -1214,7 +1207,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.3"
time:
dependency: transitive
description:

Loading…
Cancel
Save