classList.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // pages/Components/classList/classList.js
  2. Component({
  3. lifetimes:{
  4. attached:function(){
  5. wx.getSystemInfo({
  6. success: (result) => {
  7. this.setData({
  8. height: result.windowHeight
  9. })
  10. },
  11. })
  12. }
  13. },
  14. /**
  15. * 组件的属性列表
  16. */
  17. properties: {
  18. showLeaveNum: { //是否显示请假余额
  19. type: Boolean,
  20. value: false
  21. },
  22. showTime:{ //是否显示上课时间
  23. type: Boolean,
  24. value: true
  25. },
  26. showFlag:{ //是否显示上课状态
  27. type: Boolean,
  28. value: true
  29. },
  30. showBtn:{ //是否显示功能按钮
  31. type:Boolean,
  32. value: false,
  33. },
  34. showRadio:{ //是否显示单选按钮
  35. type:Boolean,
  36. value: false,
  37. },
  38. date: {
  39. type: String
  40. },
  41. list: {
  42. type: Array,
  43. value: []
  44. }
  45. },
  46. /**
  47. * 组件的初始数据
  48. */
  49. data: {
  50. animation: null,
  51. height:0,
  52. overflow: 'auto',
  53. },
  54. /**
  55. * 组件的方法列表
  56. */
  57. methods: {
  58. toPages:function(e){
  59. wx.navigateTo({
  60. url: e.currentTarget.dataset.url,
  61. })
  62. },
  63. showChoose:function(){
  64. this.animation = wx.createAnimation({
  65. timingFunction: 'linear',
  66. })
  67. const bottom = 0
  68. this.animation.translateY(bottom).step()
  69. this.setData({
  70. overflow: 'hidden',
  71. animation:this.animation.export(),
  72. bottom
  73. })
  74. },
  75. hideChoose:function(){
  76. this.animation = wx.createAnimation({
  77. timingFunction: 'linear',
  78. })
  79. const bottom = 2000
  80. this.animation.translateY(bottom).step()
  81. this.setData({
  82. overflow: 'auto',
  83. animation:this.animation.export(),
  84. })
  85. setTimeout(() => {
  86. this.setData({
  87. bottom
  88. })
  89. }, 400);
  90. },
  91. getLeaveNumList: function () {
  92. wx.navigateTo({
  93. url: '/pages/leaveRecord/leaveRecord',
  94. })
  95. },
  96. radioChange:function(e){
  97. console.log(JSON.stringify(e.detail.value))
  98. },
  99. }
  100. })