Skip to content

Commit

Permalink
fix: 관리자 예약 내역 내 예약자 정보 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ryr0121 committed Dec 3, 2023
1 parent da8bbbc commit c4d8be2
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/Model/model/booking/car_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ class CarBookingHistoryData {
class CarBookingHistory {
int id;
int targetId;
String? reservatorName;
String? reservatorPhone;
String name;
String? location;
String startDateTime;
Expand All @@ -146,6 +148,8 @@ class CarBookingHistory {
CarBookingHistory({
required this.id,
required this.targetId,
this.reservatorName,
this.reservatorPhone,
required this.name,
this.location,
required this.startDateTime,
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/model/booking/car_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/Model/model/booking/office_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ class OfficeBookingHistoryData {
class OfficeBookingHistory {
int id;
int targetId;
String? reservatorName;
String? reservatorPhone;
String name;
String? detailInfo;
String startDateTime;
Expand All @@ -244,6 +246,8 @@ class OfficeBookingHistory {
OfficeBookingHistory({
required this.id,
required this.targetId,
this.reservatorName,
this.reservatorPhone,
required this.name,
this.detailInfo,
required this.startDateTime,
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/model/booking/office_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/Model/model/booking/resource_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ class ResourceBookingHistoryData {
class ResourceBookingHistory {
int id;
int targetId;
String? reservatorName;
String? reservatorPhone;
String name;
String? location;
String startDateTime;
Expand All @@ -247,6 +249,8 @@ class ResourceBookingHistory {
ResourceBookingHistory({
required this.id,
required this.targetId,
this.reservatorName,
this.reservatorPhone,
required this.name,
this.location,
required this.startDateTime,
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/model/booking/resource_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 24 additions & 5 deletions lib/View/booking/component/booking_item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class BookingItemCard extends StatefulWidget {
final bool isAdmin;
final BookingType type;
final int id;
final int tergetId;
final int targetId;
final String? reservatorName;
final String? reservatorPhone;
final String name;
final String? location;
final String startDateTime;
Expand All @@ -29,7 +31,9 @@ class BookingItemCard extends StatefulWidget {
required this.isAdmin,
required this.type,
required this.id,
required this.tergetId,
required this.targetId,
this.reservatorName,
this.reservatorPhone,
required this.name,
required this.location,
required this.startDateTime,
Expand Down Expand Up @@ -95,7 +99,22 @@ class _BookingItemCardState extends State<BookingItemCard> {
),
const Divider(thickness: 1.2,),

/// 예약일시, 이용목적, 예약상태
/// 예약자, 예약일시, 이용목적, 예약상태
widget.isAdmin
? Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text('예약자', style: titleStyle,),
),
Text('${widget.reservatorName} (${widget.reservatorPhone})', style: contentStyle, overflow: TextOverflow.ellipsis)
],
),
)
: const SizedBox(height: 0,),

Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
Expand Down Expand Up @@ -344,9 +363,9 @@ class _BookingItemCardState extends State<BookingItemCard> {
void didTapMoveToDetailButton() {
switch (widget.type) {
case BookingType.office:
Navigator.of(context).push(MaterialPageRoute(builder: (_) => OfficeDetailScreen(officeId: widget.tergetId,)));
Navigator.of(context).push(MaterialPageRoute(builder: (_) => OfficeDetailScreen(officeId: widget.targetId,)));
default:
Navigator.of(context).push(MaterialPageRoute(builder: (_) => GeneralDetailScreen(type: widget.type, id: widget.tergetId,)));
Navigator.of(context).push(MaterialPageRoute(builder: (_) => GeneralDetailScreen(type: widget.type, id: widget.targetId,)));
}
}
}
4 changes: 3 additions & 1 deletion lib/View/booking/screen/booking_history_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ class BookingHistoryScreenState extends State<BookingHistoryScreen> with SingleT
isAdmin: widget.isAdmin,
type: currentType,
id: data.data.content[index].id,
tergetId: data.data.content[index].targetId,
targetId: data.data.content[index].targetId,
reservatorName: widget.isAdmin ? data.data.content[index].reservatorName : null,
reservatorPhone: widget.isAdmin ? data.data.content[index].reservatorPhone : null,
name: data.data.content[index].name,
location: (currentType == BookingType.office)
? data.data.content[index].detailInfo
Expand Down

0 comments on commit c4d8be2

Please sign in to comment.