pull/1/head
张萌 3 years ago
commit 26562854e2

@ -22,7 +22,7 @@ class _MyHouse {
class _MyFamily { class _MyFamily {
/// ///
String get myFamilyMember => '/app/user/myFamily/findCurrentMembers'; String get myFamilyMember => '/app/user/myFamily/findCurrentMembers';
/// ///
String get myFamilyExamine => '/app/user/myFamily/findCurrentUserApply'; String get myFamilyExamine => '/app/user/myFamily/findCurrentUserApply';

@ -323,6 +323,9 @@ class _Pay {
/// ///
String get livingExpensesOrderCheckAlipay => String get livingExpensesOrderCheckAlipay =>
'/app/user/alipay/livingExpensesOrderCheckAlipay'; '/app/user/alipay/livingExpensesOrderCheckAlipay';
String get settlement =>
'/app/user/shop/cart/settlement';
} }
class _LifePay { class _LifePay {

@ -52,7 +52,7 @@ class _MyAppState extends State<MyApp> {
} }
}, },
child: MediaQuery( child: MediaQuery(
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window), data: MediaQueryData.fromWindow(WidgetsBinding.instance!.window),
child: ScreenUtilInit( child: ScreenUtilInit(
designSize: Size(750, 1334), designSize: Size(750, 1334),
// minTextAdapt: true, // minTextAdapt: true,

@ -40,11 +40,11 @@ class FacilityAppointmentModel {
Color get statusColor { Color get statusColor {
switch (status) { switch (status) {
case 1: case 1:
return kPrimaryColor; return kBalckSubColor;
case 2: case 2:
return Color(0xFF2576E5); return kDarkPrimaryColor;
case 3: case 3:
return Color(0xFFFB4702); return kDangerColor;
case 4: case 4:
return Color(0xFF999999); return Color(0xFF999999);
case 5: case 5:
@ -57,15 +57,15 @@ class FacilityAppointmentModel {
String get statusValue { String get statusValue {
switch (status) { switch (status) {
case 1: case 1:
return '预约成功'; return '待签到';
case 2: case 2:
return '签到成功'; return '使用中';
case 3: case 3:
return '预约作废'; return '超时作废';
case 4: case 4:
return '取消'; return '取消预约';
case 5: case 5:
return '结束'; return '使用结束';
default: default:
return '未知状态'; return '未知状态';
} }

@ -0,0 +1,20 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
part 'test.g.dart';
@JsonSerializable()
class Test extends Equatable {
final int id;
factory Test.fromJson(Map<String, dynamic> json) => _$TestFromJson(json);
@override
List<Object?> get props => [
id,
];
const Test({
required this.id,
});
}

@ -0,0 +1,11 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'test.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Test _$TestFromJson(Map<String, dynamic> json) => Test(
id: json['id'] as int,
);

@ -123,7 +123,8 @@ class UserProvider extends ChangeNotifier {
'' + '' +
_defaultHouse!.unitName + _defaultHouse!.unitName +
'单元' + '单元' +
_defaultHouse!.estateName; _defaultHouse!.estateName +
'';
} }
} }

@ -31,7 +31,7 @@ class Member {
final int id; final int id;
final String name; final String name;
final int identity; final int identity;
final List<ImgModel> avatarImgList; final List<ImgModel> imgList;
factory Member.fromJson(Map<String, dynamic> json) => _$MemberFromJson(json); factory Member.fromJson(Map<String, dynamic> json) => _$MemberFromJson(json);
@ -39,6 +39,6 @@ class Member {
required this.id, required this.id,
required this.name, required this.name,
required this.identity, required this.identity,
required this.avatarImgList, required this.imgList,
}); });
} }

@ -23,7 +23,7 @@ Member _$MemberFromJson(Map<String, dynamic> json) => Member(
id: json['id'] as int, id: json['id'] as int,
name: json['name'] as String, name: json['name'] as String,
identity: json['identity'] as int, identity: json['identity'] as int,
avatarImgList: (json['avatarImgList'] as List<dynamic>) imgList: (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(),
); );

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/community/facility/pick_facility_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,11 +37,16 @@ class FacilityAppointmentCard extends StatelessWidget {
Text( Text(
name, name,
style: TextStyle( style: TextStyle(
color: ktextSubColor, color: ktextThirdColor,
), ),
), ),
Spacer(), Spacer(),
Text(subTitle), Text(
subTitle,
style: TextStyle(
color: ktextSubColor,
),
),
], ],
); );
} }
@ -57,13 +63,17 @@ class FacilityAppointmentCard extends StatelessWidget {
bool inTime = diffTime >= 0 && diffTime <= 30; bool inTime = diffTime >= 0 && diffTime <= 30;
if (inTime) if (inTime)
button = _FacilityButton( button = _FacilityButton(
bold: true,
onPressed: () async { onPressed: () async {
var result = await BeeQR.scan(); var result = await BeeQR.scan();
if (result != null) { if (result != null) {
final cancel = BotToast.showLoading(); final cancel = BotToast.showLoading();
await NetUtil().get( await NetUtil().get(
SAASAPI.facilities.signIn, SAASAPI.facilities.signIn,
params: {'appointmentCode': result}, params: {
'facilitiesReserveId': model.id,
'appointmentCode': result
},
showMessage: true, showMessage: true,
); );
cancel(); cancel();
@ -74,6 +84,9 @@ class FacilityAppointmentCard extends StatelessWidget {
); );
else else
button = _FacilityButton( button = _FacilityButton(
outline: true,
border: true,
bold: true,
onPressed: () async { onPressed: () async {
bool? result = await Get.dialog( bool? result = await Get.dialog(
CupertinoAlertDialog( CupertinoAlertDialog(
@ -95,7 +108,7 @@ class FacilityAppointmentCard extends StatelessWidget {
final cancel = BotToast.showLoading(); final cancel = BotToast.showLoading();
await NetUtil().get( await NetUtil().get(
SAASAPI.facilities.cancel, SAASAPI.facilities.cancel,
params: {'facilitiesAppointmentId': model.id}, params: {'facilitiesReserveId': model.id},
showMessage: true, showMessage: true,
); );
cancel(); cancel();
@ -107,11 +120,12 @@ class FacilityAppointmentCard extends StatelessWidget {
break; break;
case 2: case 2:
button = _FacilityButton( button = _FacilityButton(
bold: true,
onPressed: () async { onPressed: () async {
final cancel = BotToast.showLoading(); final cancel = BotToast.showLoading();
await NetUtil().get( await NetUtil().get(
SAASAPI.facilities.useStop, SAASAPI.facilities.useStop,
params: {'facilitiesAppointmentId': model.id}, params: {'facilitiesReserveId': model.id},
showMessage: true, showMessage: true,
); );
cancel(); cancel();
@ -120,24 +134,67 @@ class FacilityAppointmentCard extends StatelessWidget {
text: '使用结束', text: '使用结束',
); );
break; break;
default: default:
button = SizedBox(); button = _FacilityButton(
outline: true,
border: true,
bold: true,
textColor: ktextSubColor,
onPressed: () async {
await Get.to(() => PickFacilityPage());
},
text: '重新预约',
);
} }
return Row( return model.status == 3
children: [ ? Column(
if (showTip) children: [
Text( Container(
'请在预约时间前30分钟内到场扫码', decoration: BoxDecoration(
style: TextStyle( borderRadius: BorderRadius.circular(5.w),
color: ktextSubColor, color: Color(0xFFF9F9F9),
fontSize: 24.sp, ),
), width: double.infinity,
), padding: EdgeInsets.all(10.w),
Spacer(), child: Text(
button, '作废原因:${model.nullifyReason??''}',
], style: TextStyle(
); color: Colors.black.withOpacity(0.8),
fontSize: 24.sp,
),
),
),
20.hb,
Row(
children: [
if (showTip)
Text(
'请在预约时间前30分钟内到场扫码',
style: TextStyle(
color: ktextSubColor,
fontSize: 24.sp,
),
),
Spacer(),
button,
],
),
],
)
: Row(
children: [
if (showTip)
Text(
'请在预约时间前30分钟内到场扫码',
style: TextStyle(
color: ktextThirdColor,
fontSize: 24.sp,
),
),
Spacer(),
button,
],
);
} }
@override @override
@ -202,6 +259,8 @@ class _FacilityButton extends StatelessWidget {
final VoidCallback onPressed; final VoidCallback onPressed;
final String text; final String text;
final bool outline; final bool outline;
final bool border;
final bool bold;
const _FacilityButton({ const _FacilityButton({
Key? key, Key? key,
@ -210,13 +269,21 @@ class _FacilityButton extends StatelessWidget {
required this.text, required this.text,
this.outline = false, this.outline = false,
this.textColor = ktextPrimary, this.textColor = ktextPrimary,
this.border = false,
this.bold = false,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialButton( return MaterialButton(
color: outline ? null : color, color: outline ? null : color,
shape: StadiumBorder(), shape: border
? StadiumBorder(
side: BorderSide(
width: 1,
color: Colors.grey,
))
: StadiumBorder(),
elevation: 0, elevation: 0,
height: 60.w, height: 60.w,
minWidth: 168.w, minWidth: 168.w,
@ -225,6 +292,7 @@ class _FacilityButton extends StatelessWidget {
child: Text( child: Text(
text, text,
style: TextStyle( style: TextStyle(
fontWeight: bold?FontWeight.bold:FontWeight.normal,
color: textColor, color: textColor,
fontSize: 26.sp, fontSize: 26.sp,
), ),

@ -14,6 +14,15 @@ import '../../../utils/network/base_model.dart';
import '../../../utils/network/net_util.dart'; import '../../../utils/network/net_util.dart';
import '../../../widget/buttons/bee_check_radio.dart'; import '../../../widget/buttons/bee_check_radio.dart';
class FacilityPreorderDate {
static Future<List<int>> choose(
FacilityTypeDetailModel typeModel,
) async {
return await Get.bottomSheet(
FacilityPreorderDatePicker(typeModel: typeModel));
}
}
class FacilityPreorderDatePicker extends StatefulWidget { class FacilityPreorderDatePicker extends StatefulWidget {
FacilityTypeDetailModel typeModel; FacilityTypeDetailModel typeModel;
@ -32,16 +41,43 @@ class _FacilityPreorderDatePickerState
getNum(widget.typeModel.openStartDT!), getNum(widget.typeModel.openStartDT!),
(index) => index + 1); (index) => index + 1);
DateTime? start; DateTime? start;
List<int> models = []; List models = [];
List<int> _selectIndex = []; List<int> _selectIndex = [];
List<int> _selectDates = [];
_load() async {
BaseModel model =
await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: {
'facilitiesManageId': widget.typeModel.id,
'todayDate': DateTime.now(),
});
if (model.success) {
models = (model.data as List);
print(models);
}
setState(() {
});
}
@override
void initState() {
Future.delayed(
Duration.zero,
() => setState(() {
_load();
}));
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeChooseDatePicker( return BeeChooseDatePicker(
height: 700.h, height: 700.h,
onPressed: () { onPressed: () {
Get.back(); Get.back(result: _selectDates);
//print(_selectDates);
}, },
body: Container( body: Container(
height: 600.h, height: 600.h,
@ -69,24 +105,18 @@ class _FacilityPreorderDatePickerState
Widget _datesList(int index) { Widget _datesList(int index) {
DateTime start = widget.typeModel.openStartDT!; DateTime start = widget.typeModel.openStartDT!;
() async {
BaseModel model =
await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: {
'facilitiesManageId': widget.typeModel.id,
'todayDate': DateTime.now(),
});
if (model.success) {
models = (model.data as List<int>).toList();
}
};
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
print(getNum(start)+index); //print(getNum(start)+index);
if(!models.contains(getNum(start)+index)||start.add(Duration(minutes: 30 * index)).isAfter(DateTime.now())){ if (!models.contains(getNum(start) + index) ||
isPass(start.add(Duration(minutes: 30 * index)))) {
if (_selectIndex.contains(index)) { if (_selectIndex.contains(index)) {
_selectIndex.remove(index); _selectIndex.remove(index);
_selectDates.remove(getNum(start) + index);
} else { } else {
_selectIndex.add(index); _selectIndex.add(index);
_selectDates.add(getNum(start) + index);
} }
} }
setState(() {}); setState(() {});
@ -97,7 +127,8 @@ class _FacilityPreorderDatePickerState
BeeCheckRadio( BeeCheckRadio(
value: index, value: index,
groupValue: _selectIndex, groupValue: _selectIndex,
canCheck: models.contains(getNum(start)+index), canCheck: models.contains(getNum(start) + index) ||
isPass(start.add(Duration(minutes: 30 * index))),
), ),
30.wb, 30.wb,
Text( Text(
@ -114,8 +145,8 @@ class _FacilityPreorderDatePickerState
.size(30.sp) .size(30.sp)
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
.make() .make()
: models.contains(getNum(start)+index) : models.contains(getNum(start) + index)
? '已被他人预约' ? '已被预约'
.text .text
.size(30.sp) .size(30.sp)
.color(Colors.black.withOpacity(0.45)) .color(Colors.black.withOpacity(0.45))
@ -127,14 +158,14 @@ class _FacilityPreorderDatePickerState
} }
} }
bool isPass(DateTime date){ bool isPass(DateTime date) {
if(date.hour<DateTime.now().hour||(date.minute<DateTime.now().minute&&date.hour==DateTime.now().hour)){ if (date.hour < DateTime.now().hour ||
(date.minute < DateTime.now().minute &&
date.hour == DateTime.now().hour)) {
return true; return true;
} } else {
else{
return false; return false;
} }
} }
int getNum(DateTime dateTime) { int getNum(DateTime dateTime) {

@ -1,9 +1,11 @@
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
@ -22,6 +24,9 @@ import 'package:aku_new_community/widget/buttons/bottom_button.dart';
import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart';
import '../../../constants/saas_api.dart'; import '../../../constants/saas_api.dart';
import '../../../models/facility/facility_type_model.dart'; import '../../../models/facility/facility_type_model.dart';
import '../../../widget/bee_avatar_widget.dart';
import '../../../widget/bee_image_network.dart';
import '../../../widget/others/user_tool.dart';
import '../../../widget/picker/bee_choose_date_picker.dart'; import '../../../widget/picker/bee_choose_date_picker.dart';
import '../../../widget/picker/bee_day_picker.dart'; import '../../../widget/picker/bee_day_picker.dart';
import '../../manager/advice/advice_house_page.dart'; import '../../manager/advice/advice_house_page.dart';
@ -30,184 +35,192 @@ class FacilityPreorderPage extends StatefulWidget {
final FacilityTypeModel facilityModel; final FacilityTypeModel facilityModel;
final FacilityTypeDetailModel typeModel; final FacilityTypeDetailModel typeModel;
FacilityPreorderPage({Key? key, required this.facilityModel,required this.typeModel}) : 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> {
DateTime? startDate; List<int> dateList = [];
DateTime? endDate; DateTime? date;
bool get canTap => startDate != null && endDate != null; bool get canTap => dateList.isNotEmpty;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
return BeeScaffold( return BeeScaffold(
title: '添加预订', title: '添加预约',
bodyColor: Colors.white,
systemStyle: SystemStyle.yellowBottomBar, systemStyle: SystemStyle.yellowBottomBar,
body: ListView( body: ListView(
padding: EdgeInsets.symmetric(vertical: 32.w), padding: EdgeInsets.symmetric(vertical: 20.w),
children: [ children: [
Text('业主房屋').pSymmetric(h: 32.w), Container(
ListTile( padding: EdgeInsets.all(10.w),
leading: Image.asset( color: Colors.white,
R.ASSETS_ICONS_HOUSE_PNG, child: ListTile(
height: 60.w, leading: BeeAvatarWidget(
width: 60.w, width: 90.w,
height: 90.w,
imgs: UserTool.userProvider.userInfoModel!.imgList,
),
onTap: () => Get.to(() => AdviceHousePage()),
title: Text(
UserTool.userProvider.userInfoModel!.name!,
style: TextStyle(
fontSize: 30.sp,
),
),
subtitle: Text(
'租户 ' +
userProvider.defaultHouse!.communityName +
userProvider.defaultHouseString,
style: TextStyle(
color: Colors.black.withOpacity(0.45),
fontSize: 26.sp,
),
),
trailing: Icon(
CupertinoIcons.chevron_forward,
size: 35.w,
color: Colors.black.withOpacity(0.25),
),
), ),
onTap: () => Get.to(() => AdviceHousePage()),
title: Text(S.of(context)!.tempPlotName),
subtitle: Text(userProvider.defaultHouse!.addressName),
trailing: Icon(CupertinoIcons.chevron_forward),
), ),
BeeDivider( 20.hb,
indent: 32.w, Container(
endIndent: 32.w, padding: EdgeInsets.all(40.w),
), color: Colors.white,
32.hb, child: Column(
Text('选择设施').pSymmetric(h: 32.w),
ListTile(
leading: Image.asset(
R.ASSETS_ICONS_FACILITY_PNG,
height: 60.w,
width: 60.w,
),
onTap: () async {await Get.to(() =>
FacilityTypeDetailPage(facilityModel: widget.facilityModel));
setState(() {});
},
title: Text(S.of(context)!.tempPlotName),
subtitle: Text(widget.typeModel.name),
trailing: Icon(CupertinoIcons.chevron_forward),
),
BeeDivider(
indent: 32.w,
endIndent: 32.w,
),
32.hb,
Text('预约时间').pSymmetric(h: 32.w),
SizedBox(
height: 120.w,
child: Row(
children: [ children: [
MaterialButton( GestureDetector(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onTap: () async {
height: 120.w, await Get.to(() => FacilityTypeDetailPage(
onPressed: () async { facilityModel: widget.facilityModel));
DateTime? date = await BeeDayPicker.pick(DateTime.now()); setState(() {});
await Get.bottomSheet(FacilityPreorderDatePicker(typeModel: widget.typeModel,));
if (date != null) {
startDate = date;
setState(() {});
}
}, },
child: Text( child: Material(
startDate == null color: Colors.transparent,
? '请选择开始时间' child: Row(
: DateUtil.formatDate( children: [
startDate, SizedBox(
format: 'yyyy/MM/dd', width: 170.w,
), child: '选择设施'
style: TextStyle( .text
color: ktextSubColor, .size(28.sp)
.color(Colors.black.withOpacity(0.50))
.make(),
),
'${widget.typeModel.name}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 35.w,
color: Colors.black.withOpacity(0.25),
),
],
), ),
), ),
).expand(), ),
Icon(Icons.arrow_forward), 30.hb,
MaterialButton( BeeDivider(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, 30.hb,
height: 120.w, GestureDetector(
onPressed: () async { onTap: () async {
DateTime? date = await BeeDatePicker.pick( date = await BeeDayPicker.pick(DateTime.now());
startDate == null
? DateTime.now().add(Duration(minutes: 90))
: startDate!.add(Duration(minutes: 30)),
min: startDate == null
? DateTime.now().add(Duration(minutes: 60))
: startDate!.add(Duration(minutes: 30)),
max: startDate == null
? DateTime.now().add(Duration(days: 2))
: (startDate!).add(Duration(days: 2)),
mode: CupertinoDatePickerMode.dateAndTime,
);
if (date != null) { if (date != null) {
endDate = date; dateList =
await FacilityPreorderDate.choose(widget.typeModel);
dateList.sort();
setState(() {}); setState(() {});
} }
}, },
child: Text( child: Material(
endDate == null color: Colors.transparent,
? '请选择结束时间' child: Row(
: DateUtil.formatDate( children: [
endDate, SizedBox(
format: 'yyyy-MM-dd HH:mm', width: 170.w,
), child: '预约时间'
style: TextStyle( .text
color: ktextSubColor, .size(28.sp)
.color(Colors.black.withOpacity(0.50))
.make(),
),
date != null
? '${DateUtil.formatDate(date, format: 'yyyy/MM/dd')} ${dateString(dateList)}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make()
: '请选择预约时段'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 35.w,
color: Colors.black.withOpacity(0.25),
),
],
), ),
), ),
).expand(), ),
], ],
), ),
), ),
BeeDivider(
indent: 32.w,
endIndent: 32.w,
),
], ],
), ),
bottomNavi: BottomButton( bottomNavi: Padding(
onPressed: canTap padding: EdgeInsets.only(
? () async { left: 32.w,
// if (dateDifferenceIsTrue) { right: 32.w,
final cancel = BotToast.showLoading(); bottom: MediaQuery.of(context).padding.bottom + 32.w),
var model = await NetUtil().post( child: BeeLongButton(
SAASAPI.facilities.insert, onPressed: canTap
params: { ? () async {
'estateId': userProvider.defaultHouse!.id, // if (dateDifferenceIsTrue) {
'type':widget.facilityModel.type, final cancel = BotToast.showLoading();
'facilitiesCategoryId':widget.facilityModel.id, var model = await NetUtil().post(
'facilitiesManageId':widget.typeModel.id, SAASAPI.facilities.insert,
'appointmentDate':1, params: {
'appointmentPeriodList':1, 'estateId': userProvider.defaultHouse!.id,
}, 'type': widget.facilityModel.type,
); 'facilitiesCategoryId': widget.facilityModel.id,
cancel(); 'facilitiesManageId': widget.typeModel.id,
if (model.success == true) { 'appointmentDate': DateUtil.formatDate(date,format: 'yyyy-MM-dd HH:mm:ss'),
BotToast.showText(text: '预约成功'); 'appointmentPeriodList': dateList,
Get.back(result: true); },
} else if (model.msg == '该时段已被预约') { );
await Get.dialog(_hasBeenOrder()); cancel();
} else { if (model.success == true) {
BotToast.showText(text: '预约失败'); BotToast.showText(text: '预约成功');
Get.back(result: true);
} else if (model.msg == '该时段已被预约') {
await Get.dialog(_hasBeenOrder());
} else {
BotToast.showText(text: '预约失败');
}
// } else {
// BotToast.showText(text: '预约时间必须为半小时的整数倍');
// }
} }
// } else { : null,
// BotToast.showText(text: '预约时间必须为半小时的整数倍'); text: '确认提交',
// } ),
}
: null,
child: Text('确认提交'),
), ),
); );
} }
bool get dateDifferenceIsTrue {
if (startDate != null && endDate != null) {
int _diff = endDate!.difference(startDate!).inMinutes;
if (_diff < 30) {
return false;
} else if (_diff % 30 != 0) {
return false;
}
return true;
}
return false;
}
Widget _hasBeenOrder() { Widget _hasBeenOrder() {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: '此设施已被预约' title: '此设施已被预约'
@ -232,8 +245,8 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
'取消'.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()), '取消'.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction( CupertinoActionSheetAction(
onPressed: () { onPressed: () {
Get.off( Get.off(() =>
() => FacilityOrderDateListPage(facilitiesId: widget.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()),
@ -241,3 +254,17 @@ class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
); );
} }
} }
DateTime getDate(int dateNum) {
DateTime startDate = DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day, 0, 0, 0);
return startDate.add(Duration(minutes: 30 * (dateNum - 1)));
}
String dateString(List<int> dates){
if(dates.length==1)
return '${DateUtil.formatDate(getDate(dates.first), format: 'HH:mm')}-${DateUtil.formatDate(getDate(dates.first).add(Duration(minutes: 30)), format: 'HH:mm')}';
else{
return '${DateUtil.formatDate(getDate(dates.first), format: 'HH:mm')}-${DateUtil.formatDate(getDate(dates.first).add(Duration(minutes: 30)), format: 'HH:mm')}';
}
}

@ -1,3 +1,4 @@
import 'package:aku_new_community/widget/bee_image_network.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -19,7 +20,7 @@ class FacilityTypeCard extends StatelessWidget {
return MaterialButton( return MaterialButton(
color: Colors.white, color: Colors.white,
elevation: 0, elevation: 0,
padding: EdgeInsets.all(30.w), padding: EdgeInsets.all(25.w),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.w), borderRadius: BorderRadius.circular(10.w),
@ -29,13 +30,18 @@ class FacilityTypeCard extends StatelessWidget {
Material( Material(
borderRadius: BorderRadius.circular(10.w), borderRadius: BorderRadius.circular(10.w),
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
child: FadeInImage.assetNetwork( child: BeeImageNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, imgs: model.imgUrls??[],
image: SAASAPI.image(ImgModel.first(model.imgUrls)),
height: 280.w, height: 280.w,
width: double.infinity, width: double.infinity,
fit: BoxFit.cover,
), ),
// 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, 24.hb,
Row( Row(

@ -9,6 +9,7 @@ import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import '../../../models/facility/facility_type_detail_model.dart'; import '../../../models/facility/facility_type_detail_model.dart';
import '../../../models/facility/facility_type_model.dart'; import '../../../models/facility/facility_type_model.dart';
import '../../../widget/bee_image_network.dart';
import 'facility_preorder_page.dart'; import 'facility_preorder_page.dart';
class FacilityTypeDetailCard extends StatelessWidget { class FacilityTypeDetailCard extends StatelessWidget {
@ -36,13 +37,19 @@ class FacilityTypeDetailCard extends StatelessWidget {
Material( Material(
borderRadius: BorderRadius.circular(10.w), borderRadius: BorderRadius.circular(10.w),
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
child:FadeInImage.assetNetwork( child:BeeImageNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, imgs: model.imgList??[],
image: SAASAPI.image(ImgModel.first(model.imgList)),
height: 150.h, height: 150.h,
width: 200.w, width: 200.w,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
// FadeInImage.assetNetwork(
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
// image: SAASAPI.image(ImgModel.first(model.imgList)),
// height: 150.h,
// width: 200.w,
// fit: BoxFit.cover,
// ),
), ),
30.wb, 30.wb,
Column( Column(

@ -106,7 +106,7 @@ class _LineCardState extends State<LineCard> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
_height = context.size?.height ?? 0; _height = context.size?.height ?? 0;
print(context.size?.height); print(context.size?.height);
setState(() {}); setState(() {});

@ -190,57 +190,51 @@ class _SubmitOrderPageState extends State<SubmitOrderPage> {
), ),
_addressModel != null _addressModel != null
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.symmetric(
children: [ horizontal: 20.w, vertical: 6.w),
Padding( child: SizedBox(
padding: EdgeInsets.symmetric( width: 518.w,
horizontal: 20.w, vertical: 6.w), child: Text(
child: SizedBox( _addressModel!.locationName ?? '',
width: 518.w, style: TextStyle(
child: Text( fontSize: 24.sp, color: ktextPrimary),
_addressModel!.locationName ?? '', maxLines: 1,
style: TextStyle( overflow: TextOverflow.ellipsis,
fontSize: 24.sp, color: ktextPrimary),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.w, vertical: 6.w),
child: SizedBox(
width: 518.w,
child: Text(
(_addressModel!.addressDetail ?? ''),
style: TextStyle(
fontSize: 32.sp, color: ktextPrimary),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
), ),
Padding( ),
padding: EdgeInsets.symmetric( ),
horizontal: 20.w, vertical: 6.w), Padding(
child: Row( padding: EdgeInsets.symmetric(
crossAxisAlignment: CrossAxisAlignment.end, horizontal: 20.w, vertical: 6.w),
children: <Widget>[ child: SizedBox(
Text(_addressModel!.name ?? '', width: 518.w,
style: TextStyle( child: Text(
fontSize: 24.sp, (_addressModel!.addressDetail ?? ''),
color: ktextPrimary)), style: TextStyle(
30.wb, fontSize: 32.sp, color: ktextPrimary),
Text(_addressModel!.tel ?? '', maxLines: 1,
style: TextStyle( overflow: TextOverflow.ellipsis,
fontSize: 24.sp,
color: ktextPrimary)),
],
),
), ),
], ),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.w, vertical: 6.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(_addressModel!.name ?? '',
style: TextStyle(
fontSize: 24.sp, color: ktextPrimary)),
30.wb,
Text(_addressModel!.tel ?? '',
style: TextStyle(
fontSize: 24.sp, color: ktextPrimary)),
],
),
), ),
], ],
) )

@ -513,7 +513,6 @@ class _ShopCarPageState extends State<ShopCarPage> {
_controllers[index].text = (num - 1).toString(); _controllers[index].text = (num - 1).toString();
} }
} }
setState(() {}); setState(() {});
}, },
child: Padding( child: Padding(

@ -82,7 +82,7 @@ class _MemberViewState extends State<MemberView> {
crossAxisCount: 4, crossAxisCount: 4,
children: [ children: [
...model.members ...model.members
.map((e) => _avatar(e.avatarImgList,Identify.values[e.identity], e.name)) .map((e) => _avatar(e.imgList,Identify.values[e.identity], e.name))
.toList() .toList()
], ],
shrinkWrap: true, shrinkWrap: true,

@ -55,7 +55,7 @@ class __BeeDayPickerState extends State<_BeeDayPicker> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeChooseDatePicker( return BeeChooseDatePicker(
onPressed: () async{ onPressed: () async{
Get.back(); Get.back(result: _date);
// await FacilityPreorderDatePicker(); // await FacilityPreorderDatePicker();
}, },
body: CupertinoDatePicker( body: CupertinoDatePicker(

Loading…
Cancel
Save