周末总是在吃的方面,及其纠结,今天来制作一个点单小程序,加入自己喜欢吃的东西,来慢慢挑选,让每个周末快乐无限!
一.安装环境
python 3.7.8
QT
xlrd、xlwt库使用pip接口进行安装
pip install xlrd
pip install xlwt
二.实例
1.首先我们需要先制作一个UI界面出来,这边用到了Qt来实现,代码如下
class Ui_MainWindow(object):def setupUi(self, MainWindow):MainWindow.setObjectName("MainWindow")MainWindow.resize(511, 619)self.centralwidget = QtWidgets.QWidget(MainWindow)self.centralwidget.setObjectName("centralwidget")self.scrollArea = QtWidgets.QScrollArea(self.centralwidget)self.scrollArea.setGeometry(QtCore.QRect(0, 0, 511, 111))self.scrollArea.setStyleSheet("background-color: rgb(85, 170, 127);")self.scrollArea.setWidgetResizable(True)self.scrollArea.setObjectName("scrollArea")self.scrollAreaWidgetContents = QtWidgets.QWidget()self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 509, 109))self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")self.label = QtWidgets.QLabel(self.scrollAreaWidgetContents)self.label.setGeometry(QtCore.QRect(10, 30, 54, 51))self.label.setStyleSheet("border-image: url(:/新前缀/1684916689129.png);")self.label.setText("")self.label.setObjectName("label")self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents)self.label_2.setGeometry(QtCore.QRect(70, 50, 81, 31))self.label_2.setStyleSheet("background-color: rgb(170, 170, 255);")self.label_2.setObjectName("label_2")self.label_4 = QtWidgets.QLabel(self.scrollAreaWidgetContents)self.label_4.setGeometry(QtCore.QRect(433, 10, 61, 41))self.label_4.setStyleSheet("border-image: url(:/新前缀/1684916954341.png);")self.label_4.setText("")self.label_4.setObjectName("label_4")self.label_5 = QtWidgets.QLabel(self.scrollAreaWidgetContents)self.label_5.setGeometry(QtCore.QRect(353, 10, 61, 41))self.label_5.setStyleSheet("border-image: url(:/BACK/1684917571038.png);")self.label_5.setText("")self.label_5.setObjectName("label_5")self.toolButton = QtWidgets.QToolButton(self.scrollAreaWidgetContents)self.toolButton.setGeometry(QtCore.QRect(350, 60, 71, 31))self.toolButton.setObjectName("toolButton")self.toolButton_2 = QtWidgets.QToolButton(self.scrollAreaWidgetContents)self.toolButton_2.setGeometry(QtCore.QRect(430, 60, 71, 31))self.toolButton_2.setObjectName("toolButton_2")self.scrollArea.setWidget(self.scrollAreaWidgetContents)self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)self.tabWidget.setGeometry(QtCore.QRect(0, 112, 511, 401))self.tabWidget.setObjectName("tabWidget")self.Staple_food = QtWidgets.QWidget()self.Staple_food.setObjectName("Staple_food")self.scrollArea_2 = QtWidgets.QScrollArea(self.Staple_food)self.scrollArea_2.setGeometry(QtCore.QRect(10, 10, 481, 361))self.scrollArea_2.setWidgetResizable(True)self.scrollArea_2.setObjectName("scrollArea_2")self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 462, 1100))self.scrollAreaWidgetContents_2.setMinimumSize(QtCore.QSize(0, 1100))self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")self.scrollArea_3 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_3.setGeometry(QtCore.QRect(30, 20, 421, 81))self.scrollArea_3.setWidgetResizable(True)self.scrollArea_3.setObjectName("scrollArea_3")self.scrollAreaWidgetContents_3 = QtWidgets.QWidget()self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3")self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)self.label_3.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_3.setStyleSheet("border-image: url(:/新前缀/1684918877698.png);")self.label_3.setText("")self.label_3.setObjectName("label_3")self.label_6 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)self.label_6.setGeometry(QtCore.QRect(210, 20, 81, 41))font = QtGui.QFont()font.setPointSize(20)self.label_6.setFont(font)self.label_6.setObjectName("label_6")self.pushButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents_3)self.pushButton.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton.setText("")self.pushButton.setObjectName("pushButton")self.label_15 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)self.label_15.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_15.setObjectName("label_15")self.pushButton_6 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_3)self.pushButton_6.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_6.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_6.setText("")self.pushButton_6.setObjectName("pushButton_6")self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3)self.scrollArea_4 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_4.setGeometry(QtCore.QRect(30, 140, 421, 81))self.scrollArea_4.setWidgetResizable(True)self.scrollArea_4.setObjectName("scrollArea_4")self.scrollAreaWidgetContents_4 = QtWidgets.QWidget()self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4")self.label_7 = QtWidgets.QLabel(self.scrollAreaWidgetContents_4)self.label_7.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_7.setStyleSheet("border-image: url(:/新前缀/1684919893294.png);")self.label_7.setText("")self.label_7.setObjectName("label_7")self.label_8 = QtWidgets.QLabel(self.scrollAreaWidgetContents_4)self.label_8.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_8.setFont(font)self.label_8.setObjectName("label_8")self.pushButton_2 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_4)self.pushButton_2.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_2.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_2.setText("")self.pushButton_2.setObjectName("pushButton_2")self.label_16 = QtWidgets.QLabel(self.scrollAreaWidgetContents_4)self.label_16.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_16.setObjectName("label_16")self.pushButton_7 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_4)self.pushButton_7.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_7.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_7.setText("")self.pushButton_7.setObjectName("pushButton_7")self.scrollArea_4.setWidget(self.scrollAreaWidgetContents_4)self.scrollArea_5 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_5.setGeometry(QtCore.QRect(30, 260, 421, 81))self.scrollArea_5.setWidgetResizable(True)self.scrollArea_5.setObjectName("scrollArea_5")self.scrollAreaWidgetContents_6 = QtWidgets.QWidget()self.scrollAreaWidgetContents_6.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_6.setObjectName("scrollAreaWidgetContents_6")self.label_11 = QtWidgets.QLabel(self.scrollAreaWidgetContents_6)self.label_11.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_11.setStyleSheet("border-image: url(:/新前缀/1684919988567.png);")self.label_11.setText("")self.label_11.setObjectName("label_11")self.label_12 = QtWidgets.QLabel(self.scrollAreaWidgetContents_6)self.label_12.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_12.setFont(font)self.label_12.setObjectName("label_12")self.pushButton_4 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_6)self.pushButton_4.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_4.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_4.setText("")self.pushButton_4.setObjectName("pushButton_4")self.label_17 = QtWidgets.QLabel(self.scrollAreaWidgetContents_6)self.label_17.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_17.setObjectName("label_17")self.pushButton_8 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_6)self.pushButton_8.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_8.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_8.setText("")self.pushButton_8.setObjectName("pushButton_8")self.scrollArea_5.setWidget(self.scrollAreaWidgetContents_6)self.scrollArea_6 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_6.setGeometry(QtCore.QRect(30, 380, 421, 81))self.scrollArea_6.setWidgetResizable(True)self.scrollArea_6.setObjectName("scrollArea_6")self.scrollAreaWidgetContents_7 = QtWidgets.QWidget()self.scrollAreaWidgetContents_7.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_7.setObjectName("scrollAreaWidgetContents_7")self.label_13 = QtWidgets.QLabel(self.scrollAreaWidgetContents_7)self.label_13.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_13.setStyleSheet("border-image: url(:/新前缀/1684920456823.png);")self.label_13.setText("")self.label_13.setObjectName("label_13")self.label_14 = QtWidgets.QLabel(self.scrollAreaWidgetContents_7)self.label_14.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_14.setFont(font)self.label_14.setObjectName("label_14")self.pushButton_5 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_7)self.pushButton_5.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_5.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_5.setText("")self.pushButton_5.setObjectName("pushButton_5")self.pushButton_9 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_7)self.pushButton_9.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_9.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_9.setText("")self.pushButton_9.setObjectName("pushButton_9")self.scrollArea_6.setWidget(self.scrollAreaWidgetContents_7)self.scrollArea_7 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_7.setGeometry(QtCore.QRect(30, 500, 421, 81))self.scrollArea_7.setWidgetResizable(True)self.scrollArea_7.setObjectName("scrollArea_7")self.scrollAreaWidgetContents_9 = QtWidgets.QWidget()self.scrollAreaWidgetContents_9.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_9.setObjectName("scrollAreaWidgetContents_9")self.label_20 = QtWidgets.QLabel(self.scrollAreaWidgetContents_9)self.label_20.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_20.setStyleSheet("border-image: url(:/新前缀/1684977055363.png);")self.label_20.setText("")self.label_20.setObjectName("label_20")self.label_21 = QtWidgets.QLabel(self.scrollAreaWidgetContents_9)self.label_21.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_21.setFont(font)self.label_21.setObjectName("label_21")self.pushButton_12 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_9)self.pushButton_12.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_12.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_12.setText("")self.pushButton_12.setObjectName("pushButton_12")self.pushButton_13 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_9)self.pushButton_13.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_13.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_13.setText("")self.pushButton_13.setObjectName("pushButton_13")self.scrollArea_7.setWidget(self.scrollAreaWidgetContents_9)self.scrollArea_8 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_8.setGeometry(QtCore.QRect(30, 620, 421, 81))self.scrollArea_8.setWidgetResizable(True)self.scrollArea_8.setObjectName("scrollArea_8")self.scrollAreaWidgetContents_10 = QtWidgets.QWidget()self.scrollAreaWidgetContents_10.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_10.setObjectName("scrollAreaWidgetContents_10")self.label_22 = QtWidgets.QLabel(self.scrollAreaWidgetContents_10)self.label_22.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_22.setStyleSheet("border-image: url(:/新前缀/1684977425475.png);")self.label_22.setText("")self.label_22.setObjectName("label_22")self.label_23 = QtWidgets.QLabel(self.scrollAreaWidgetContents_10)self.label_23.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_23.setFont(font)self.label_23.setObjectName("label_23")self.pushButton_14 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_10)self.pushButton_14.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_14.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_14.setText("")self.pushButton_14.setObjectName("pushButton_14")self.pushButton_15 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_10)self.pushButton_15.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_15.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_15.setText("")self.pushButton_15.setObjectName("pushButton_15")self.scrollArea_8.setWidget(self.scrollAreaWidgetContents_10)self.scrollArea_9 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_9.setGeometry(QtCore.QRect(30, 740, 421, 81))self.scrollArea_9.setWidgetResizable(True)self.scrollArea_9.setObjectName("scrollArea_9")self.scrollAreaWidgetContents_11 = QtWidgets.QWidget()self.scrollAreaWidgetContents_11.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_11.setObjectName("scrollAreaWidgetContents_11")self.label_24 = QtWidgets.QLabel(self.scrollAreaWidgetContents_11)self.label_24.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_24.setStyleSheet("border-image: url(:/新前缀/1684977503374.png);")self.label_24.setText("")self.label_24.setObjectName("label_24")self.label_25 = QtWidgets.QLabel(self.scrollAreaWidgetContents_11)self.label_25.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_25.setFont(font)self.label_25.setObjectName("label_25")self.pushButton_16 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_11)self.pushButton_16.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_16.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_16.setText("")self.pushButton_16.setObjectName("pushButton_16")self.pushButton_17 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_11)self.pushButton_17.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_17.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_17.setText("")self.pushButton_17.setObjectName("pushButton_17")self.scrollArea_9.setWidget(self.scrollAreaWidgetContents_11)self.scrollArea_10 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_10.setGeometry(QtCore.QRect(30, 860, 421, 81))self.scrollArea_10.setWidgetResizable(True)self.scrollArea_10.setObjectName("scrollArea_10")self.scrollAreaWidgetContents_12 = QtWidgets.QWidget()self.scrollAreaWidgetContents_12.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_12.setObjectName("scrollAreaWidgetContents_12")self.label_26 = QtWidgets.QLabel(self.scrollAreaWidgetContents_12)self.label_26.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_26.setStyleSheet("border-image: url(:/新前缀/1684977236635.png);")self.label_26.setText("")self.label_26.setObjectName("label_26")self.label_27 = QtWidgets.QLabel(self.scrollAreaWidgetContents_12)self.label_27.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_27.setFont(font)self.label_27.setObjectName("label_27")self.pushButton_18 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_12)self.pushButton_18.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_18.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_18.setText("")self.pushButton_18.setObjectName("pushButton_18")self.pushButton_19 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_12)self.pushButton_19.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_19.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_19.setText("")self.pushButton_19.setObjectName("pushButton_19")self.scrollArea_10.setWidget(self.scrollAreaWidgetContents_12)self.scrollArea_11 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_11.setGeometry(QtCore.QRect(30, 980, 421, 81))self.scrollArea_11.setWidgetResizable(True)self.scrollArea_11.setObjectName("scrollArea_11")self.scrollAreaWidgetContents_13 = QtWidgets.QWidget()self.scrollAreaWidgetContents_13.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_13.setObjectName("scrollAreaWidgetContents_13")self.label_28 = QtWidgets.QLabel(self.scrollAreaWidgetContents_13)self.label_28.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_28.setStyleSheet("border-image: url(:/新前缀/1684977358561.png);")self.label_28.setText("")self.label_28.setObjectName("label_28")self.label_29 = QtWidgets.QLabel(self.scrollAreaWidgetContents_13)self.label_29.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_29.setFont(font)self.label_29.setObjectName("label_29")self.pushButton_20 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_13)self.pushButton_20.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_20.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_20.setText("")self.pushButton_20.setObjectName("pushButton_20")self.pushButton_21 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_13)self.pushButton_21.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_21.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_21.setText("")self.pushButton_21.setObjectName("pushButton_21")self.scrollArea_11.setWidget(self.scrollAreaWidgetContents_13)self.scrollArea_12 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_2)self.scrollArea_12.setGeometry(QtCore.QRect(30, 1100, 421, 81))self.scrollArea_12.setWidgetResizable(True)self.scrollArea_12.setObjectName("scrollArea_12")self.scrollAreaWidgetContents_14 = QtWidgets.QWidget()self.scrollAreaWidgetContents_14.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_14.setObjectName("scrollAreaWidgetContents_14")self.label_30 = QtWidgets.QLabel(self.scrollAreaWidgetContents_14)self.label_30.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_30.setStyleSheet("border-image: url(:/新前缀/1684977055363.png);")self.label_30.setText("")self.label_30.setObjectName("label_30")self.label_31 = QtWidgets.QLabel(self.scrollAreaWidgetContents_14)self.label_31.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_31.setFont(font)self.label_31.setObjectName("label_31")self.pushButton_22 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_14)self.pushButton_22.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_22.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_22.setText("")self.pushButton_22.setObjectName("pushButton_22")self.pushButton_23 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_14)self.pushButton_23.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_23.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_23.setText("")self.pushButton_23.setObjectName("pushButton_23")self.scrollArea_12.setWidget(self.scrollAreaWidgetContents_14)self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)self.tabWidget.addTab(self.Staple_food, "")self.tab_2 = QtWidgets.QWidget()self.tab_2.setObjectName("tab_2")self.scrollArea_13 = QtWidgets.QScrollArea(self.tab_2)self.scrollArea_13.setGeometry(QtCore.QRect(10, 10, 481, 381))self.scrollArea_13.setWidgetResizable(True)self.scrollArea_13.setObjectName("scrollArea_13")self.scrollAreaWidgetContents_15 = QtWidgets.QWidget()self.scrollAreaWidgetContents_15.setGeometry(QtCore.QRect(0, 0, 462, 500))self.scrollAreaWidgetContents_15.setMinimumSize(QtCore.QSize(0, 500))self.scrollAreaWidgetContents_15.setObjectName("scrollAreaWidgetContents_15")self.scrollArea_14 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_15)self.scrollArea_14.setGeometry(QtCore.QRect(30, 20, 421, 81))self.scrollArea_14.setWidgetResizable(True)self.scrollArea_14.setObjectName("scrollArea_14")self.scrollAreaWidgetContents_16 = QtWidgets.QWidget()self.scrollAreaWidgetContents_16.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_16.setObjectName("scrollAreaWidgetContents_16")self.label_32 = QtWidgets.QLabel(self.scrollAreaWidgetContents_16)self.label_32.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_32.setStyleSheet("border-image: url(:/新前缀/1684977876533.png);")self.label_32.setText("")self.label_32.setObjectName("label_32")self.label_33 = QtWidgets.QLabel(self.scrollAreaWidgetContents_16)self.label_33.setGeometry(QtCore.QRect(210, 20, 81, 41))font = QtGui.QFont()font.setPointSize(20)self.label_33.setFont(font)self.label_33.setObjectName("label_33")self.pushButton_24 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_16)self.pushButton_24.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_24.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_24.setText("")self.pushButton_24.setObjectName("pushButton_24")self.label_34 = QtWidgets.QLabel(self.scrollAreaWidgetContents_16)self.label_34.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_34.setObjectName("label_34")self.pushButton_25 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_16)self.pushButton_25.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_25.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_25.setText("")self.pushButton_25.setObjectName("pushButton_25")self.scrollArea_14.setWidget(self.scrollAreaWidgetContents_16)self.scrollArea_15 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_15)self.scrollArea_15.setGeometry(QtCore.QRect(30, 140, 421, 81))self.scrollArea_15.setWidgetResizable(True)self.scrollArea_15.setObjectName("scrollArea_15")self.scrollAreaWidgetContents_17 = QtWidgets.QWidget()self.scrollAreaWidgetContents_17.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_17.setObjectName("scrollAreaWidgetContents_17")self.label_35 = QtWidgets.QLabel(self.scrollAreaWidgetContents_17)self.label_35.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_35.setStyleSheet("border-image: url(:/新前缀/1684977933535.png);")self.label_35.setText("")self.label_35.setObjectName("label_35")self.label_36 = QtWidgets.QLabel(self.scrollAreaWidgetContents_17)self.label_36.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_36.setFont(font)self.label_36.setObjectName("label_36")self.pushButton_26 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_17)self.pushButton_26.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_26.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_26.setText("")self.pushButton_26.setObjectName("pushButton_26")self.label_37 = QtWidgets.QLabel(self.scrollAreaWidgetContents_17)self.label_37.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_37.setObjectName("label_37")self.pushButton_27 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_17)self.pushButton_27.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_27.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_27.setText("")self.pushButton_27.setObjectName("pushButton_27")self.scrollArea_15.setWidget(self.scrollAreaWidgetContents_17)self.scrollArea_16 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_15)self.scrollArea_16.setGeometry(QtCore.QRect(30, 260, 421, 81))self.scrollArea_16.setWidgetResizable(True)self.scrollArea_16.setObjectName("scrollArea_16")self.scrollAreaWidgetContents_18 = QtWidgets.QWidget()self.scrollAreaWidgetContents_18.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_18.setObjectName("scrollAreaWidgetContents_18")self.label_38 = QtWidgets.QLabel(self.scrollAreaWidgetContents_18)self.label_38.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_38.setStyleSheet("border-image: url(:/新前缀/1684977973655.png);")self.label_38.setText("")self.label_38.setObjectName("label_38")self.label_39 = QtWidgets.QLabel(self.scrollAreaWidgetContents_18)self.label_39.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_39.setFont(font)self.label_39.setObjectName("label_39")self.pushButton_28 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_18)self.pushButton_28.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_28.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_28.setText("")self.pushButton_28.setObjectName("pushButton_28")self.label_40 = QtWidgets.QLabel(self.scrollAreaWidgetContents_18)self.label_40.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_40.setObjectName("label_40")self.pushButton_29 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_18)self.pushButton_29.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_29.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_29.setText("")self.pushButton_29.setObjectName("pushButton_29")self.scrollArea_16.setWidget(self.scrollAreaWidgetContents_18)self.scrollArea_17 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_15)self.scrollArea_17.setGeometry(QtCore.QRect(30, 380, 421, 81))self.scrollArea_17.setWidgetResizable(True)self.scrollArea_17.setObjectName("scrollArea_17")self.scrollAreaWidgetContents_19 = QtWidgets.QWidget()self.scrollAreaWidgetContents_19.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_19.setObjectName("scrollAreaWidgetContents_19")self.label_41 = QtWidgets.QLabel(self.scrollAreaWidgetContents_19)self.label_41.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_41.setStyleSheet("border-image: url(:/新前缀/1684978053669.png);")self.label_41.setText("")self.label_41.setObjectName("label_41")self.label_42 = QtWidgets.QLabel(self.scrollAreaWidgetContents_19)self.label_42.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_42.setFont(font)self.label_42.setObjectName("label_42")self.pushButton_30 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_19)self.pushButton_30.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_30.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_30.setText("")self.pushButton_30.setObjectName("pushButton_30")self.pushButton_31 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_19)self.pushButton_31.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_31.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_31.setText("")self.pushButton_31.setObjectName("pushButton_31")self.scrollArea_17.setWidget(self.scrollAreaWidgetContents_19)self.scrollArea_23 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_15)self.scrollArea_23.setGeometry(QtCore.QRect(30, 1100, 421, 81))self.scrollArea_23.setWidgetResizable(True)self.scrollArea_23.setObjectName("scrollArea_23")self.scrollAreaWidgetContents_25 = QtWidgets.QWidget()self.scrollAreaWidgetContents_25.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_25.setObjectName("scrollAreaWidgetContents_25")self.label_53 = QtWidgets.QLabel(self.scrollAreaWidgetContents_25)self.label_53.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_53.setStyleSheet("border-image: url(:/新前缀/1684977055363.png);")self.label_53.setText("")self.label_53.setObjectName("label_53")self.label_54 = QtWidgets.QLabel(self.scrollAreaWidgetContents_25)self.label_54.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_54.setFont(font)self.label_54.setObjectName("label_54")self.pushButton_42 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_25)self.pushButton_42.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_42.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_42.setText("")self.pushButton_42.setObjectName("pushButton_42")self.pushButton_43 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_25)self.pushButton_43.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_43.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_43.setText("")self.pushButton_43.setObjectName("pushButton_43")self.scrollArea_23.setWidget(self.scrollAreaWidgetContents_25)self.scrollArea_13.setWidget(self.scrollAreaWidgetContents_15)self.tabWidget.addTab(self.tab_2, "")self.tab = QtWidgets.QWidget()self.tab.setObjectName("tab")self.scrollArea_18 = QtWidgets.QScrollArea(self.tab)self.scrollArea_18.setGeometry(QtCore.QRect(10, 10, 481, 381))self.scrollArea_18.setWidgetResizable(True)self.scrollArea_18.setObjectName("scrollArea_18")self.scrollAreaWidgetContents_20 = QtWidgets.QWidget()self.scrollAreaWidgetContents_20.setGeometry(QtCore.QRect(0, 0, 462, 500))self.scrollAreaWidgetContents_20.setMinimumSize(QtCore.QSize(0, 500))self.scrollAreaWidgetContents_20.setObjectName("scrollAreaWidgetContents_20")self.scrollArea_19 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_20)self.scrollArea_19.setGeometry(QtCore.QRect(30, 20, 421, 81))self.scrollArea_19.setWidgetResizable(True)self.scrollArea_19.setObjectName("scrollArea_19")self.scrollAreaWidgetContents_21 = QtWidgets.QWidget()self.scrollAreaWidgetContents_21.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_21.setObjectName("scrollAreaWidgetContents_21")self.label_43 = QtWidgets.QLabel(self.scrollAreaWidgetContents_21)self.label_43.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_43.setStyleSheet("border-image: url(:/新前缀/1684978225943.png);")self.label_43.setText("")self.label_43.setObjectName("label_43")self.label_44 = QtWidgets.QLabel(self.scrollAreaWidgetContents_21)self.label_44.setGeometry(QtCore.QRect(210, 20, 81, 41))font = QtGui.QFont()font.setPointSize(20)self.label_44.setFont(font)self.label_44.setObjectName("label_44")self.pushButton_32 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_21)self.pushButton_32.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_32.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_32.setText("")self.pushButton_32.setObjectName("pushButton_32")self.label_45 = QtWidgets.QLabel(self.scrollAreaWidgetContents_21)self.label_45.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_45.setObjectName("label_45")self.pushButton_33 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_21)self.pushButton_33.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_33.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_33.setText("")self.pushButton_33.setObjectName("pushButton_33")self.scrollArea_19.setWidget(self.scrollAreaWidgetContents_21)self.scrollArea_20 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_20)self.scrollArea_20.setGeometry(QtCore.QRect(30, 140, 421, 81))self.scrollArea_20.setWidgetResizable(True)self.scrollArea_20.setObjectName("scrollArea_20")self.scrollAreaWidgetContents_22 = QtWidgets.QWidget()self.scrollAreaWidgetContents_22.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_22.setObjectName("scrollAreaWidgetContents_22")self.label_46 = QtWidgets.QLabel(self.scrollAreaWidgetContents_22)self.label_46.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_46.setStyleSheet("border-image: url(:/新前缀/1684978276976.png);")self.label_46.setText("")self.label_46.setObjectName("label_46")self.label_47 = QtWidgets.QLabel(self.scrollAreaWidgetContents_22)self.label_47.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_47.setFont(font)self.label_47.setObjectName("label_47")self.pushButton_34 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_22)self.pushButton_34.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_34.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_34.setText("")self.pushButton_34.setObjectName("pushButton_34")self.label_48 = QtWidgets.QLabel(self.scrollAreaWidgetContents_22)self.label_48.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_48.setObjectName("label_48")self.pushButton_35 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_22)self.pushButton_35.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_35.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_35.setText("")self.pushButton_35.setObjectName("pushButton_35")self.scrollArea_20.setWidget(self.scrollAreaWidgetContents_22)self.scrollArea_21 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_20)self.scrollArea_21.setGeometry(QtCore.QRect(30, 260, 421, 81))self.scrollArea_21.setWidgetResizable(True)self.scrollArea_21.setObjectName("scrollArea_21")self.scrollAreaWidgetContents_23 = QtWidgets.QWidget()self.scrollAreaWidgetContents_23.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_23.setObjectName("scrollAreaWidgetContents_23")self.label_49 = QtWidgets.QLabel(self.scrollAreaWidgetContents_23)self.label_49.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_49.setStyleSheet("border-image: url(:/新前缀/1684978332490.png);")self.label_49.setText("")self.label_49.setObjectName("label_49")self.label_50 = QtWidgets.QLabel(self.scrollAreaWidgetContents_23)self.label_50.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_50.setFont(font)self.label_50.setObjectName("label_50")self.pushButton_36 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_23)self.pushButton_36.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_36.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_36.setText("")self.pushButton_36.setObjectName("pushButton_36")self.label_51 = QtWidgets.QLabel(self.scrollAreaWidgetContents_23)self.label_51.setGeometry(QtCore.QRect(230, 60, 54, 12))self.label_51.setObjectName("label_51")self.pushButton_37 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_23)self.pushButton_37.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_37.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_37.setText("")self.pushButton_37.setObjectName("pushButton_37")self.scrollArea_21.setWidget(self.scrollAreaWidgetContents_23)self.scrollArea_22 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_20)self.scrollArea_22.setGeometry(QtCore.QRect(30, 380, 421, 81))self.scrollArea_22.setWidgetResizable(True)self.scrollArea_22.setObjectName("scrollArea_22")self.scrollAreaWidgetContents_24 = QtWidgets.QWidget()self.scrollAreaWidgetContents_24.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_24.setObjectName("scrollAreaWidgetContents_24")self.label_52 = QtWidgets.QLabel(self.scrollAreaWidgetContents_24)self.label_52.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_52.setStyleSheet("border-image: url(:/新前缀/1684978053669.png);")self.label_52.setText("")self.label_52.setObjectName("label_52")self.label_55 = QtWidgets.QLabel(self.scrollAreaWidgetContents_24)self.label_55.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_55.setFont(font)self.label_55.setObjectName("label_55")self.pushButton_38 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_24)self.pushButton_38.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_38.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_38.setText("")self.pushButton_38.setObjectName("pushButton_38")self.pushButton_39 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_24)self.pushButton_39.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_39.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_39.setText("")self.pushButton_39.setObjectName("pushButton_39")self.scrollArea_22.setWidget(self.scrollAreaWidgetContents_24)self.scrollArea_24 = QtWidgets.QScrollArea(self.scrollAreaWidgetContents_20)self.scrollArea_24.setGeometry(QtCore.QRect(30, 1100, 421, 81))self.scrollArea_24.setWidgetResizable(True)self.scrollArea_24.setObjectName("scrollArea_24")self.scrollAreaWidgetContents_26 = QtWidgets.QWidget()self.scrollAreaWidgetContents_26.setGeometry(QtCore.QRect(0, 0, 419, 79))self.scrollAreaWidgetContents_26.setObjectName("scrollAreaWidgetContents_26")self.label_56 = QtWidgets.QLabel(self.scrollAreaWidgetContents_26)self.label_56.setGeometry(QtCore.QRect(0, 0, 181, 81))self.label_56.setStyleSheet("border-image: url(:/新前缀/1684977055363.png);")self.label_56.setText("")self.label_56.setObjectName("label_56")self.label_57 = QtWidgets.QLabel(self.scrollAreaWidgetContents_26)self.label_57.setGeometry(QtCore.QRect(210, 20, 131, 41))font = QtGui.QFont()font.setPointSize(20)self.label_57.setFont(font)self.label_57.setObjectName("label_57")self.pushButton_44 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_26)self.pushButton_44.setGeometry(QtCore.QRect(320, 20, 41, 41))self.pushButton_44.setStyleSheet("border-image: url(:/新前缀/1684919348708.png);")self.pushButton_44.setText("")self.pushButton_44.setObjectName("pushButton_44")self.pushButton_45 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_26)self.pushButton_45.setGeometry(QtCore.QRect(370, 20, 41, 41))self.pushButton_45.setStyleSheet("border-image: url(:/BACK/Desktop/img/help.jpg);")self.pushButton_45.setText("")self.pushButton_45.setObjectName("pushButton_45")self.scrollArea_24.setWidget(self.scrollAreaWidgetContents_26)self.scrollArea_18.setWidget(self.scrollAreaWidgetContents_20)self.tabWidget.addTab(self.tab, "")self.pushButton_40 = QtWidgets.QPushButton(self.centralwidget)self.pushButton_40.setGeometry(QtCore.QRect(40, 520, 171, 51))self.pushButton_40.setStyleSheet("background-color: rgb(170, 170, 255);")self.pushButton_40.setObjectName("pushButton_40")self.pushButton_41 = QtWidgets.QPushButton(self.centralwidget)self.pushButton_41.setGeometry(QtCore.QRect(280, 520, 171, 51))self.pushButton_41.setStyleSheet("background-color: rgb(170, 170, 255);")self.pushButton_41.setObjectName("pushButton_41")MainWindow.setCentralWidget(self.centralwidget)self.menubar = QtWidgets.QMenuBar(MainWindow)self.menubar.setGeometry(QtCore.QRect(0, 0, 511, 23))self.menubar.setObjectName("menubar")MainWindow.setMenuBar(self.menubar)self.statusbar = QtWidgets.QStatusBar(MainWindow)self.statusbar.setObjectName("statusbar")MainWindow.setStatusBar(self.statusbar)self.retranslateUi(MainWindow)self.tabWidget.setCurrentIndex(0)QtCore.QMetaObject.connectSlotsByName(MainWindow)def retranslateUi(self, MainWindow):_translate = QtCore.QCoreApplication.translateMainWindow.setWindowTitle(_translate("MainWindow", "PPN的小店"))self.label_2.setText(_translate("MainWindow", "Neng的小餐馆"))self.toolButton.setText(_translate("MainWindow", "收藏商家"))self.toolButton_2.setText(_translate("MainWindow", "联系商家"))self.label_6.setText(_translate("MainWindow", "红烧肉"))self.label_15.setText(_translate("MainWindow", "0.01¥"))self.label_8.setText(_translate("MainWindow", "清蒸鲈鱼"))self.label_16.setText(_translate("MainWindow", "0.01¥"))self.label_12.setText(_translate("MainWindow", "芋头扣肉"))self.label_17.setText(_translate("MainWindow", "0.01¥"))self.label_14.setText(_translate("MainWindow", "白灼虾"))self.label_21.setText(_translate("MainWindow", "孜然羊肉"))self.label_23.setText(_translate("MainWindow", "糖醋排骨"))self.label_25.setText(_translate("MainWindow", "可乐鸡翅"))self.label_27.setText(_translate("MainWindow", "鱼头汤"))self.label_29.setText(_translate("MainWindow", "咖喱牛肉"))self.label_31.setText(_translate("MainWindow", "孜然羊肉"))self.tabWidget.setTabText(self.tabWidget.indexOf(self.Staple_food), _translate("MainWindow", "主食"))self.label_33.setText(_translate("MainWindow", "茶叶蛋"))self.label_34.setText(_translate("MainWindow", "0.01¥"))self.label_36.setText(_translate("MainWindow", "鸡爪爪"))self.label_37.setText(_translate("MainWindow", "0.01¥"))self.label_39.setText(_translate("MainWindow", "毛豆"))self.label_40.setText(_translate("MainWindow", "0.01¥"))self.label_42.setText(_translate("MainWindow", "盐水花生"))self.label_54.setText(_translate("MainWindow", "孜然羊肉"))self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "小吃"))self.label_44.setText(_translate("MainWindow", "柠檬茶"))self.label_45.setText(_translate("MainWindow", "0.01¥"))self.label_47.setText(_translate("MainWindow", "多肉葡萄"))self.label_48.setText(_translate("MainWindow", "0.01¥"))self.label_50.setText(_translate("MainWindow", "茶颜"))self.label_51.setText(_translate("MainWindow", "0.01¥"))self.label_55.setText(_translate("MainWindow", "盐水花生"))self.label_57.setText(_translate("MainWindow", "孜然羊肉"))self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "奶茶"))self.pushButton_40.setText(_translate("MainWindow", "购物车"))self.pushButton_41.setText(_translate("MainWindow", "结算"))
输出如下界面:
2.界面做好了,那么接下来就可以实现功能了:
先实现每个菜加入购物车的功能
把红烧肉加入购物车怎么做,一起来看代码:
(1)首先我们用xlrd库创建xls表格
self.workbook = xlwt.Workbook(encoding='utf-8',style_compression=0)self.sheet = self.workbook.add_sheet('表格1', cell_overwrite_ok=False)style = xlwt.XFStyle()
(2)点击加入购物车功能,实际上就是把对应的变量写入表格中
def PushButton(self):self.sheet.write(0, 0, '红烧肉 +1') ###红烧肉self.workbook.save('eat.xls')tkinter.messagebox.showinfo('添加','红烧肉 +1')return
(3)红烧肉的做法功能:用到了tk库的弹窗函数
def PushButton16(self):tkinter.messagebox.showinfo('做法:','1、锅烧热,加少许油,油热后放入五花肉。\n 2、煸炒至五花肉变色,加入红烧酱油。\n 3、翻炒均匀,加入糖,炒至糖融化,且均匀包裹肉块。\n 4、将炒好的五花肉倒入炖锅,加水没过肉。 \n 5、大火烧开,放入葱、姜、八角和香叶,转小火炖半小时。\n 6、放入鹌鹑蛋,继续炖10分钟左右,大火收汁即可')
点击弹窗,显示做法如下图:
3.这样我们来加入红烧肉,然后结算一下:
3.1.加购物车
3.2.结算
4.奶茶小吃栏功能都类似
def PushButton9(self):self.sheet.write(0, 9, '茶叶蛋 +1')self.workbook.save('eat.xls')tkinter.messagebox.showinfo('添加','茶叶蛋 +1')
上述代码添加茶叶蛋的功能。
界面右上角的联系商家按钮,也类似;
def tubutton1(self):tkinter.messagebox.showinfo('完成','+86: 1314520')
5.结算输出用到xlwt库来实现:
excel1 = xlrd.open_workbook(r'eat.xls','utf-8',formatting_info=True)
###获取所有sheet名字
excel1.sheet_names()###获取sheet数量
excel1.nsheets###获取所有sheet对象
excel1.sheets()###通过sheet名查找
sheet1 = excel1.sheet_by_name("表格1")
三.总结
可以根据个人喜好,添加各种东西,让你有吃啥纠结症的朋友挑选起来!