lgq
3 天以前 081f12a52906abe6c2d139fdc144135978681009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import dxui from '../../../../../dxmodules/dxUi.js'
import viewUtils from "../../../viewUtils.js"
import topView from "../../../topView.js"
import deviceInfoView from '../deviceInfoView.js'
import i18n from "../../../i18n.js"
 
import screen from '../../../../screen.js'
const systemInfoView = {}
systemInfoView.init = function () {
    /**************************************************创建屏幕*****************************************************/
    const screenMain = dxui.View.build('systemInfoView', dxui.Utils.LAYER.MAIN)
    systemInfoView.screenMain = screenMain
    screenMain.scroll(false)
    screenMain.bgColor(0xffffff)
    screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
        topView.changeTheme(true)
 
        const config = screen.getConfig()
        systemInfoView.info[0].label.text(config["sys.sn"])
        systemInfoView.info[1].label.text(config["sys.appVersion"])
        systemInfoView.info[2].label.text(config["sys.releaseTime"])
    })
 
    const titleBox = viewUtils.title(screenMain, deviceInfoView.screenMain, 'systemInfoViewTitle', 'deviceInfoView.systemInfo')
    titleBox.align(dxui.Utils.ALIGN.TOP_MID, 0, screen.screenSize.height * (50 / 1024))
 
    systemInfoView.info = [
        {
            title: "deviceInfoView.deviceSN",
            type: 'label',
            value: 'G2440288881',
        },
        {
            title: "deviceInfoView.firmwareVersion",
            type: 'label',
            value: 'VF203-v1.1.36.3a885-240611',
        },
        {
            title: "deviceInfoView.firmwareReleaseDate",
            type: 'label',
            value: '2024-06-11 18:00:00',
        },
    ]
 
    const settingInfoBox = dxui.View.build('settingInfoBox', screenMain)
    viewUtils._clearStyle(settingInfoBox)
    settingInfoBox.align(dxui.Utils.ALIGN.TOP_MID, 0, screen.screenSize.height * (140 / 1024))
    settingInfoBox.setSize(screen.screenSize.width * (600 / 600), screen.screenSize.height * (700 / 1024))
    settingInfoBox.bgOpa(0)
    settingInfoBox.flexFlow(dxui.Utils.FLEX_FLOW.ROW_WRAP)
    settingInfoBox.flexAlign(dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.START, dxui.Utils.FLEX_ALIGN.START)
    settingInfoBox.obj.lvObjSetStylePadGap(screen.screenSize.width * (0 / 600), dxui.Utils.ENUM._LV_STYLE_STATE_CMP_SAME)
    settingInfoBox.borderWidth(screen.screenSize.width * (1 / 600))
    settingInfoBox.setBorderColor(0xDEDEDE)
    settingInfoBox.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_TOP, 0)
 
    systemInfoView.info.forEach(item => {
        const itemBox = dxui.View.build(item.title, settingInfoBox)
        viewUtils._clearStyle(itemBox)
        itemBox.setSize(screen.screenSize.width * (560 / 600), screen.screenSize.height * (76 / 1024))
        itemBox.borderWidth(screen.screenSize.width * (1 / 600))
        itemBox.setBorderColor(0xDEDEDE)
        itemBox.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_BOTTOM, 0)
 
        const itemLabel = dxui.Label.build(item.title + 'Label', itemBox)
        itemLabel.dataI18n = item.title
        itemLabel.align(dxui.Utils.ALIGN.LEFT_MID, 0, 0)
        itemLabel.textFont(viewUtils.font(26))
 
        switch (item.type) {
            case 'label':
                const label = dxui.Label.build(item.title + 'label', itemBox)
                label.textFont(viewUtils.font(24))
                label.align(dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
                label.text(item.value)
                label.textColor(0x767676)
                item.label = label
                break;
        }
    })
 
    const currentVersion = dxui.Label.build('deviceInfoView.currentVersion', screenMain)
    currentVersion.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -screen.screenSize.height * (213 / 1024))
    currentVersion.textFont(viewUtils.font(22))
    currentVersion.textColor(0x888888)
    currentVersion.dataI18n = 'deviceInfoView.currentVersion'
    currentVersion.textAlign(dxui.Utils.TEXT_ALIGN.CENTER, 0, 0)
    currentVersion.hide()
 
    const saveBtn = viewUtils.bottomBtn(screenMain, screenMain.id + 'saveBtn', 'deviceInfoView.updateDevice', () => {
    })
    saveBtn.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -screen.screenSize.height * (40 / 1024))
    saveBtn.hide()
}
 
export default systemInfoView