forked from eatvio/eatvio_app
Merge pull request 'fix(consultation): some fixes' (#474) from mso7nueh/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#474
This commit is contained in:
@@ -94,13 +94,10 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (chatRoom.chosenPlan?.consultantId == chatRoom.users.receiver.id) {
|
if (chosenPlan?.consultantId == chatRoom.users.sender.id) {
|
||||||
await checkCards();
|
await checkCards();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendInitialMessage) {
|
|
||||||
await chatRepository.sendMessage(chatId: chatId, data: 'Здравствуйте, хочу заказать у вас: ${chosenPlan?.plan.name ?? 'план'}');
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e.toString());
|
log(e.toString());
|
||||||
typingSubscription?.cancel();
|
typingSubscription?.cancel();
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
} else if (!amIConsultant &&
|
} else if (!amIConsultant &&
|
||||||
(chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateStartDateHasBeenSet || chosenPlan.chosenPlanState == ChosenPlanStateEnum.statePendingPayment)) {
|
(chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateStartDateHasBeenSet || chosenPlan.chosenPlanState == ChosenPlanStateEnum.statePendingPayment)) {
|
||||||
bannerType = BannerType.payment;
|
bannerType = BannerType.payment;
|
||||||
} else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateDone) {
|
} else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateDone && amIConsultant) {
|
||||||
bannerType = BannerType.collectCharge;
|
bannerType = BannerType.collectCharge;
|
||||||
} else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateLastDayFinished && !amIConsultant) {
|
} else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateLastDayFinished && !amIConsultant) {
|
||||||
bannerType = BannerType.finishPlan;
|
bannerType = BannerType.finishPlan;
|
||||||
@@ -303,17 +303,17 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (bannerType != null)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
|
||||||
child: NotificationBanner(
|
|
||||||
bannerType: bannerType,
|
|
||||||
chosenPlanId: chosenPlan?.id,
|
|
||||||
planName: chosenPlan?.plan.name,
|
|
||||||
planPrice: chosenOption?.price.toDouble(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
|
if (bannerType != null)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||||
|
child: NotificationBanner(
|
||||||
|
bannerType: bannerType,
|
||||||
|
chosenPlanId: chosenPlan?.id,
|
||||||
|
planName: chosenPlan?.plan.name,
|
||||||
|
planPrice: chosenOption?.price.toDouble(),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -9,5 +9,9 @@ abstract class ConsultationService {
|
|||||||
factory ConsultationService(Dio dio, {String baseUrl}) = _ConsultationService;
|
factory ConsultationService(Dio dio, {String baseUrl}) = _ConsultationService;
|
||||||
|
|
||||||
@GET('/api/consultations')
|
@GET('/api/consultations')
|
||||||
Future<ConsultationPaginationModel> getConsultations();
|
Future<ConsultationPaginationModel> getConsultations({
|
||||||
|
@Query('filters[last_state][\$notIn][]') String query = 'canceled_by_the_initiator',
|
||||||
|
@Query('filters[last_state][\$notIn][]') String query2 = 'charge_was_collected',
|
||||||
|
@Query('sort[]') String sort = 'created_at:desc',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,9 @@ class _CalendarWidgetState extends State<CalendarWidget> {
|
|||||||
return isSameDay(_selectedDay, day);
|
return isSameDay(_selectedDay, day);
|
||||||
},
|
},
|
||||||
onPageChanged: (focusedDay) {
|
onPageChanged: (focusedDay) {
|
||||||
_focusedDay = focusedDay;
|
setState(() {
|
||||||
|
_focusedDay = focusedDay;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onFormatChanged: (format) {
|
onFormatChanged: (format) {
|
||||||
if (_calendarFormat != format) {
|
if (_calendarFormat != format) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class NotificationWidget extends StatelessWidget {
|
|||||||
ChosenPlanTomorrowReminderToConsultantNotification() => _ChosenPlanTomorrowReminderToConsultantWidget(
|
ChosenPlanTomorrowReminderToConsultantNotification() => _ChosenPlanTomorrowReminderToConsultantWidget(
|
||||||
notification: notification as ChosenPlanTomorrowReminderToConsultantNotification,
|
notification: notification as ChosenPlanTomorrowReminderToConsultantNotification,
|
||||||
),
|
),
|
||||||
PlanSubscriptionPaidToAuthorNotification() => throw _PlanSubscriptionPaidToAuthorWidget(
|
PlanSubscriptionPaidToAuthorNotification() => _PlanSubscriptionPaidToAuthorWidget(
|
||||||
notification: notification as PlanSubscriptionPaidToAuthorNotification,
|
notification: notification as PlanSubscriptionPaidToAuthorNotification,
|
||||||
),
|
),
|
||||||
ChosenPlanFinishedToConsultantNotification() => _ChosenPlanFinishedToConsultantWidget(
|
ChosenPlanFinishedToConsultantNotification() => _ChosenPlanFinishedToConsultantWidget(
|
||||||
|
|||||||
Reference in New Issue
Block a user