tsb_help_page.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --[[
  2. @module tsb_help_page
  3. @summary 帮助页面
  4. @version 1.0
  5. @date 2026.03.17
  6. @author 李一玮
  7. @usage
  8. 本文件是帮助页面,展示帮助的各种用法。
  9. ]]
  10. local tsb_help_page = {}
  11. -- 页面UI元素
  12. local main_container = nil
  13. local common_ui = require("tsb_common_page")
  14. -- 创建UI
  15. function tsb_help_page .create_ui()
  16. main_container = airui.container({
  17. x = 0,
  18. y = 0,
  19. w = 480,
  20. h = 320,
  21. color = 0xF5F5F5,
  22. })
  23. --------------------- 标题栏 ------------------------
  24. local title_bar = airui.container({
  25. parent = main_container,
  26. x = 0,
  27. y = 0,
  28. w = 480,
  29. h = 30,
  30. color = 0xCE93D8,
  31. })
  32. airui.label({
  33. parent = title_bar,
  34. text = "帮助界面",
  35. x = 190,
  36. y = 8,
  37. w = 200,
  38. h = 20,
  39. font_size = 16,
  40. color = 0xFFFFFF,
  41. })
  42. -- 标题栏公共信息展示
  43. common_ui.add_battery_display(title_bar)
  44. common_ui.create_back_button(title_bar, tsb_help_page .cleanup)
  45. -- 滚动容器
  46. local scroll_container = airui.container({
  47. parent = main_container,
  48. x = 0,
  49. y = 30,
  50. w = 480,
  51. h = 290,
  52. color = 0xFFFFFF,
  53. })
  54. local hardware_img = airui.image({
  55. parent = scroll_container,
  56. x = 0,
  57. y = 0,
  58. w = 480,
  59. h = 290,
  60. src = "/luadb/hardware.png",
  61. zoom = 145,
  62. opacity = 255,
  63. })
  64. ---------------------------------------------------
  65. -- 底部信息
  66. --common_ui.create_status_bar(main_container)
  67. end
  68. -- 初始化页面
  69. function tsb_help_page .init(params)
  70. tsb_help_page .create_ui()
  71. end
  72. -- 清理页面
  73. function tsb_help_page .cleanup()
  74. common_ui.cleanup()
  75. if main_container then
  76. main_container:destroy()
  77. main_container = nil
  78. end
  79. end
  80. return tsb_help_page