lattice.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. // pages/tabber/news/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. selectInfo: {},
  8. latticelist: [
  9. {
  10. num: 1,
  11. status: '待收',
  12. color: '#FF7300',
  13. },
  14. {
  15. num: 2,
  16. status: '待收',
  17. color: '#FF7300',
  18. },
  19. {
  20. num: 3,
  21. status: '已存',
  22. color: '#408FED',
  23. },
  24. {
  25. num: 4,
  26. status: '暂存',
  27. color: '#8B5728',
  28. },
  29. {
  30. num: 5,
  31. status: '冻结',
  32. color: '#D1011D',
  33. },
  34. {
  35. num: 6,
  36. status: '空闲',
  37. color: '#55BE19',
  38. },
  39. {
  40. num: 7,
  41. status: '空闲',
  42. color: '#55BE19',
  43. },
  44. {
  45. num: 8,
  46. status: '空闲',
  47. color: '#55BE19',
  48. },
  49. {
  50. num: 9,
  51. status: '空闲',
  52. color: '#55BE19',
  53. },
  54. ],
  55. state:"",
  56. detashow:true,
  57. show:true,
  58. },
  59. /**
  60. * 生命周期函数--监听页面加载
  61. */
  62. onLoad: function (options) {
  63. class Select {
  64. in = 1
  65. getSelet() {
  66. console.log(2);
  67. return 10
  68. }
  69. }
  70. var b = new Select();
  71. console.log(b.getSelet());
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady: function () {
  77. const query = wx.createSelectorQuery()
  78. query.select('#nav').boundingClientRect((res) => {
  79. console.log(res);
  80. this.setData({
  81. selectInfo: res
  82. })
  83. })
  84. query.exec()
  85. },
  86. //点击变色 显示按钮
  87. seled:function(e){
  88. this.setData({
  89. state: e.currentTarget.dataset.key,
  90. });
  91. },
  92. deta:function(){
  93. if(this.data.detashow){
  94. this.setData({
  95. detashow: false,
  96. });
  97. }else{
  98. this.setData({
  99. detashow: true,
  100. });
  101. }
  102. },
  103. show:function(){
  104. if(this.data.detashow){
  105. this.setData({
  106. show: false,
  107. });
  108. }else{
  109. this.setData({
  110. show: true,
  111. });
  112. }
  113. }
  114. })