EmptyBoxStorage.ets 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. import {NavigationBar} from '../component/NavigationBar'
  2. import {TimeAndTitle} from "../component/TimeAndTitle"
  3. import {InBoundView} from '../component/InBoundView'
  4. import router from '@ohos.router';
  5. @Entry
  6. @Component
  7. struct emptyBoxStorage {
  8. @State materialBoxID: string = 'LX-00010';
  9. @State isMaterialBoxExist: Boolean = true;
  10. @State isPrinterOnline: Boolean = true;
  11. @State isRfidOnline: Boolean = true;
  12. @State messages: string[] = [
  13. "抽屉伸出成功 12-12-12",
  14. "抽屉伸出成功 12-12-12",
  15. "抽屉伸出成功 12-12-12",
  16. "抽屉伸出成功 12-12-12"
  17. ]
  18. build() {
  19. Row() {
  20. Column() {
  21. Row(){
  22. TimeAndTitle()
  23. }.width('100%')
  24. .height('3.4%')
  25. .alignItems(VerticalAlign.Bottom)
  26. .justifyContent(FlexAlign.End)
  27. Row(){
  28. Image($r('app.media.general_return'))
  29. .height($r('app.float.virtualSize_22_4'))
  30. .width($r('app.float.virtualSize_22_4'))
  31. .fillColor($r('app.color.FFFFFF'))
  32. // .onClick(()=> {
  33. // router.back()
  34. // })
  35. Text('空箱入库')
  36. .fontColor($r('app.color.FFFFFF'))
  37. .fontSize($r('app.float.fontSize_15_2'))
  38. }
  39. .height('4%')
  40. .width('100%')
  41. .justifyContent(FlexAlign.Start)
  42. .margin({left:'5%'})
  43. .onClick(()=> {
  44. router.back()
  45. })
  46. Row(){
  47. NavigationBar().width('20%')
  48. }
  49. .width('100%')
  50. .height('4%')
  51. .justifyContent(FlexAlign.End)
  52. Row(){
  53. Row(){
  54. Column(){
  55. Text("生成编号")
  56. .fontColor($r('app.color.FFFFFF'))
  57. .fontSize($r('app.float.fontSize_15_2'))
  58. .margin({top:'3%'})
  59. Row(){
  60. Stack() {
  61. Image(this.isMaterialBoxExist? $r('app.media.identified_material_box'):$r('app.media.not_identified_material_box'))
  62. .width('100%')
  63. .height('100%')
  64. .borderRadius($r('app.float.virtualSize_6_4'))
  65. .objectFit(ImageFit.Contain)
  66. Text("LX-00010")
  67. .fontSize($r('app.float.fontSize_19_2'))
  68. .fontColor($r('app.color.FFFFFF'))
  69. .position({
  70. x: '38%', // 水平位置
  71. y: '80%', // 垂直位置
  72. })
  73. Text("已生成新编号")
  74. .fontSize($r('app.float.fontSize_6'))
  75. .fontColor($r('app.color.60FFFFFF'))
  76. .position({
  77. x: '45%', // 水平位置
  78. y: '87%', // 垂直位置
  79. })
  80. }
  81. }
  82. .margin({top:'3%'})
  83. .height('75%')
  84. .width('100%')
  85. Button({type:ButtonType.Normal}) {
  86. Row() {
  87. Image($r('app.media.material_qr_code'))
  88. .width('15%')
  89. .height('45%')
  90. .margin({ right: 8 })
  91. .fillColor($r('app.color.0A84FF'))
  92. Text("生成料箱编号")
  93. .fontSize($r('app.float.fontSize_12'))
  94. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  95. }
  96. .justifyContent(FlexAlign.Center)
  97. }
  98. .margin({top:'10%'})
  99. .width('35%')
  100. .height('6%')
  101. .backgroundColor($r('app.color.20FFFFFF'))
  102. .borderRadius($r('app.float.virtualSize_6_4'))
  103. .onClick(() => {
  104. // 按钮点击事件处理
  105. })
  106. }
  107. .height('100%')
  108. .width('45%')
  109. .justifyContent(FlexAlign.Start)
  110. Image($r('app.media.arrow_right'))
  111. .width($r('app.float.virtualSize_23'))
  112. .height($r('app.float.virtualSize_23'))
  113. .fillColor($r('app.color.FFFFFF'))
  114. Column(){
  115. Text("打印条码")
  116. .fontColor($r('app.color.FFFFFF'))
  117. .fontSize($r('app.float.fontSize_15_2'))
  118. .margin({top:'3%'})
  119. Column(){
  120. Image(this.isPrinterOnline? $r('app.media.printer_online'):$r('app.media.printer_offline'))
  121. .width('100%')
  122. .height('40%')
  123. .borderRadius($r('app.float.virtualSize_6_4'))
  124. .objectFit(ImageFit.Contain)
  125. //.margin({top:'3%'})
  126. Button({type:ButtonType.Normal}) {
  127. Row() {
  128. Image($r('app.media.material_qr_code'))
  129. .width('15%')
  130. .height('50%')
  131. .margin({ right: 8 })
  132. .fillColor($r('app.color.0A84FF'))
  133. Text("打印编号")
  134. .fontSize($r('app.float.fontSize_12'))
  135. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  136. }
  137. .justifyContent(FlexAlign.Center)
  138. }
  139. .margin({top:'6%'})
  140. .width('35%')
  141. .height('8%')
  142. .backgroundColor($r('app.color.20FFFFFF'))
  143. .borderRadius($r('app.float.virtualSize_6_4'))
  144. .onClick(() => {
  145. // 按钮点击事件处理
  146. })
  147. Divider()
  148. .margin({top:'3%'})
  149. .vertical(false)
  150. .strokeWidth(1)
  151. .color($r('app.color.10FFFFFF'))
  152. .width('100%')
  153. Text("写入磁卡")
  154. .fontColor($r('app.color.FFFFFF'))
  155. .fontSize($r('app.float.fontSize_15_2'))
  156. .margin({top:'3%'})
  157. Image(this.isRfidOnline? $r('app.media.rfid_online'):$r('app.media.rfid_offline'))
  158. .width('100%')
  159. .height('40%')
  160. .margin({top:'1%'})
  161. .borderRadius($r('app.float.virtualSize_6_4'))
  162. .objectFit(ImageFit.Contain)
  163. }
  164. // .margin({top:'3%'})
  165. .height('75%')
  166. .width('100%')
  167. .justifyContent(FlexAlign.Start)
  168. Row(){
  169. Text("当前编号:")
  170. .fontColor($r('app.color.FFFFFF'))
  171. .fontSize($r('app.float.fontSize_9_6'))
  172. .margin({top:'3%'})
  173. Text("LX-00010")
  174. .fontColor($r('app.color.0A84FF'))
  175. .fontSize($r('app.float.fontSize_9_6'))
  176. .margin({top:'3%'})
  177. }.height('5%')
  178. .margin({top:'2%'})
  179. Button({type:ButtonType.Normal}) {
  180. Row() {
  181. Image($r('app.media.material_qr_code'))
  182. .width('15%')
  183. .height('45%')
  184. .margin({ right: 8 })
  185. .fillColor($r('app.color.0A84FF'))
  186. Text("写入磁卡")
  187. .fontSize($r('app.float.fontSize_12'))
  188. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  189. }
  190. .justifyContent(FlexAlign.Center)
  191. }
  192. .margin({top:'3%'})
  193. .width('35%')
  194. .height('6%')
  195. .backgroundColor($r('app.color.20FFFFFF'))
  196. .borderRadius($r('app.float.virtualSize_6_4'))
  197. .onClick(() => {
  198. // 按钮点击事件处理
  199. })
  200. }
  201. .justifyContent(FlexAlign.Start)
  202. .width('45%')
  203. .height('100%')
  204. }
  205. .width('60%')
  206. .height('85%')
  207. .justifyContent(FlexAlign.SpaceAround)
  208. .backgroundColor($r('app.color.10FFFFFF'))
  209. Image($r('app.media.arrow_right'))
  210. .width($r('app.float.virtualSize_23'))
  211. .height($r('app.float.virtualSize_23'))
  212. .fillColor($r('app.color.FFFFFF'))
  213. .margin({left:'-2%',right:'-2%'})
  214. Column(){
  215. InBoundView({messages:this.messages});
  216. }
  217. .width('29%')
  218. .height('85%')
  219. .backgroundColor($r('app.color.10FFFFFF'))
  220. .justifyContent(FlexAlign.Center)
  221. }
  222. .height('88.6%')
  223. .width('100%')
  224. .justifyContent(FlexAlign.SpaceEvenly)
  225. }
  226. .width('100%')
  227. .backgroundColor($r('app.color.000000'))
  228. }
  229. .height('100%')
  230. }
  231. }