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

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

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

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

@ -42,6 +42,7 @@ class SAASAPI {
static _CommitteeStaff committeeStaff = _CommitteeStaff(); static _CommitteeStaff committeeStaff = _CommitteeStaff();
static _Advice advice = _Advice(); static _Advice advice = _Advice();
static _Vote vote = _Vote(); static _Vote vote = _Vote();
static _Facilities facilities = _Facilities();
/// ///
static _ProfileApi profile = _ProfileApi(); static _ProfileApi profile = _ProfileApi();
@ -382,4 +383,22 @@ class _Vote{
String get vote =>'/app/user/vote/vote'; String get vote =>'/app/user/vote/vote';
/// ///
String get details =>'/app/user/vote/details'; 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'); const buildType = const String.fromEnvironment('BUILD_TYPE');
DeveloperUtil.setDev(!(buildType.contains('PRODUCT'))); DeveloperUtil.setDev(!(buildType.contains('PRODUCT')));
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await MainInitialize.initJPush();
runApp(MyApp()); runApp(MyApp());
} }

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

@ -11,11 +11,9 @@ FacilityAppointmentModel _$FacilityAppointmentModelFromJson(
FacilityAppointmentModel( FacilityAppointmentModel(
id: json['id'] as int, id: json['id'] as int,
code: json['code'] as String, code: json['code'] as String,
facilitiesName: json['facilitiesName'] as String,
status: json['status'] as int, status: json['status'] as int,
address: json['address'] as String, address: json['address'] as String,
appointmentStartDate: json['appointmentStartDate'] as String, reserveStartDate: json['reserveStartDate'] as String,
appointmentEndDate: json['appointmentEndDate'] as String, reserveEndDate: json['reserveEndDate'] as String,
nullifyReason: json['nullifyReason'] 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:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
import '../../model/common/img_model.dart';
part 'facility_type_detail_model.g.dart'; part 'facility_type_detail_model.g.dart';
@JsonSerializable() @JsonSerializable()
class FacilityTypeDetailModel extends Equatable { class FacilityTypeDetailModel extends Equatable {
final int id; final int id;
final String code;
final String address;
final String name; 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({ FacilityTypeDetailModel({
required this.id, required this.id,
required this.code,
required this.name, required this.name,
required this.address,
required this.openStartDate,
required this.openEndDate,
required this.imgList,
}); });
factory FacilityTypeDetailModel.fromJson(Map<String, dynamic> json) => factory FacilityTypeDetailModel.fromJson(Map<String, dynamic> json) =>
_$FacilityTypeDetailModelFromJson(json); _$FacilityTypeDetailModelFromJson(json);
@override @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) => Map<String, dynamic> json) =>
FacilityTypeDetailModel( FacilityTypeDetailModel(
id: json['id'] as int, id: json['id'] as int,
code: json['code'] as String,
name: json['name'] 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() @JsonSerializable()
class FacilityTypeModel { class FacilityTypeModel {
final int id; final int id;
final String code;
final String name; final String name;
final String openStartDate; final int type;
final String openEndDate;
String get startDateStr => openStartDate.split(':').getRange(0, 2).join(':');
String get endDateStr => openEndDate.split(':').getRange(0, 2).join(':');
@JsonKey(name: 'num') @JsonKey(name: 'num')
final int num_; final int num_;
@ -21,9 +17,9 @@ class FacilityTypeModel {
FacilityTypeModel({ FacilityTypeModel({
required this.id, required this.id,
required this.code,
required this.name, required this.name,
required this.openStartDate, required this.type,
required this.openEndDate,
required this.num_, required this.num_,
required this.imgUrls, required this.imgUrls,
}); });

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

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

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

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

@ -45,7 +45,7 @@ class _FacilityOrderDateListPageState extends State<FacilityOrderDateListPage> {
body: BeeListView( body: BeeListView(
path: SAASAPI.facilities.allAppointmentPeriod, path: SAASAPI.facilities.allAppointmentPeriod,
extraParams: { extraParams: {
"facilitiesManageId ": widget.facilitiesId, "facilitiesManageId": widget.facilitiesId,
}, },
controller: _refreshController, controller: _refreshController,
convert: (models) { 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/constants/app_theme.dart';
import 'package:aku_new_community/models/facility/facility_type_detail_model.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/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/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/ui/profile/house/pick_my_house_page.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/net_util.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:get/get.dart';
import 'package:provider/provider.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 { 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 @override
_FacilityPreorderPageState createState() => _FacilityPreorderPageState(); _FacilityPreorderPageState createState() => _FacilityPreorderPageState();
} }
class _FacilityPreorderPageState extends State<FacilityPreorderPage> { class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
FacilityTypeDetailModel? typeModel;
DateTime? startDate; DateTime? startDate;
DateTime? endDate; DateTime? endDate;
bool get canTap => startDate != null && endDate != null && typeModel != null; bool get canTap => startDate != null && endDate != null;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context); final userProvider = Provider.of<UserProvider>(context);
return BeeScaffold( return BeeScaffold(
title: '添加预订', title: '添加预订',
bodyColor: Colors.white, bodyColor: Colors.white,
@ -52,9 +58,9 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
height: 60.w, height: 60.w,
width: 60.w, width: 60.w,
), ),
onTap: () => Get.to(() => PickMyHousePage()), onTap: () => Get.to(() => AdviceHousePage()),
title: Text(S.of(context)!.tempPlotName), title: Text(S.of(context)!.tempPlotName),
subtitle: Text(appProvider.selectedHouse?.roomName ?? '选择房间'), subtitle: Text(userProvider.defaultHouse!.addressName),
trailing: Icon(CupertinoIcons.chevron_forward), trailing: Icon(CupertinoIcons.chevron_forward),
), ),
BeeDivider( BeeDivider(
@ -69,14 +75,12 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
height: 60.w, height: 60.w,
width: 60.w, width: 60.w,
), ),
onTap: () async { onTap: () async {await Get.to(() =>
FacilityTypeDetailModel? model = await Get.to(() => FacilityTypeDetailPage(facilityModel: widget.facilityModel));
FacilityTypeDetailPage(model: typeModel, id: widget.id));
if (model != null) typeModel = model;
setState(() {}); setState(() {});
}, },
title: Text(S.of(context)!.tempPlotName), title: Text(S.of(context)!.tempPlotName),
subtitle: Text(typeModel?.name ?? '选择设施'), subtitle: Text(widget.typeModel.name),
trailing: Icon(CupertinoIcons.chevron_forward), trailing: Icon(CupertinoIcons.chevron_forward),
), ),
BeeDivider( BeeDivider(
@ -93,13 +97,8 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
height: 120.w, height: 120.w,
onPressed: () async { onPressed: () async {
DateTime _currentTime = DateTime.now(); DateTime? date = await BeeDayPicker.pick(DateTime.now());
DateTime? date = await BeeDatePicker.pick( BeeDayPicker.pick(DateTime.now());
_currentTime.add(Duration(minutes: 60)),
mode: CupertinoDatePickerMode.dateAndTime,
min: _currentTime.add(Duration(minutes: 30)),
max: _currentTime.add(Duration(days: 30)),
);
if (date != null) { if (date != null) {
startDate = date; startDate = date;
setState(() {}); setState(() {});
@ -110,7 +109,7 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
? '请选择开始时间' ? '请选择开始时间'
: DateUtil.formatDate( : DateUtil.formatDate(
startDate, startDate,
format: 'yyyy-MM-dd HH:mm', format: 'yyyy/MM/dd',
), ),
style: TextStyle( style: TextStyle(
color: ktextSubColor, color: ktextSubColor,
@ -166,12 +165,14 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
// if (dateDifferenceIsTrue) { // if (dateDifferenceIsTrue) {
final cancel = BotToast.showLoading(); final cancel = BotToast.showLoading();
var model = await NetUtil().post( var model = await NetUtil().post(
API.manager.facility.add, SAASAPI.facilities.insert,
params: { params: {
'estateId': appProvider.selectedHouse?.estateId ?? 0, 'estateId': userProvider.defaultHouse!.id,
'facilitiesManageId': typeModel!.id, 'type':widget.facilityModel.type,
'appointmentStartDate': NetUtil.getDate(startDate!), 'facilitiesCategoryId':widget.facilityModel.id,
'appointmentEndDate': NetUtil.getDate(endDate!), 'facilitiesManageId':widget.typeModel.id,
'appointmentDate':1,
'appointmentPeriodList':1,
}, },
); );
cancel(); cancel();
@ -231,7 +232,7 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
CupertinoActionSheetAction( CupertinoActionSheetAction(
onPressed: () { onPressed: () {
Get.off( Get.off(
() => FacilityOrderDateListPage(facilitiesId: typeModel!.id)); () => FacilityOrderDateListPage(facilitiesId: widget.typeModel.id));
}, },
child: child:
'查看'.text.size(30.sp).color(kPrimaryColor).isIntrinsic.make()), '查看'.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:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'facility_type_detail_page.dart';
class FacilityTypeCard extends StatelessWidget { class FacilityTypeCard extends StatelessWidget {
final FacilityTypeModel model; final FacilityTypeModel model;
@ -17,25 +19,28 @@ class FacilityTypeCard extends StatelessWidget {
return MaterialButton( return MaterialButton(
color: Colors.white, color: Colors.white,
elevation: 0, elevation: 0,
padding: EdgeInsets.zero, padding: EdgeInsets.all(30.w),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(10.w),
), ),
child: Column( child: Column(
children: [ children: [
FadeInImage.assetNetwork( Material(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, borderRadius: BorderRadius.circular(10.w),
image: SAASAPI.image(ImgModel.first(model.imgUrls)), clipBehavior: Clip.antiAliasWithSaveLayer,
height: 320.w, child: FadeInImage.assetNetwork(
width: double.infinity, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover, image: SAASAPI.image(ImgModel.first(model.imgUrls)),
height: 280.w,
width: double.infinity,
fit: BoxFit.cover,
),
), ),
24.hb, 24.hb,
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
32.wb,
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -47,35 +52,39 @@ class FacilityTypeCard extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
32.hb, 15.hb,
Row( '${model.type==1?'设备数量':'设施数量'} ${model.num_}'
children: [ .text
Text( .size(15.sp)
'开放时段', .color(BaseStyle.color4a4b51.withOpacity(0.45))
style: TextStyle( .make(),
color: ktextSubColor, // Row(
fontSize: 22.sp, // children: [
), // Text(
), // '开放时段',
Text( // style: TextStyle(
'${model.startDateStr}-${model.endDateStr}', // color: ktextSubColor,
style: TextStyle( // fontSize: 22.sp,
fontSize: 22.sp, // ),
), // ),
), // Text(
], // '${model.startDateStr}-${model.endDateStr}',
), // style: TextStyle(
// fontSize: 22.sp,
// ),
// ),
// ],
// ),
], ],
), ),
), ),
32.wb, 32.wb,
], ],
), ),
24.hb,
], ],
), ),
onPressed: () { 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/constants/api.dart';
import 'package:aku_new_community/models/facility/facility_type_detail_model.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/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.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:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.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 { class FacilityTypeDetailPage extends StatefulWidget {
final int id; final FacilityTypeModel facilityModel;
final FacilityTypeDetailModel? model;
FacilityTypeDetailPage({ FacilityTypeDetailPage({
Key? key, Key? key,
required this.model, required this.facilityModel,
required this.id,
}) : super(key: key); }) : super(key: key);
@override @override
@ -23,41 +28,57 @@ class FacilityTypeDetailPage extends StatefulWidget {
} }
class _FacilityTypeDetailPageState extends State<FacilityTypeDetailPage> { class _FacilityTypeDetailPageState extends State<FacilityTypeDetailPage> {
EasyRefreshController _refreshController = EasyRefreshController();
List<FacilityTypeDetailModel> _models = []; List<FacilityTypeDetailModel> _models = [];
int _page = 1;
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '选择设施', title: '选择设施',
body: EasyRefresh( body: EasyRefresh(
controller: _refreshController,
firstRefresh: true, firstRefresh: true,
header: MaterialHeader(), header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async { onRefresh: () async {
BaseModel model = await NetUtil().get( _page = 1;
API.manager.facility.detailType, BaseListModel model = await NetUtil()
params: {'categoryId': widget.id}, .getList(SAASAPI.facilities.manageList, params: {
); 'pageNum': _page,
_models = (model.data as List) '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)) .map((e) => FacilityTypeDetailModel.fromJson(e))
.toList(); .toList();
setState(() {}); setState(() {});
}, },
child: ListView.separated( child: ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = _models[index]; return FacilityTypeDetailCard(model: _models[index],facilityModel:widget.facilityModel);
return ListTile(
onTap: () => selectModel(item),
leading: Radio(
value: item,
groupValue: widget.model,
onChanged: (_) {
selectModel(item);
},
),
title: Text(item.name),
);
}, },
separatorBuilder: (_, __) => BeeDivider.horizontal(), separatorBuilder: (context, index) => 32.hb,
itemCount: _models.length, 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/ui/community/facility/facility_type_card.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.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 { class PickFacilityPage extends StatefulWidget {
PickFacilityPage({Key? key}) : super(key: key); PickFacilityPage({Key? key}) : super(key: key);
@ -14,9 +25,15 @@ class PickFacilityPage extends StatefulWidget {
_PickFacilityPageState createState() => _PickFacilityPageState(); _PickFacilityPageState createState() => _PickFacilityPageState();
} }
class _PickFacilityPageState extends State<PickFacilityPage> { class _PickFacilityPageState extends State<PickFacilityPage> with TickerProviderStateMixin{
final EasyRefreshController _refreshController = EasyRefreshController(); final EasyRefreshController _refreshController = EasyRefreshController();
late TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override @override
void dispose() { void dispose() {
_refreshController.dispose(); _refreshController.dispose();
@ -26,23 +43,65 @@ class _PickFacilityPageState extends State<PickFacilityPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '选择设施', title: '选择设施类型',
body: BeeListView<FacilityTypeModel>( // actions: [
path: API.manager.facility.type, // IconButton(
controller: _refreshController, // icon: Icon(CupertinoIcons.doc_text),
convert: (model) => // onPressed: () async {
model.rows.map((e) => FacilityTypeModel.fromJson(e)).toList(), // await Get.to(() => FacilityAppointmentPage());
builder: (items) { // childKey.currentState!.callRefresh();
return ListView.separated( // },
padding: EdgeInsets.all(32.w), // ),
itemBuilder: (context, index) { // ],
return FacilityTypeCard(model: items[index]); 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> { class _QuestionnaireDetailPageState extends State<QuestionnaireDetailPage> {
late QuestionnaireDetialModel _model; late QuestionnaireDetialModel _model;
bool _onload = true; bool _onload = true;
List<AppQuestionnaireAnswerSubmits> _submitModels = []; List<AppQuestionnaireAnswerSubmits> _submitModels = [];
Widget _emptyWidget() { Widget _emptyWidget() {
return Container(); return Container();
} }

@ -314,10 +314,10 @@ class _MarketPageState extends State<MarketPage>
key: _sliverAppBarGlobalKey, key: _sliverAppBarGlobalKey,
title: geSearch(), title: geSearch(),
backgroundColor: Color(0xFFF9F9F9), backgroundColor: Color(0xFFF9F9F9),
expandedHeight: MessageHeight + expandedHeight: MessageHeight+
bannerHeight + bannerHeight +
buttonsHeight + buttonsHeight +
// searchHeight + //searchHeight +
tabBarHeight + tabBarHeight +
hotGoodHeight + hotGoodHeight +
ScreenUtil().statusBarHeight + ScreenUtil().statusBarHeight +
@ -326,7 +326,7 @@ class _MarketPageState extends State<MarketPage>
172 * 2.w, 172 * 2.w,
flexibleSpace: _flexibleSpaceBar(context), flexibleSpace: _flexibleSpaceBar(context),
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: Size.fromHeight(tabBarHeight), preferredSize: Size.fromHeight(tabBarHeight+50.h),
child: _goodsTitle( child: _goodsTitle(
normalTypeButton, normalTypeButton,
salesTypeButton, salesTypeButton,
@ -475,7 +475,7 @@ class _MarketPageState extends State<MarketPage>
height: ScreenUtil().statusBarHeight + kToolbarHeight, height: ScreenUtil().statusBarHeight + kToolbarHeight,
), ),
// geSearch(), // geSearch(),
20.hb, 50.hb,
// getNum(), // getNum(),
// 20.hb, // 20.hb,
HomeSwiper(), HomeSwiper(),
@ -597,36 +597,43 @@ class _MarketPageState extends State<MarketPage>
} }
geSearch() { geSearch() {
return Row( return Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Expanded( 16.hb,
child: GestureDetector( '本商城所有商品来源于京东'.text.color(Color(0xFFACACAC)).normal.size(30.sp).make(),
onTap: () async { 16.hb,
Get.to(() => SearchGoodsPage()); Row(
}, mainAxisSize: MainAxisSize.min,
child: Container( children: [
height: 72.w, Expanded(
margin: EdgeInsets.only(left: 32.w), child: GestureDetector(
decoration: BoxDecoration( onTap: () async {
borderRadius: BorderRadius.circular(36.w), Get.to(() => SearchGoodsPage());
color: Colors.white), },
child: Row( child: Container(
children: [ height: 72.w,
32.wb, margin: EdgeInsets.only(left: 32.w),
Assets.home.icSearch.image( decoration: BoxDecoration(
width: 48.w, borderRadius: BorderRadius.circular(36.w),
height: 48.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: '设施预约', title: '设施预约',
imgPath: Assets.home.icSsyy.path, imgPath: Assets.home.icSsyy.path,
onTap: () { onTap: () {
BotToast.showText(text: '此功能升级中,敬请期待');
return;
Get.to(() => FacilityAppointmentPage()); Get.to(() => FacilityAppointmentPage());
}), }),
AppElement( AppElement(

@ -1,3 +1,4 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HomeSliverAppBar extends StatefulWidget { class HomeSliverAppBar extends StatefulWidget {
@ -8,15 +9,15 @@ class HomeSliverAppBar extends StatefulWidget {
final PreferredSizeWidget? bottom; final PreferredSizeWidget? bottom;
final double? expandedHeight; final double? expandedHeight;
HomeSliverAppBar( HomeSliverAppBar({
{Key? key, Key? key,
this.actions, this.actions,
this.title, this.title,
this.backgroundColor, this.backgroundColor,
this.flexibleSpace, this.flexibleSpace,
this.bottom, this.bottom,
this.expandedHeight}) this.expandedHeight,
: super(key: key); }) : super(key: key);
@override @override
HomeSliverAppBarState createState() => HomeSliverAppBarState(); HomeSliverAppBarState createState() => HomeSliverAppBarState();
@ -49,8 +50,9 @@ class HomeSliverAppBarState extends State<HomeSliverAppBar> {
elevation: 0, elevation: 0,
backgroundColor: _displayColor, backgroundColor: _displayColor,
flexibleSpace: widget.flexibleSpace, flexibleSpace: widget.flexibleSpace,
collapsedHeight: kToolbarHeight + 10, collapsedHeight: kToolbarHeight + 40.h,
expandedHeight: widget.expandedHeight, expandedHeight: widget.expandedHeight,
toolbarHeight: kToolbarHeight+40.h,
bottom: widget.bottom, 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'; import 'package:aku_new_community/widget/picker/bee_custom_picker.dart';
class BeeDatePicker { class BeeDatePicker {
static Future<DateTime?> pick(DateTime initDate, { static Future<DateTime?> pick(DateTime initDate, {
CupertinoDatePickerMode mode = CupertinoDatePickerMode.date, CupertinoDatePickerMode mode = CupertinoDatePickerMode.date,
@ -35,6 +36,7 @@ class BeeDatePicker {
BeeMonthPickBody(initTime: initDate) BeeMonthPickBody(initTime: initDate)
); );
} }
} }
class _BeeDatePicker extends StatefulWidget { 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/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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'; import 'bee_picker_box.dart';
class BeeMonthPickBody extends StatefulWidget { class BeeMonthPickBody extends StatefulWidget {
@ -34,7 +37,8 @@ class _BeeMonthPickBodyState extends State<BeeMonthPickBody> {
(index) => index + 1); (index) => index + 1);
@override @override
void initState() { void initState() async{
setState(() {});
_pickYear = widget.initTime.year; _pickYear = widget.initTime.year;
_pickMonth = 1; _pickMonth = 1;
super.initState(); super.initState();

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

Loading…
Cancel
Save