-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashboard.qml
92 lines (81 loc) · 2.67 KB
/
Dashboard.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "."
ApplicationWindow {
id: root
title: "Dashboard"
// 全屏
width: 1800
height: 1200
visible: true
color: "ghostwhite"
RowLayout {
anchors.fill: parent
// Left Sidebar
Rectangle {
id: leftsidebar
width: 400
Layout.fillHeight: true
color: "#738e95"
Column {
spacing: 30
y: parent.y + 30
Layout.fillWidth: true
CustomButton {
buttonText: "欢迎 " + user.phoneNum
background: Rectangle {
color: "#738e95"
}
}
CustomButton {
buttonText: "存取"
onClicked: contentLoader.source = listModel.get(0).source
}
CustomButton {
buttonText: "转账"
onClicked: contentLoader.source = listModel.get(1).source
}
CustomButton {
buttonText: "收支"
onClicked: contentLoader.source = listModel.get(2).source
}
CustomButton {
buttonText: "账户"
onClicked: contentLoader.source = listModel.get(3).source
}
}
CustomButton {
buttonText: "登出"
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
onClicked: {
root.close()
}
}
}
// Main content area
ListModel {
id: listModel
ListElement { name: "存取"; source: "qrc:/qml/Deposit.qml" }
ListElement { name: "转账"; source: "qrc:/qml/Transfer.qml" }
ListElement { name: "收支"; source: "qrc:/qml/IncomeExpense.qml" }
ListElement { name: "账户"; source: "qrc:/qml/Account.qml" }
}
Loader {
id: contentLoader
Layout.fillHeight: true
Layout.fillWidth: true
Text {
topPadding: 20
leftPadding: 30
bottomPadding: 10
// 如果为Premium用户显示
text: user.isPremium ? "Premium User" : "Free User"
font.pointSize: 24
font.family: "Microsoft YaHei"
font.bold: true
}
}
}
}