TaskComp.ets 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. import {task, taskclass} from '../util/request/StorageRequestInstance'
  2. @Component
  3. export struct TaskComp {
  4. @State bugNum:number=0
  5. @State completeNum:number=0
  6. @State kittingNum:number=0
  7. @State planNum:number=0
  8. private isHomePage?: boolean = false
  9. aboutToAppear() {
  10. ////获取仓储占有率
  11. task().then((res: taskclass) => {
  12. console.log("on page show11", res.bugNum, res.completeNum, res.kittingNum, res.planNum
  13. )
  14. this.bugNum = res.bugNum, this.completeNum = res.completeNum, this.kittingNum = res.kittingNum
  15. this.planNum = res.planNum
  16. })
  17. }
  18. build(){
  19. //中间框
  20. Row(){
  21. Column(){
  22. Text('未完成计划')
  23. .fontSize(px2vp(27))
  24. .opacity(0.6)
  25. .fontColor('#FFFFFF')
  26. .width('100%')
  27. .fontWeight(FontWeight.Bold)
  28. .padding({left:10,top:10})
  29. Text('20')
  30. .fontSize(px2vp(64))
  31. .fontColor('#FFFFFF')
  32. .width('100%')
  33. .fontWeight(FontWeight.Bold)
  34. .padding({left:10,top:10})
  35. Blank()
  36. Text('产品种类:'+"11")
  37. .fontSize(px2vp(27))
  38. .opacity(0.6)
  39. .fontColor('#FFFFFF')
  40. .width('100%')
  41. .fontWeight(FontWeight.Bold)
  42. .padding({left:10,top:10,bottom:10})
  43. }.width('40%')
  44. .backgroundImage($r('app.media.Unfinished_Plan'))
  45. .backgroundImageSize({width:'100%',height:'100%'})
  46. .height('100%')
  47. .borderRadius(15)
  48. //左右column
  49. Column(){
  50. //左边
  51. Column(){
  52. Row(){
  53. Blank()
  54. Image($r("app.media.Unfinished_orders"))
  55. .width('38px')
  56. .height('38px')
  57. Text().width('5%')
  58. Text('今日计划').width('40%')
  59. .height('100%')
  60. .fontColor('#99000000')
  61. .fontSize(px2vp(19))
  62. .fontWeight(FontWeight.Regular)
  63. Blank()
  64. }.width('100%')
  65. .height('30%')
  66. Text(this.planNum.toString()).width('80%')
  67. .height('70%')
  68. .fontColor('#e6000000')
  69. .textAlign(TextAlign.Center)
  70. .fontSize(px2vp(64))
  71. .fontWeight(FontWeight.Bold)
  72. }.width('100%')
  73. .height('50%')
  74. Divider().vertical(false)
  75. .width('80%')
  76. Blank()
  77. Column(){
  78. Blank()
  79. Row(){
  80. Blank()
  81. Image($r("app.media.completeMaterials"))
  82. .width('38px')
  83. .height('38px')
  84. Text().width('5%')
  85. Text('主料齐套').width('40%')
  86. .height('100%')
  87. .fontColor('#99000000')
  88. .fontSize(px2vp(19))
  89. .fontWeight(FontWeight.Regular)
  90. Blank()
  91. }.width('100%')
  92. .height('30%')
  93. Text(this.kittingNum.toString()).width('80%')
  94. .height('60%')
  95. .fontColor('#e6000000')
  96. .textAlign(TextAlign.Center)
  97. .fontSize(px2vp(64))
  98. .fontWeight(FontWeight.Bold)
  99. }.width('100%')
  100. .height('50%')
  101. }.width('30%')
  102. .height('70%')
  103. .borderRadius(15)
  104. .alignItems(HorizontalAlign.End)
  105. Divider().vertical(true)
  106. .height('60%')
  107. Column(){
  108. //右边
  109. Column(){
  110. Row(){
  111. Blank()
  112. Image($r("app.media.completedToday"))
  113. .width('38px')
  114. .height('38px')
  115. Text().width('5%')
  116. Text('今日完成').width('40%')
  117. .height('100%')
  118. .fontColor('#99000000')
  119. .fontSize(px2vp(19))
  120. .fontWeight(FontWeight.Regular)
  121. Blank()
  122. }.width('100%')
  123. .height('30%')
  124. Text(this.completeNum.toString()).width('80%')
  125. .height('70%')
  126. .fontColor('#e6000000')
  127. .textAlign(TextAlign.Center)
  128. .fontSize(px2vp(64))
  129. .fontWeight(FontWeight.Bold)
  130. }.width('100%')
  131. .height('50%')
  132. Divider().vertical(false)
  133. .width('80%')
  134. Column(){
  135. Blank()
  136. Row(){
  137. Blank()
  138. Image($r("app.media.todayReport"))
  139. .width('38px')
  140. .height('38px')
  141. Text().width('5%')
  142. Text('今日报故').width('40%')
  143. .height('100%')
  144. .fontColor('#99000000')
  145. .fontSize(px2vp(19))
  146. .fontWeight(FontWeight.Regular)
  147. Blank()
  148. }.width('100%')
  149. .height('30%')
  150. Text(this.bugNum.toString()).width('80%')
  151. .height('60%')
  152. .fontColor('#e6000000')
  153. .textAlign(TextAlign.Center)
  154. .fontSize(px2vp(64))
  155. .fontWeight(FontWeight.Bold)
  156. }.width('100%')
  157. .height('50%')
  158. }.width('30%')
  159. .height('70%')
  160. .borderRadius(15)
  161. .alignItems(HorizontalAlign.Start)
  162. }
  163. .padding(10)
  164. .width('100%')
  165. .height('100%')
  166. .backgroundColor('#F1F3F5')
  167. .borderRadius(15)
  168. .margin({left:10})
  169. }
  170. }