|
|
|
@ -21,12 +21,50 @@ class FootSpaManagementSystem:
|
|
|
|
|
self.welcome_label = tk.Label(self.main_frame, text="欢迎使用足浴店管理系统")
|
|
|
|
|
self.welcome_label.pack()
|
|
|
|
|
|
|
|
|
|
self.register_button_main = tk.Button(self.main_frame, text="注册", command=self.switch_to_register)
|
|
|
|
|
self.register_button_main = tk.Button(self.main_frame, text="用户注册", command=self.switch_to_register)
|
|
|
|
|
self.register_button_main.pack()
|
|
|
|
|
|
|
|
|
|
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.admin_login_button = tk.Button(self.main_frame, text="管理员登录", command=self.create_admin_login_view)
|
|
|
|
|
self.admin_login_button.pack()
|
|
|
|
|
|
|
|
|
|
#管理员登录函数
|
|
|
|
|
def admin_login(self):
|
|
|
|
|
admin_username = "zg"
|
|
|
|
|
admin_password = "zg123"
|
|
|
|
|
|
|
|
|
|
username = self.username_entry.get()
|
|
|
|
|
password = self.password_entry.get()
|
|
|
|
|
|
|
|
|
|
if username == admin_username and password == admin_password:
|
|
|
|
|
messagebox.showinfo("管理员登录", "登录成功!")
|
|
|
|
|
# Add code here for handling admin login success
|
|
|
|
|
else:
|
|
|
|
|
messagebox.showerror("管理员登录", "用户名或密码错误")
|
|
|
|
|
|
|
|
|
|
#管理员登录
|
|
|
|
|
def create_admin_login_view(self):
|
|
|
|
|
self.main_frame.pack_forget()
|
|
|
|
|
self.admin_login_window = tk.Frame(self.root)
|
|
|
|
|
self.admin_login_window.pack()
|
|
|
|
|
|
|
|
|
|
self.username_label = tk.Label(self.admin_login_window, text="用户名")
|
|
|
|
|
self.username_label.pack()
|
|
|
|
|
|
|
|
|
|
self.username_entry = tk.Entry(self.admin_login_window)
|
|
|
|
|
self.username_entry.pack()
|
|
|
|
|
|
|
|
|
|
self.password_label = tk.Label(self.admin_login_window, text="密码")
|
|
|
|
|
self.password_label.pack()
|
|
|
|
|
|
|
|
|
|
self.password_entry = tk.Entry(self.admin_login_window, show="*")
|
|
|
|
|
self.password_entry.pack()
|
|
|
|
|
|
|
|
|
|
self.login_button = tk.Button(self.admin_login_window, text="登录", command=self.admin_login)
|
|
|
|
|
self.login_button.pack()
|
|
|
|
|
|
|
|
|
|
#用户注册函数
|
|
|
|
|
def register_user(self):
|
|
|
|
|
username = self.username_entry.get()
|
|
|
|
|