EditGreenPlantPageModel.ets 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import dayjs from "dayjs"
  2. import { DateFrequency } from "../constants"
  3. @ObservedV2
  4. export class EditGreenPlantPageModel{
  5. @Trace
  6. swiperController:SwiperController=new SwiperController()
  7. @Trace
  8. swiperComController:SwiperController[]=[
  9. new SwiperController(),
  10. new SwiperController(),
  11. new SwiperController(),
  12. new SwiperController(),
  13. ]
  14. /**
  15. * 新增绿植
  16. */
  17. @Trace
  18. greenPlantsName:string=""
  19. @Trace
  20. greenPlantsPicture:string=""
  21. //新增提醒间隔类型
  22. @Trace
  23. frequency:string=DateFrequency.NONE //默认一次
  24. // @Trace
  25. // siw:SwiperController=new SwiperController()
  26. //提醒事项id
  27. @Trace
  28. remindTaskItemId:number=0
  29. //提醒事项名称
  30. @Trace
  31. remindTaskName:string=""
  32. //t提醒事项图标
  33. @Trace
  34. remindTaskUrl:string=""
  35. //植物id,植物名称
  36. @Trace
  37. remindPlantsId:number=0
  38. @Trace
  39. remindPlantsName:string=""
  40. // @Local
  41. // clockDate:string=""
  42. // @Local
  43. // clockTime:string=""
  44. /**
  45. * 新增事项
  46. */
  47. @Trace taskName:string=""
  48. @Trace taskUrl:string=""
  49. /**
  50. * 时间间隔
  51. */
  52. //时间
  53. @Trace
  54. time:string=""
  55. //日期
  56. @Trace
  57. date:string=dayjs(new Date).format('YYYY-MM-DD')
  58. //间隔天数
  59. @Trace
  60. dayNumber:string=""
  61. //每周几
  62. @Trace
  63. week:string=""
  64. //每月几号
  65. @Trace
  66. mon:string=""
  67. /**
  68. * 养护打卡方面
  69. */
  70. /**
  71. * 新增打卡记录
  72. */
  73. @Trace
  74. taskItemId:number=0
  75. @Trace
  76. taskItemName:string=""
  77. @Trace
  78. plantsId:number=0
  79. @Trace
  80. plantsName:string=""
  81. @Trace
  82. clockDate:string=""
  83. @Trace
  84. clockTime:string=""
  85. @Trace
  86. isshowRed:boolean=false
  87. @Monitor('date')
  88. onNameChangeDate(monitor: IMonitor) {
  89. if(dayjs(this.date+" "+this.time).valueOf()<dayjs(new Date()).valueOf()){
  90. //提醒的时间在当前时间之前
  91. this.isshowRed=true
  92. }else{
  93. this.isshowRed=false
  94. }
  95. }
  96. @Monitor('time')
  97. onNameChangeTime(monitor: IMonitor) {
  98. if(dayjs(this.date+" "+this.time).valueOf()<dayjs(new Date()).valueOf()){
  99. //提醒的时间在当前时间之前
  100. this.isshowRed=true
  101. }else{
  102. this.isshowRed=false
  103. }
  104. }
  105. }