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/idleView.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/vf205_access/src/view/idleView.js b/vf205_access/src/view/idleView.js
new file mode 100644
index 0000000..fb0ff43
--- /dev/null
+++ b/vf205_access/src/view/idleView.js
@@ -0,0 +1,54 @@
+import dxui from '../../dxmodules/dxUi.js'
+import viewUtils from './viewUtils.js'
+import std from '../../dxmodules/dxStd.js'
+import i18n from './i18n.js'
+import screen from '../screen.js'
+const idleView = {}
+idleView.init = function () {
+ /**************************************************鍒涘缓灞忓箷*****************************************************/
+ const screenMain = dxui.View.build('idleView', dxui.Utils.LAYER.SYS)
+ idleView.screenMain = screenMain
+ viewUtils._clearStyle(screenMain)
+ screenMain.hide()
+ screenMain.scroll(false)
+ screenMain.width(screen.screenSize.width)
+ screenMain.height(screen.screenSize.height)
+
+ const idleImage = dxui.Image.build('idleImage', screenMain)
+ // 灞忎繚鍥剧墖
+ idleImage.source('/app/code/resource/image/idleImage.jpg')
+
+ const dateBox = dxui.View.build('dateBox', screenMain)
+ viewUtils._clearStyle(dateBox)
+ dateBox.width(600)
+ dateBox.height(200)
+ dateBox.align(dxui.Utils.ALIGN.CENTER, 0, 0)
+ dateBox.bgOpa(0)
+
+ const timeLbl = dxui.Label.build(dateBox.id + 'timeLbl', dateBox)
+ timeLbl.textFont(viewUtils.font(80, dxui.Utils.FONT_STYLE.BOLD))
+ timeLbl.text("10:00:00")
+ timeLbl.textColor(0xffffff)
+ timeLbl.align(dxui.Utils.ALIGN.TOP_MID, 0, 0)
+
+ const dateLbl = dxui.Label.build(dateBox.id + 'dateLbl', dateBox)
+ dateLbl.textFont(viewUtils.font(40))
+ dateLbl.text("2025-01-17 鍛ㄤ簲")
+ dateLbl.textColor(0xffffff)
+ dateLbl.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, 0)
+
+ std.setInterval(() => {
+ const t = new Date();
+ // 琛ラ浂鍑芥暟
+ const pad = (n) => n < 10 ? `0${n}` : n;
+ // 鑾峰彇鏄熸湡鐨勫浗闄呭寲鏂囨湰
+ const weekDay = i18n.t(`idleView.week.${t.getDay()}`);
+
+ timeLbl.text(`${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}`)
+ dateLbl.text(`${t.getFullYear()}-${pad(t.getMonth() + 1)}-${pad(t.getDate())} ${weekDay}`)
+ }, 1000, true)
+
+}
+
+
+export default idleView
\ No newline at end of file
--
Gitblit v1.9.3