From e491cdb48129752324c4e3764f99bd9203c56dec Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期二, 31 三月 2026 09:48:44 +0800
Subject: [PATCH] 1.新增VF205门禁机代码
---
vf205_access/src/view/config/newPwdView.js | 137 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 137 insertions(+), 0 deletions(-)
diff --git a/vf205_access/src/view/config/newPwdView.js b/vf205_access/src/view/config/newPwdView.js
new file mode 100644
index 0000000..da0b51b
--- /dev/null
+++ b/vf205_access/src/view/config/newPwdView.js
@@ -0,0 +1,137 @@
+import dxui from '../../../dxmodules/dxUi.js'
+import std from '../../../dxmodules/dxStd.js'
+import viewUtils from "../viewUtils.js"
+import topView from '../topView.js'
+import mainView from '../mainView.js'
+import identityVerificationView from './identityVerificationView.js'
+import screen from '../../screen.js'
+const newPwdView = {}
+newPwdView.init = function () {
+ /**************************************************鍒涘缓灞忓箷*****************************************************/
+ const screenMain = dxui.View.build('newPwdView', dxui.Utils.LAYER.MAIN)
+ newPwdView.screenMain = screenMain
+ screenMain.scroll(false)
+ screenMain.bgColor(0xffffff)
+ screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
+ topView.changeTheme(true)
+
+ newPwdView.timer = std.setInterval(() => {
+ let count = dxui.Utils.GG.NativeDisp.lvDispGetInactiveTime()
+ if (count > 15 * 1000) {
+ std.clearInterval(newPwdView.timer)
+ newPwdView.timer = null
+ dxui.loadMain(mainView.screenMain)
+ }
+ }, 1000)
+ // 濡傛灉绠$悊鍛樺瘑鐮佷负绌�,鍒欏脊鍑烘鐣岄潰,鍚﹀垯鐩存帴杩涘叆璁よ瘉鐣岄潰
+ if (screen.getConfig()['base.firstLogin'] == 1) {
+ std.clearInterval(newPwdView.timer)
+ dxui.loadMain(identityVerificationView.screenMain)
+ }
+ })
+ screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_UNLOADED, () => {
+ if (newPwdView.timer) {
+ std.clearInterval(newPwdView.timer)
+ }
+ })
+
+ const titleBox = viewUtils.title(screenMain, mainView.screenMain, 'newPwdViewTitle', 'newPwdView.title')
+ titleBox.align(dxui.Utils.ALIGN.TOP_MID, 0, 70)
+
+ const pwdInput = viewUtils.input(screenMain, 'newPwdInput', undefined, undefined, 'newPwdView.pwd')
+ pwdInput.align(dxui.Utils.ALIGN.TOP_MID, 0, 211)
+ pwdInput.setPasswordMode(true)
+
+ const eyeFill = viewUtils.imageBtn(screenMain, screenMain.id + 'eye_fill', '/app/code/resource/image/eye-fill.png')
+ eyeFill.alignTo(pwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ eyeFill.on(dxui.Utils.EVENT.CLICK, () => {
+ pwdInput.setPasswordMode(true)
+ eyeFill.hide()
+ eyeOff.show()
+ })
+ eyeFill.hide()
+
+ const eyeOff = viewUtils.imageBtn(screenMain, screenMain.id + 'eye_off', '/app/code/resource/image/eye-off.png')
+ eyeOff.alignTo(pwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ eyeOff.on(dxui.Utils.EVENT.CLICK, () => {
+ pwdInput.setPasswordMode(false)
+ eyeFill.show()
+ eyeOff.hide()
+ })
+
+ const confirmPwdInput = viewUtils.input(screenMain, 'confirmPwdInput', undefined, undefined, 'newPwdView.confirmPwd')
+ confirmPwdInput.alignTo(pwdInput, dxui.Utils.ALIGN.OUT_BOTTOM_MID, 0, 30)
+ confirmPwdInput.setPasswordMode(true)
+
+ const eyeFill2 = viewUtils.imageBtn(screenMain, screenMain.id + 'eye_fill2', '/app/code/resource/image/eye-fill.png')
+ eyeFill2.alignTo(confirmPwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ eyeFill2.on(dxui.Utils.EVENT.CLICK, () => {
+ confirmPwdInput.setPasswordMode(true)
+ eyeFill2.hide()
+ eyeOff2.show()
+ })
+ eyeFill2.hide()
+
+ const eyeOff2 = viewUtils.imageBtn(screenMain, screenMain.id + 'eye_off2', '/app/code/resource/image/eye-off.png')
+ eyeOff2.alignTo(confirmPwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ eyeOff2.on(dxui.Utils.EVENT.CLICK, () => {
+ confirmPwdInput.setPasswordMode(false)
+ eyeFill2.show()
+ eyeOff2.hide()
+ })
+
+ const tipLbl = dxui.Label.build('newPwdViewTip', screenMain)
+ tipLbl.textFont(viewUtils.font(22))
+ tipLbl.textColor(0x888888)
+ tipLbl.dataI18n = 'newPwdView.tip'
+ tipLbl.align(dxui.Utils.ALIGN.TOP_MID, 0, 530)
+
+ const skipView = dxui.View.build('skipView', screenMain)
+ viewUtils._clearStyle(skipView)
+ const skipLbl = dxui.Label.build('skipLbl', skipView)
+ skipLbl.textFont(viewUtils.font(24))
+ skipLbl.textColor(0x767676)
+ skipLbl.dataI18n = 'newPwdView.skip'
+ const skipText = skipLbl.text
+ skipLbl.text = (data) => {
+ skipText.call(skipLbl, data)
+ skipLbl.update()
+ skipView.setSize(skipLbl.width(), skipLbl.height())
+ }
+ skipLbl.borderWidth(2)
+ skipLbl.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_BOTTOM, 0)
+ skipLbl.setBorderColor(0x767676)
+
+ const pwdAccessBtn = viewUtils.bottomBtn(screenMain, screenMain.id + 'pwdAccessBtn', 'newPwdView.pwdAccess', () => {
+ if (pwdInput.text() != confirmPwdInput.text()) {
+ newPwdView.statusPanel.fail("newPwdView.pwdNotMatch")
+ return
+ }
+ const res = screen.saveConfig({
+ base: {
+ password: pwdInput.text()
+ }
+ })
+ if (res === true) {
+ newPwdView.statusPanel.success()
+ std.clearInterval(newPwdView.timer)
+ dxui.loadMain(identityVerificationView.screenMain)
+ } else {
+ newPwdView.statusPanel.fail()
+ }
+ })
+ pwdAccessBtn.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -83)
+
+ skipView.setSize(skipLbl.width(), skipLbl.height())
+ skipView.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -217)
+ skipView.on(dxui.Utils.EVENT.CLICK, () => {
+ //淇敼鐘舵��
+ screen.saveConfig({ base: { firstLogin: 1 } })
+ std.clearInterval(newPwdView.timer)
+ dxui.loadMain(identityVerificationView.screenMain)
+ })
+
+ newPwdView.statusPanel = viewUtils.statusPanel(screenMain, 'newPwdView.success', 'newPwdView.fail')
+}
+
+export default newPwdView
\ No newline at end of file
--
Gitblit v1.9.3