@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
@ -0,0 +1 @@
|
|||||||
|
Bank_System
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.9" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/../Bank_System/.idea/Bank_System.iml" filepath="$PROJECT_DIR$/../Bank_System/.idea/Bank_System.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,742 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Form implementation generated from reading ui file 'InterfaceUi.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt5 UI code generator 5.15.9
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
MainWindow.setObjectName("MainWindow")
|
||||||
|
MainWindow.resize(980, 600)
|
||||||
|
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName("centralwidget")
|
||||||
|
self.frame = QtWidgets.QFrame(self.centralwidget)
|
||||||
|
self.frame.setGeometry(QtCore.QRect(90, 50, 800, 500))
|
||||||
|
self.frame.setMinimumSize(QtCore.QSize(800, 500))
|
||||||
|
self.frame.setStyleSheet("#frame{\n"
|
||||||
|
" font: 12pt \"幼圆\";\n"
|
||||||
|
" background-color:rgb(255, 255, 255);\n"
|
||||||
|
" \n"
|
||||||
|
" border-radius:30px;\n"
|
||||||
|
"}")
|
||||||
|
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame.setObjectName("frame")
|
||||||
|
self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
|
||||||
|
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout.setSpacing(0)
|
||||||
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
|
self.frame_2 = QtWidgets.QFrame(self.frame)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_2.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_2.setStyleSheet("background-color:rgb(223, 223, 223);\n"
|
||||||
|
"border-top-right-radius:30px;\n"
|
||||||
|
"border-top-left-radius:30px;")
|
||||||
|
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_2.setObjectName("frame_2")
|
||||||
|
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_2)
|
||||||
|
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout.setSpacing(0)
|
||||||
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
|
self.frame_4 = QtWidgets.QFrame(self.frame_2)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_4.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_4.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_4.setObjectName("frame_4")
|
||||||
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_4)
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
|
self.pushButton = QtWidgets.QPushButton(self.frame_4)
|
||||||
|
self.pushButton.setStyleSheet("border:none;\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.pushButton.setObjectName("pushButton")
|
||||||
|
self.horizontalLayout_2.addWidget(self.pushButton, 0, QtCore.Qt.AlignLeft)
|
||||||
|
self.horizontalLayout.addWidget(self.frame_4)
|
||||||
|
self.frame_5 = QtWidgets.QFrame(self.frame_2)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_5.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_5.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_5.setStyleSheet("QPushButton{\n"
|
||||||
|
" border:none;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:hover{\n"
|
||||||
|
" padding-bottom:5px;\n"
|
||||||
|
"}\n"
|
||||||
|
"border-top-right-radius:30px;")
|
||||||
|
self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_5.setObjectName("frame_5")
|
||||||
|
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame_5)
|
||||||
|
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||||
|
self.logout_button = QtWidgets.QPushButton(self.frame_5)
|
||||||
|
self.logout_button.setStyleSheet("")
|
||||||
|
self.logout_button.setText("")
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(QtGui.QPixmap(":/icons/icons/exit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.logout_button.setIcon(icon)
|
||||||
|
self.logout_button.setIconSize(QtCore.QSize(25, 25))
|
||||||
|
self.logout_button.setObjectName("logout_button")
|
||||||
|
self.horizontalLayout_3.addWidget(self.logout_button)
|
||||||
|
self.pushButton_3 = QtWidgets.QPushButton(self.frame_5)
|
||||||
|
self.pushButton_3.setStyleSheet("")
|
||||||
|
self.pushButton_3.setText("")
|
||||||
|
icon1 = QtGui.QIcon()
|
||||||
|
icon1.addPixmap(QtGui.QPixmap(":/icons/icons/minimize.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.pushButton_3.setIcon(icon1)
|
||||||
|
self.pushButton_3.setIconSize(QtCore.QSize(25, 25))
|
||||||
|
self.pushButton_3.setObjectName("pushButton_3")
|
||||||
|
self.horizontalLayout_3.addWidget(self.pushButton_3)
|
||||||
|
self.pushButton_2 = QtWidgets.QPushButton(self.frame_5)
|
||||||
|
self.pushButton_2.setStyleSheet("")
|
||||||
|
self.pushButton_2.setText("")
|
||||||
|
icon2 = QtGui.QIcon()
|
||||||
|
icon2.addPixmap(QtGui.QPixmap(":/icons/icons/close_3.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.pushButton_2.setIcon(icon2)
|
||||||
|
self.pushButton_2.setIconSize(QtCore.QSize(25, 25))
|
||||||
|
self.pushButton_2.setObjectName("pushButton_2")
|
||||||
|
self.horizontalLayout_3.addWidget(self.pushButton_2)
|
||||||
|
self.horizontalLayout.addWidget(self.frame_5, 0, QtCore.Qt.AlignRight)
|
||||||
|
self.verticalLayout.addWidget(self.frame_2)
|
||||||
|
self.frame_3 = QtWidgets.QFrame(self.frame)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(10)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_3.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_3.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_3.setStyleSheet("")
|
||||||
|
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_3.setObjectName("frame_3")
|
||||||
|
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.frame_3)
|
||||||
|
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_4.setSpacing(0)
|
||||||
|
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||||
|
self.frame_6 = QtWidgets.QFrame(self.frame_3)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(2)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_6.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_6.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_6.setStyleSheet("#frame_6{\n"
|
||||||
|
" background-color:rgb(0, 170, 255);\n"
|
||||||
|
" border-bottom-left-radius:30px;\n"
|
||||||
|
" border-top-right-radius:30px;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton{\n"
|
||||||
|
" border:none;\n"
|
||||||
|
" color:rgb(255, 255, 255);\n"
|
||||||
|
" font: 12pt \"幼圆\";\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:hover{\n"
|
||||||
|
" color:rgb(131, 131, 131);\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:pressed{\n"
|
||||||
|
" padding-left:5px;\n"
|
||||||
|
" padding-top:5px;\n"
|
||||||
|
"}")
|
||||||
|
self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_6.setObjectName("frame_6")
|
||||||
|
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame_6)
|
||||||
|
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||||
|
self.pushButton_6 = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_6.setObjectName("pushButton_6")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_6)
|
||||||
|
self.pushButton_home = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_home.setObjectName("pushButton_home")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_home)
|
||||||
|
self.pushButton_add = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_add.setObjectName("pushButton_add")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_add)
|
||||||
|
self.pushButton_get = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_get.setObjectName("pushButton_get")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_get)
|
||||||
|
self.pushButton_transfer = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_transfer.setObjectName("pushButton_transfer")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_transfer)
|
||||||
|
self.pushButton_look = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_look.setObjectName("pushButton_look")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_look)
|
||||||
|
self.pushButton_irt = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_irt.setObjectName("pushButton_irt")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_irt)
|
||||||
|
self.pushButton_info = QtWidgets.QPushButton(self.frame_6)
|
||||||
|
self.pushButton_info.setObjectName("pushButton_info")
|
||||||
|
self.verticalLayout_2.addWidget(self.pushButton_info)
|
||||||
|
self.horizontalLayout_4.addWidget(self.frame_6)
|
||||||
|
self.frame_7 = QtWidgets.QFrame(self.frame_3)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(7)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_7.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_7.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_7.setStyleSheet("#frame_7{\n"
|
||||||
|
" background-color:rgb(255, 255, 255);\n"
|
||||||
|
" border-bottom-right-radius:30px;\n"
|
||||||
|
"}")
|
||||||
|
self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_7.setObjectName("frame_7")
|
||||||
|
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frame_7)
|
||||||
|
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_3.setSpacing(0)
|
||||||
|
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||||
|
self.stackedWidget = QtWidgets.QStackedWidget(self.frame_7)
|
||||||
|
self.stackedWidget.setObjectName("stackedWidget")
|
||||||
|
self.page_home = QtWidgets.QWidget()
|
||||||
|
self.page_home.setObjectName("page_home")
|
||||||
|
self.label = QtWidgets.QLabel(self.page_home)
|
||||||
|
self.label.setGeometry(QtCore.QRect(20, 20, 291, 21))
|
||||||
|
self.label.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.tableWidget = QtWidgets.QTableWidget(self.page_home)
|
||||||
|
self.tableWidget.setGeometry(QtCore.QRect(20, 60, 591, 361))
|
||||||
|
self.tableWidget.setStyleSheet("\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.tableWidget.setObjectName("tableWidget")
|
||||||
|
self.tableWidget.setColumnCount(6)
|
||||||
|
self.tableWidget.setRowCount(16)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(0, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(1, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(2, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(3, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(4, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(5, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(6, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(7, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(8, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(9, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(10, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(11, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(12, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(13, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(14, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setVerticalHeaderItem(15, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(0, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(1, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(2, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(3, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(4, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget.setHorizontalHeaderItem(5, item)
|
||||||
|
self.stackedWidget.addWidget(self.page_home)
|
||||||
|
self.page_add = QtWidgets.QWidget()
|
||||||
|
self.page_add.setObjectName("page_add")
|
||||||
|
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.page_add)
|
||||||
|
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_7.setSpacing(0)
|
||||||
|
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||||
|
self.frame_13 = QtWidgets.QFrame(self.page_add)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(5)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_13.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_13.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_13.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_13.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_13.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_13.setObjectName("frame_13")
|
||||||
|
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.frame_13)
|
||||||
|
self.verticalLayout_8.setObjectName("verticalLayout_8")
|
||||||
|
self.label_5 = QtWidgets.QLabel(self.frame_13)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.verticalLayout_8.addWidget(self.label_5, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_6 = QtWidgets.QLabel(self.frame_13)
|
||||||
|
self.label_6.setObjectName("label_6")
|
||||||
|
self.verticalLayout_8.addWidget(self.label_6, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_7 = QtWidgets.QLabel(self.frame_13)
|
||||||
|
self.label_7.setObjectName("label_7")
|
||||||
|
self.verticalLayout_8.addWidget(self.label_7, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.pushButton_4 = QtWidgets.QPushButton(self.frame_13)
|
||||||
|
self.pushButton_4.setStyleSheet("background-color:rgba(255, 255, 255,0)")
|
||||||
|
self.pushButton_4.setText("")
|
||||||
|
self.pushButton_4.setObjectName("pushButton_4")
|
||||||
|
self.verticalLayout_8.addWidget(self.pushButton_4)
|
||||||
|
self.horizontalLayout_7.addWidget(self.frame_13)
|
||||||
|
self.frame_14 = QtWidgets.QFrame(self.page_add)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(5)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_14.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_14.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_14.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_14.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_14.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_14.setObjectName("frame_14")
|
||||||
|
self.submit_button = QtWidgets.QPushButton(self.frame_14)
|
||||||
|
self.submit_button.setGeometry(QtCore.QRect(100, 390, 93, 28))
|
||||||
|
self.submit_button.setStyleSheet("background-color:rgb(170, 255, 255)")
|
||||||
|
self.submit_button.setObjectName("submit_button")
|
||||||
|
self.get_savings = QtWidgets.QLineEdit(self.frame_14)
|
||||||
|
self.get_savings.setGeometry(QtCore.QRect(10, 55, 280, 40))
|
||||||
|
self.get_savings.setObjectName("get_savings")
|
||||||
|
self.type_box = QtWidgets.QGroupBox(self.frame_14)
|
||||||
|
self.type_box.setGeometry(QtCore.QRect(10, 190, 281, 43))
|
||||||
|
self.type_box.setStyleSheet("border:none")
|
||||||
|
self.type_box.setTitle("")
|
||||||
|
self.type_box.setObjectName("type_box")
|
||||||
|
self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.type_box)
|
||||||
|
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
|
||||||
|
self.current_radio = QtWidgets.QRadioButton(self.type_box)
|
||||||
|
self.current_radio.setObjectName("current_radio")
|
||||||
|
self.horizontalLayout_8.addWidget(self.current_radio)
|
||||||
|
self.fixed_radio = QtWidgets.QRadioButton(self.type_box)
|
||||||
|
self.fixed_radio.setObjectName("fixed_radio")
|
||||||
|
self.horizontalLayout_8.addWidget(self.fixed_radio)
|
||||||
|
self.deposit_time = QtWidgets.QComboBox(self.frame_14)
|
||||||
|
self.deposit_time.setGeometry(QtCore.QRect(20, 328, 271, 31))
|
||||||
|
self.deposit_time.setObjectName("deposit_time")
|
||||||
|
self.deposit_time.addItem("")
|
||||||
|
self.deposit_time.addItem("")
|
||||||
|
self.deposit_time.addItem("")
|
||||||
|
self.deposit_time.addItem("")
|
||||||
|
self.deposit_time.addItem("")
|
||||||
|
self.horizontalLayout_7.addWidget(self.frame_14)
|
||||||
|
self.stackedWidget.addWidget(self.page_add)
|
||||||
|
self.page_get = QtWidgets.QWidget()
|
||||||
|
self.page_get.setObjectName("page_get")
|
||||||
|
self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.page_get)
|
||||||
|
self.horizontalLayout_9.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_9.setSpacing(0)
|
||||||
|
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
|
||||||
|
self.frame_15 = QtWidgets.QFrame(self.page_get)
|
||||||
|
self.frame_15.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_15.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_15.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_15.setObjectName("frame_15")
|
||||||
|
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.frame_15)
|
||||||
|
self.verticalLayout_9.setObjectName("verticalLayout_9")
|
||||||
|
self.label_4 = QtWidgets.QLabel(self.frame_15)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.verticalLayout_9.addWidget(self.label_4, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_8 = QtWidgets.QLabel(self.frame_15)
|
||||||
|
self.label_8.setObjectName("label_8")
|
||||||
|
self.verticalLayout_9.addWidget(self.label_8, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_9 = QtWidgets.QLabel(self.frame_15)
|
||||||
|
self.label_9.setObjectName("label_9")
|
||||||
|
self.verticalLayout_9.addWidget(self.label_9, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.pushButton_5 = QtWidgets.QPushButton(self.frame_15)
|
||||||
|
self.pushButton_5.setStyleSheet("background-color:rgba(255, 255, 255,0)")
|
||||||
|
self.pushButton_5.setText("")
|
||||||
|
self.pushButton_5.setObjectName("pushButton_5")
|
||||||
|
self.verticalLayout_9.addWidget(self.pushButton_5)
|
||||||
|
self.horizontalLayout_9.addWidget(self.frame_15)
|
||||||
|
self.frame_16 = QtWidgets.QFrame(self.page_get)
|
||||||
|
self.frame_16.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_16.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_16.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_16.setObjectName("frame_16")
|
||||||
|
self.accid_1 = QtWidgets.QLineEdit(self.frame_16)
|
||||||
|
self.accid_1.setGeometry(QtCore.QRect(10, 60, 280, 40))
|
||||||
|
self.accid_1.setObjectName("accid_1")
|
||||||
|
self.money_1 = QtWidgets.QLineEdit(self.frame_16)
|
||||||
|
self.money_1.setGeometry(QtCore.QRect(10, 190, 280, 40))
|
||||||
|
self.money_1.setObjectName("money_1")
|
||||||
|
self.psw_sure1 = QtWidgets.QLineEdit(self.frame_16)
|
||||||
|
self.psw_sure1.setGeometry(QtCore.QRect(10, 320, 280, 40))
|
||||||
|
self.psw_sure1.setObjectName("psw_sure1")
|
||||||
|
self.sure_button1 = QtWidgets.QPushButton(self.frame_16)
|
||||||
|
self.sure_button1.setGeometry(QtCore.QRect(110, 400, 93, 28))
|
||||||
|
self.sure_button1.setStyleSheet("background-color:rgb(170, 255, 255)")
|
||||||
|
self.sure_button1.setObjectName("sure_button1")
|
||||||
|
self.horizontalLayout_9.addWidget(self.frame_16)
|
||||||
|
self.stackedWidget.addWidget(self.page_get)
|
||||||
|
self.page_transfer = QtWidgets.QWidget()
|
||||||
|
self.page_transfer.setObjectName("page_transfer")
|
||||||
|
self.horizontalLayout_10 = QtWidgets.QHBoxLayout(self.page_transfer)
|
||||||
|
self.horizontalLayout_10.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_10.setSpacing(0)
|
||||||
|
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
|
||||||
|
self.frame_17 = QtWidgets.QFrame(self.page_transfer)
|
||||||
|
self.frame_17.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_17.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_17.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_17.setObjectName("frame_17")
|
||||||
|
self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.frame_17)
|
||||||
|
self.verticalLayout_10.setObjectName("verticalLayout_10")
|
||||||
|
self.label_10 = QtWidgets.QLabel(self.frame_17)
|
||||||
|
self.label_10.setObjectName("label_10")
|
||||||
|
self.verticalLayout_10.addWidget(self.label_10, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_11 = QtWidgets.QLabel(self.frame_17)
|
||||||
|
self.label_11.setObjectName("label_11")
|
||||||
|
self.verticalLayout_10.addWidget(self.label_11, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_12 = QtWidgets.QLabel(self.frame_17)
|
||||||
|
self.label_12.setObjectName("label_12")
|
||||||
|
self.verticalLayout_10.addWidget(self.label_12, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.label_13 = QtWidgets.QLabel(self.frame_17)
|
||||||
|
self.label_13.setObjectName("label_13")
|
||||||
|
self.verticalLayout_10.addWidget(self.label_13, 0, QtCore.Qt.AlignHCenter)
|
||||||
|
self.pushButton_7 = QtWidgets.QPushButton(self.frame_17)
|
||||||
|
self.pushButton_7.setStyleSheet("background-color:rgba(255, 255, 255,0)")
|
||||||
|
self.pushButton_7.setText("")
|
||||||
|
self.pushButton_7.setObjectName("pushButton_7")
|
||||||
|
self.verticalLayout_10.addWidget(self.pushButton_7)
|
||||||
|
self.horizontalLayout_10.addWidget(self.frame_17)
|
||||||
|
self.frame_18 = QtWidgets.QFrame(self.page_transfer)
|
||||||
|
self.frame_18.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_18.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_18.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_18.setObjectName("frame_18")
|
||||||
|
self.out_accid = QtWidgets.QLineEdit(self.frame_18)
|
||||||
|
self.out_accid.setGeometry(QtCore.QRect(10, 40, 280, 40))
|
||||||
|
self.out_accid.setObjectName("out_accid")
|
||||||
|
self.in_accid = QtWidgets.QLineEdit(self.frame_18)
|
||||||
|
self.in_accid.setGeometry(QtCore.QRect(10, 140, 280, 40))
|
||||||
|
self.in_accid.setObjectName("in_accid")
|
||||||
|
self.out_money = QtWidgets.QLineEdit(self.frame_18)
|
||||||
|
self.out_money.setGeometry(QtCore.QRect(10, 240, 280, 40))
|
||||||
|
self.out_money.setObjectName("out_money")
|
||||||
|
self.sure_psw2 = QtWidgets.QLineEdit(self.frame_18)
|
||||||
|
self.sure_psw2.setGeometry(QtCore.QRect(10, 340, 280, 40))
|
||||||
|
self.sure_psw2.setObjectName("sure_psw2")
|
||||||
|
self.sure_button2 = QtWidgets.QPushButton(self.frame_18)
|
||||||
|
self.sure_button2.setGeometry(QtCore.QRect(90, 410, 93, 28))
|
||||||
|
self.sure_button2.setStyleSheet("background-color:rgb(170, 255, 255)")
|
||||||
|
self.sure_button2.setObjectName("sure_button2")
|
||||||
|
self.horizontalLayout_10.addWidget(self.frame_18)
|
||||||
|
self.stackedWidget.addWidget(self.page_transfer)
|
||||||
|
self.page_look = QtWidgets.QWidget()
|
||||||
|
self.page_look.setObjectName("page_look")
|
||||||
|
self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.page_look)
|
||||||
|
self.verticalLayout_11.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_11.setSpacing(0)
|
||||||
|
self.verticalLayout_11.setObjectName("verticalLayout_11")
|
||||||
|
self.frame_19 = QtWidgets.QFrame(self.page_look)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_19.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_19.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_19.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_19.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_19.setObjectName("frame_19")
|
||||||
|
self.label_14 = QtWidgets.QLabel(self.frame_19)
|
||||||
|
self.label_14.setGeometry(QtCore.QRect(10, 10, 151, 31))
|
||||||
|
self.label_14.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.label_14.setObjectName("label_14")
|
||||||
|
self.verticalLayout_11.addWidget(self.frame_19)
|
||||||
|
self.frame_20 = QtWidgets.QFrame(self.page_look)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(9)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_20.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_20.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_20.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_20.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_20.setObjectName("frame_20")
|
||||||
|
self.horizontalLayout_11 = QtWidgets.QHBoxLayout(self.frame_20)
|
||||||
|
self.horizontalLayout_11.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_11.setSpacing(0)
|
||||||
|
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
|
||||||
|
self.textEdit = QtWidgets.QTextEdit(self.frame_20)
|
||||||
|
self.textEdit.setObjectName("textEdit")
|
||||||
|
self.horizontalLayout_11.addWidget(self.textEdit)
|
||||||
|
self.verticalLayout_11.addWidget(self.frame_20)
|
||||||
|
self.stackedWidget.addWidget(self.page_look)
|
||||||
|
self.page_irt = QtWidgets.QWidget()
|
||||||
|
self.page_irt.setObjectName("page_irt")
|
||||||
|
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.page_irt)
|
||||||
|
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_4.setSpacing(0)
|
||||||
|
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||||
|
self.frame_8 = QtWidgets.QFrame(self.page_irt)
|
||||||
|
self.frame_8.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_8.setObjectName("frame_8")
|
||||||
|
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.frame_8)
|
||||||
|
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_6.setSpacing(0)
|
||||||
|
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||||
|
self.frame_9 = QtWidgets.QFrame(self.frame_8)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_9.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_9.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_9.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_9.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_9.setObjectName("frame_9")
|
||||||
|
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.frame_9)
|
||||||
|
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||||
|
self.label_2 = QtWidgets.QLabel(self.frame_9)
|
||||||
|
self.label_2.setStyleSheet("color:rgb(0, 0, 0);\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.horizontalLayout_5.addWidget(self.label_2)
|
||||||
|
self.verticalLayout_6.addWidget(self.frame_9)
|
||||||
|
self.frame_12 = QtWidgets.QFrame(self.frame_8)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(6)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_12.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_12.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_12.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_12.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_12.setObjectName("frame_12")
|
||||||
|
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.frame_12)
|
||||||
|
self.horizontalLayout_6.setContentsMargins(70, 0, 70, 120)
|
||||||
|
self.horizontalLayout_6.setSpacing(0)
|
||||||
|
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||||
|
self.tableWidget_2 = QtWidgets.QTableWidget(self.frame_12)
|
||||||
|
self.tableWidget_2.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.tableWidget_2.setObjectName("tableWidget_2")
|
||||||
|
self.tableWidget_2.setColumnCount(3)
|
||||||
|
self.tableWidget_2.setRowCount(0)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget_2.setHorizontalHeaderItem(0, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget_2.setHorizontalHeaderItem(1, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.tableWidget_2.setHorizontalHeaderItem(2, item)
|
||||||
|
self.tableWidget_2.horizontalHeader().setDefaultSectionSize(150)
|
||||||
|
self.horizontalLayout_6.addWidget(self.tableWidget_2)
|
||||||
|
self.verticalLayout_6.addWidget(self.frame_12)
|
||||||
|
self.verticalLayout_4.addWidget(self.frame_8)
|
||||||
|
self.stackedWidget.addWidget(self.page_irt)
|
||||||
|
self.home = QtWidgets.QWidget()
|
||||||
|
self.home.setObjectName("home")
|
||||||
|
self.verticalLayout_12 = QtWidgets.QVBoxLayout(self.home)
|
||||||
|
self.verticalLayout_12.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_12.setSpacing(0)
|
||||||
|
self.verticalLayout_12.setObjectName("verticalLayout_12")
|
||||||
|
self.frame_21 = QtWidgets.QFrame(self.home)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_21.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_21.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_21.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_21.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_21.setObjectName("frame_21")
|
||||||
|
self.horizontalLayout_12 = QtWidgets.QHBoxLayout(self.frame_21)
|
||||||
|
self.horizontalLayout_12.setObjectName("horizontalLayout_12")
|
||||||
|
self.label_15 = QtWidgets.QLabel(self.frame_21)
|
||||||
|
self.label_15.setStyleSheet("font: 12pt \"幼圆\";\n"
|
||||||
|
"border:none;")
|
||||||
|
self.label_15.setObjectName("label_15")
|
||||||
|
self.horizontalLayout_12.addWidget(self.label_15)
|
||||||
|
self.label_17 = QtWidgets.QLabel(self.frame_21)
|
||||||
|
self.label_17.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.label_17.setObjectName("label_17")
|
||||||
|
self.horizontalLayout_12.addWidget(self.label_17, 0, QtCore.Qt.AlignRight)
|
||||||
|
self.verticalLayout_12.addWidget(self.frame_21)
|
||||||
|
self.frame_22 = QtWidgets.QFrame(self.home)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(8)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_22.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_22.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_22.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.frame_22.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_22.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_22.setObjectName("frame_22")
|
||||||
|
self.label_18 = QtWidgets.QLabel(self.frame_22)
|
||||||
|
self.label_18.setGeometry(QtCore.QRect(10, 10, 100, 40))
|
||||||
|
self.label_18.setObjectName("label_18")
|
||||||
|
self.label_19 = QtWidgets.QLabel(self.frame_22)
|
||||||
|
self.label_19.setGeometry(QtCore.QRect(10, 60, 650, 40))
|
||||||
|
self.label_19.setObjectName("label_19")
|
||||||
|
self.label_20 = QtWidgets.QLabel(self.frame_22)
|
||||||
|
self.label_20.setGeometry(QtCore.QRect(10, 120, 650, 40))
|
||||||
|
self.label_20.setObjectName("label_20")
|
||||||
|
self.label_21 = QtWidgets.QLabel(self.frame_22)
|
||||||
|
self.label_21.setGeometry(QtCore.QRect(10, 180, 650, 40))
|
||||||
|
self.label_21.setObjectName("label_21")
|
||||||
|
self.label_22 = QtWidgets.QLabel(self.frame_22)
|
||||||
|
self.label_22.setGeometry(QtCore.QRect(10, 240, 650, 40))
|
||||||
|
self.label_22.setObjectName("label_22")
|
||||||
|
self.verticalLayout_12.addWidget(self.frame_22)
|
||||||
|
self.stackedWidget.addWidget(self.home)
|
||||||
|
self.page_info = QtWidgets.QWidget()
|
||||||
|
self.page_info.setObjectName("page_info")
|
||||||
|
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.page_info)
|
||||||
|
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_5.setSpacing(0)
|
||||||
|
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||||
|
self.frame_10 = QtWidgets.QFrame(self.page_info)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(3)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_10.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_10.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_10.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_10.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_10.setObjectName("frame_10")
|
||||||
|
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.frame_10)
|
||||||
|
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||||
|
self.label_3 = QtWidgets.QLabel(self.frame_10)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||||
|
self.label_3.setSizePolicy(sizePolicy)
|
||||||
|
self.label_3.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.label_3.setObjectName("label_3")
|
||||||
|
self.verticalLayout_7.addWidget(self.label_3)
|
||||||
|
self.tableView = QtWidgets.QTableView(self.frame_10)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(2)
|
||||||
|
sizePolicy.setHeightForWidth(self.tableView.sizePolicy().hasHeightForWidth())
|
||||||
|
self.tableView.setSizePolicy(sizePolicy)
|
||||||
|
self.tableView.setObjectName("tableView")
|
||||||
|
self.verticalLayout_7.addWidget(self.tableView)
|
||||||
|
self.label_16 = QtWidgets.QLabel(self.frame_10)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(7)
|
||||||
|
sizePolicy.setHeightForWidth(self.label_16.sizePolicy().hasHeightForWidth())
|
||||||
|
self.label_16.setSizePolicy(sizePolicy)
|
||||||
|
self.label_16.setMinimumSize(QtCore.QSize(597, 285))
|
||||||
|
self.label_16.setStyleSheet("background-image:url(:/images/images/123.jpg)")
|
||||||
|
self.label_16.setText("")
|
||||||
|
self.label_16.setObjectName("label_16")
|
||||||
|
self.verticalLayout_7.addWidget(self.label_16)
|
||||||
|
self.verticalLayout_5.addWidget(self.frame_10)
|
||||||
|
self.stackedWidget.addWidget(self.page_info)
|
||||||
|
self.verticalLayout_3.addWidget(self.stackedWidget)
|
||||||
|
self.horizontalLayout_4.addWidget(self.frame_7)
|
||||||
|
self.verticalLayout.addWidget(self.frame_3)
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName("statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
self.stackedWidget.setCurrentIndex(6)
|
||||||
|
self.pushButton_2.clicked.connect(MainWindow.close) # type: ignore
|
||||||
|
self.pushButton_3.clicked.connect(MainWindow.showMinimized) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||||
|
self.pushButton.setText(_translate("MainWindow", "神州银行"))
|
||||||
|
self.pushButton_6.setText(_translate("MainWindow", "首页"))
|
||||||
|
self.pushButton_home.setText(_translate("MainWindow", "账户"))
|
||||||
|
self.pushButton_add.setText(_translate("MainWindow", "存钱"))
|
||||||
|
self.pushButton_get.setText(_translate("MainWindow", "取钱"))
|
||||||
|
self.pushButton_transfer.setText(_translate("MainWindow", "转账"))
|
||||||
|
self.pushButton_look.setText(_translate("MainWindow", "查看流水"))
|
||||||
|
self.pushButton_irt.setText(_translate("MainWindow", "查看利率"))
|
||||||
|
self.pushButton_info.setText(_translate("MainWindow", "个人信息"))
|
||||||
|
self.label.setText(_translate("MainWindow", "下面是您的所有账户:"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(0)
|
||||||
|
item.setText(_translate("MainWindow", "1"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(1)
|
||||||
|
item.setText(_translate("MainWindow", "2"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(2)
|
||||||
|
item.setText(_translate("MainWindow", "3"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(3)
|
||||||
|
item.setText(_translate("MainWindow", "4"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(4)
|
||||||
|
item.setText(_translate("MainWindow", "5"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(5)
|
||||||
|
item.setText(_translate("MainWindow", "6"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(6)
|
||||||
|
item.setText(_translate("MainWindow", "7"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(7)
|
||||||
|
item.setText(_translate("MainWindow", "8"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(8)
|
||||||
|
item.setText(_translate("MainWindow", "9"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(9)
|
||||||
|
item.setText(_translate("MainWindow", "10"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(10)
|
||||||
|
item.setText(_translate("MainWindow", "11"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(11)
|
||||||
|
item.setText(_translate("MainWindow", "12"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(12)
|
||||||
|
item.setText(_translate("MainWindow", "13"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(13)
|
||||||
|
item.setText(_translate("MainWindow", "14"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(14)
|
||||||
|
item.setText(_translate("MainWindow", "15"))
|
||||||
|
item = self.tableWidget.verticalHeaderItem(15)
|
||||||
|
item.setText(_translate("MainWindow", "16"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(0)
|
||||||
|
item.setText(_translate("MainWindow", "账户ID"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(1)
|
||||||
|
item.setText(_translate("MainWindow", "余额"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(2)
|
||||||
|
item.setText(_translate("MainWindow", "开户时间"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(3)
|
||||||
|
item.setText(_translate("MainWindow", "存款时长"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(4)
|
||||||
|
item.setText(_translate("MainWindow", "户主身份证号"))
|
||||||
|
item = self.tableWidget.horizontalHeaderItem(5)
|
||||||
|
item.setText(_translate("MainWindow", "存款类型"))
|
||||||
|
self.label_5.setText(_translate("MainWindow", "存款金额:"))
|
||||||
|
self.label_6.setText(_translate("MainWindow", "存款类型:"))
|
||||||
|
self.label_7.setText(_translate("MainWindow", "存款时长:"))
|
||||||
|
self.submit_button.setText(_translate("MainWindow", "确认"))
|
||||||
|
self.current_radio.setText(_translate("MainWindow", "活期"))
|
||||||
|
self.fixed_radio.setText(_translate("MainWindow", "定期"))
|
||||||
|
self.deposit_time.setItemText(0, _translate("MainWindow", "1年"))
|
||||||
|
self.deposit_time.setItemText(1, _translate("MainWindow", "2年"))
|
||||||
|
self.deposit_time.setItemText(2, _translate("MainWindow", "3年"))
|
||||||
|
self.deposit_time.setItemText(3, _translate("MainWindow", "5年"))
|
||||||
|
self.deposit_time.setItemText(4, _translate("MainWindow", "不定期"))
|
||||||
|
self.label_4.setText(_translate("MainWindow", "账户号:"))
|
||||||
|
self.label_8.setText(_translate("MainWindow", "金额:"))
|
||||||
|
self.label_9.setText(_translate("MainWindow", "确认密码:"))
|
||||||
|
self.sure_button1.setText(_translate("MainWindow", "确认"))
|
||||||
|
self.label_10.setText(_translate("MainWindow", "转出账号:"))
|
||||||
|
self.label_11.setText(_translate("MainWindow", "收款人账号:"))
|
||||||
|
self.label_12.setText(_translate("MainWindow", "转出金额:"))
|
||||||
|
self.label_13.setText(_translate("MainWindow", "确认密码:"))
|
||||||
|
self.sure_button2.setText(_translate("MainWindow", "确认"))
|
||||||
|
self.label_14.setText(_translate("MainWindow", "您的账户流水:"))
|
||||||
|
self.label_2.setText(_translate("MainWindow", "神州银行存款利率"))
|
||||||
|
item = self.tableWidget_2.horizontalHeaderItem(0)
|
||||||
|
item.setText(_translate("MainWindow", "存款期限(年)"))
|
||||||
|
item = self.tableWidget_2.horizontalHeaderItem(1)
|
||||||
|
item.setText(_translate("MainWindow", "存款类型"))
|
||||||
|
item = self.tableWidget_2.horizontalHeaderItem(2)
|
||||||
|
item.setText(_translate("MainWindow", "存款利率"))
|
||||||
|
self.label_15.setText(_translate("MainWindow", "欢迎您来到神州银行业务系统"))
|
||||||
|
self.label_17.setText(_translate("MainWindow", "TextLabel"))
|
||||||
|
self.label_18.setText(_translate("MainWindow", "用户须知:"))
|
||||||
|
self.label_19.setText(_translate("MainWindow", "1.保护个人隐私,慎重使用证件号码、银行卡号等个人敏感信息。"))
|
||||||
|
self.label_20.setText(_translate("MainWindow", "2.避免在公共电脑、免费WIFI、公用电话及他人手机使用个人信息。"))
|
||||||
|
self.label_21.setText(_translate("MainWindow", "3.电脑及智能手机应安装并及时更新杀毒软件及个人防火墙。"))
|
||||||
|
self.label_22.setText(_translate("MainWindow", "4.定制短信通知服务,定期检查对账单,随时了解账户资金变动情况。"))
|
||||||
|
self.label_3.setText(_translate("MainWindow", "点击表格可直接进行个人信息修改"))
|
||||||
|
import res_rc
|
@ -0,0 +1,297 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Form implementation generated from reading ui file 'LoginUi.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt5 UI code generator 5.15.9
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_LoginWindow(object):
|
||||||
|
def setupUi(self, LoginWindow):
|
||||||
|
LoginWindow.setObjectName("LoginWindow")
|
||||||
|
LoginWindow.resize(980, 600)
|
||||||
|
LoginWindow.setMinimumSize(QtCore.QSize(0, 0))
|
||||||
|
self.centralwidget = QtWidgets.QWidget(LoginWindow)
|
||||||
|
self.centralwidget.setObjectName("centralwidget")
|
||||||
|
self.frame = QtWidgets.QFrame(self.centralwidget)
|
||||||
|
self.frame.setGeometry(QtCore.QRect(70, 40, 400, 500))
|
||||||
|
self.frame.setStyleSheet("border-image:url(:/images/images/login.png);\n"
|
||||||
|
"border-top-left-radius:30px;\n"
|
||||||
|
"border-bottom-left-radius:30px")
|
||||||
|
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame.setObjectName("frame")
|
||||||
|
self.frame_2 = QtWidgets.QFrame(self.centralwidget)
|
||||||
|
self.frame_2.setGeometry(QtCore.QRect(470, 40, 400, 500))
|
||||||
|
self.frame_2.setStyleSheet("#frame_2{\n"
|
||||||
|
" background-color: rgb(255, 255, 255);\n"
|
||||||
|
" border-top-right-radius:30px;\n"
|
||||||
|
"border-bottom-right-radius:30px;\n"
|
||||||
|
"}")
|
||||||
|
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_2.setObjectName("frame_2")
|
||||||
|
self.pushButton = QtWidgets.QPushButton(self.frame_2)
|
||||||
|
self.pushButton.setGeometry(QtCore.QRect(340, 10, 51, 51))
|
||||||
|
self.pushButton.setStyleSheet("QPushButton{\n"
|
||||||
|
" border:none;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:hover{\n"
|
||||||
|
" padding-bottom:5px;\n"
|
||||||
|
"}\n"
|
||||||
|
"")
|
||||||
|
self.pushButton.setText("")
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(QtGui.QPixmap(":/icons/icons/close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
self.pushButton.setIcon(icon)
|
||||||
|
self.pushButton.setIconSize(QtCore.QSize(40, 40))
|
||||||
|
self.pushButton.setObjectName("pushButton")
|
||||||
|
self.frame_3 = QtWidgets.QFrame(self.frame_2)
|
||||||
|
self.frame_3.setGeometry(QtCore.QRect(0, 70, 399, 419))
|
||||||
|
self.frame_3.setMinimumSize(QtCore.QSize(399, 419))
|
||||||
|
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_3.setObjectName("frame_3")
|
||||||
|
self.verticalLayout = QtWidgets.QVBoxLayout(self.frame_3)
|
||||||
|
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout.setSpacing(0)
|
||||||
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
|
self.frame_4 = QtWidgets.QFrame(self.frame_3)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(10)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_4.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_4.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_4.setObjectName("frame_4")
|
||||||
|
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frame_4)
|
||||||
|
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout_3.setSpacing(0)
|
||||||
|
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||||
|
self.frame_6 = QtWidgets.QFrame(self.frame_4)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(5)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_6.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_6.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_6.setObjectName("frame_6")
|
||||||
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_6)
|
||||||
|
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_2.setSpacing(0)
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
|
self.stackedWidget_2 = QtWidgets.QStackedWidget(self.frame_6)
|
||||||
|
self.stackedWidget_2.setMinimumSize(QtCore.QSize(0, 0))
|
||||||
|
self.stackedWidget_2.setStyleSheet("QLineEdit{\n"
|
||||||
|
" background-color:rgba(255, 255, 255,0);\n"
|
||||||
|
" border:none;\n"
|
||||||
|
" border-bottom:1px solid black;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton{\n"
|
||||||
|
" background-color:rgb(0, 0, 0);\n"
|
||||||
|
" color:rgb(255, 255, 255);\n"
|
||||||
|
" border-radius:8px;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:pressed{\n"
|
||||||
|
" padding-top:5px;\n"
|
||||||
|
" padding-left:5px;\n"
|
||||||
|
"}")
|
||||||
|
self.stackedWidget_2.setObjectName("stackedWidget_2")
|
||||||
|
self.page_Login = QtWidgets.QWidget()
|
||||||
|
self.page_Login.setObjectName("page_Login")
|
||||||
|
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.page_Login)
|
||||||
|
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||||
|
self.login_account = QtWidgets.QLineEdit(self.page_Login)
|
||||||
|
self.login_account.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.login_account.setObjectName("login_account")
|
||||||
|
self.verticalLayout_4.addWidget(self.login_account)
|
||||||
|
self.login_psw = QtWidgets.QLineEdit(self.page_Login)
|
||||||
|
self.login_psw.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.login_psw.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||||
|
self.login_psw.setObjectName("login_psw")
|
||||||
|
self.verticalLayout_4.addWidget(self.login_psw)
|
||||||
|
self.login_sure = QtWidgets.QPushButton(self.page_Login)
|
||||||
|
self.login_sure.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.login_sure.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.login_sure.setObjectName("login_sure")
|
||||||
|
self.verticalLayout_4.addWidget(self.login_sure)
|
||||||
|
self.stackedWidget_2.addWidget(self.page_Login)
|
||||||
|
self.page_Register = QtWidgets.QWidget()
|
||||||
|
self.page_Register.setObjectName("page_Register")
|
||||||
|
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.page_Register)
|
||||||
|
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||||
|
self.register_account = QtWidgets.QLineEdit(self.page_Register)
|
||||||
|
self.register_account.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.register_account.setObjectName("register_account")
|
||||||
|
self.verticalLayout_5.addWidget(self.register_account)
|
||||||
|
self.register_psw = QtWidgets.QLineEdit(self.page_Register)
|
||||||
|
self.register_psw.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.register_psw.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||||
|
self.register_psw.setObjectName("register_psw")
|
||||||
|
self.verticalLayout_5.addWidget(self.register_psw)
|
||||||
|
self.register_psw2 = QtWidgets.QLineEdit(self.page_Register)
|
||||||
|
self.register_psw2.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.register_psw2.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||||
|
self.register_psw2.setObjectName("register_psw2")
|
||||||
|
self.verticalLayout_5.addWidget(self.register_psw2)
|
||||||
|
self.register_sure = QtWidgets.QPushButton(self.page_Register)
|
||||||
|
self.register_sure.setMinimumSize(QtCore.QSize(0, 40))
|
||||||
|
self.register_sure.setStyleSheet("font: 12pt \"幼圆\";")
|
||||||
|
self.register_sure.setObjectName("register_sure")
|
||||||
|
self.verticalLayout_5.addWidget(self.register_sure)
|
||||||
|
self.stackedWidget_2.addWidget(self.page_Register)
|
||||||
|
self.horizontalLayout_2.addWidget(self.stackedWidget_2)
|
||||||
|
self.verticalLayout_3.addWidget(self.frame_6)
|
||||||
|
self.frame_7 = QtWidgets.QFrame(self.frame_4)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_7.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_7.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_7.setStyleSheet("QPushButton{\n"
|
||||||
|
" font: 12pt \"幼圆\";\n"
|
||||||
|
" border:none;\n"
|
||||||
|
"}\n"
|
||||||
|
"QPushButton:pressed{\n"
|
||||||
|
" padding-top:5px;\n"
|
||||||
|
" padding-left:5px;\n"
|
||||||
|
"}")
|
||||||
|
self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_7.setObjectName("frame_7")
|
||||||
|
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_7)
|
||||||
|
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout.setSpacing(0)
|
||||||
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
|
self.login_button = QtWidgets.QPushButton(self.frame_7)
|
||||||
|
self.login_button.setObjectName("login_button")
|
||||||
|
self.horizontalLayout.addWidget(self.login_button)
|
||||||
|
self.line = QtWidgets.QFrame(self.frame_7)
|
||||||
|
self.line.setFrameShape(QtWidgets.QFrame.VLine)
|
||||||
|
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||||
|
self.line.setObjectName("line")
|
||||||
|
self.horizontalLayout.addWidget(self.line)
|
||||||
|
self.register_button = QtWidgets.QPushButton(self.frame_7)
|
||||||
|
self.register_button.setObjectName("register_button")
|
||||||
|
self.horizontalLayout.addWidget(self.register_button)
|
||||||
|
self.verticalLayout_3.addWidget(self.frame_7)
|
||||||
|
self.verticalLayout.addWidget(self.frame_4)
|
||||||
|
self.frame_5 = QtWidgets.QFrame(self.frame_3)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(1)
|
||||||
|
sizePolicy.setHeightForWidth(self.frame_5.sizePolicy().hasHeightForWidth())
|
||||||
|
self.frame_5.setSizePolicy(sizePolicy)
|
||||||
|
self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
|
self.frame_5.setObjectName("frame_5")
|
||||||
|
self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.frame_5)
|
||||||
|
self.horizontalLayout_8.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_8.setSpacing(0)
|
||||||
|
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
|
||||||
|
self.stackedWidget = QtWidgets.QStackedWidget(self.frame_5)
|
||||||
|
self.stackedWidget.setStyleSheet("")
|
||||||
|
self.stackedWidget.setObjectName("stackedWidget")
|
||||||
|
self.page = QtWidgets.QWidget()
|
||||||
|
self.page.setObjectName("page")
|
||||||
|
self.stackedWidget.addWidget(self.page)
|
||||||
|
self.page_6 = QtWidgets.QWidget()
|
||||||
|
self.page_6.setObjectName("page_6")
|
||||||
|
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.page_6)
|
||||||
|
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.horizontalLayout_7.setSpacing(0)
|
||||||
|
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||||
|
self.label_5 = QtWidgets.QLabel(self.page_6)
|
||||||
|
self.label_5.setStyleSheet("color:rgb(255, 0, 0);\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.horizontalLayout_7.addWidget(self.label_5)
|
||||||
|
self.stackedWidget.addWidget(self.page_6)
|
||||||
|
self.page_2 = QtWidgets.QWidget()
|
||||||
|
self.page_2.setObjectName("page_2")
|
||||||
|
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.page_2)
|
||||||
|
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||||
|
self.label = QtWidgets.QLabel(self.page_2)
|
||||||
|
self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||||
|
self.label.setStyleSheet("color:rgb(255, 0, 0);\n"
|
||||||
|
"font: 12pt \"幼圆\";\n"
|
||||||
|
"")
|
||||||
|
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.horizontalLayout_3.addWidget(self.label)
|
||||||
|
self.stackedWidget.addWidget(self.page_2)
|
||||||
|
self.page_4 = QtWidgets.QWidget()
|
||||||
|
self.page_4.setObjectName("page_4")
|
||||||
|
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.page_4)
|
||||||
|
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||||
|
self.label_3 = QtWidgets.QLabel(self.page_4)
|
||||||
|
self.label_3.setStyleSheet("color:rgb(255, 0, 0);\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label_3.setObjectName("label_3")
|
||||||
|
self.horizontalLayout_5.addWidget(self.label_3)
|
||||||
|
self.stackedWidget.addWidget(self.page_4)
|
||||||
|
self.page_5 = QtWidgets.QWidget()
|
||||||
|
self.page_5.setObjectName("page_5")
|
||||||
|
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.page_5)
|
||||||
|
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||||
|
self.label_4 = QtWidgets.QLabel(self.page_5)
|
||||||
|
self.label_4.setStyleSheet("color:rgb(0, 255, 0);\n"
|
||||||
|
"\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.horizontalLayout_6.addWidget(self.label_4)
|
||||||
|
self.stackedWidget.addWidget(self.page_5)
|
||||||
|
self.page_3 = QtWidgets.QWidget()
|
||||||
|
self.page_3.setObjectName("page_3")
|
||||||
|
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.page_3)
|
||||||
|
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||||
|
self.label_2 = QtWidgets.QLabel(self.page_3)
|
||||||
|
self.label_2.setStyleSheet("color:rgb(255, 0, 0);\n"
|
||||||
|
"font: 12pt \"幼圆\";")
|
||||||
|
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.horizontalLayout_4.addWidget(self.label_2)
|
||||||
|
self.stackedWidget.addWidget(self.page_3)
|
||||||
|
self.horizontalLayout_8.addWidget(self.stackedWidget)
|
||||||
|
self.verticalLayout.addWidget(self.frame_5)
|
||||||
|
self.frame_2.raise_()
|
||||||
|
self.frame.raise_()
|
||||||
|
LoginWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.statusbar = QtWidgets.QStatusBar(LoginWindow)
|
||||||
|
self.statusbar.setObjectName("statusbar")
|
||||||
|
LoginWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.retranslateUi(LoginWindow)
|
||||||
|
self.stackedWidget_2.setCurrentIndex(0)
|
||||||
|
self.stackedWidget.setCurrentIndex(0)
|
||||||
|
self.pushButton.clicked.connect(LoginWindow.close) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(LoginWindow)
|
||||||
|
|
||||||
|
def retranslateUi(self, LoginWindow):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
LoginWindow.setWindowTitle(_translate("LoginWindow", "MainWindow"))
|
||||||
|
self.login_account.setPlaceholderText(_translate("LoginWindow", "账号:"))
|
||||||
|
self.login_psw.setPlaceholderText(_translate("LoginWindow", "密码:"))
|
||||||
|
self.login_sure.setText(_translate("LoginWindow", "确认"))
|
||||||
|
self.register_account.setPlaceholderText(_translate("LoginWindow", "输入账号:"))
|
||||||
|
self.register_psw.setPlaceholderText(_translate("LoginWindow", "设置密码:"))
|
||||||
|
self.register_psw2.setPlaceholderText(_translate("LoginWindow", "确认密码:"))
|
||||||
|
self.register_sure.setText(_translate("LoginWindow", "注册"))
|
||||||
|
self.login_button.setText(_translate("LoginWindow", "登录"))
|
||||||
|
self.register_button.setText(_translate("LoginWindow", "注册"))
|
||||||
|
self.label_5.setText(_translate("LoginWindow", "两次输入密码不一致!"))
|
||||||
|
self.label.setText(_translate("LoginWindow", "密码或账号不能为空!"))
|
||||||
|
self.label_3.setText(_translate("LoginWindow", "账号已存在!"))
|
||||||
|
self.label_4.setText(_translate("LoginWindow", "注册成功!"))
|
||||||
|
self.label_2.setText(_translate("LoginWindow", "账号不存在或密码错误!"))
|
||||||
|
import res_rc
|
@ -0,0 +1,591 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>LoginWindow</class>
|
||||||
|
<widget class="QMainWindow" name="LoginWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>980</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>70</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>500</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border-image:url(:/images/images/login.png);
|
||||||
|
border-top-left-radius:30px;
|
||||||
|
border-bottom-left-radius:30px</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>470</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>500</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#frame_2{
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
border-top-right-radius:30px;
|
||||||
|
border-bottom-right-radius:30px;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>340</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>51</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
padding-bottom:5px;
|
||||||
|
}
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="res.qrc">
|
||||||
|
<normaloff>:/icons/icons/close.png</normaloff>:/icons/icons/close.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QFrame" name="frame_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>399</width>
|
||||||
|
<height>419</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>399</width>
|
||||||
|
<height>419</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>10</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_6">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>5</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QStackedWidget" name="stackedWidget_2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QLineEdit{
|
||||||
|
background-color:rgba(255, 255, 255,0);
|
||||||
|
border:none;
|
||||||
|
border-bottom:1px solid black;
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
color:rgb(255, 255, 255);
|
||||||
|
border-radius:8px;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
padding-top:5px;
|
||||||
|
padding-left:5px;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page_Login">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="login_account">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>账号:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="login_psw">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>密码:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="login_sure">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>确认</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_Register">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="register_account">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>输入账号:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="register_psw">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>设置密码:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="register_psw2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>确认密码:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="register_sure">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>注册</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_7">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>1</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{
|
||||||
|
font: 12pt "幼圆";
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
padding-top:5px;
|
||||||
|
padding-left:5px;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="login_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>登录</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="register_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>注册</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_5">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>1</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page"/>
|
||||||
|
<widget class="QWidget" name="page_6">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:rgb(255, 0, 0);
|
||||||
|
font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>两次输入密码不一致!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:rgb(255, 0, 0);
|
||||||
|
font: 12pt "幼圆";
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>密码或账号不能为空!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_4">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:rgb(255, 0, 0);
|
||||||
|
font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>账号已存在!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_5">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:rgb(0, 255, 0);
|
||||||
|
|
||||||
|
font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>注册成功!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:rgb(255, 0, 0);
|
||||||
|
font: 12pt "幼圆";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>账号不存在或密码错误!</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<zorder>frame_2</zorder>
|
||||||
|
<zorder>frame</zorder>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="res.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>pushButton</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>LoginWindow</receiver>
|
||||||
|
<slot>close()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>836</x>
|
||||||
|
<y>73</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>930</x>
|
||||||
|
<y>27</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 830 KiB |
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,624 @@
|
|||||||
|
from PyQt5.QtGui import QStandardItem, QStandardItemModel, QPixmap
|
||||||
|
from PyQt5.QtSql import QSqlTableModel, QSqlDatabase
|
||||||
|
from LoginUi import *
|
||||||
|
from InterfaceUi import *
|
||||||
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QTableView, QWidget, QVBoxLayout, QComboBox, \
|
||||||
|
QButtonGroup, QMessageBox, QRadioButton
|
||||||
|
from PyQt5.QtCore import Qt, QTimer, QTime, QDateTime
|
||||||
|
import sys
|
||||||
|
import pymysql
|
||||||
|
import random
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
user_now=""
|
||||||
|
|
||||||
|
class LoginWindow(QMainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.ui=Ui_LoginWindow()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
#去除边框
|
||||||
|
self.setWindowFlag(QtCore.Qt.FramelessWindowHint)
|
||||||
|
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||||
|
#阴影
|
||||||
|
self.shadow = QtWidgets.QGraphicsDropShadowEffect(self)
|
||||||
|
self.shadow.setOffset(0,0)
|
||||||
|
self.shadow.setBlurRadius(10)
|
||||||
|
self.shadow.setColor(QtCore.Qt.black)
|
||||||
|
self.ui.frame.setGraphicsEffect(self.shadow)
|
||||||
|
#按钮切换登录和注册、以及按登录键实现页面跳转
|
||||||
|
self.ui.login_button.clicked.connect(lambda: self.ui.stackedWidget_2.setCurrentIndex(0))
|
||||||
|
self.ui.register_button.clicked.connect(lambda: self.ui.stackedWidget_2.setCurrentIndex(1))
|
||||||
|
self.ui.login_sure.clicked.connect(self.login_in)
|
||||||
|
self.ui.register_sure.clicked.connect(self.register_in)
|
||||||
|
self.show()
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
if event.button() == Qt.LeftButton:
|
||||||
|
self.drag_position = event.globalPos() - self.frameGeometry().topLeft()
|
||||||
|
event.accept()
|
||||||
|
|
||||||
|
def mouseMoveEvent(self, event):
|
||||||
|
if event.buttons() == Qt.LeftButton:
|
||||||
|
self.move(event.globalPos() - self.drag_position)
|
||||||
|
event.accept()
|
||||||
|
|
||||||
|
def mouseReleaseEvent(self, event):
|
||||||
|
self.drag_position = None
|
||||||
|
|
||||||
|
#注册账号
|
||||||
|
def register_in(self):
|
||||||
|
account = self.ui.register_account.text()
|
||||||
|
password_1 = self.ui.register_psw.text()
|
||||||
|
password_2 = self.ui.register_psw2.text()
|
||||||
|
# 判断是否输入为空
|
||||||
|
if not account or not password_1 or not password_2:
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2) # 设置当前页面索引为空输入错误页面
|
||||||
|
return
|
||||||
|
# 判断账号是否已存在
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute('select cid from customer')
|
||||||
|
rows = cur.fetchall()
|
||||||
|
db.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2) # 设置为数据库错误页面(可以调整索引)
|
||||||
|
return
|
||||||
|
# 提取所有现有账号
|
||||||
|
existing_accounts = [row[0] for row in rows]
|
||||||
|
if account in existing_accounts:
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(3) # 设置当前页面索引为账号已存在错误页面
|
||||||
|
return
|
||||||
|
# 判断两次输入密码是否正确
|
||||||
|
if password_1 == password_2:
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute(f"insert into customer(cid, cpsw) values('{account}', '{password_2}')")
|
||||||
|
db.commit() # 提交事务
|
||||||
|
db.close()
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(4) # 设置当前页面索引为注册成功页面
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2) # 设置为数据库错误页面
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(1) # 设置当前页面索引为密码不匹配错误页面
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
#登录验证
|
||||||
|
def login_in(self):
|
||||||
|
account = self.ui.login_account.text()
|
||||||
|
password = self.ui.login_psw.text()
|
||||||
|
# 检查输入框是否为空
|
||||||
|
if not account or not password:
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2) # 设置当前页面索引为空输入错误页面
|
||||||
|
return
|
||||||
|
account_list = []
|
||||||
|
password_list = []
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute('select cid, cpsw from customer')
|
||||||
|
rows = cur.fetchall()
|
||||||
|
db.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2) # 设置为数据库错误页面(可以调整索引)
|
||||||
|
return
|
||||||
|
for row in rows:
|
||||||
|
account_list.append(row[0])
|
||||||
|
password_list.append(row[1])
|
||||||
|
# 验证账号和密码
|
||||||
|
for i in range(len(account_list)):
|
||||||
|
if account == account_list[i] and password == password_list[i]: # 假设密码是字符串
|
||||||
|
global user_now
|
||||||
|
user_now = account
|
||||||
|
self.win = MainWindow()
|
||||||
|
self.win.show()
|
||||||
|
self.close()
|
||||||
|
return
|
||||||
|
# 如果没有匹配成功
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(5) # 设置当前页面索引为账号或密码错误页面
|
||||||
|
|
||||||
|
|
||||||
|
class MainWindow(QMainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.model = None
|
||||||
|
self.ui=Ui_MainWindow()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
self.initialize_image() #初始化图片
|
||||||
|
try:
|
||||||
|
# 设置定时器
|
||||||
|
self.timer = QTimer(self)
|
||||||
|
self.timer.timeout.connect(self.update_time)
|
||||||
|
self.timer.start(1000) # 每秒更新一次
|
||||||
|
self.update_time() # 初始化时间显示
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
#去除边框
|
||||||
|
self.setWindowFlag(QtCore.Qt.FramelessWindowHint)
|
||||||
|
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||||
|
#阴影
|
||||||
|
self.shadow = QtWidgets.QGraphicsDropShadowEffect(self)
|
||||||
|
self.shadow.setOffset(0,0)
|
||||||
|
self.shadow.setBlurRadius(10)
|
||||||
|
self.shadow.setColor(QtCore.Qt.black)
|
||||||
|
self.ui.frame_6.setGraphicsEffect(self.shadow)
|
||||||
|
#按钮切换到各个操作面
|
||||||
|
self.ui.logout_button.clicked.connect(self.log_out)
|
||||||
|
self.ui.pushButton_home.clicked.connect(self.home_in)
|
||||||
|
self.ui.pushButton_add.clicked.connect(self.add_in)
|
||||||
|
self.ui.pushButton_get.clicked.connect(self.get_out)
|
||||||
|
self.ui.pushButton_transfer.clicked.connect(self.transfer_in)
|
||||||
|
self.ui.pushButton_look.clicked.connect(self.look_in)
|
||||||
|
self.ui.pushButton_irt.clicked.connect(self.irt_in)
|
||||||
|
self.ui.pushButton_info.clicked.connect(self.info_in)
|
||||||
|
self.ui.pushButton_6.clicked.connect(lambda :self.ui.stackedWidget.setCurrentIndex(6))
|
||||||
|
# 创建 tableView 属性,并将其设置为 UI 文件中的 tableView 对象
|
||||||
|
self.tableView = self.ui.tableView # 这里的 self.ui.tableView 是 UI 文件中 tableView 对象的引用
|
||||||
|
self.show()
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
if event.button() == Qt.LeftButton:
|
||||||
|
self.drag_position = event.globalPos() - self.frameGeometry().topLeft()
|
||||||
|
event.accept()
|
||||||
|
|
||||||
|
def mouseMoveEvent(self, event):
|
||||||
|
if event.buttons() == Qt.LeftButton:
|
||||||
|
self.move(event.globalPos() - self.drag_position)
|
||||||
|
event.accept()
|
||||||
|
|
||||||
|
def mouseReleaseEvent(self, event):
|
||||||
|
self.drag_position = None
|
||||||
|
|
||||||
|
def update_time(self):
|
||||||
|
current_time = QTime.currentTime()
|
||||||
|
self.ui.label_17.setText(current_time.toString('hh:mm:ss'))
|
||||||
|
|
||||||
|
def update_time(self):
|
||||||
|
current_date_time = QDateTime.currentDateTime()
|
||||||
|
formatted_time = current_date_time.toString('yyyy-MM-dd hh:mm:ss dddd')
|
||||||
|
self.ui.label_17.setText(formatted_time)
|
||||||
|
|
||||||
|
#初始化图片,应用在info中
|
||||||
|
def initialize_image(self):
|
||||||
|
try:
|
||||||
|
pixmap = QPixmap(":/images/images/123.jpg")
|
||||||
|
self.ui.label_16.setScaledContents(True) # 让图片填充满 QLabel
|
||||||
|
self.ui.label_16.setPixmap(pixmap)
|
||||||
|
#self.ui.label_16.setPixmap(pixmap.scaled(self.ui.label_16.size(), Qt.KeepAspectRatio))
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error loading image: {e}")
|
||||||
|
|
||||||
|
#将account表中数据导出到home界面,使用的是tableWidget
|
||||||
|
def home_in(self):
|
||||||
|
global user_now
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(0)
|
||||||
|
try:
|
||||||
|
# 连接数据库
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute(f"SELECT * FROM account WHERE cid = '{user_now}'")
|
||||||
|
rows = cur.fetchall()
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
|
# 填充表格数据
|
||||||
|
for row_index, row_data in enumerate(rows):
|
||||||
|
for col_index, data in enumerate(row_data):
|
||||||
|
item = QTableWidgetItem(str(data))
|
||||||
|
item.setFlags(item.flags() & ~Qt.ItemIsEditable) # 禁止编辑
|
||||||
|
item.setTextAlignment(Qt.AlignCenter) #居中
|
||||||
|
self.ui.tableWidget.setItem(row_index, col_index, item)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
# 连接数据库或执行查询时出错,可以在界面上显示相应的错误提示
|
||||||
|
|
||||||
|
def add_in(self):
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(1)
|
||||||
|
self.ui.submit_button.clicked.connect(self.add_acc)
|
||||||
|
|
||||||
|
def add_acc(self):
|
||||||
|
global user_now
|
||||||
|
try:
|
||||||
|
accid = self.generator_accid()
|
||||||
|
accbalance = self.ui.get_savings.text()
|
||||||
|
current_date = datetime.now().date()
|
||||||
|
acc_start = current_date.strftime('%Y-%m-%d')
|
||||||
|
cid = user_now
|
||||||
|
acctime = self.ui.deposit_time.currentText()
|
||||||
|
|
||||||
|
# 获取 QGroupBox 中选中的 QRadioButton
|
||||||
|
typebox = self.ui.type_box
|
||||||
|
acctype = None
|
||||||
|
for button in typebox.findChildren(QRadioButton):
|
||||||
|
if button.isChecked():
|
||||||
|
acctype = button
|
||||||
|
break
|
||||||
|
if acctype is None:
|
||||||
|
raise ValueError("未选择账户类型")
|
||||||
|
|
||||||
|
acc_type = acctype.text()
|
||||||
|
|
||||||
|
# 确认选择活期类型时长只能选择不定期
|
||||||
|
if acc_type == "活期" and acctime != "不定期":
|
||||||
|
raise ValueError("活期账户的时长只能选择不定期")
|
||||||
|
|
||||||
|
# 验证输入是否为空
|
||||||
|
if not accbalance or not acc_type or not acctime:
|
||||||
|
raise ValueError("所有输入字段必须填写")
|
||||||
|
|
||||||
|
accbalance_old=accbalance
|
||||||
|
accbalance=int(accbalance)
|
||||||
|
if acc_type=="定期":
|
||||||
|
if acctime=='1年':
|
||||||
|
accbalance=accbalance*(1+0.017)
|
||||||
|
elif acctime=='2年':
|
||||||
|
accbalance=accbalance*(1+0.019)**2
|
||||||
|
elif acctime=='3年':
|
||||||
|
accbalance=accbalance*(1+0.022)**3
|
||||||
|
else:
|
||||||
|
accbalance=accbalance*(1+0.024)**5
|
||||||
|
# 输出到控制台
|
||||||
|
print(accid, accbalance, acc_start, acctime, cid, acc_type)
|
||||||
|
|
||||||
|
|
||||||
|
# 将新账户信息插入数据库
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
query = "INSERT INTO account (accid, accbalance, acctime_start, accdur_time, cid, acc_type) VALUES (%s, %s, %s, %s, %s, %s)"
|
||||||
|
cur.execute(query, (accid, accbalance, acc_start, acctime, cid, acc_type))
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
|
QMessageBox.information(self, "成功", "账户添加成功")
|
||||||
|
except Exception as db_error:
|
||||||
|
print(f"数据库错误: {db_error}")
|
||||||
|
QMessageBox.critical(self, "错误", "添加账户到数据库失败")
|
||||||
|
return
|
||||||
|
|
||||||
|
# 将信息写入文件
|
||||||
|
try:
|
||||||
|
filename = f"{user_now}.txt"
|
||||||
|
if acc_type=="定期":
|
||||||
|
s = f"用户于{acc_start},开通账号:{accid},存取金额为{accbalance_old},期限为{acctime},到期后待取金额为{accbalance:.3f}\n"
|
||||||
|
else:
|
||||||
|
s = f"用户于{acc_start},开通账号:{accid},存取金额为{accbalance_old},期限为{acctime}\n"
|
||||||
|
with open(filename, "a", encoding='UTF-8') as file:
|
||||||
|
file.write(s)
|
||||||
|
file.write("-" * 76 + "\n")
|
||||||
|
print(f"信息已写入文件: {filename}")
|
||||||
|
except Exception as file_error:
|
||||||
|
print(f"文件写入错误: {file_error}")
|
||||||
|
|
||||||
|
# 清空输入框
|
||||||
|
self.ui.get_savings.clear()
|
||||||
|
self.ui.deposit_time.setCurrentIndex(0)
|
||||||
|
for button in typebox.findChildren(QRadioButton):
|
||||||
|
button.setAutoExclusive(False)
|
||||||
|
button.setChecked(False)
|
||||||
|
button.setAutoExclusive(True)
|
||||||
|
|
||||||
|
except ValueError as ve:
|
||||||
|
QMessageBox.critical(self, "错误", str(ve))
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
QMessageBox.critical(self, "错误", f"发生错误: {e}")
|
||||||
|
|
||||||
|
def generator_accid(self):
|
||||||
|
while True:
|
||||||
|
accid = random.randint(10000, 99999)
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute('SELECT * FROM account WHERE accid = %s', (accid,))
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows:
|
||||||
|
db.close()
|
||||||
|
return accid
|
||||||
|
else:
|
||||||
|
print("Accid already exists. Generating a new one.")
|
||||||
|
db.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
return accid
|
||||||
|
|
||||||
|
def get_out(self):
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(2)
|
||||||
|
self.ui.sure_button1.clicked.connect(self.get_money)
|
||||||
|
|
||||||
|
def get_money(self):
|
||||||
|
global user_now
|
||||||
|
accid=self.ui.accid_1.text()
|
||||||
|
savings=self.ui.money_1.text()
|
||||||
|
psw=self.ui.psw_sure1.text()
|
||||||
|
|
||||||
|
self.ui.accid_1.clear()
|
||||||
|
self.ui.money_1.clear()
|
||||||
|
self.ui.psw_sure1.clear()
|
||||||
|
# 检查取款金额是否为空
|
||||||
|
if not savings:
|
||||||
|
QMessageBox.critical(self, "错误", "请输入取款金额")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
# 查询密码是否匹配
|
||||||
|
cur.execute(f"SELECT cpsw FROM customer WHERE cid='{user_now}'")
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows or rows[0] != psw:
|
||||||
|
QMessageBox.critical(self, "错误", "密码错误")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
# 查询账户余额
|
||||||
|
cur.execute(f"SELECT accbalance, acc_type FROM account WHERE accid='{accid}' AND cid='{user_now}'")
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows:
|
||||||
|
QMessageBox.critical(self, "错误", "账户不存在或不属于当前用户")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
accbalance, acc_type = rows
|
||||||
|
|
||||||
|
# 检查账户类型是否是活期
|
||||||
|
if acc_type != "活期":
|
||||||
|
QMessageBox.critical(self, "错误", "账户类型不是活期,无法取款")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# 检查余额是否足够
|
||||||
|
if float(accbalance) < float(savings):
|
||||||
|
QMessageBox.critical(self, "错误", "账户余额不足")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# 更新账户余额
|
||||||
|
new_balance = float(accbalance) - float(savings)
|
||||||
|
cur.execute(f"UPDATE account SET accbalance={new_balance} WHERE accid='{accid}' AND cid='{user_now}'")
|
||||||
|
db.commit()
|
||||||
|
QMessageBox.information(self, "成功", f"成功取款 {savings} 元,当前余额为 {new_balance} 元")
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
current_date = datetime.now().date()
|
||||||
|
acctime= current_date.strftime('%Y-%m-%d')
|
||||||
|
# 将信息写入文件
|
||||||
|
try:
|
||||||
|
filename = f"{user_now}.txt"
|
||||||
|
s = f"用户于{acctime},在账户{accid},取款{savings}元,当前余额为{new_balance}元\n"
|
||||||
|
with open(filename, "a", encoding='UTF-8') as file:
|
||||||
|
file.write(s)
|
||||||
|
file.write("-" * 76 + "\n")
|
||||||
|
print(f"信息已写入文件: {filename}")
|
||||||
|
except Exception as file_error:
|
||||||
|
print(f"文件写入错误: {file_error}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"数据库错误: {e}")
|
||||||
|
QMessageBox.critical(self, "错误", "数据库错误")
|
||||||
|
|
||||||
|
|
||||||
|
def transfer_in(self):
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(3)
|
||||||
|
self.ui.sure_button2.clicked.connect(self.transfer)
|
||||||
|
|
||||||
|
def transfer(self):
|
||||||
|
out_account = self.ui.out_accid.text()
|
||||||
|
in_account = self.ui.in_accid.text()
|
||||||
|
out_saving = self.ui.out_money.text()
|
||||||
|
psw = self.ui.sure_psw2.text()
|
||||||
|
|
||||||
|
self.ui.out_accid.clear()
|
||||||
|
self.ui.in_accid.clear()
|
||||||
|
self.ui.out_money.clear()
|
||||||
|
self.ui.sure_psw2.clear()
|
||||||
|
|
||||||
|
# 检查输入是否为空
|
||||||
|
if not out_account or not in_account or not out_saving or not psw:
|
||||||
|
QMessageBox.critical(self, "错误", "请输入完整信息")
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
|
||||||
|
# 查询密码是否匹配
|
||||||
|
cur.execute(f"SELECT cpsw FROM customer WHERE cid='{user_now}'")
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows or rows[0] != psw:
|
||||||
|
QMessageBox.critical(self, "错误", "密码错误")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# 查询转出账号是否存在并且是活期类型
|
||||||
|
cur.execute(
|
||||||
|
f"SELECT accbalance FROM account WHERE accid='{out_account}' AND cid='{user_now}' AND acc_type='活期'")
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows:
|
||||||
|
QMessageBox.critical(self, "错误", "转出账号不存在或不是活期类型")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
out_balance = float(rows[0])
|
||||||
|
|
||||||
|
# 检查转出金额是否大于转出账号余额
|
||||||
|
if float(out_saving) > out_balance:
|
||||||
|
QMessageBox.critical(self, "错误", "转出账号余额不足")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# 查询收款账号是否存在并且是活期类型
|
||||||
|
cur.execute(f"SELECT acc_type FROM account WHERE accid='{in_account}' AND acc_type='活期'")
|
||||||
|
rows = cur.fetchone()
|
||||||
|
if not rows:
|
||||||
|
QMessageBox.critical(self, "错误", "收款账号不存在或不是活期类型")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# 更新转出账号余额和收款账号余额
|
||||||
|
new_out_balance = out_balance - float(out_saving)
|
||||||
|
cur.execute(
|
||||||
|
f"UPDATE account SET accbalance={new_out_balance} WHERE accid='{out_account}' AND cid='{user_now}'")
|
||||||
|
cur.execute(f"UPDATE account SET accbalance=accbalance+{out_saving} WHERE accid='{in_account}'")
|
||||||
|
|
||||||
|
# 获取收款账号所属用户的cid和新余额
|
||||||
|
cur.execute(f"SELECT cid FROM account WHERE accid='{in_account}'")
|
||||||
|
row = cur.fetchone()
|
||||||
|
if not row:
|
||||||
|
QMessageBox.critical(self, "错误", "获取收款账号信息失败")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
recipient_cid = row[0]
|
||||||
|
|
||||||
|
cur.execute(f"SELECT accbalance FROM account WHERE accid='{in_account}'")
|
||||||
|
row = cur.fetchone()
|
||||||
|
if not row:
|
||||||
|
QMessageBox.critical(self, "错误", "获取收款账号余额失败")
|
||||||
|
db.close()
|
||||||
|
return
|
||||||
|
new_in_balance = float(row[0])
|
||||||
|
|
||||||
|
db.commit()
|
||||||
|
QMessageBox.information(self, "成功", f"成功转账 {out_saving} 元到账户 {in_account}")
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
# 写入转账信息到文件
|
||||||
|
try:
|
||||||
|
current_date = datetime.now().date()
|
||||||
|
acctime = current_date.strftime('%Y-%m-%d')
|
||||||
|
filename1 = f"{user_now}.txt"
|
||||||
|
filename2 = f"{recipient_cid}.txt"
|
||||||
|
out_info = f"用户于{acctime},账号:{out_account}转给{in_account}, {out_saving}元,当前余额为{new_out_balance}元\n"
|
||||||
|
in_info = f"用户于{acctime},账号:{in_account} 收到{out_saving}元,当前余额为{new_in_balance}元\n"
|
||||||
|
|
||||||
|
with open(filename1, "a", encoding='UTF-8') as file1:
|
||||||
|
file1.write(out_info)
|
||||||
|
file1.write("-" * 76 + "\n")
|
||||||
|
with open(filename2, "a", encoding='UTF-8') as file2:
|
||||||
|
file2.write(in_info)
|
||||||
|
file2.write("-" * 76 + "\n")
|
||||||
|
print(f"信息已写入文件: {filename1} 和 {filename2}")
|
||||||
|
except Exception as file_error:
|
||||||
|
print(f"文件写入错误: {file_error}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"数据库错误: {e}")
|
||||||
|
QMessageBox.critical(self, "错误", "数据库错误")
|
||||||
|
|
||||||
|
def look_in(self):
|
||||||
|
try:
|
||||||
|
global user_now
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(4)
|
||||||
|
textname=f"{user_now}.txt"
|
||||||
|
with open(textname,'r',encoding='utf-8') as f:
|
||||||
|
f.seek(0)
|
||||||
|
str=f.read()
|
||||||
|
self.ui.textEdit.setPlainText(str)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
def irt_in(self):
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(5)
|
||||||
|
try:
|
||||||
|
# 连接数据库
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute("SELECT * FROM irt")
|
||||||
|
rows = cur.fetchall()
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
|
# 设置表格行数
|
||||||
|
self.ui.tableWidget_2.setRowCount(len(rows))
|
||||||
|
# 填充表格数据
|
||||||
|
for row_index, row_data in enumerate(rows):
|
||||||
|
for col_index, data in enumerate(row_data):
|
||||||
|
item = QTableWidgetItem(str(data))
|
||||||
|
item.setFlags(item.flags() & ~Qt.ItemIsEditable) # 禁止编辑
|
||||||
|
item.setTextAlignment(Qt.AlignCenter) # 居中
|
||||||
|
self.ui.tableWidget_2.setItem(row_index, col_index, item)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Database error: {e}")
|
||||||
|
# 连接数据库或执行查询时出错,可以在界面上显示相应的错误提示
|
||||||
|
|
||||||
|
def info_in(self):
|
||||||
|
try:
|
||||||
|
# 切换到包含 QTableView 的页面
|
||||||
|
self.ui.stackedWidget.setCurrentIndex(7)
|
||||||
|
# 设置模型
|
||||||
|
self.model = QStandardItemModel(0, 7)
|
||||||
|
self.model.setHorizontalHeaderLabels(['身份证号', '姓名', '性别', '年龄', '电话号码', '户籍', '密码'])
|
||||||
|
self.tableView.setModel(self.model)
|
||||||
|
# 加载数据
|
||||||
|
self.load_data()
|
||||||
|
# 使表格可编辑
|
||||||
|
self.tableView.setEditTriggers(QTableView.AllEditTriggers)
|
||||||
|
# 捕捉模型数据改变信号
|
||||||
|
self.model.itemChanged.connect(self.update_database)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error in info_in: {e}")
|
||||||
|
|
||||||
|
# 连接 MySQL 并获取数据
|
||||||
|
def load_data(self):
|
||||||
|
global user_now
|
||||||
|
try:
|
||||||
|
connection = pymysql.connect(
|
||||||
|
host='127.0.0.1',
|
||||||
|
user='root',
|
||||||
|
password='20021220',
|
||||||
|
database='pybank'
|
||||||
|
)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
cursor.execute(f"SELECT * FROM customer where cid='{user_now}'")
|
||||||
|
data = cursor.fetchall()
|
||||||
|
cursor.close()
|
||||||
|
connection.close()
|
||||||
|
for row in data:
|
||||||
|
items = [QStandardItem(str(field)) for field in row]
|
||||||
|
for item in items:
|
||||||
|
item.setTextAlignment(Qt.AlignCenter)
|
||||||
|
self.model.appendRow(items)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error loading data: {e}")
|
||||||
|
def update_database(self, item):
|
||||||
|
row = item.row()
|
||||||
|
col = item.column()
|
||||||
|
new_value = item.text()
|
||||||
|
print(row, col, new_value)
|
||||||
|
try:
|
||||||
|
# 获取主键(第一列是主键)
|
||||||
|
primary_key = self.model.item(row, 0).text()
|
||||||
|
# 映射列名
|
||||||
|
columns = ['cid', 'cname', 'csex', 'cage', 'cnumber', 'caddress', 'cpsw']
|
||||||
|
column_name = columns[col]
|
||||||
|
# 更新数据库
|
||||||
|
connection = pymysql.connect(
|
||||||
|
host='127.0.0.1',
|
||||||
|
user='root',
|
||||||
|
password='20021220',
|
||||||
|
database='pybank'
|
||||||
|
)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
query = f"UPDATE customer SET {column_name} = %s WHERE cid = %s"
|
||||||
|
cursor.execute(query, (new_value, primary_key))
|
||||||
|
connection.commit()
|
||||||
|
cursor.close()
|
||||||
|
connection.close()
|
||||||
|
print(f"Updated row {row}, column {col} with new value {new_value}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error updating database: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
#退出当前账号回到登录界面
|
||||||
|
def log_out(self):
|
||||||
|
global user_now
|
||||||
|
self.close()
|
||||||
|
self.login = LoginWindow()
|
||||||
|
user_now = ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
win = LoginWindow()
|
||||||
|
sys.exit(app.exec_())
|
@ -0,0 +1,14 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="icons">
|
||||||
|
<file>icons/minimize.png</file>
|
||||||
|
<file>icons/close_3.png</file>
|
||||||
|
<file>icons/close.png</file>
|
||||||
|
<file>icons/close_2.png</file>
|
||||||
|
<file>icons/exit.png</file>
|
||||||
|
<file>icons/mini.png</file>
|
||||||
|
</qresource>
|
||||||
|
<qresource prefix="images">
|
||||||
|
<file>images/123.jpg</file>
|
||||||
|
<file>images/login.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@ -0,0 +1,141 @@
|
|||||||
|
'''
|
||||||
|
import sys
|
||||||
|
import pymysql
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
from PyQt5.QtGui import QStandardItemModel, QStandardItem
|
||||||
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QTableView
|
||||||
|
|
||||||
|
class MainWindow(QMainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setWindowTitle("Personal Information")
|
||||||
|
# 创建 QTableView delete
|
||||||
|
self.table_view = QTableView(self)
|
||||||
|
self.setCentralWidget(self.table_view)
|
||||||
|
# 设置模型
|
||||||
|
self.model = QStandardItemModel(0, 7)
|
||||||
|
self.model.setHorizontalHeaderLabels(['身份证号','用户名', '性别', '用户年龄', '电话号码','户籍','密码'])
|
||||||
|
self.table_view.setModel(self.model)
|
||||||
|
# 加载数据
|
||||||
|
self.load_data()
|
||||||
|
# 使表格可编辑
|
||||||
|
self.table_view.setEditTriggers(QTableView.AllEditTriggers)
|
||||||
|
# 捕捉模型数据改变信号
|
||||||
|
self.model.itemChanged.connect(self.update_database)
|
||||||
|
|
||||||
|
|
||||||
|
#connect mysql and enquire database data
|
||||||
|
def load_data(self):
|
||||||
|
try:
|
||||||
|
connection = pymysql.connect(
|
||||||
|
host='127.0.0.1',
|
||||||
|
user='root',
|
||||||
|
password='20021220',
|
||||||
|
database='pybank'
|
||||||
|
)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
cursor.execute("SELECT * FROM customer")
|
||||||
|
data = cursor.fetchall()
|
||||||
|
cursor.close()
|
||||||
|
connection.close()
|
||||||
|
for row in data:
|
||||||
|
items = [QStandardItem(str(field)) for field in row]
|
||||||
|
for item in items:
|
||||||
|
item.setTextAlignment(Qt.AlignCenter)
|
||||||
|
self.model.appendRow(items)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error loading data: {e}")
|
||||||
|
|
||||||
|
def update_database(self, item):
|
||||||
|
row = item.row()
|
||||||
|
col = item.column()
|
||||||
|
new_value = item.text()
|
||||||
|
|
||||||
|
print(row,col,new_value)
|
||||||
|
try:
|
||||||
|
# 获取主键(第一列是主键)
|
||||||
|
primary_key = self.model.item(row, 0).text()
|
||||||
|
#map column names
|
||||||
|
columns=['cid', 'cname', 'csex', 'cage', 'cnumber', 'caddress', 'cpsw']
|
||||||
|
column_name=columns[col]
|
||||||
|
# 更新数据库
|
||||||
|
connection = pymysql.connect(
|
||||||
|
host='127.0.0.1',
|
||||||
|
user='root',
|
||||||
|
password='20021220',
|
||||||
|
database='pybank'
|
||||||
|
)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
query = f"UPDATE account SET {column_name} = %s WHERE cid = %s"
|
||||||
|
cursor.execute(query, (new_value, primary_key))
|
||||||
|
connection.commit()
|
||||||
|
cursor.close()
|
||||||
|
connection.close()
|
||||||
|
print(f"Updated row {row}, column {col} with new value {new_value}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error updating database: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
main_window = MainWindow()
|
||||||
|
main_window.resize(800, 600)
|
||||||
|
main_window.show()
|
||||||
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def add_acc(self):
|
||||||
|
global user_now
|
||||||
|
try:
|
||||||
|
accid = self.generator_accid()
|
||||||
|
accbalance = self.ui.get_savings.text()
|
||||||
|
current_date = datetime.now().date()
|
||||||
|
acc_start = current_date.strftime('%Y-%m-%d')
|
||||||
|
cid = user_now
|
||||||
|
acctime = self.ui.deposit_time.currentText()
|
||||||
|
# 获取 QGroupBox 中选中的 QRadioButton
|
||||||
|
typebox = self.ui.type_box
|
||||||
|
acctype = None
|
||||||
|
for button in typebox.findChildren(QRadioButton):
|
||||||
|
if button.isChecked():
|
||||||
|
acctype = button
|
||||||
|
break
|
||||||
|
if acctype is None:
|
||||||
|
raise ValueError("未选择账户类型")
|
||||||
|
return
|
||||||
|
acc_type = acctype.text()
|
||||||
|
# 确认选择活期类型时长只能选择不定期
|
||||||
|
if acc_type == "活期" and acctime != "不定期":
|
||||||
|
raise ValueError("活期账户的时长只能选择不定期")
|
||||||
|
return
|
||||||
|
# 输出到控制台
|
||||||
|
print(accid, accbalance, acc_start, acctime, cid, acc_type)
|
||||||
|
# 将新账户信息插入数据库
|
||||||
|
try:
|
||||||
|
db = pymysql.connect(host='127.0.0.1', user='root', password='20021220', database='pybank')
|
||||||
|
cur = db.cursor()
|
||||||
|
query = "INSERT INTO account (accid, accbalance, acctime_start, accdur_time, cid, acc_type) VALUES (%s, %s, %s, %s, %s, %s)"
|
||||||
|
cur.execute(query, (accid, accbalance, acc_start, acctime, cid, acc_type))
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
|
QMessageBox.information(self, "成功", "账户添加成功")
|
||||||
|
except Exception as db_error:
|
||||||
|
print(f"数据库错误: {db_error}")
|
||||||
|
QMessageBox.critical(self, "错误", "添加账户到数据库失败")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
QMessageBox.critical(self, "错误", f"发生错误: {e}")
|
||||||
|
|
||||||
|
# 将信息写入文件
|
||||||
|
try:
|
||||||
|
filename = f"{user_now}.txt"
|
||||||
|
s = f"用户于{acc_start},开通账号:{accid},存取金额为{accbalance},期限为{acctime}\n"
|
||||||
|
with open(filename, "a", encoding='UTF-8') as file:
|
||||||
|
file.write(s)
|
||||||
|
file.write("-" * 60 + "\n")
|
||||||
|
print(f"信息已写入文件: {filename}")
|
||||||
|
except Exception as file_error:
|
||||||
|
print(f"文件写入错误: {file_error}")
|
||||||
|
self.ui.get_savings.clear()
|