From cd40c6f6f3a6138cb70b2e2d017cc7f34a887ef8 Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期五, 17 四月 2026 13:59:49 +0800
Subject: [PATCH] 1.更新vf107代码,更新自动上报通行记录接口、人员查询接口、人员添加接口
---
vf107/src/view/mainView.js | 56 ++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/vf107/src/view/mainView.js b/vf107/src/view/mainView.js
index 669dcc6..7fd7566 100644
--- a/vf107/src/view/mainView.js
+++ b/vf107/src/view/mainView.js
@@ -35,10 +35,10 @@
// 鐩存帴浠巒et妯″潡鑾峰彇IP鍦板潃锛岀‘淇濊幏鍙栧埌鏈�鏂扮殑IP
let ip = ""
try {
- let netType = config["net.type"] || 1
- let netMode = net.getModeByCard(netType)
- if (netMode && netMode.param && netMode.param.ip) {
- ip = netMode.param.ip
+ // 浣跨敤getNetParam()鏂规硶鑾峰彇鏈�鏂扮殑缃戠粶鍙傛暟
+ let param = net.getNetParam()
+ if (param && param.ip) {
+ ip = param.ip
}
} catch (error) {
// 鍑洪敊鏃朵娇鐢╟onfig涓殑IP
@@ -86,10 +86,10 @@
// 鐩存帴浠巒et妯″潡鑾峰彇IP鍦板潃锛岀‘淇濊幏鍙栧埌鏈�鏂扮殑IP
let ip = ""
try {
- let netType = config["net.type"] || 1
- let netMode = net.getModeByCard(netType)
- if (netMode && netMode.param && netMode.param.ip) {
- ip = netMode.param.ip
+ // 浣跨敤getNetParam()鏂规硶鑾峰彇鏈�鏂扮殑缃戠粶鍙傛暟
+ let param = net.getNetParam()
+ if (param && param.ip) {
+ ip = param.ip
}
} catch (error) {
// 鍑洪敊鏃朵娇鐢╟onfig涓殑IP
@@ -128,6 +128,33 @@
}
}
+ // 鏇存柊缃戠粶鍥炬爣
+ function updateNetworkIcon() {
+ try {
+ let config = screen.getConfig()
+ let netType = config["net.type"] || 1
+ let isConnected = net.isConnected()
+
+ // 闅愯棌鎵�鏈夌綉缁滃浘鏍�
+ if (topView.ethShow) topView.ethShow.hide()
+ if (topView.wifiShow) topView.wifiShow.hide()
+ if (topView._4gShow) topView._4gShow.hide()
+
+ // 鏍规嵁缃戠粶绫诲瀷鍜岃繛鎺ョ姸鎬佹樉绀哄搴旂殑鍥炬爣
+ if (isConnected) {
+ if (netType === 1) { // 浠ュお缃�
+ if (topView.ethShow) topView.ethShow.show()
+ } else if (netType === 2) { // WiFi
+ if (topView.wifiShow) topView.wifiShow.show()
+ } else if (netType === 4) { // 4G
+ if (topView._4gShow) topView._4gShow.show()
+ }
+ }
+ } catch (error) {
+ logger.error('[mainView]: 鏇存柊缃戠粶鍥炬爣澶辫触:', error)
+ }
+ }
+
screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
topView.changeTheme(false)
@@ -148,6 +175,8 @@
// 绋嬪簭鍚姩鏃舵洿鏂板簱鍖哄悕绉板拰浠撳彿
updateWarehouseInfo()
+ // 鍒濆鍖栫綉缁滃浘鏍�
+ updateNetworkIcon()
// 鍙敞鍐屼竴娆′簨浠剁洃鍚櫒
if (!mainView.eventListenersRegistered) {
@@ -158,9 +187,11 @@
onStatusChange: function(netType, status) {
// 缃戠粶鐘舵�佸彉鍖栨椂鏇存柊IP淇℃伅
updateDeviceInfo()
+ // 鏇存柊缃戠粶鍥炬爣
+ updateNetworkIcon()
}
})
-
+
// 鍚姩缃戠粶浜嬩欢寰幆
std.setInterval(() => {
try {
@@ -803,9 +834,10 @@
oxygenValueContainer.flexAlign(dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.CENTER)
oxygenValueContainer.obj.lvObjSetStylePadGap(5, dxui.Utils.ENUM._LV_STYLE_STATE_CMP_SAME)
+
// 姘ф皵鏁板�奸儴鍒�
const oxygenValue = dxui.Label.build('oxygenValue', oxygenValueContainer)
- oxygenValue.text('20')
+ oxygenValue.text('-')
oxygenValue.textFont(viewUtils.font(20, dxui.Utils.FONT_STYLE.BOLD))
oxygenValue.textColor(0xffffff)
mainView.oxygenValue = oxygenValue // 璁剧疆涓簃ainView灞炴��
@@ -865,7 +897,7 @@
// 纾峰寲姘㈡暟鍊奸儴鍒�
const ph3Value = dxui.Label.build('ph3Value', ph3ValueContainer)
- ph3Value.text('0')
+ ph3Value.text('-')
ph3Value.textFont(viewUtils.font(20, dxui.Utils.FONT_STYLE.BOLD))
ph3Value.textColor(0xffffff)
mainView.ph3Value = ph3Value // 璁剧疆涓簃ainView灞炴��
@@ -909,7 +941,7 @@
// 浜屾哀鍖栫⒊鏁板�奸儴鍒�
const co2Value = dxui.Label.build('co2Value', co2ValueContainer)
- co2Value.text('400')
+ co2Value.text('-')
co2Value.textFont(viewUtils.font(20, dxui.Utils.FONT_STYLE.BOLD))
co2Value.textColor(0xffffff)
mainView.co2Value = co2Value // 璁剧疆涓簃ainView灞炴��
--
Gitblit v1.9.3