Добавлен полноценный сценарий записи
- выбор услуги через inline-кнопки - выбор даты через календарь - выбор времени через кнопки - подтверждение записи - отмена записи - редактирование записи - сохранение времени записи - исправлена работа FSM - исправлены callback-обработчики - улучшен интерфейс бота
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
def get_dates_keyboard():
|
||||
buttons = []
|
||||
|
||||
today = datetime.now()
|
||||
|
||||
for i in range(7):
|
||||
day = today + timedelta(days=i)
|
||||
|
||||
buttons.append(
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=day.strftime("%d.%m"),
|
||||
callback_data=f"date_{day.strftime('%d.%m')}"
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=buttons
|
||||
)
|
||||
@@ -0,0 +1,28 @@
|
||||
from aiogram.types import InlineKeyboardMarkup
|
||||
from aiogram.types import InlineKeyboardButton
|
||||
|
||||
|
||||
def get_confirm_booking_keyboard():
|
||||
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="✅ Подтвердить",
|
||||
callback_data="confirm_booking"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="✏️ Изменить",
|
||||
callback_data="edit_booking"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Отменить",
|
||||
callback_data="cancel_booking"
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,28 @@
|
||||
from aiogram.types import InlineKeyboardMarkup
|
||||
from aiogram.types import InlineKeyboardButton
|
||||
|
||||
|
||||
def get_services_keyboard():
|
||||
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="💆 Массаж",
|
||||
callback_data="service_massage"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="🌿 SPA",
|
||||
callback_data="service_spa"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="✨ Косметология",
|
||||
callback_data="service_cosmetology"
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,30 @@
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
|
||||
|
||||
def get_time_keyboard():
|
||||
|
||||
times = [
|
||||
"10:00",
|
||||
"11:00",
|
||||
"12:00",
|
||||
"13:00",
|
||||
"14:00",
|
||||
"15:00",
|
||||
"16:00"
|
||||
]
|
||||
|
||||
buttons = []
|
||||
|
||||
for t in times:
|
||||
buttons.append(
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=t,
|
||||
callback_data=f"time_{t}"
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=buttons
|
||||
)
|
||||
Reference in New Issue
Block a user