--[[ @module tsb_update_page @summary 更新页面 @version 1.0 @date 2026.03.04 @author 李一玮 @usage 本文件是更新页面,展示更新的各种用法。 ]] local tsb_update_page = {} -- 页面UI元素 local main_container = nil local common_ui = require("tsb_common_page") -- 创建UI function tsb_update_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 = 0xA5D6A7, }) 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_update_page.cleanup) --------------------------------------------------- -- 滚动容器 local scroll_container = airui.container({ parent = main_container, x = 0, y = 30, w = 480, h = 270, color = 0xFFFFFF, }) --------------------- 检查更新 ----------------------- local update_btn = airui.button({ parent = scroll_container, x = 15, y = 15, w = 120, h = 40, text = "检查设备更新", on_click = function() log.info("检查设备更新") end }) -- 底部信息 common_ui.create_status_bar(main_container) end -- 初始化页面 function tsb_update_page.init(params) tsb_update_page.create_ui() end -- 清理页面 function tsb_update_page.cleanup() if main_container then main_container:destroy() main_container = nil end end return tsb_update_page