commit_0602

main
123456789zs 6 months ago
parent 146bf31494
commit 22030ddebb

@ -1 +1,4 @@
1001, 按摩
8号技师 - 8号技师
8号技师

@ -26,6 +26,41 @@ class FootSpaManagementSystem:
self.admin_login_button = tk.Button(self.main_frame, text="管理员登录", command=self.create_admin_login_view)
self.admin_login_button.pack()
#注册界面返回初始界面
def surer1(self):
self.frame_register.pack_forget()
self.main_frame.pack()
#选择订单界面返回用户界面
def surer2(self):
self.frame_order.pack_forget()
self.user_frame.pack()
#选择技师界面返回用户界面
def surer3(self):
self.frame_technician.pack_forget()
self.user_frame.pack()
#删除订单界面返回用户界面
def surer4(self):
self.delete_frame.pack_forget()
self.user_frame.pack()
#酒水订单界面返回用户界面
def surer5(self):
self.beverage_frame.pack_forget()
self.user_frame.pack()
#管理员登录界面返回初始界面
def surer6(self):
self.admin_login_window.pack_forget()
self.main_frame.pack()
#用户登录界面返回初始界面
def surer7(self):
self.frame_login.pack_forget()
self.main_frame.pack()
#管理员登录函数
def admin_login(self):
admin_username = "zg"
@ -53,6 +88,8 @@ class FootSpaManagementSystem:
self.password_entry.pack()
self.login_button = tk.Button(self.admin_login_window, text="登录", command=self.admin_login)
self.login_button.pack()
self.back_button = tk.Button(self.admin_login_window, text="返回主界面", command=self.surer6)
self.back_button.pack()
#查看用户函数
def show_user_info(self):
@ -130,43 +167,6 @@ class FootSpaManagementSystem:
else:
messagebox.showerror("登录失败", "没有用户数据。") # 显示找不到用户数据的消息
#注册界面返回初始界面
def surer1(self):
self.frame_register.pack_forget()
self.main_frame.pack()
if hasattr(self, "back_button"):
self.back_button.pack_forget() # 移除返回主界面的按钮
self.frame_register.pack_forget()
self.main_frame.pack()
#选择订单界面返回用户界面
def surer2(self):
self.frame_order.pack_forget()
self.user_frame.pack()
if hasattr(self, "back_button_order"):
self.back_button_order.pack_forget() # 移除返回主界面的按钮
self.frame_order.pack_forget()
self.user_frame.pack()
#选择技师界面返回用户界面
def surer3(self):
self.frame_technician.pack_forget()
self.user_frame.pack()
if hasattr(self, "back_button_order"):
self.back_button_order.pack_forget() # 移除返回主界面的按钮
self.frame_technician.pack_forget()
self.user_frame.pack()
#删除订单界面返回用户界面
def surer4(self):
self.delete_frame.pack_forget()
self.user_frame.pack()
#酒水订单界面返回用户界面
def surer5(self):
self.beverage_frame.pack_forget()
self.user_frame.pack()
#注册界面
def switch_to_register(self):
self.main_frame.pack_forget()
@ -182,7 +182,7 @@ class FootSpaManagementSystem:
self.password_entry.pack()
self.register_button = tk.Button(self.frame_register, text="注册", command=self.register_user)
self.register_button.pack()
self.back_button = tk.Button(self.root, text="返回主界面", command=self.surer1)
self.back_button = tk.Button(self.frame_register, text="返回主界面", command=self.surer1)
self.back_button.pack()
#用户登录界面
@ -200,6 +200,8 @@ class FootSpaManagementSystem:
self.password_entry_login.pack()
self.login_button = tk.Button(self.frame_login, text="登录", command=self.login_user)
self.login_button.pack()
self.back_button = tk.Button(self.frame_login, text="返回主界面", command=self.surer7)
self.back_button.pack()
#用户登录后的用户界面
def show_user_interface(self):
@ -213,6 +215,8 @@ class FootSpaManagementSystem:
self.user_frame.pack()
self.order_button = tk.Button(self.user_frame, text="选择订单", command=self.switch_to_order)
self.order_button.pack()
self.select_technician = tk.Button(self.user_frame, text="选择技师", command=self.show_select_technician_screen)
self.select_technician.pack()
self.view_order_button = tk.Button(self.user_frame, text="查看订单", command=self.view_order)
self.view_order_button.pack()
self.delete_order_button = tk.Button(self.user_frame, text="删除订单", command=self.delete_order)
@ -288,8 +292,6 @@ class FootSpaManagementSystem:
if selected_services:
order_number = self.generate_order_number() # 生成订单号
messagebox.showinfo("下单成功", f"您选择了:{', '.join(selected_services)}\n 订单号:{order_number}")
# 显示选择技师的界面
self.show_select_technician_screen()
with open(self.order_data_file, "a") as file:
file.write(f"{order_number}, {', '.join(selected_services)}{self.order_info}\n")
else:
@ -302,7 +304,7 @@ class FootSpaManagementSystem:
# 选择技师界面
def show_select_technician_screen(self):
self.frame_order.pack_forget() # 移除选择订单界面
self.user_frame.pack_forget() # 移除用户界面
# 创建选择技师的界面
self.frame_technician = tk.Frame(self.root)
self.frame_technician.pack()
@ -327,16 +329,16 @@ class FootSpaManagementSystem:
self.back_button_order = tk.Button(self.frame_technician, text="返回用户界面", command=self.surer3)
self.back_button_order.pack()
#选择技师函数
def confirm_technician(self):
selected_services = [service for service, selected in self.services.items() if selected.get() == 1]
selected_services = [service for service, selected in self.technicians.items() if selected.get() == 1]
if selected_services:
selected_technicians = [technician for technician, selected in self.technicians.items() if selected.get() == 1]
selected_services_str = ', '.join(selected_services)
selected_technicians_str = ', '.join(selected_technicians)
messagebox.showinfo("下单成功",
f"选择了:{selected_services_str}\n所选择的技师: {selected_technicians_str}")
f"所选择的技师: {selected_technicians_str}")
with open(self.order_data_file, "a") as file:
file.write(f"{selected_services_str} - {selected_technicians_str}{self.order_info}\n")
file.write(f" {selected_technicians_str}{self.order_info}\n")
#酒水订单界面
def switch_to_beverage_order(self):
@ -365,7 +367,6 @@ class FootSpaManagementSystem:
def run(self):
self.root.mainloop() # 启动主循环
# 实例化足浴店管理系统
foot_spa_system = FootSpaManagementSystem()
foot_spa_system.run()
Loading…
Cancel
Save