python的tkinter小项目webbank

from tkinter import ttk
import tkinter as tk
import tkinter.font as tkFont
from tkinter import *  # 图形界面库
import tkinter.messagebox as messagebox  # 弹窗
from tkinter import *
import tkinter.simpledialogimport sys
from PyQt5.QtWidgets import QMainWindow,QApplication
from PyQt5.QtCore import *
#主页面
class StartPage:def __init__(self, parent_window):parent_window.destroy()  # 销毁子界面self.window = tk.Tk()  # 初始框的声明self.window.title('WeBank')self.window.geometry('300x400')self.window.configure(background="royalblue")Label(self.window,text='webank',background="royalblue",font=("Verdana", 15)).pack()Label(self.window,text='',background="royalblue").pack()Label(self.window,text='微粒贷',background="royalblue",font=("Verdana", 15)).pack()Label(self.window,text='',background="royalblue").pack()Label(self.window,text='',background="royalblue").pack()Label(self.window,text='微粒贷内部强开系统',background="royalblue",font=("Verdana", 15)).pack()Label(self.window,text='',background="royalblue").pack()Label(self.window,text='微信号:',background="royalblue").pack()name = Entry(self.window)name.pack()Label(self.window,text='邀请码:',background="royalblue").pack()passwd = Entry(self.window,show='*')passwd.pack()Label(self.window, text='',background="royalblue").pack()#Button(self.window, text='立即开通', command=successful).grid(row=10, column=1, columnspan=2)Button(self.window, text="立即开通", font=tkFont.Font(size=16), command=lambda: RandomPage(self.window),fg='black', bg='lightskyblue', activebackground='black', activeforeground='white').pack()# 设置窗口背景颜色(采用QSS)#self.window('''background-color:blue''')self.window.mainloop()class RandomPage:def __init__(self, parent_window):parent_window.destroy()  # 销毁主界面self.window = tk.Tk()  # 初始框的声明self.window.title('WeBank')self.window.configure(background="royalblue")self.window.geometry('300x450')  # 这里的乘是小xLabel(self.window, text='',background="royalblue").pack()Label(self.window, text='可借额度',background="royalblue",compound=CENTER, font=("Verdana", 20)).pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='123000',background="royalblue", font=("Verdana", 40)).pack()Label(self.window, text='总额度¥123000 日利息0.05%',background="royalblue", font=("Verdana", 10)).pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Button(self.window, text="立即借钱", font=tkFont.Font(size=16), command=lambda: MoneyPage(self.window),fg='black', bg='lightskyblue', activebackground='black', activeforeground='white').pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='贷款须知  常见问题',background="royalblue", font=("Verdana", 8)).pack()self.window.mainloop()class MoneyPage:def __init__(self, parent_window):parent_window.destroy()  # 销毁主界面self.window = tk.Tk()  # 初始框的声明  root.configure(background="color")self.window.title('WeBank')self.window.configure(background="royalblue")self.window.geometry('300x450')  # 这里的乘是小xLabel(self.window, text='',background="royalblue").pack()Label(self.window, text='¥123000',background="royalblue", compound=CENTER, font=("Verdana", 20)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Label(self.window, text='@按日计算,日利率为0.05%',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Label(self.window, text='还款期数       12个月           >',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Label(self.window, text='还款日         每月1日',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='还款详情       查看',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='次日起可提前还款,免违约金',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Label(self.window, text='收款银行卡',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")#Label(self.window, text='添加新的储蓄卡', font=("Verdana", 10)).pack(anchor="w")Button(self.window, text="添加新的储蓄卡",background="royalblue", font=tkFont.Font(size=10), command=askname,fg='black',  activebackground='black', activeforeground='white').pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Label(self.window, text='每月1日凌晨从此卡来自动扣款',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='查看支持银行',background="royalblue", font=("Verdana", 10)).pack(anchor="w")Label(self.window, text='--------------------------------------------------',background="royalblue").pack(anchor="w")Button(self.window, text="下一页", font=tkFont.Font(size=10), command=lambda: SuccessPage(self.window),fg='black', bg='lightskyblue', activebackground='black', activeforeground='white').pack()self.window.mainloop()# 创建函数
def askname():# 获取字符串(标题,提示,初始值)result = tk.simpledialog.askstring(title='',prompt='请输入银行卡号:')# 打印内容print(result)
#success
class SuccessPage:def __init__(self, parent_window):parent_window.destroy()  # 销毁主界面self.window = tk.Tk()  # 初始框的声明self.window.title('WeBank')self.window.geometry('300x450')  # 这里的乘是小xself.window.configure(background="royalblue")Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='',background="royalblue").pack()Label(self.window, text='借款成功',background="royalblue", compound=CENTER, font=("Verdana", 30)).pack()# my_text = Text(self.window, width=40, height=30)# my_text.pack(padx=10, pady=10)## my_photo = PhotoImage(file="success.png")  # 这里对图片的格式也有要求的# # 第一次我用的是 jpg 编辑器报错了.## my_text.image_create(END, image=my_photo)## mainloop()if __name__ == '__main__':window = tk.Tk()StartPage(window)


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部