| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- --[[
- @module tsb_devinfo_page
- @summary 设备信息页面
- @version 1.0
- @date 2026.03.04
- @author 李一玮
- @usage
- 本文件是设备信息页面,展示设备的各种信息。
- ]]
- local tsb_devinfo_page = {}
- -- 页面UI元素
- local main_container = nil
- local common_ui = require("tsb_common_page")
- -- 创建UI
- function tsb_devinfo_page.create_ui()
- main_container = airui.container({
- x = 0,
- y = 0,
- w = 480,
- h = 320,
- color = 0xF5F5F5,
- })
- --------------------- 标题栏 ------------------------
- local title_bar = airui.container({
- parent = main_container,
- x = 0,
- y = 0,
- w = 480,
- h = 30,
- color = 0xB3E5FC,
- })
- airui.label({
- parent = title_bar,
- text = "本机信息",
- x = 200,
- y = 8,
- w = 80,
- h = 20,
- font_size = 16,
- color = 0xFFFFFF,
- })
- -- 标题栏公共信息展示
- common_ui.add_battery_display(title_bar)
- common_ui.create_back_button(title_bar, tsb_devinfo_page.cleanup)
- ---------------------------------------------------
- -- 滚动容器
- local scroll_container = airui.container({
- parent = main_container,
- x = 0,
- y = 30,
- w = 480,
- h = 270,
- color = 0xFFFFFF,
- })
- --------------------- 设备信息展示 ------------------------
- -- 程序版本
- airui.label({
- parent = scroll_container,
- text = "程序版本:",
- x = 20,
- y = 20,
- w = 100,
- h = 30,
- font_size = 16,
- })
- local version_label = airui.label({
- parent = scroll_container,
- text = "V1.0.0",
- x = 120,
- y = 20,
- w = 200,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- -- 运行时间
- airui.label({
- parent = scroll_container,
- text = "运行时间:",
- x = 20,
- y = 60,
- w = 100,
- h = 30,
- font_size = 16,
- })
- local runtime_label = airui.label({
- parent = scroll_container,
- text = "00:00:00",
- x = 120,
- y = 60,
- w = 200,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- -- 设备复位次数
- airui.label({
- parent = scroll_container,
- text = "设备复位次数:",
- x = 20,
- y = 100,
- w = 120,
- h = 30,
- font_size = 16,
- })
- local reset_count_label = airui.label({
- parent = scroll_container,
- text = "0",
- x = 140,
- y = 100,
- w = 200,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- -- 设备SN
- airui.label({
- parent = scroll_container,
- text = "设备SN:",
- x = 20,
- y = 140,
- w = 100,
- h = 30,
- font_size = 16,
- })
- local device_sn_label = airui.label({
- parent = scroll_container,
- text = "SN001",
- x = 120,
- y = 140,
- w = 200,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- -- IMEI
- airui.label({
- parent = scroll_container,
- text = "IMEI:",
- x = 20,
- y = 180,
- w = 100,
- h = 30,
- font_size = 16,
- })
- local imei_label = airui.label({
- parent = scroll_container,
- text = "123456789012345",
- x = 120,
- y = 180,
- w = 300,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- -- ICCID
- airui.label({
- parent = scroll_container,
- text = "ICCID:",
- x = 20,
- y = 220,
- w = 100,
- h = 30,
- font_size = 16,
- })
- local iccid_label = airui.label({
- parent = scroll_container,
- text = "8986012345678901234",
- x = 120,
- y = 220,
- w = 300,
- h = 30,
- font_size = 16,
- color = 0x666666,
- })
- ---------------------------------------------------
- -- 底部信息
- common_ui.create_status_bar(main_container)
- end
- -- 初始化页面
- function tsb_devinfo_page.init(params)
- tsb_devinfo_page.create_ui()
- end
- -- 清理页面
- function tsb_devinfo_page.cleanup()
- if main_container then
- main_container:destroy()
- main_container = nil
- end
- end
- return tsb_devinfo_page
|