1
0

DistributedControl.ets 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import {TitleStateComp,}from '../common/component/TitleStateComp'
  2. import { BottomOperateComp } from '../common/component/BottomOperateComp';
  3. import router from '@ohos.router';
  4. @Entry
  5. @Component
  6. export struct DistributeControl{
  7. @State click:boolean=true
  8. private isHomePage: boolean = false
  9. build(){
  10. Column(){
  11. TitleStateComp({ isHomePage: this.isHomePage})
  12. Column(){
  13. Row(){
  14. Image($r('app.media.Frame'))
  15. .height('52px')
  16. .height('52px')
  17. .padding({left:20})
  18. .onClick(()=>{
  19. router.pushUrl({
  20. url:'pages/Distribute'
  21. })
  22. })
  23. Text('分布式控制')
  24. .width('80%')
  25. .fontSize('51px')
  26. .fontColor('#e6000000')
  27. .textAlign(TextAlign.Center)
  28. .height('100%')
  29. } .height('10%')
  30. .width('100%')
  31. Row(){
  32. Blank()
  33. Image($r('app.media.distributeimage'))
  34. .height('90%')
  35. .width('60%')
  36. .border({width:5})
  37. .borderRadius(21)
  38. Column(){
  39. Column(){
  40. }.width('100%')
  41. .height('20%')
  42. Column({space:60}){
  43. if(this.click===true){
  44. Column(){
  45. Image($r('app.media.suoping'))
  46. .width('150px')
  47. .height('150px')
  48. .onClick(()=>{
  49. this.click=false
  50. })
  51. Text('锁屏')
  52. .fontSize('32px')
  53. .fontColor('#e6000000')
  54. .fontWeight(FontWeight.Medium)
  55. }
  56. } else if (this.click===false) {
  57. Column(){
  58. Image($r('app.media.unlock'))
  59. .width('150px')
  60. .height('150px')
  61. .onClick(()=>{
  62. this.click=true
  63. })
  64. Text('解锁')
  65. .fontSize('32px')
  66. .fontColor('#e6000000')
  67. .fontWeight(FontWeight.Medium)
  68. }
  69. }
  70. Column(){
  71. Image($r('app.media.xiping'))
  72. .width('150px')
  73. .height('150px')
  74. .onClick(()=>{
  75. this.click=true
  76. })
  77. Text('熄屏')
  78. .fontSize('32px')
  79. .fontColor('#e6000000')
  80. .fontWeight(FontWeight.Medium)
  81. }
  82. }.width('100%')
  83. .height('60%')
  84. Column(){
  85. Text('退出')
  86. .width('70%')
  87. .height('50%')
  88. .fontColor('#fff')
  89. .borderRadius(21)
  90. .textAlign(TextAlign.Center)
  91. .backgroundColor("#0A59F7")
  92. .onClick(()=>{
  93. router.pushUrl({
  94. url:'pages/Distribute'
  95. })
  96. })
  97. }.width('100%')
  98. .height('20%')
  99. .justifyContent(FlexAlign.Center)
  100. }.height("100%")
  101. .width('25%')
  102. .justifyContent(FlexAlign.Center)
  103. }
  104. .width('100%')
  105. .height('90%')
  106. }
  107. .width('100%')
  108. .height('84%')
  109. BottomOperateComp({ isHomePage: this.isHomePage })
  110. }.width('100%')
  111. .height('100%')
  112. }
  113. }