Login.qml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. /*
  2. This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
  3. It is supposed to be strictly declarative and only uses a subset of QML. If you edit
  4. this file manually, you might introduce QML code that is not supported by Qt Design Studio.
  5. Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
  6. */
  7. import QtQuick 6.5
  8. import QtQuick.Controls 6.5
  9. import QtQuick.VirtualKeyboard
  10. import com.lock 1.0 // 导入 C++ 类
  11. // import com.InteractiveCore 1.0
  12. import com.InteractiveTask 1.0
  13. Item {
  14. id: login
  15. property string cardID : ""
  16. property int errorNoticeTimeout: 3
  17. property int enterSet: 0
  18. property int enterSetTimeout: 5
  19. signal signal_login(int type, string username, string password)
  20. signal signal_fingerWork(bool stat)
  21. onVisibleChanged:
  22. {
  23. if (visible)
  24. {
  25. proThread.getError(get_error_callback);
  26. proThread.moveCursorTo(0, 0);
  27. }
  28. if (visible === true)
  29. {
  30. interactiveHand.setFingerImageAppearCallBack(
  31. (url)=>{
  32. waitPromptBox.show();
  33. // visible = false;
  34. interactiveHand.fingerImageStop();
  35. interactiveCore.appendTask(
  36. InteractiveTask.TypeHttpPost_loginByFingerprintDat, null, (json)=>{
  37. waitPromptBox.hide();
  38. var jsonObjRoot = JSON.parse(json);
  39. var stat = jsonObjRoot["stat"];
  40. var str = jsonObjRoot["str"];
  41. var name = jsonObjRoot["name"];
  42. var outh = jsonObjRoot["outh"];
  43. if (stat === 0)
  44. {
  45. mainScreen.login_return_param(name, outh);
  46. loginScreen.login_return_stat(stat, str);
  47. proThread.slot_feature_login();
  48. }
  49. else
  50. {
  51. loginScreen.login_return_stat(stat, str);
  52. interactiveHand.fingerImagePlay();
  53. }
  54. });
  55. });
  56. interactiveHand.fingerImagePlay();
  57. }
  58. else
  59. {
  60. interactiveHand.fingerImageStop();
  61. }
  62. }
  63. function set_cardID(value) {
  64. switch(value)
  65. {
  66. case Qt.Key_0:cardID = cardID + "0";break;
  67. case Qt.Key_1:cardID = cardID + "1";break;
  68. case Qt.Key_2:cardID = cardID + "2";break;
  69. case Qt.Key_3:cardID = cardID + "3";break;
  70. case Qt.Key_4:cardID = cardID + "4";break;
  71. case Qt.Key_5:cardID = cardID + "5";break;
  72. case Qt.Key_6:cardID = cardID + "6";break;
  73. case Qt.Key_7:cardID = cardID + "7";break;
  74. case Qt.Key_8:cardID = cardID + "8";break;
  75. case Qt.Key_9:cardID = cardID + "9";break;
  76. case Qt.Key_A:cardID = cardID + "A";break;
  77. case Qt.Key_B:cardID = cardID + "B";break;
  78. case Qt.Key_C:cardID = cardID + "C";break;
  79. case Qt.Key_D:cardID = cardID + "D";break;
  80. case Qt.Key_E:cardID = cardID + "E";break;
  81. case Qt.Key_F:cardID = cardID + "F";break;
  82. case Qt.Key_Return:{
  83. console.log("card:" + cardID);
  84. card_login()
  85. cardID = "";
  86. }
  87. }
  88. }
  89. focus: true // 确保 Rectangle 能够接收键盘事件
  90. // 强制保持焦点
  91. onFocusChanged: {
  92. if(cardInput.visible === true)
  93. {
  94. if (!focus) {
  95. forceActiveFocus()
  96. }
  97. }
  98. }
  99. Keys.onPressed: {
  100. console.log("key:" + event.key);
  101. if(visible === true)
  102. {
  103. set_cardID(event.key)
  104. }
  105. }
  106. function get_error_callback(isError)
  107. {
  108. login_toolbutton_error.visible = isError;
  109. }
  110. Image {
  111. id: logoImage
  112. x: 73
  113. y: 61
  114. width: 200
  115. height: 50
  116. source: "qrc:/png/bozz.png"
  117. fillMode: Image.PreserveAspectFit
  118. MouseArea {
  119. anchors.fill: parent // 让MouseArea覆盖整个Image区域
  120. onClicked: {
  121. enterSetTimeout = 5;
  122. if(enterSet >= 4)
  123. {
  124. enterSet = 0
  125. setView.load_configParam(true)
  126. setView.fingerVisible = false
  127. setView.visible = true
  128. }
  129. else{
  130. enterSet++
  131. }
  132. }
  133. }
  134. }
  135. Label {
  136. id: loginNotice
  137. x:0
  138. y:900
  139. width: 1920
  140. color: "#ffffff"
  141. text: qsTr("您可以通过刷卡或者指纹直接登录系统")
  142. font.pixelSize: 42
  143. horizontalAlignment: Text.AlignHCenter
  144. verticalAlignment: Text.AlignVCenter
  145. font.bold: true
  146. visible: true
  147. }
  148. ToolButton
  149. {
  150. id: login_toolbutton_error
  151. x: 1572
  152. y: 49
  153. width: 300
  154. height: 110
  155. enabled: false // 不可点击
  156. display: AbstractButton.TextBesideIcon // 文字在图标旁边
  157. visible: false
  158. icon.source: "qrc:/png/exception_handle.png"
  159. icon.width: 81
  160. icon.height: 72
  161. text: "物资错放"
  162. palette.buttonText: "#ff0000"
  163. font {
  164. pixelSize: 40
  165. // bold: true
  166. }
  167. background: Rectangle {
  168. color: "#00ffffff"
  169. border.color: "#ff0000"
  170. border.width: 2 // 边框宽度
  171. radius: 20 // 可选,设置圆角
  172. }
  173. }
  174. Label {
  175. id: label1
  176. x: 720
  177. y: 181
  178. color: "#ddffffff"
  179. text: qsTr("物资管理系统")
  180. font.pixelSize: 80
  181. horizontalAlignment: Text.AlignHCenter
  182. verticalAlignment: Text.AlignVCenter
  183. font.bold: true
  184. }
  185. Rectangle {
  186. id: rectangle1
  187. x: 227
  188. y: 342
  189. width: 1466
  190. height: 512
  191. color: "#00ffffff"
  192. // 人脸登录
  193. Button {
  194. id: face_sel
  195. x: 103
  196. y: 56
  197. width: 300
  198. height: 400
  199. background: Rectangle {
  200. id: face_sel_background
  201. color: "#982b7ae9"
  202. border.color: "#4c2b7ae9"
  203. border.width: 2 // 边框宽度
  204. radius: 20 // 可选,设置圆角
  205. }
  206. icon.height: 150
  207. icon.width: 120
  208. display: AbstractButton.TextUnderIcon
  209. icon.source: "qrc:/png/face.png"
  210. icon.color: "#00ffffff"
  211. text: qsTr("人脸登录")
  212. font.pixelSize: 40
  213. spacing: 20
  214. palette.buttonText: "#7fffffff" // 设置字体颜色为绿
  215. activeFocusOnTab: false
  216. Connections {
  217. target: face_sel
  218. onClicked: {
  219. cardInput.visible = false;
  220. passLogin_rec.visible = false;
  221. fingerInput.visible = false;
  222. faceInput.visible = true;
  223. }
  224. }
  225. }
  226. // 工卡登录
  227. Button {
  228. id: card_sel
  229. x: 423
  230. y: 56
  231. width: 300
  232. height: 400
  233. background: Rectangle {
  234. id: card_sel_background
  235. color: "#982b7ae9"
  236. border.color: "#4c2b7ae9"
  237. border.width: 2 // 边框宽度
  238. radius: 20 // 可选,设置圆角
  239. }
  240. icon.height: 150
  241. icon.width: 120
  242. display: AbstractButton.TextUnderIcon
  243. icon.source: "qrc:/png/card.png"
  244. icon.color: "#00ffffff"
  245. text: qsTr("工卡登录")
  246. font.pixelSize: 40
  247. spacing: 20
  248. palette.buttonText: "#7fffffff" // 设置字体颜色为绿
  249. activeFocusOnTab: false
  250. Connections {
  251. target: card_sel
  252. onClicked: {
  253. passLogin_rec.visible = false;
  254. password_sel.enabled = true;
  255. fingerInput.visible = false;
  256. faceInput.visible = false;
  257. cardInput.visible = true;
  258. cardID = "";
  259. }
  260. }
  261. }
  262. Button {
  263. id: password_sel
  264. x: 743
  265. y: 56
  266. width: 300
  267. height: 400
  268. background: Rectangle {
  269. id: password_sel_background
  270. color: "#982b7ae9"
  271. border.color: "#4c2b7ae9"
  272. border.width: 2 // 边框宽度
  273. radius: 20 // 可选,设置圆角
  274. }
  275. icon.height: 150
  276. icon.width: 120
  277. display: AbstractButton.TextUnderIcon
  278. icon.source: "qrc:/png/user.png"
  279. icon.color: "#00ffffff"
  280. text: qsTr("用户名登录")
  281. font.pixelSize: 40
  282. spacing: 20
  283. palette.buttonText: "#7fffffff" // 设置字体颜色为绿
  284. activeFocusOnTab: false
  285. Connections {
  286. target: password_sel
  287. onClicked: {
  288. cardInput.visible = false;
  289. faceInput.visible = false;
  290. fingerInput.visible = false;
  291. passLogin_rec.visible = true
  292. password_sel.enabled = false
  293. usernameText.text = ""
  294. passwordText.text = ""
  295. }
  296. }
  297. }
  298. Button {
  299. id: finger_sel
  300. x: 1063
  301. y: 56
  302. width: 300
  303. height: 400
  304. background: Rectangle {
  305. id: finger_sel_background
  306. color: "#982b7ae9"
  307. border.color: "#4c2b7ae9"
  308. border.width: 2 // 边框宽度
  309. radius: 20 // 可选,设置圆角
  310. }
  311. icon.height: 150
  312. icon.width: 120
  313. display: AbstractButton.TextUnderIcon
  314. icon.source: "qrc:/png/finger.png"
  315. icon.color: "#00ffffff"
  316. text: qsTr("指纹登录")
  317. font.pixelSize: 40
  318. spacing: 20
  319. palette.buttonText: "#7fffffff" // 设置字体颜色为绿
  320. activeFocusOnTab: false
  321. Connections {
  322. target: finger_sel
  323. onClicked: {
  324. cardInput.visible = false;
  325. passLogin_rec.visible = false;
  326. password_sel.enabled = true;
  327. fingerInput.visible = true;
  328. faceInput.visible = false;
  329. }
  330. }
  331. }
  332. }
  333. Rectangle {
  334. id: passLogin_rec
  335. x: 711
  336. y: 371
  337. width: 497
  338. height: 438
  339. visible: false
  340. color: "#980e57ea"
  341. radius: 20
  342. Column {
  343. id: column
  344. x: 0
  345. y: 0
  346. width: 497
  347. height: 438
  348. visible: true
  349. spacing: 30
  350. padding: 0
  351. topPadding: 46
  352. Rectangle {
  353. x: 72
  354. width: 353
  355. height: 68
  356. color: "#00ffffff"
  357. border.color: "#a3ffffff"
  358. border.width: 3
  359. radius: 10
  360. TextField {
  361. id: usernameText
  362. anchors.fill: parent
  363. anchors.margins: 2
  364. font.pointSize: 15
  365. focus: false
  366. color: "#a3ffffff"
  367. background: Rectangle {
  368. color: "transparent" // 使TextField背景透明
  369. }
  370. placeholderText: qsTr("请输入用户名")
  371. font.pixelSize: 30
  372. horizontalAlignment: Text.AlignLeft
  373. verticalAlignment: Text.AlignVCenter
  374. wrapMode: Text.NoWrap
  375. selectionColor: "#a300aaff"
  376. placeholderTextColor: "#60ffffff"
  377. bottomPadding: 5
  378. topPadding: 5
  379. rightPadding: 20
  380. leftPadding: 20
  381. renderType: Text.QtRendering
  382. font.styleName: "Regular"
  383. }
  384. }
  385. Rectangle {
  386. x: 72
  387. width: 353
  388. height: 68
  389. color: "#00ffffff"
  390. border.color: "#a3ffffff"
  391. border.width: 3
  392. radius: 10
  393. TextField {
  394. id: passwordText
  395. anchors.fill: parent
  396. anchors.margins: 2
  397. font.pointSize: 15
  398. focus: false
  399. color: "#a3ffffff"
  400. background: Rectangle {
  401. color: "transparent" // 使TextField背景透明
  402. }
  403. placeholderText: qsTr("请输入密码")
  404. echoMode: TextInput.Password // 设置echoMode为Password
  405. font.pixelSize: 30
  406. selectionColor: "#a300aaff"
  407. horizontalAlignment: Text.AlignLeft
  408. verticalAlignment: Text.AlignVCenter
  409. wrapMode: Text.NoWrap
  410. placeholderTextColor: "#60ffffff"
  411. bottomPadding: 5
  412. topPadding: 5
  413. rightPadding: 20
  414. leftPadding: 20
  415. renderType: Text.QtRendering
  416. font.styleName: "Regular"
  417. }
  418. }
  419. Button {
  420. id: button_enter
  421. x: 72
  422. width: 353
  423. height: 68
  424. text: qsTr("登录")
  425. contentItem: Label {
  426. id: label3
  427. text: parent.text
  428. font.pixelSize: 30
  429. color: "#a3ffffff" // 设置字体颜色
  430. horizontalAlignment: Text.AlignHCenter
  431. verticalAlignment: Text.AlignVCenter
  432. }
  433. background: Rectangle {
  434. color: "#a300aaff"
  435. radius: 10 // 设置圆角半径
  436. }
  437. Connections {
  438. target: button_enter
  439. onClicked: {
  440. username_login()
  441. }
  442. }
  443. }
  444. Button {
  445. id: button_cancel
  446. x: 72
  447. width: 353
  448. height: 68
  449. text: qsTr("取消")
  450. contentItem: Label {
  451. text: parent.text
  452. font.pixelSize: 30
  453. color: "#a3ffffff" // 设置字体颜色
  454. horizontalAlignment: Text.AlignHCenter
  455. verticalAlignment: Text.AlignVCenter
  456. }
  457. background: Rectangle {
  458. color: "#00ffffff"
  459. border.color: "#a3ffffff"
  460. border.width: 3
  461. radius: 10 // 设置圆角半径
  462. }
  463. Connections {
  464. target: button_cancel
  465. onClicked: {
  466. console.log("username return:");
  467. passLogin_rec.visible = false
  468. password_sel.enabled = true
  469. usernameText.text = ""
  470. passwordText.text = ""
  471. }
  472. }
  473. }
  474. }
  475. }
  476. Rectangle {
  477. id: faceInput
  478. x: (mainScreen.width - width) / 2 - parent.x
  479. y: 420
  480. width: 350
  481. height: 350
  482. visible: false
  483. color: "#980e57ea"
  484. radius: 20
  485. onVisibleChanged: {
  486. if (faceInput.visible === true)
  487. {
  488. interactiveFace.setCallBackFaceStatus(
  489. (status)=>{
  490. if (!status)
  491. {
  492. loginScreen.login_return_stat(-1, "未检测到人脸");
  493. }
  494. }
  495. );
  496. interactiveFace.setCameraImageCallBack(
  497. null, (url)=>{
  498. waitPromptBox.show();
  499. // interactiveFace.cameraImageStop();
  500. faceInput.visible = false;
  501. interactiveCore.appendTask(
  502. InteractiveTask.TypeHttpPost_loginByFace, null, (json)=>{
  503. waitPromptBox.hide();
  504. var jsonObjRoot = JSON.parse(json);
  505. var stat = jsonObjRoot["stat"];
  506. var str = jsonObjRoot["str"];
  507. var name = jsonObjRoot["name"];
  508. var outh = jsonObjRoot["outh"];
  509. if (stat === 0)
  510. {
  511. mainScreen.login_return_param(name, outh);
  512. loginScreen.login_return_stat(stat, str);
  513. proThread.slot_feature_login();
  514. }
  515. else
  516. {
  517. loginScreen.login_return_stat(stat, str);
  518. // interactiveFace.cameraImagePlay();
  519. }
  520. });
  521. }, null);
  522. interactiveFace.cameraImagePlay();
  523. }
  524. else
  525. {
  526. interactiveFace.setCallBackFaceStatus(null);
  527. interactiveFace.cameraImageStop();
  528. proThread.moveCursorTo(0, 0);
  529. }
  530. }
  531. Column {
  532. x: 0
  533. y: 0
  534. width: 350
  535. height: 350
  536. visible: true
  537. spacing: 30
  538. padding: 0
  539. topPadding: 46
  540. Image {
  541. width: 200
  542. height: 200
  543. opacity: 0.5
  544. anchors.horizontalCenter: parent.horizontalCenter
  545. source: "qrc:/png/faceNotice.png"
  546. }
  547. Label {
  548. id: cardNotice
  549. anchors.horizontalCenter: parent.horizontalCenter
  550. color: "#9affffff"
  551. text: qsTr("请刷人脸")
  552. font.pixelSize: 30
  553. horizontalAlignment: Text.AlignHCenter
  554. verticalAlignment: Text.AlignVCenter
  555. font.bold: true
  556. }
  557. }
  558. }
  559. Rectangle {
  560. id: cardInput
  561. x: (mainScreen.width - width) / 2 - parent.x
  562. y: 420
  563. width: 350
  564. height: 350
  565. visible: false
  566. color: "#980e57ea"
  567. radius: 20
  568. Column {
  569. x: 0
  570. y: 0
  571. width: 350
  572. height: 350
  573. visible: true
  574. spacing: 30
  575. padding: 0
  576. topPadding: 46
  577. Image {
  578. width: 200
  579. height: 200
  580. opacity: 0.5
  581. anchors.horizontalCenter: parent.horizontalCenter
  582. source: "qrc:/png/cardNotice.png"
  583. }
  584. Label {
  585. id: faceNotice
  586. anchors.horizontalCenter: parent.horizontalCenter
  587. color: "#9affffff"
  588. text: qsTr("请刷工卡")
  589. font.pixelSize: 30
  590. horizontalAlignment: Text.AlignHCenter
  591. verticalAlignment: Text.AlignVCenter
  592. font.bold: true
  593. }
  594. }
  595. }
  596. Rectangle {
  597. id: fingerInput
  598. x: (mainScreen.width - width) / 2 - parent.x
  599. y: 420
  600. width: 350
  601. height: 350
  602. visible: false
  603. color: "#980e57ea"
  604. radius: 20
  605. Column {
  606. x: 0
  607. y: 0
  608. width: 350
  609. height: 350
  610. visible: true
  611. spacing: 30
  612. padding: 0
  613. topPadding: 46
  614. Image {
  615. width: 200
  616. height: 200
  617. opacity: 0.5
  618. anchors.horizontalCenter: parent.horizontalCenter
  619. source: "qrc:/png/fingerNotice.png"
  620. }
  621. Label {
  622. id: fingerNotice
  623. anchors.horizontalCenter: parent.horizontalCenter
  624. color: "#9affffff"
  625. text: qsTr("请刷指纹")
  626. font.pixelSize: 30
  627. horizontalAlignment: Text.AlignHCenter
  628. verticalAlignment: Text.AlignVCenter
  629. font.bold: true
  630. }
  631. }
  632. onVisibleChanged: {
  633. // signal_fingerWork(visible)
  634. }
  635. }
  636. Rectangle {
  637. id: errorLogin
  638. x: 785
  639. y: 415
  640. width: 350
  641. height: 350
  642. visible: false
  643. color: "#66ea3a0e"
  644. radius: 20
  645. onVisibleChanged: {
  646. errorNotice.visible = errorLogin.visible
  647. }
  648. Column {
  649. x: 0
  650. y: 0
  651. width: 350
  652. height: 350
  653. visible: true
  654. spacing: 30
  655. padding: 0
  656. topPadding: 46
  657. Image {
  658. width: 200
  659. height: 200
  660. opacity: 0.5
  661. anchors.horizontalCenter: parent.horizontalCenter
  662. source: "qrc:/png/error.png"
  663. }
  664. Label {
  665. id: errorNotice_old
  666. anchors.horizontalCenter: parent.horizontalCenter
  667. color: "#9affffff"
  668. text: qsTr("登录失败")
  669. font.pixelSize: 30
  670. horizontalAlignment: Text.AlignHCenter
  671. verticalAlignment: Text.AlignVCenter
  672. font.bold: true
  673. }
  674. }
  675. }
  676. Label {
  677. id: errorNotice
  678. y:835
  679. anchors.horizontalCenter: errorLogin.horizontalCenter
  680. color: "#9affffff"
  681. text: qsTr("用户名密码错误")
  682. font.pixelSize: 30
  683. horizontalAlignment: Text.AlignHCenter
  684. verticalAlignment: Text.AlignVCenter
  685. font.bold: true
  686. visible: false
  687. }
  688. Timer {
  689. interval: 1000
  690. running: true
  691. repeat: true
  692. onTriggered: {
  693. if(errorNoticeTimeout > 0)
  694. {
  695. errorNoticeTimeout--;
  696. }
  697. else{
  698. errorLogin.visible = false;
  699. }
  700. if(enterSetTimeout > 0)
  701. {
  702. enterSetTimeout--;
  703. }
  704. }
  705. }
  706. function username_login() {
  707. var username = usernameText.text;
  708. var password = passwordText.text;
  709. if(username.length > 0)
  710. {
  711. signal_login(0, username, password);
  712. }
  713. else{
  714. login_return_stat(-99, "请输入用户名");
  715. }
  716. }
  717. function card_login() {
  718. if(cardID.length > 0)
  719. {
  720. signal_login(1, cardID, cardID);
  721. }
  722. }
  723. function login_return_stat(stat, notice)
  724. {
  725. if(stat === 0)
  726. {
  727. // 获取http 异常类型字典值
  728. interactiveCore.appendTask(
  729. InteractiveTask.TypeHttpGet_exception_type, null, null);
  730. // 获取http 严重等级字典值
  731. interactiveCore.appendTask(
  732. InteractiveTask.TypeHttpGet_severity_level, null, null);
  733. // 通过物资Code获取物资柜ID
  734. interactiveCore.appendTask(
  735. InteractiveTask.TypeHttpGet_selectIsMaterialsCabinetByCode, null, null);
  736. // 获取用户登录信息
  737. interactiveCore.appendTask(
  738. InteractiveTask.TypeHttpGet_getInfo, null, null);
  739. interactiveCore.appendTask(
  740. InteractiveTask.TypeDataCacheRefresh, null, null);
  741. usernameText.text = "";
  742. passwordText.text = "";
  743. passLogin_rec.visible = false;
  744. password_sel.enabled = true;
  745. cardInput.visible = false;
  746. fingerInput.visible = false;
  747. loginScreen.visible = false;
  748. mainScreen.resetLogin_timeout();
  749. mainScreen.visible = true;
  750. materialSelmodel.visible = true;
  751. }
  752. else {
  753. passwordText.text = "";
  754. errorNotice.text = qsTr(notice);
  755. errorLogin.visible = true
  756. errorNoticeTimeout = 3
  757. }
  758. }
  759. Item {
  760. id: __materialLibrary__
  761. }
  762. states: [
  763. State {
  764. name: "clicked"
  765. }
  766. ]
  767. }