| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import Felgo
- import QtQuick
- import QtQuick.Layouts
- import "../model"
- //import ExampleCustomMaterial 1.0
- AppPage {
- id: loginPage
- title: "植物病菌孢子捕捉分析系统"
- property int logintimeout: 300
- backgroundColor: "#f5f5f5"
- useSafeArea: false // do not consider safe area insets of screen
- // 添加一个函数来处理亮度设置和重置计时
- function resetScreenTimeout() {
- serial.setLightness(128)
- logintimeout = 300
- }
- onVisibleChanged: {
- if(loginPage.visible==true){
- numberpad.txtPassword.clear()
- }
- }
- // login form background
- Rectangle {
- id: loginForm
- anchors.fill: parent
- color: app.theme_backgroundColor
- width: parent.width //content.width + dp(48)
- height: parent.height //content.height + dp(16)
- radius: dp(4)
- MouseArea {
- anchors.fill: parent
- onClicked: {
- console.log("AppPage clicked!")
- // 在这里添加处理点击事件的逻辑
- resetScreenTimeout()
- }
- }
- Column{
- anchors.fill: loginForm
- AppText {
- id: apptext_title
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "植物病菌孢子捕捉分析系统2.0"
- color: app.fontColor
- fontSize: 30
- }
- AppText{
- id: text_logintime
- anchors.topMargin: 5
- text: "休眠计时:" + logintimeout
- color: "red"
- fontSize: 20
- }
- AppText {
- text: "软件版本:" + app.appversionText
- color: "gray"
- fontSize: 10
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- }
- }
- NumberPad {
- id: numberpad
- anchors.centerIn: parent
- mlogin.onClicked: {
- loginPage.forceActiveFocus() // move focus away from text fields
- logic.login(txtPassword.text)
- resetScreenTimeout()
- }
- onButtonClicked: {
- resetScreenTimeout()
- }
- }
- }
- }
|