commit_0528

main
123456789zs 6 months ago
parent 6739fbe909
commit 774b223a9b

@ -1,19 +1,2 @@
zs
spa Services: ×ãÔ¡, Order info:
spa
foot_spa
foot_spa, spa
foot_spa, spa
massage
massage, spa
massage, spa
spa
Services: spa, Order info:
Services: spa, Order info:
Services: spa, Order info:
Services: spa, Order info:
Services: spa, Order info:
Services: spa, Order info:
Services: foot_spa, massage, spa, ear_cleaning, Order info:
Services: spa, Order info:
Services: SPA, Order info:

@ -1,2 +1,2 @@
zs,zs
zs,zs zs,zs

@ -26,6 +26,7 @@ class FootSpaManagementSystem:
self.login_button_main = tk.Button(self.main_frame, text="登录", command=self.switch_to_login) self.login_button_main = tk.Button(self.main_frame, text="登录", command=self.switch_to_login)
self.login_button_main.pack() self.login_button_main.pack()
#用户注册函数
def register_user(self): def register_user(self):
username = self.username_entry.get() username = self.username_entry.get()
password = self.password_entry.get() password = self.password_entry.get()
@ -37,6 +38,7 @@ class FootSpaManagementSystem:
else: else:
messagebox.showerror("注册失败", "请输入用户名和密码。") # 显示注册失败信息 messagebox.showerror("注册失败", "请输入用户名和密码。") # 显示注册失败信息
#用户登录函数
def login_user(self): def login_user(self):
username = self.username_entry_login.get() username = self.username_entry_login.get()
password = self.password_entry_login.get() password = self.password_entry_login.get()
@ -44,13 +46,18 @@ class FootSpaManagementSystem:
with open(self.user_data_file, "r") as file: with open(self.user_data_file, "r") as file:
user_data = file.readlines() user_data = file.readlines()
if user_data:
for user in user_data: for user in user_data:
stored_username, stored_password = user.strip().split(",") stored_data = user.strip().split(",")
if len(stored_data) == 2:
stored_username, stored_password = stored_data
if username == stored_username and password == stored_password: if username == stored_username and password == stored_password:
messagebox.showinfo("登录成功", f"欢迎回来, {username}") # 显示登录成功信息 messagebox.showinfo("登录成功", f"欢迎回来{username}") # 显示登录成功消
self.switch_to_order() self.show_user_interface() # 在成功登录后显示用户界面
return return
messagebox.showerror("登录失败", "用户名或密码错误。") # 显示登录失败信息 messagebox.showerror("登录失败", "无效的用户名或密码。") # 显示登录失败消息
else:
messagebox.showerror("登录失败", "没有用户数据。") # 显示找不到用户数据的消息
def surer1(self): def surer1(self):
self.frame_register.pack_forget() self.frame_register.pack_forget()
@ -62,11 +69,11 @@ class FootSpaManagementSystem:
def surer2(self): def surer2(self):
self.frame_order.pack_forget() self.frame_order.pack_forget()
self.main_frame.pack() self.user_frame.pack()
if hasattr(self, "back_button_order"): if hasattr(self, "back_button_order"):
self.back_button_order.pack_forget() # 移除返回主界面的按钮 self.back_button_order.pack_forget() # 移除返回主界面的按钮
self.frame_order.pack_forget() self.frame_order.pack_forget()
self.main_frame.pack() self.user_frame.pack()
#注册界面 #注册界面
def switch_to_register(self): def switch_to_register(self):
@ -109,13 +116,38 @@ class FootSpaManagementSystem:
self.login_button = tk.Button(self.frame_login, text="登录", command=self.login_user) self.login_button = tk.Button(self.frame_login, text="登录", command=self.login_user)
self.login_button.pack() self.login_button.pack()
#选择订单界面 #用户登录后的用户界面
def switch_to_order(self): def show_user_interface(self):
self.main_frame.pack_forget() # 移除主界面 self.main_frame.pack_forget() # 移除主界面
if hasattr(self, "frame_register"): if hasattr(self, "frame_register"):
self.frame_register.pack_forget() # 移除注册界面(如果存在) self.frame_register.pack_forget() # 移除注册界面(如果存在)
if hasattr(self, "frame_login"): if hasattr(self, "frame_login"):
self.frame_login.pack_forget() # 移除登录界面(如果存在) self.frame_login.pack_forget() # 移除登录界面(如果存在)
# 创建用户界面框架
self.user_frame = tk.Frame(self.root)
self.user_frame.pack()
self.order_button = tk.Button(self.user_frame, text="选择订单", command=self.switch_to_order)
self.order_button.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)
self.delete_order_button.pack()
#查看订单
def view_order(self):
messagebox.showinfo("查看订单", "查看订单功能正在开发中!")
#删除界面
def delete_order(self):
# 在这里添加删除订单逻辑
messagebox.showinfo("删除订单", "删除订单功能正在开发中!")
#选择订单界面
def switch_to_order(self):
self.user_frame.pack_forget()
self.frame_order = tk.Frame(self.root) self.frame_order = tk.Frame(self.root)
self.frame_order.pack() self.frame_order.pack()
@ -144,13 +176,13 @@ class FootSpaManagementSystem:
self.confirm_order_button = tk.Button(self.frame_order, text="确认订单", command=self.confirm_order) self.confirm_order_button = tk.Button(self.frame_order, text="确认订单", command=self.confirm_order)
self.confirm_order_button.pack() self.confirm_order_button.pack()
self.back_button_order = tk.Button(self.frame_order, text="返回界面", command=self.surer2) self.back_button_order = tk.Button(self.frame_order, text="返回用户界面", command=self.surer2)
self.back_button_order.pack() self.back_button_order.pack()
def confirm_order(self): def confirm_order(self):
selected_services = [service for service, selected in self.services.items() if selected.get() == 1] selected_services = [service for service, selected in self.services.items() if selected.get() == 1]
if selected_services: if selected_services:
messagebox.showinfo("下单成功", f"您选择了:{', '.join(selected_services)}\n订单信息:{self.order_info}") messagebox.showinfo("下单成功", f"您选择了:{', '.join(selected_services)}\n")
# 显示选择技师的界面 # 显示选择技师的界面
self.show_select_technician_screen() self.show_select_technician_screen()
@ -177,26 +209,24 @@ class FootSpaManagementSystem:
"88号技师": tk.IntVar(), "88号技师": tk.IntVar(),
} }
self.john_doe_checkbox = tk.Checkbutton(self.frame_technician, text="6号技师", self.john_doe_checkbox = tk.Checkbutton(self.frame_technician, text="6号技师",variable=self.technicians["6号技师"])
variable=self.technicians["6号技师"])
self.john_doe_checkbox.pack() self.john_doe_checkbox.pack()
self.jane_smith_checkbox = tk.Checkbutton(self.frame_technician, text="8号技师", self.jane_smith_checkbox = tk.Checkbutton(self.frame_technician, text="8号技师",variable=self.technicians["8号技师"])
variable=self.technicians["8号技师"])
self.jane_smith_checkbox.pack() self.jane_smith_checkbox.pack()
self.mike_wilson_checkbox = tk.Checkbutton(self.frame_technician, text="66号技师", self.mike_wilson_checkbox = tk.Checkbutton(self.frame_technician, text="66号技师",variable=self.technicians["66号技师"])
variable=self.technicians["66号技师"])
self.mike_wilson_checkbox.pack() self.mike_wilson_checkbox.pack()
self.mike_wilson_checkbox = tk.Checkbutton(self.frame_technician, text="88号技师", self.mike_wilson_checkbox = tk.Checkbutton(self.frame_technician, text="88号技师",variable=self.technicians["88号技师"])
variable=self.technicians["88号技师"])
self.mike_wilson_checkbox.pack() self.mike_wilson_checkbox.pack()
self.confirm_technician_button = tk.Button(self.frame_technician, text="确认技师", self.confirm_technician_button = tk.Button(self.frame_technician, text="确认技师",command=self.confirm_technician)
command=self.confirm_technician)
self.confirm_technician_button.pack() self.confirm_technician_button.pack()
self.back_button_order = tk.Button(self.frame_technician, text="返回用户界面", command=self.surer2)
self.back_button_order.pack()
def confirm_technician(self): def confirm_technician(self):
selected_technicians = [technician for technician, selected in self.technicians.items() if selected.get() == 1] selected_technicians = [technician for technician, selected in self.technicians.items() if selected.get() == 1]
if selected_technicians: if selected_technicians:

Loading…
Cancel
Save